pmotschmann / Evolve

An incremental game about evolving a civilization
Mozilla Public License 2.0
839 stars 361 forks source link

Add missing save file upgrade logic #1072

Closed yarukishi closed 7 months ago

yarukishi commented 7 months ago

Commit https://github.com/pmotschmann/Evolve/commit/28b4e46200b0a4ccc87558194ee3e8ee9c59533a in version 1.3.0 beta 8 simplified the initialization routines for various structures to use loops. These loops set all values to 0 or false. However, custom save upgrade logic existed for two values, and this logic was lost in the transition.

  1. In 0.9.0, the showCiv property was created. It was seeded with the value of showCity for old saves. Currently, loading a save from prior to 0.9.0 will unconditionally set showCiv to false, so post- sentience saves will fail to show the main tab and cannot naturally recover without a soft reset, a prestige reset, or save file editing.

  2. In approximately 0.4.9 / 0.4.10, the counter for demonic invasions was created. Older save files that have the Doomed achievement initialized this counter to 1, so restore this logic as well.

Separately, the default locale is currently 'en-US', but this was only partially updated in https://github.com/pmotschmann/Evolve/commit/b7e7a9c086c4c1328de5f4c917f2313d50b66ed2. Save files currently attempt to set the default locale to 'en-us', which causes the locale selection box not to show any option as selected. This commit changes the default locale for upgrades to 'en-US'.

I tested the effects of the first and third changes with another user's save file, attached. The Civilization tab appears, but it has to be manually selected, which may be acceptable, as this most likely matches the previous behavior. I did not specifically test the change associated with the demonic invasion counter.

EvolveSave-_2019-05-24.txt