Save/Load Different Versions of Same Map?

Level 45
Joined
Feb 27, 2007
Messages
5,578
Well it's just a string and you can truncate it as you wish. I think the issue is attempting to load data from another iteration/version/revision of the map may either produce gibberish or other unwanted behavior; by including the version in the save data you ensure it's only valid to load save data from the same map version.
 
Level 21
Joined
Mar 16, 2008
Messages
955
I'm trying to figure out how to just continue referencing the same save folder. Maybe I could edit the system to search for a truncated name instead of a full string. Not exactly sure what part of the system to change.
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
For version control I would always Save/Load an Integer that represented the game version. That way I could say "Hey, your save file is 5 versions behind the current version" and react accordingly. The name/folder for the Preload file would never need to change.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,285
I think the topic creator wants to enumerate save files in a folder, and then process them based on their name.

I do not think Warcraft III has this functionality. If you want this for backups, consider using a value representing current save version and if the version is old, it writes out a backup copy of the existing save before updating it. This way if you break the codes by accident with a release, the players can manually restore their save files from the backup copy made during the migration.

If you want your code to be compatible with older versions, then this will likely require some very clever code system programming. Specifically you need to avoid depending on a sequence for writing or reading the data, with each saved value having a very strictly controlled identifier. When loading it processes the entire stream and then passes the detected identifiers on for loading. The load system then handles all identifiers it can understand, ignores any it does not and defaults sensibly for values it is missing. Even with all this it may still be prone to bugging by swapping between versions as older versions cannot guarantee the consistency of data for newer versions.
 
Top