Is there somewhere in the documentation a description of the format of the save file, or must I dig through the source to piece it together?
I would like to make a small standalone utility to display information about a saved game, not unlike what already exists for grf files.
Savegame file format
Moderator: OpenTTD Developers
Re: Savegame file format
The format is not stable, every now and then a setting gets added, changed, or removed, and we get a new savegame version.
I don't know all the details, but basically it is a compressed chunk-like format, the code lives in src/saveload.
It may be easier to extend the load GUI to display additional information (but not sure about that either).
I don't know all the details, but basically it is a compressed chunk-like format, the code lives in src/saveload.
It may be easier to extend the load GUI to display additional information (but not sure about that either).
- planetmaker
- OpenTTD Developer
- Posts: 9432
- Joined: 07 Nov 2007 22:44
- Location: Sol d
Re: Savegame file format
OpenTTD: manual | online content | translations | Wanted contributions and patches
#openttdcoop: blog | wiki | public server | DevZone | NewGRF web translator
DevZone - home of the free NewGRFs: OpenSFX | OpenMSX | OpenGFX | Swedish Rails | OpenGFX+ Trains|RV|Industries|Airports|Landscape | NML
Re: Savegame file format
Maybe this can also give you some hints:
http://devs.openttd.org/~frosch/scndeps.c
It lacks support for compressed savegames though, so effectively is not useable at all
http://devs.openttd.org/~frosch/scndeps.c
It lacks support for compressed savegames though, so effectively is not useable at all
⢇⡸⢸⠢⡇⡇⢎⡁⢎⡱⢸⡱⢸⣭⠀⢸⢜⢸⢸⣀⢸⣀⢸⣭⢸⡱⠀⢰⠭⡆⣫⠰⣉⢸⢸⠀⢰⠭⡆⡯⡆⢹⠁⠀⢐⠰⡁
Re: Savegame file format
Thanks for the help. This looks messier than I had imagined. Was the format originally designed to be deliberately difficult to decode (in the old proprietary game)?
- planetmaker
- OpenTTD Developer
- Posts: 9432
- Joined: 07 Nov 2007 22:44
- Location: Sol d
Re: Savegame file format
I don't think so. See also an old analysis of the TTD savegame format at http://marcin.ttdpatch.net/sv1codec/TTD-locations.htmlBjørn wrote:Thanks for the help. This looks messier than I had imagined. Was the format originally designed to be deliberately difficult to decode (in the old proprietary game)?
It's quite efficient and doesn't waste space as it was written in a time where disk space was still measured in kilo- and Megabytes instead of Giga- and Terabytes.
OpenTTD: manual | online content | translations | Wanted contributions and patches
#openttdcoop: blog | wiki | public server | DevZone | NewGRF web translator
DevZone - home of the free NewGRFs: OpenSFX | OpenMSX | OpenGFX | Swedish Rails | OpenGFX+ Trains|RV|Industries|Airports|Landscape | NML
Re: Savegame file format
it's certainly not difficult, it's clearly structured (RIFF), just needs a lot of metainformation that is not stored in the file itself (but in the algorithm decoding it)
add to that the compression using standard libraries
add to that the compression using standard libraries
Who is online
Users browsing this forum: Google [Bot] and 19 guests