A guide to how to inspect and edit your Derail Valley save file yourself without having to install a third-party tool.
How to manually edit your save file
Here’s how you can inspect and edit your Derail Valley save file yourself without having to install a third-party tool.
Step 1 – locate your save file
First, locate your save file. It will be in the folder ‘steamapps/common/Derail Valley/DerailValley_Data/SaveGameData’. The main save file is called ‘savefile’. If you want, make a backup of it by copying it to ‘savefile.old’ or similar.
Step 2 – decode the file
The save file is encrypted, however I have configured the code-breaking tool CyberChef to decrypt it. Go to this website – [github.io] and paste the contents of your save file into the top-right box (or, alternatively, click on ‘open file as input’ in the top right and select your save file).
In the bottom-left, your decrypted save file will be displayed. It’s written in JSON – [wikipedia.org] , but if you’re unfamiliar, don’t worry, it’s fairly intuitive to understand.
Step 3: edit your save file
Copy the decoded save file into a text editor, like Notepad++ or VS Code. Now make whatever changes you want. Example changes you can make:
- Remove a locomotive: find ‘”carsData”‘ and delete the relevant entry from the list. The ‘”id”‘ matches that used in the game. Here you can also change the damage, fuel etc., but note that a value of ‘0’ implies maximum damage.
- Change your money: find ‘”Player_money”‘ and edit the number.
- Unlock a technical license: add a line to the end of the file, for example ‘”License_SH282″: true,’ will unlock the SH282 steam locomotive license; ‘”License_MultipleUnit”: true,’ unlocks connecting multiple shunter units; ‘”License_ConcurrentJobs1″: true,’ unlocks the first concurrent jobs license
- Unlock job licenses: find ‘”Job_Licenses”‘ and set the number to ‘34952’. This unlocks every job license (Hazmat 3, Military 3, etc.)
- Add items to your inventory: the inventory is a list of item names under ‘”inventory”‘. Simply edit the list to add or remove items.
Step 4: encode your edited save file
Go to this website – [github.io] and paste the edited save file into the top-right. If you get an error in the output, then you have made an error in your JSON format – try pasting it into a tool like JSONLint – [jsonlint.com] for more information about what’s wrong.
The output should look a bit like your original save file, and (I think) should always begin ‘xsKIAY’. If it doesn’t, it may be a sign something is wrong.
Finally, if everything is correct, copy this encoded output into the file ‘savefile’ (i.e. the file whose contents you originally copied). Boot up DV, and you should find your changes to have taken affect!
Technical notes: DV save files are, for what ever reason, AES encrypted using the key “AEILMMHGsFFguLlKwyUZIGTRdEpokqAAjMcvV1boFMI=” (derived from the password “WeDidntSecureThisVeryWell!!1”), and the IV “pemgail9uzpgzl88”, and are base64 encoded before being written. This can all be seen by disassembling – [github.com] the C# scripts used in the game, which are left unobfuscated by the devs. Job licenses use a hex flag system, where 0x8888 is the ‘fully set’ state of the flags, hence the magic number 34952.
Hope this guide helps. If there’s a mistake, please leave a comment 🙂
I hope you enjoy the How to manually edit your save file – Derail Valley guide. This is all for now! If you have something to add to this guide or forget to add some information, please let us know via comment! We check each comment manually!
- All Derail Valley Posts List