Startup performance patch and WIP save/mod editor

  • We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

Timeslip

Recruit
22 Badges
Jun 21, 2017
4
0
  • Stellaris: Leviathans Story Pack
  • Prison Architect
  • Shadowrun: Hong Kong
  • Shadowrun: Dragonfall
  • Shadowrun Returns
  • Stellaris: Distant Stars
  • Stellaris: Apocalypse
  • Stellaris: Humanoids Species Pack
  • Age of Wonders III
  • Stellaris - Path to Destruction bundle
  • Stellaris: Digital Anniversary Edition
  • Stellaris
  • Crusader Kings II: Way of Life
  • Mount & Blade: With Fire and Sword
  • Cities in Motion 2
  • Stellaris: Synthetic Dawn
  • Magicka
  • Knights of Pen and Paper +1 Edition
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II
I've started work on a mod/save editor for Stellaris. For now it's not much more than a text editor that knows about Stellaris' file structure, but the plan is to teach it how files link together, so that you can follow references between data files, and get syntax highlighting and folding. I'm posting early to take feature requests, and so the more experienced modders can point out all of the horrible mistakes I've made. And also because I think the startup performance patch thing is cool.

On first launch it will try and locate your install and user directory. If it fails to find them, it'll ask you to point at them.

main.png


On the main form, there is the list of data files on the right, the editor on the left, and search results at the bottom. Each save game, DLC and mod has an entry in the search path, as well as one special entry ('Data files') which displays all files as Stellaris sees them. The active mod (or user folder, if no mod is active) is displayed in bold, and is where newly created files will go. Right clicking on files on the right offers a couple of options.

settings.png


The settings form lets you pick the active DLC and mods, and select the currently active mod. Redirect writes to head of search path will cause files to be written to the active mod even if they're opened from elsewhere. Click on a mod to set it as the currently active one.

find.png


The search form lets you search open files, the search path as Stellaris sees it, or all files. (which includes save files and files that are overridden.) You can do regex replaces as well as searches. Searching all files gives a list of all matches, which can be clicked to jump to even if the matching file isn't open.

The most interesting button in the menu at the moment is 'tools | apply startup performance patch'. Clicking this will rearrange the stellaris install directory and patch stellaris to change the way it searches for files. This improves startup performance, measured from the time you click play on the launcher to the time the main menu becomes responsive, by >60% on my machine. I'm sure most players would prefer something to improve in game performance, but I was finding I was opening and closing the game a lot to test things, and it was that startup time that was annoying me most. Benefit will probably vary based on CPU speed and disk speed, so I'd be interested to know what it does on others. This only works for 1.6.2, and only on windows - it'll complain at you if the exe isn't recognised. It does not affect the checksum or disable achievements.

Generating the patch creates two zip archives which together consume around 2.8GB of disk space. Once it's complete you can delete all folders in the stellaris install directory other than dlc, to get 5GB back, (so a 2.2GB saving overall) but that's not required, and if playing through steam will result in steam downloading it all again at some point in the future.

Known issues:

- The Anniversary portraits DLC won't show up on the search path. That's due to a typo in the Stellaris DLC description - the .dlc file has 'archive = "dlc/dlc015_anniversery/dlc015.zip"' but the actual zip file is in dlc/dlc015_anniversary. I could special case it, but since the zip is empty I didn't see any point.
- I haven't done any non-ascii testing. Everything is UTF8 in the editor, so it'll work on the editor side, but I haven't actually checked what encoding Stellaris wants...

Changelog:
v0.2
Fixed extracting files from mod archives that are bzip2 compressed. (Will still be saved back into the archive with deflate if edited though.)
Fixed tabs closing when switching between files

v0.3
Added syntax highlighting
Added bracket matching (Select a bracket and the matching partner is highlighted.)
Added bracket folding, and outline/expand menu options.
File list tooltips display the file size
Fixed tab focus order
 

Attachments

  • StellarisEdit.7z
    172 KB · Views: 30
Last edited:
Very interesting, indeed!

What do you consider the primary use cases for your editor?

Would this allow you to manipulate flags and variables? For example, allowing you to fix a bugged out questline? Or maybe delay or speedup the time to endgame crisis?
 
Very interesting, indeed!

What do you consider the primary use cases for your editor?

Would this allow you to manipulate flags and variables? For example, allowing you to fix a bugged out questline? Or maybe delay or speedup the time to endgame crisis?
You can't do anything with it that you can't do in notepad; it's just a convenience thing. If you want to edit a save file, then at the moment this saves the unpack and repack steps. In the future it might have some tools to simplify making certain modifications (I want to do a graphical planet editor, for example,) but they'll still be operating on the same data files, and wont be able to do anything that couldn't be done manually if you knew what to edit.
 
I like this, I would like to see a planet editor and a specie editor. Having a gui, surely makes life easier although you still have the same limitations.

Also please add an xml/json/(whatever markup you feel like) of mods as an export to be shared for mp.