Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Add autosave and sendmap save formats #7330

Closed

Conversation

@SamuXarick
Copy link
Contributor

SamuXarick commented Mar 5, 2019

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:

  • savegame_format sets the format of manual save games.
  • autosave_format sets the format of autosave save games.
  • sendmap_format sets the format that is used by a server when sending a map to a client joining.

b.2) Each of these 3 formats also include 2 additional compression level defaults to complement the already existant default:

  • fast
  • default
  • slow

As it currently stands, only lzma and zlib benefit from these added defaults.

  • lzma:0 .. lzma:9 (fast: 0, default: 2, slow: 2)
  • zlib:0 .. zlib:9 (fast: 1, default: 6, slow: 6)

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:

  • fast when the current running game is the host of a network game or if an autosave occurs when the current running game is in fast forward mode.
  • slow when the current running game is the host of a network game and a client is joining in.
  • default whenever the criterias above don't occur.
@SamuXarick
Copy link
Contributor Author

SamuXarick commented Mar 5, 2019

Related #7292

@stale
Copy link

stale bot commented Apr 4, 2019

This pull request has been automatically marked as stale because it has not had any activity in the last month.
Please feel free to give a status update now, ping for review, or re-open when it's ready.
It will be closed if no further activity occurs within 7 days.
Thank you for your contributions.

@stale stale bot added the stale label Apr 4, 2019
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:
- savegame_format sets the format of manual save games.
- autosave_format sets the format of autosave save games.
- sendmap_format sets the format that is used by a server when sending a map to a client joining.

b.2) Each of these 3 formats also include 2 additional compression level defaults to complement the already existant default:
- fast
- default
- slow

As it currently stands, only lzma and zlib benefit from these added defaults.
- lzma:0 .. lzma:9 (fast: 0, default: 2, slow: 2)
- zlib:0 .. zlib:9 (fast: 1, default: 6, slow: 6)

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:
- fast when the current running game is the host of a network game or if an autosave occurs when the current running game is in fast forward mode.
- slow when the current running game is the host of a network game and a client is joining in.
- default whenever the criterias above don't occur.
@SamuXarick SamuXarick force-pushed the SamuXarick:faster-server-autosaves branch from 3a77761 to a938fc0 Apr 7, 2019
@stale stale bot removed the stale label Apr 7, 2019
@TrueBrain
Copy link
Member

TrueBrain commented Apr 7, 2019

More options is not always better. I do not think it helps if we put this to the users; only a very select group of people know how to use it properly, and it will only lead to more questions, problems, and weird bug reports. So I think this is not the way to implement this.

Given no other developer has given it any attention over the last month (and this is why stalebot wants to close it), I amt going to call it a day.

Sorry to close your PR, but this is currently not within our vision.

@TrueBrain TrueBrain closed this Apr 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.