Note - This issue originally called for the use of Json, which was determined be unfeasible due to the lack of a good full-featured Json serializer that is compatible with Unity.
Describe your idea
In TMPE's current persistence strategy, the introduction of a new type into the persistent data will break backward compatibility. Although old versions are not supported, players reverting from alpha to stable should not lose savegame data needlessly.
The same issue also affects forward compatibility in ways that restrict future development choices. Ideally, the save data would not be bound to specific types. A move away from strongly typed serialization would give everyone more flexibility moving forward.
Requirements
- This is an opt-in change. All existing serialization will remain untouched until there is a reason to do it the new way, as determined feature by feature.
- A manager-based persistence mechanism in which
SerializableDataExtension enumerates a collection of managers and calls LoadData() and SaveData() methods basically like the ones we have today.
SerializableDataExtension will save the data from each manager separately, to isolate them and minimize the risks associated with changes to persistent data.
- A manager will have a means of identifying other managers upon which its data depends. This will determine the enumeration order during load and save.
- Linq to XML will be used for persistence.
TrafficLightSimulationManager will be the first converted to the new persistence strategy, since displaced lane support was the breaking change that prompted this issue. Its conversion to the new persistence strategy will be delivered separately from and prior to displaced lane support.
Tasks
Note - This issue originally called for the use of Json, which was determined be unfeasible due to the lack of a good full-featured Json serializer that is compatible with Unity.
Describe your idea
In TMPE's current persistence strategy, the introduction of a new type into the persistent data will break backward compatibility. Although old versions are not supported, players reverting from alpha to stable should not lose savegame data needlessly.
The same issue also affects forward compatibility in ways that restrict future development choices. Ideally, the save data would not be bound to specific types. A move away from strongly typed serialization would give everyone more flexibility moving forward.
Requirements
SerializableDataExtensionenumerates a collection of managers and callsLoadData()andSaveData()methods basically like the ones we have today.SerializableDataExtensionwill save the data from each manager separately, to isolate them and minimize the risks associated with changes to persistent data.TrafficLightSimulationManagerwill be the first converted to the new persistence strategy, since displaced lane support was the breaking change that prompted this issue. Its conversion to the new persistence strategy will be delivered separately from and prior to displaced lane support.Tasks
SerializableDataExtension)