Skip to content

[SUGOI] Allow saving in modified games.

Sal requested to merge TehRealSalt/SRB2:allow-modified-saving into next

Saving gamedata and save files is now allowed in modified games.

This is a bit of a big philosophical change, I know, but I've always thought that there is no need to be so heavily anti-mod for a single-player experience. Here is my argument, if you're not already on-board with the idea:

  • It's kind of nonsense that entire features like emblems, or even just saving your progress, get shut off entirely just because you wanted to play the game with a mod, when SRB2 only has so much longevity because of its modding
  • I think it's really not anyone else's business if some random kid wants to add a cheat script or HMS123311 and get all of the emblems with minimal effort
  • v_customsave-v1.soc was allowed through Releases
  • I can't stand working on SUGOI anymore because of the entire mod short-circuiting without emblems available and having to do all of these extra Lua hijinks and frustrating compromises to get around that.

Additional changes:

  • Changed how the modded check works for different types of save files. Instead of writing if it's modded or unmodded, it'll actually write a hash based on which mod it's intended for. (This is actually the one kind of anti-cheat I'm for, because making a "skeleton key" gamedata file that works for all mods is almost disrespectful ... at least play with an OP mod for a bit to get everything :p)
  • The -gamedata parameter is now only initialized when the game first loads, and is ignored for gamedata mods. Before, it could severely short-circuit when using it with gamedata mods.
  • Gamedata is no longer saved after a G_LoadGameData corruption. Before, the game would close with a message implying that it didn't change anything, but in reality it just completely zero'd out the file without permission. Very scary if, say, any kind of bug on the game's end ever happens during the reading.
  • Prevented creation of the gamedata name "main.dat", because that would allow a mod to overwrite vanilla replays.
  • Separated cheat commands from modifying the game. (Using a cheat command now sets cheatsUsed, instead of modifiedgame)
  • Using cheats only disables saving gamedata and save files. You can still collect emblems & unlockables (as opposed to them being disabled entirely, like before), but they won't stay collected when the game is rebooted.
  • Added the Lua function G_SetUsedCheats. Intended for large-scale gamedata-using level packs, if they want to add a cheat command or two.

Similar to !1503 (merged), this will convert old gamedata.dat for format changes, but not the other way around, so be sure to make a backup of your gamedata.dat (and any other mod gamedatas) before trying.

EXE (up to date with next @ 31a6b7b3): srb2win_allow-modified-saving.exe

Edited by Sal

Merge request reports