How are theme mod files loaded/cached?

Please post here for questions and discussion about scenario, art and sound modding and the game editor for Distant Worlds.

Moderators: Icemania, elliotg

Post Reply
tppytel
Posts: 34
Joined: Thu Nov 12, 2015 4:08 am

How are theme mod files loaded/cached?

Post by tppytel »

Context: I don't want to make a true mod. I just want to be able to occasionally tweak ship design files over the course of a game so that I can automate ship design according to those templates and not have to design/retrofit so much manually. I've been using Icemania's AI mod without digging deeply into the details of how it works, but now that I'm experimenting I have a *lot* of questions.

So I'm really, really confused about exactly how theme mod files are loaded. There seems to be some very strange caching behavior going on, and I'm not sure whether it's due to DW, Windows, or Steam (I have the Steam version of DW:U). If someone can explain why/how the following sequence happens, that would explain a lot...

0) (I've played with theme mod "foo" previously.)

1) Run DWU, change theme to Default in the main menu. Exit DWU.

2) Delete folder foo from Customization folder.

3) Run DWU. Theme change to foo is still allowed, even though I just deleted the files. Switch theme to foo.

3b) Alt-Tab out and check out the Customization folder in Windows. The foo folder in Customization is still absent. Where did DWU load that information from?

4) Exit DWU. Check out the Customization folder. The foo folder has reappeared!

So... what exactly is happening here? It seems like DWU loads theme mods from a Customation subfolder when the mod is loaded for the very first time. After that, it appears to maintain some internal cache of the information, one that I can't seem to locate anywhere in the DWU folder tree or anywhere in various Windows directories.

Further testing suggests that changes to the foo folder "stick" if foo is currently loaded. I'm not sure whether the DWU executable needs to be running or not. But if edits to foo are made while DWU is set to default, then those change will get overwritten the next time foo is loaded.

It seems like there has to be some cache *somewhere* where DWU keeps track of what it thinks the current version of each mod is. It's clearly reading from sort of cache to be able to load a mod despite the files being absent from Customization. But I can't find that location.

Again, my interest is only in minor tweaks to the ship design files. So, for example, if I decide my frigates could really use a tractor beam but don't want to go full manual and deal with all the retrofitting hassle, I'd like to be able to take a time out, add that to the template, and have it "just work" from that point on. I just want to know the best way to do that. From what I've seen, I *think* I just Alt-Tab out, edit the template files in Notepad, and the changes should "stick" from there. But the apparent caching behavior is really confusing to me, and I'm not sure I understand it correctly.
HerpInYourDerp
Posts: 118
Joined: Thu May 07, 2015 7:59 pm

RE: How are theme mod files loaded/cached?

Post by HerpInYourDerp »

From experience, part of the theme's data is loaded as needed when you start the game, other parts are 'cached' within your savefile if available. I couldn't tell you which is which because I think there are some inconsistencies in how the game actually processes which set of data to use, but it's probably safest to work under the assumption that you'll need to start a fresh game for all the changes to be properly reflected.
Post Reply

Return to “Design and Modding”