Ludeon Forums

RimWorld => Mods => Tools => Topic started by: theit8514 on February 09, 2015, 09:43:41 AM

Title: [TOOL][Alpha] RimWorld Profile Manager
Post by: theit8514 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 (https://easyhook.codeplex.com/) 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 (http://sourceforge.net/projects/modorganizer/) 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 (https://github.com/theit8514/RimWorldProfileManager/releases).
The source code is available under a partial GPL/partial LGPL license at https://github.com/theit8514/RimWorldProfileManager (https://github.com/theit8514/RimWorldProfileManager).

Install instructions:

Current Known Issues:

Changelog:
0.3-alpha
Fixes:
Features:
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.
Title: Re: [TOOL][Alpha] RimWorld Profile Manager
Post by: Rock5 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".
Title: Re: [TOOL][Alpha] RimWorld Profile Manager
Post by: theit8514 on February 22, 2015, 06:37:18 PM
Quote from: Rock5 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".

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.
Title: Re: [TOOL][Alpha] RimWorld Profile Manager
Post by: Rock5 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
Title: Re: [TOOL][Alpha] RimWorld Profile Manager
Post by: Rock5 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.
Title: Re: [TOOL][Alpha] RimWorld Profile Manager
Post by: theit8514 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?
Title: Re: [TOOL][Alpha] RimWorld Profile Manager
Post by: Rock5 on February 22, 2015, 07:19:00 PM
I'm using Windows 7 64bit

[attachment deleted due to age]
Title: Re: [TOOL][Alpha] RimWorld Profile Manager
Post by: theit8514 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.
Title: Re: [TOOL][Alpha] RimWorld Profile Manager
Post by: Rock5 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...
Title: Re: [TOOL][Alpha] RimWorld Profile Manager
Post by: theit8514 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?
Title: Re: [TOOL][Alpha] RimWorld Profile Manager
Post by: Rock5 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.