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

Implements #5261: Simple rotating per-round save file system. #5359

Merged
merged 2 commits into from
Apr 13, 2024

Conversation

Sleet01
Copy link
Collaborator

@Sleet01 Sleet01 commented Apr 13, 2024

This patch adds user-configurable per-round rotating save files, based on the system used by MekHQ, to MegaMek.

These saves are separate from the other autosaves and default to 3, so the last 3 rounds of the most recent game will be saved. Critically, these save files will not be overwritten by starting MegaMek; a game must actually be entered and the start of a new round must occur for this save system to be triggered.

File name format is "Round-<current round#>-autosave_.sav.gz", e.g. Round-3-autosave_2024-04-13_03-37-08.sav.gz. Note that this means only 3 rotating save files total will be saved, not 3 per separate game. If we want that functionality, more work is required.

Testing:

  • Ran small game over several rounds, confirming file rotation works and files can be loaded and resumed.
  • Ran all 3 projects' unit tests.

Close #5261

@Sleet01
Copy link
Collaborator Author

Sleet01 commented Apr 13, 2024

Based on comments from the QA team, I would like to strongly advocate for including this functionality in the .19 release in order to facilitate better testing results.

@Sleet01 Sleet01 requested review from SJuliez and HammerGS April 13, 2024 10:50
@Sleet01
Copy link
Collaborator Author

Sleet01 commented Apr 13, 2024

Files from a short Princess v Princess game:

image

@Sleet01
Copy link
Collaborator Author

Sleet01 commented Apr 13, 2024

New Game Option location:
image

Copy link
Collaborator

@HoneySkull HoneySkull left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reviewed the code - looks good.

@HoneySkull
Copy link
Collaborator

Can you test this with:

  1. Maximum Rotating Saves set to 0.
  2. Change the configured save path in the properties set to something other than the default.
  3. Using the default megamek config file (as if from a new fresh install)

@Thom293
Copy link
Contributor

Thom293 commented Apr 13, 2024

I can test this in about 10 hours if no one gets to it first.

@Sleet01
Copy link
Collaborator Author

Sleet01 commented Apr 13, 2024

I can test this in about 10 hours if no one gets to it first.

I have some errands to run this morning, but hopefully will knock the extra testing out after lunch.

@Sleet01
Copy link
Collaborator Author

Sleet01 commented Apr 13, 2024

Can you test this with:

  1. Maximum Rotating Saves set to 0.
  2. Change the configured save path in the properties set to something other than the default.
  3. Using the default megamek config file (as if from a new fresh install)

@HoneySkull @Thom293 Tested and confirmed:

  1. Setting Max to 0 prevents new rotating saves (and prevents deleting old rotating saves).
  2. Changing the configured save path in properties causes saves, including rotating saves, to appear in the new dir.
  3. Default config file sets Maximum Rotating Saves to 3.

Given that, I'm going to pull this.

@Sleet01 Sleet01 merged commit 5f14229 into MegaMek:master Apr 13, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[RFE] Have Default be 3 Autosaves, just like MHQ, to avoid losing progress. This would solve many many issues.
3 participants