Navigation Menu

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

Old patchpack savegame versions will soon overlap #8116

Closed
nielsmh opened this issue May 5, 2020 · 10 comments · Fixed by #8411
Closed

Old patchpack savegame versions will soon overlap #8116

nielsmh opened this issue May 5, 2020 · 10 comments · Fixed by #8411
Labels
needs triage This issue needs further investigation before it becomes actionable
Milestone

Comments

@nielsmh
Copy link
Contributor

nielsmh commented May 5, 2020

I don't think we'll run out of savegame versions in the foreseeable future (currently at version 218 out of 65535 max)

This is not taking into account that patch packs have already allocated some of the version numbers. How will we distinguish save games made with official OpenTTD versions (1.11 and up) from save games made with various patch packs (Spring 2013, ChillPP, JokerPP), given the fact that we'll start to overlap with Spring 2013 in just 2 savegame versions from now?

Originally posted by @James103 in #8115 (comment)

@nielsmh nielsmh added the needs triage This issue needs further investigation before it becomes actionable label May 5, 2020
@nielsmh nielsmh added this to the 1.11.0 milestone May 5, 2020
@nielsmh
Copy link
Contributor Author

nielsmh commented May 5, 2020

We'll probably have to implement some additional consistency check or additional marker that ensures we're really loading a compatible game, and not one that by chance uses the same SL version.

@JGRennison
Copy link
Contributor

SpringPP uses a different chunk header format for RIFF chunks, so attempting to load it in trunk will fail with a corrupt savegame error quite early.
For what it's worth I've already implemented heuristics for detecting overlapping/soon to be overlapping SpringPP and ChillPP versions in my branch.

@Eddi-z
Copy link
Contributor

Eddi-z commented May 6, 2020

I don't think this is worth worrying about, the patchpack savegames will simply fail to load.

@James103
Copy link
Contributor

James103 commented May 7, 2020

The exact patchpack savegame versions are as follows (as of JGRPP 0.34.2):

enum SaveLoadVersion : uint16 {
	...
	SLV_ENDING_YEAR,                        ///< 218  PR#7747 v1.10 Configurable ending year.

	SL_MAX_VERSION,                         ///< 219  Highest possible saveload version

	SL_SPRING_2013_v2_0_102 = 220,
	SL_SPRING_2013_v2_1_108 = 221,
	SL_SPRING_2013_v2_1_147 = 222,
	SL_SPRING_2013_v2_3_XXX = 223,
	SL_SPRING_2013_v2_3_b3 = 224,
	SL_SPRING_2013_v2_3_b4 = 225,
	SL_SPRING_2013_v2_3_b5 = 226,
	SL_SPRING_2013_v2_4 = 227,
	SL_TRACE_RESTRICT_2000 = 2000,
	SL_TRACE_RESTRICT_2001 = 2001,
	SL_TRACE_RESTRICT_2002 = 2002,
	SL_JOKER_1_19 = 278,
	SL_JOKER_1_20 = 279,
	SL_JOKER_1_21 = 280,
	SL_JOKER_1_22 = 281,
	SL_JOKER_1_23 = 282,
	SL_JOKER_1_24 = 283,
	SL_JOKER_1_25 = 284,
	SL_JOKER_1_26 = 285,
	SL_JOKER_1_27 = 286,
	SL_CHILLPP_201 = 201,
	SL_CHILLPP_232 = 232,
	SL_CHILLPP_233 = 233,
};

@LordAro
Copy link
Member

LordAro commented May 9, 2020

I agree with Eddi - the fact that some patchpacks used a version only slightly ahead of master isn't our problem, and the games will just fail to load as expected.

@LordAro LordAro closed this as completed May 9, 2020
@ldpl
Copy link
Contributor

ldpl commented May 9, 2020

It may become a bit of a problem if people start reporting these saves. It would be nice to at least have a way to easily tell whether it's a patchpack game or not.

@TrueBrain
Copy link
Member

TrueBrain commented Dec 22, 2020

For legacy, I know of at least 2 Spring 2013 savegame formats that are already in trouble: 191 and 201. With asserts enabled, they simply crash the game. Without some reword like JGRPP, very little we can do about that now :)

Newer versions seemed to me like very low effort to solve, so I created #8411.

@James103
Copy link
Contributor

Have you tried a similar approach for the following save game versions (with a more friendly error message)?

  • Savegame versions 2000, 2001, and 2002 (tracerestrict branch)
  • Savegame versions >= 32768 (JGRPP)

@TrueBrain
Copy link
Member

We are far far far far far FAR away from hitting 2000, so no, there is currently no code for that :) I did consider it, but I also found no sane way to add this :)
When we reach 2000, we just add a similar blob ... but I strongly doubt that will ever happen :) (~250 versions in 15 years ... :P)

@JGRennison
Copy link
Contributor

There are pretty much 0 savegames in the wild which user versions 2000 - 2002.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage This issue needs further investigation before it becomes actionable
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants