If you have a built version of the game that works, there is one thing I can think of.
- *** BACK UP YOUR PROJECT FIRST ***
- * READ THIS WHOLE ADVICE BEFORE STARTING TO DO IT *
- Run the latest version of the game that players are currently playing (re-download it if you have to).
- If your game still has an "About" screen, use it to find the version of RenPy you used to use.
- Otherwise open the
log.txt
in the game's main folder. The RenPy version is there too.
- Download that same version of RenPy and install it.
- Hopefully the configuration settings will be picked up automatically, but if not... configure your settings.
- Use UnRen to unpack the version of the game people are playing.
- Delete any now unneeded
*.rpa
archive files.
- Create a new directory within your RenPy projects folder/directory. Call it something like "<project> resurrected".
- Copy the whole
/game/
folder and all subfolders to from the "latest working game" to your RenPy project folder.
- Within the RenPy project folder...
- Delete the
script_version.txt
file.
- Delete the
game/cache/
and game/saves/
folders.
- --- You now have a development version of the game people are playing. ---
- Launch it from the RenPy launcher... make sure you are happy everything works as intended.
- Specifically, try loading save files. Delete any that don't work.
- Since this is the same version players are actually playing, any save files that don't work must be save files you've saved while swapping and changing between RenPy versions. They are incompatible with the live game and therefore are useless.
- Some save files may be using a version of the code that still in development. Those are never going to work with all this messing about. Just delete them too. (You always have your backup... you did back up, right?!?!?!).
- Quit the game and go to your "<project> resurrected" RenPy project folder.
- Delete all
*.rpy
files, in the /game/
folder and any sub-folders too.
- ONLY
*.rpy
files.
- *** DO NOT DELETE THE MATCHING
*.rpyc
FILES ***
- Copy all the
*.rpy
files from your backup project folder. i.e. the latest developer version of the source code.
- If, as part of your development, you have removed or renamed any of your source script files; delete the mismatched
.rpyc
files that are still hanging around. ONLY files that no longer have a matching .rpy
file. I can't stress enough how much you need to be careful here. For most developers, there won't be any that need deleting at this stage.
- Launch the game through the RenPy launcher. Again make sure everything works how you planned, including any new game code added after the "live" version.
And that's it... just carry on developing.
If you want to update to the latest version of RenPy, you can do so safely now.
Save/Rollback compatibility is all about what I think of as the "code cross reference" stored in the
*.rpyc
files. Any time you add/update/delete lines of code, that cross reference is updated in the matching
.rpyc
file to reflect the updated code. If the cross reference is ever corrupted, recreated or gets out of step with the live code - then save files will stop working.
But, by copying back the latest "live" version of the game - you are restoring the
*.rpyc
files back to the point where they worked just fine.
When you copy the latest development version of the
*.rpy
script files into the new project folder, RenPy is forced to apply all those code changes to the existing
*.rpyc
cross reference data. RenPy can't tell the difference between when you change 1 line of code or when you change 1,000. So all those script updates just get incorporated to the existing files... and everything carries on as normal. But now with a version of the
*.rpyc
files that is compatible with the live/players version of the game.
The only thing that won't work will be any saved games saved AFTER the latest version of the game was previously released. Those will be pointing at a version of the cross reference data that no longer exists. Thankfully, that only affects you as a developer and not the end users.
If you are in any doubt... DON'T DO THIS.
There is a huge potential for fuck ups while doing this.
Just tell your players that due to a development cockup, all previous save files are corrupted.
Change the
define config.save_directory = "xxxxx"
to something else in your
options.rpy
file - to make it difficult for players to load old save files and put it all down to a learning experience.