LGM-Doyle wrote:Ideally no player actions would be lost in any crash. Timed saves could be the next step in saving every player action.
However, the current save approach causes small delays for saving (particularly for people using non solid state drives). The delay is distracting. With the autosaves it appears to be part of the turn processing. With timed saves, it will appear to be a random hiccup.
Good point on the hiccup/distraction issue. Thinking about that a bit, I have an idea on how to possibly minimize that delay: A lot (or even most) of he savegame delay seems to stem from the AI-- clicking the save game button causes the server to query the AIs for their save-state-string, but the AIs have to finish determining their turn orders before they can process that request to prepare their savestate string. I don't think that's absolutely necessary though-- anytime you load a savegame the AI repeats all of its regular turn analysis and order determination based on the universe at that point.
So, when the save button is clicked, if the AI
has already submitted its orders for that turn then it could be queried for its savestate and that would be bundled with its orders for that turn to be saved in the save file, but otherwise, if the AI
had not submitted its orders for the turn yet, then we could simply reuse the save-state-string kept from the previous turn and use that with an
empty order bundle in the save file. (That is premised on having an AI savestate string from the previous turn, which would currently be the case if autosave for every turn is enabled, but would otherwise not always be the case, so we could explore whether it would add appreciable delay for the AI to just always submit a new savestate string along with its orders for the turn.) That would allow a manual save, or a time-triggered save, to proceed smoothly without having to wait on AIs (it seems to me). (And we might even be able to expand on that to record all human player orders as we go).
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0