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

Redesign ship pickling #9

Open
JensAyton opened this issue Mar 24, 2011 · 0 comments
Open

Redesign ship pickling #9

JensAyton opened this issue Mar 24, 2011 · 0 comments

Comments

@JensAyton
Copy link
Member

When saving a game with scanned wormholes, we save ships by making a mutable copy of their shipdata dictionaries, modifying it to reflect some aspects of the ship’s current state, then saving the difference between the modified dictionary and the original. (This is implemented in ShipEntityLoadRestore.m.) On load, the dictionary is merged into the version from the ship registry and used to set up a new ship.

With the change to explicit “ship class” objects (ongoing work in feature-ship-class-model), this approach will no longer be feasible. Instead, we need to store the mutated state and apply it after setting up the ship from the ship class object.

As part of the change to ship class objects, immutable ship properties will lose their instance variables and instead fetch their values from the ship class. This will make it more explicit what properties are in fact mutable and useful to store in the pickled ships.

It may be difficult to update existing saved games after this transition. I feel it’s reasonable to drop pickled wormhole ships when upgrading.

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

No branches or pull requests

1 participant