Feature: Add autosave and sendmap save formats #7330
Closed
+43
−12
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
a) The encoding part of a server savegame is now started on a different thread to minimize the impact of the stall that occurs after writting all the game state into memory, but there are some limitations:
a.1) When a client joins and the server is performing a savegame, the server stalls for the remaining duration that is still needed to finish encoding the savegame.
a.2) When a client joins and is receiving the map, and the server is not set to pause on join, no autosave (or any save) will be performed should a client still be receiving the map and the encoding part is not yet finished.
b) Added 2 more configurable parameters in openttd.cfg, "sendmap_format" and "autosave_format" on top of "savegame_format". Search for these 3 lines inside openttd.cfg file, under [misc] section:
[misc]
savegame_format =
sendmap_format =
autosave_format =
b.1) These 2 new parameters accept the same valid values as the existant one:
b.2) Each of these 3 formats also include 2 additional compression level defaults to complement the already existant default:
As it currently stands, only lzma and zlib benefit from these added defaults.
b.3) OpenTTD resorts to these default compression levels if they're not set in the configuration parameters, and only when certain game conditions match: