Rewrite loading of techs to support adding new techs#144
Closed
nthykier wants to merge 3 commits intosingularity:masterfrom
Closed
Rewrite loading of techs to support adding new techs#144nthykier wants to merge 3 commits intosingularity:masterfrom
nthykier wants to merge 3 commits intosingularity:masterfrom
Conversation
1c3c9be to
6a2c3ca
Compare
Previously, when we load a savegame, the program would assume that the
savegame contained all the *current* technologies. However, this
assumption fails every time a new technology is added to singularity
and then singularity simply crashes.
This patch solves this by pulling all techs from the data files and
then merging the few relevant bits ("done" and "cost_paid" from the
savegame) into the existing saves. Obsolete techs (i.e. techs prevent
in the savegame but not in the data files) are ignored to avoid
crashing on them. In the case, where a technology is renamed, we can
preserve it by correcting it's "id" in the convert_from method.
With this patch, a save game made on commit b161349 can still be
successfully loaded in 03b0bd5, where a new tech is introduced.
Signed-off-by: Niels Thykier <[email protected]>
Signed-off-by: Niels Thykier <[email protected]>
Signed-off-by: Niels Thykier <[email protected]>
6a2c3ca to
811daec
Compare
Member
Author
|
Retracted in favour of #168 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Previously, when we load a savegame, the program would assume that the
savegame contained all the current technologies. However, this
assumption fails every time a new technology is added to singularity
and then singularity simply crashes.
This patch solves this by pulling all techs from the data files and
then merging the few relevant bits ("done" and "cost_paid" from the
savegame) into the existing saves. Obsolete techs (i.e. techs prevent
in the savegame but not in the data files) are ignored to avoid
crashing on them. In the case, where a technology is renamed, we can
preserve it by correcting it's "id" in the convert_from method.
With this patch, a save game made on commit b161349 can still be
successfully loaded in 03b0bd5, where a new tech is introduced.
Signed-off-by: Niels Thykier [email protected]