Steam based save files
issueid=3188 07-18-2014 10:23 PM
The Creator
Number of reported issues by adom-admin: 499
Steam based save files

Steam-based save files (there seems to be some feature to move save files between systems)
Issue Details
Issue Number 3188
Issue Type Feature
Project ADOM (Ancient Domains Of Mystery)
Category All
Status In Progress
Priority 3
Suggested Version ADOM r50
Implemented Version (none)
Milestone Potential work pipeline
Votes for this feature 6
Votes against this feature 1
Assigned Users jt
Tags (none)




07-22-2014 12:26 AM
Junior Member
Ooooh, yeah. Now *that* would be cool.

I'm often taking saves between my home and work machines .. but I more often forget to copy them to a USB before I leave. I can connect to one via TeamViewer and transfer the file too, but it's always a hassle, whichever way I do it.
Having the save-file sync via Steam would be very very cool. I'd make use of that. (It would be great even just for switching between by pc, mac, and pc-laptop at home.)

07-22-2014 08:54 AM
Ancient Member
Yeah, the feature is called Steam Cloud and it's awesome. It can be used not only for savegames, but also for any other personal files related to your progress in the game (with ADOM this could be the highscore, the death count that gives you access to the bug temple, etc.) so you don't have to carry files around or replay stuff in your diffent machines.

As someone with several machines, I always use it, and I tend to grunt and moan when I find a Steam game that doesn't support it. I would make an exception on the grunting and moaning for ADOM, but anyway, it would be really great to have this :)

07-22-2014 10:31 AM
jt jt is offline
Administrator
The biggest problem right now is to make the saves compatible between the different systems (Windows, OSX and Linux). We probably need to move to JSON (as we already did for other data files).

07-22-2014 11:49 AM
Ancient Member
Quote Originally Posted by jt
The biggest problem right now is to make the saves compatible between the different systems (Windows, OSX and Linux). We probably need to move to JSON (as we already did for other data files).
If you have to change the save file format, it might be very good time to pay some attention to save compatibility between releases as well.

07-22-2014 04:14 PM
Ancient Member
Quote Originally Posted by jt
The biggest problem right now is to make the saves compatible between the different systems (Windows, OSX and Linux). We probably need to move to JSON (as we already did for other data files).
Aren't saves already compatible on different OSes, just not different architectures?

07-22-2014 06:04 PM
jt jt is offline
Administrator
It all depends on which compiler and which compilation mode/settings are used. For example, on Windows (using different compilers!) you can exchange save games between the native Windows and the NotEye version. This doesn't work on OSX, even though only one compiler is used for both. So if you're lucky you can copy the save game between systems, but there are some cases where this doesn't work. Also adding new stuff breaks the save game in most cases.

07-24-2014 03:05 AM
Junior Member
Hmmm.. I didn't realise this (the degree of lack of compatibility.) I'd often been swapping saves between my work PC and home Mac .. but I might have stopped doing that so much lately. Though every time I was making sure that I was on the exact same version/flavour of ADOM on both.

I never tried transferring saves between my emulated Amiga ADOM and the Mac/PC ones though .. I figured with the vast difference in compilers and CPU architectures that that didn't have much of a chance. (Fortunately WinUAE is quite easy to set up in multiple places.) ..by the way, I do still find it amazing that these new versions (without NotEYE of course) still compile for Amiga. I still smile when I launch this 2014-compiled retro-game on my retro-Amiga. :)

07-30-2014 09:28 PM
The Creator
Our current evaluation results in the following revelations:
- If we do this we need to convert everything to JSON.
- If we do use JSON, each internal ADOM object needs to be versioned.
- Additionally various binary sections in ADOM not represented by structs (e.g. a single map) needs to be turned into a versioned JSON object.
- We need a version migrator for each object type in order to update an object to the latest object version.
- We need to integrate zlib in order to save space and keep the save file sizes sane.
- Before doing this we definitely should remove the old save file manipulation protection code (it never helped in any case and just complicates things).

08-19-2014 10:26 PM
jt jt is offline
Administrator
Work in progress:

- save games should now be exchangeable between different operating systems (more testing is needed). We decided against JSON for now (because the created objects would be huge and require lots of RAM which might be a problem with the DOS version or others) and use the "old" data structures with a better serializing/deserializing mechanism.
- we still need to add a mechanism that can upgrade save games from older versions

08-20-2014 11:04 PM
Junior Member
I think it's fine if there is limited compatibility between versions. ie: (not knowing the internal structures, but taking an educated random guess) You could have three groups: NotEye+ADOM Mac/PC/Linux, plain-ADOM DOS/Mac/Linux, and ADOM Amiga (and maybe Raspbian? ..all the old Big-Endian architectures.) ..I think the vast vast majority of players would be fine if you can only transfer games within the first two groups, and 'odd' ones like Amiga, Raspbian, and MacOS PPC games will only work on that platform.

My logic for this is that, I think, most players will be sticking religiously the NotEye or non-NotEye version these days. And for the odd ones: I do still play the Amiga port from time to time, and honestly I don't expect any special treatment. I'm still just pleased it gets supported at all. If I can't use that save on other platforms, that's fine. If there's limited compatibility, maybe it's just worth listing, to the right of the save-game, what platform it was created on. Then players can easily know if they can open it on the platform they're on, and the game will just refuse to load, say, the Amiga version, saying: "Sorry, the structure of saved-games is quite complex, and the Amiga version can't be opened on Windows."

Anyway, just my random ideas. I don't think the ADOM team needs to go to extraordinary lengths to get save-games transferable between absolutely every variant. ..then it's just code to update from the last one or two versions.

08-24-2014 04:42 PM
jt jt is offline
Administrator
Update:

- added version information for some "chunk"s of data (more will follow) which helps upgrading the save game from older ADOM versions
- tested save game exchange between all OSX, Linux and Windows (MS-DOS) versions we have, which seems to work just fine

TODO:

- little- and big-endian handling needs to be discussed (all systems with Steam access use little-endian, but it would be nice to support all systems at once)
- add chunks for other important structures, e.g. the map data
- add ZIP compression (at least for files that need to be transferred over the net)

+ Reply