Ludeon Forums

Ludeon Forums

  • April 26, 2019, 12:55:19 PM
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: [TOOL][Alpha] RimWorld Profile Manager  (Read 5531 times)

theit8514

  • Muffalo
  • *
  • Posts: 5
  • Refugee
    • View Profile
[TOOL][Alpha] RimWorld Profile Manager
« on: February 09, 2015, 09:43:41 AM »

So I'm putting this out here in the tools category, since it doesn't directly affect any mods. I've designed a mechanism which will allow a user to create multiple Profiles of RimWorld for use with different sets of mods and/or configs. Currently, the RimWorld loads configuration files from a single configuration folder which is located in your user profile's AppData. This means that even if you have multiple RimWorld game folders with different mods, the game loads the same ModConfig.xml file for every one of those folders. Well, this program seeks to resolve that issue by allowing the user to create multiple profiles which separate out the AppData folder into multiple profile folders.

The profile manager does not modify the base game executable, nor does it modify anything in the data directory. It simply uses a feature of the Windows OS which allows the folders to be redirected.

Technical Details:
RimWorld Profile Manager hooks the low level API functions in Windows using EasyHook which RimWorld uses to read/write files or search directories. The hooks inspect the filenames that pass through them and filter them for only the files in the '%AppData%\..\LocalLow\Ludeon Studios\RimWorld' directory. Those filenames are modified so that they now point to a specific profile folder IE: '%AppData%\..\LocalLow\Ludeon Studios\Profiles\Profile 1'. This mechanism is akin to how Mod Organizer works for Bethesda style games, except much more simpler.

DISCLAIMER:
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
While I make the best attempt at redirecting only the files in the profile folder, I do rely upon libraries which may cause the game to crash. A backup is HIGHLY recommended before using this application (including RimWorld application directory and %AppData%\..\LocalLow\Ludeon Studios directory).


Downloads:
If you're still interested after the disclaimer, you can download the alpha pre-release at https://github.com/theit8514/RimWorldProfileManager/releases.
The source code is available under a partial GPL/partial LGPL license at https://github.com/theit8514/RimWorldProfileManager.

Install instructions:
  • Extract to any location.
  • Run ProfileManager.exe. On the form, there are four fields. Enter any profile name, then point the profile at a RimWorld install directory and executable. If Profile Directory is left blank, it will generate one for you from the name.
  • Click the run button at the top to launch the selected profile.
  • ???
  • PROFIT! (not really, it's FOSS)

Current Known Issues:
  • If the hook is applied too quickly, the game executable may crash on launch. This is due to how EasyHook won't allow CreateAndInject against .NET Framework code; the process must be started first, then injected. If the hook happens too late (which really should not happen), then the game could possibly be hooked in the middle of loading the base RimWorld directory and could crash as a result. If the error window loads after the game gets to the main menu, or if the HookLoader process reports that it could not inject into the game, please report that as an issue. Otherwise, please try restarting the profile again after closing down the game and HookLoader executable.
  • The Profile Manager currently has no mechanism for detecting if a profile is currently running. It is up to the user to not run the same profile at the same time. If the same profile is run, the game may crash.

Changelog:
0.3-alpha
Fixes:
  • Profiles folder not existing on first run. Creates it on first run of this version.
Features:
  • Options to open RimWorld folder and Profile folder of selected profile.
0.2-alpha
Resolve bug in graphical front end which prevented the grid from display any columns. Sorry about that.
0.1-alpha
Initial release.
« Last Edit: February 22, 2015, 06:54:55 PM by theit8514 »
Logged

Rock5

  • Colonist
  • ***
  • Posts: 748
  • Schizoid
    • View Profile
Re: [TOOL][Alpha] RimWorld Profile Manager
« Reply #1 on: February 22, 2015, 06:34:27 PM »

I'm finally getting sick of dealing with different Rimworld folders so I thought I'd give this a try after reading about it a few days ago.

Doesn't work. Error "Failed to initialize Grid: The type initializer for 'ProfileManager.ProfileManager' threw an exception".
Logged
Rock5 [B18] Mods
- Butchers Can Count Meat
- Sun Lamp Planner
- JTZoneButtons
- RimSearch
- JTExport

theit8514

  • Muffalo
  • *
  • Posts: 5
  • Refugee
    • View Profile
Re: [TOOL][Alpha] RimWorld Profile Manager
« Reply #2 on: February 22, 2015, 06:37:18 PM »

I'm finally getting sick of dealing with different Rimworld folders so I thought I'd give this a try after reading about it a few days ago.

Doesn't work. Error "Failed to initialize Grid: The type initializer for 'ProfileManager.ProfileManager' threw an exception".

Meant to push out a fix earlier in the week, but didn't get around to it. You can fix this by creating the Profiles folder under '%AppData%\..\LocalLow\Ludeon Studios' or downloading v0.3 from the github page, which I will be posting shortly.
Logged

Rock5

  • Colonist
  • ***
  • Posts: 748
  • Schizoid
    • View Profile
Re: [TOOL][Alpha] RimWorld Profile Manager
« Reply #3 on: February 22, 2015, 06:46:24 PM »

Thanks. And I'm happy you answered right away and I didn't have to wait. :D
Logged
Rock5 [B18] Mods
- Butchers Can Count Meat
- Sun Lamp Planner
- JTZoneButtons
- RimSearch
- JTExport

Rock5

  • Colonist
  • ***
  • Posts: 748
  • Schizoid
    • View Profile
Re: [TOOL][Alpha] RimWorld Profile Manager
« Reply #4 on: February 22, 2015, 07:01:46 PM »

It was able to launch the game the first time I tried it but then crashed the game every other time I tried, with a dialog asking me to send the crash report to the developers. The game still starts ok if I start it directly.
Logged
Rock5 [B18] Mods
- Butchers Can Count Meat
- Sun Lamp Planner
- JTZoneButtons
- RimSearch
- JTExport

theit8514

  • Muffalo
  • *
  • Posts: 5
  • Refugee
    • View Profile
Re: [TOOL][Alpha] RimWorld Profile Manager
« Reply #5 on: February 22, 2015, 07:10:21 PM »

When you launch the profile the HookLoader comes up, is there an error in that window? What OS version?
Logged

Rock5

  • Colonist
  • ***
  • Posts: 748
  • Schizoid
    • View Profile
Re: [TOOL][Alpha] RimWorld Profile Manager
« Reply #6 on: February 22, 2015, 07:19:00 PM »

I'm using Windows 7 64bit

[attachment deleted due to age]
Logged
Rock5 [B18] Mods
- Butchers Can Count Meat
- Sun Lamp Planner
- JTZoneButtons
- RimSearch
- JTExport

theit8514

  • Muffalo
  • *
  • Posts: 5
  • Refugee
    • View Profile
Re: [TOOL][Alpha] RimWorld Profile Manager
« Reply #7 on: February 22, 2015, 07:27:16 PM »

I'll take a look when I get back to my computer. Could be an issue with the hook applying too fast or too slow.
Logged

Rock5

  • Colonist
  • ***
  • Posts: 748
  • Schizoid
    • View Profile
Re: [TOOL][Alpha] RimWorld Profile Manager
« Reply #8 on: February 22, 2015, 08:16:05 PM »

I forgot to tell you something that happened when I got the error the first time. I didn't mention it because I don't think it's relevant but just in case...

This is what happened. I set up and started my version of 722 then closed it down. Then I set up and tried to run my version of 724 and I got an error saying I was missing the sub folder RimWorld724Win_Data. I had forgotten that I had renamed it to do a comparison with kdiff3. Anyway, I restored the name and tried again. That's when I got the error above for the first time.

Like I said, it doesn't seem relevant but just in case...
Logged
Rock5 [B18] Mods
- Butchers Can Count Meat
- Sun Lamp Planner
- JTZoneButtons
- RimSearch
- JTExport

theit8514

  • Muffalo
  • *
  • Posts: 5
  • Refugee
    • View Profile
Re: [TOOL][Alpha] RimWorld Profile Manager
« Reply #9 on: February 22, 2015, 09:12:25 PM »

Just got back to my computer. I've checked out the newest version of RimWorld (only version I can get is 725, doesn't appear to be a link to 724). I cannot replicate the issue on Windows 8.1, so I'll be setting up a Windows 7 test bed, see if Unity is doing something funky with that OS version.

While I set that up, I've added the debug binaries to the github release (just the HookLoader and Hook). It will create a debug.txt file in the RimWorld folder, logging the functions and what they were modified to. If you could PM me that log and the crash report, it'll tell me what function call crashed it.

EDIT: So I just got the Windows 7 64bit environment up and running, but I still cannot replicate the problem. Have you tried with a fresh copy of the 724? Could you try with the 725?
« Last Edit: February 22, 2015, 10:12:48 PM by theit8514 »
Logged

Rock5

  • Colonist
  • ***
  • Posts: 748
  • Schizoid
    • View Profile
Re: [TOOL][Alpha] RimWorld Profile Manager
« Reply #10 on: February 23, 2015, 12:43:55 AM »

Looks like I didn't make 1 point clear. After successfully starting 722 once, I was never able to start it again. I get the error with every version of the game. 722, 724 and now 725. I'll pm you the debug file.
Logged
Rock5 [B18] Mods
- Butchers Can Count Meat
- Sun Lamp Planner
- JTZoneButtons
- RimSearch
- JTExport