Open Elesbaan70 opened 2 years ago
we can ask in the harmony discord about this. they probably know something.
Since we have limited size to be stored, @Elesbaan70 have you measure worst case scenario, how much data we really need to store - assuming we use container per manager?
Two-step light on a 4-way node without complex lane groupings: 2309 bytes, or about 7,000 total stoplights of this configuration.
The more I think about this, the more I realize it's all or nothing. Otherwise we end up with savegames that some people can't read.
Here's a possible ugly way of addressing the issue:
finally
block.This code is basically ready to go. But the Linux compression issue needs to be worked out.
I am reluctant to rely on an external library for a core feature. Also, a third-party compression library will be managed code, and so it will be slower, and compression is the kind of thing where that matters.
So, what I'm looking at for the compression issue is:
its not like we have a better option.
@krzychu124 finally got around to mentioning that there's a compression library distributed with CS. Wish I'd known that earlier! LOL
Here is the wiki page. I'll improve this based on feedback.
@krzychu124 finally got around to mentioning that there's a compression library distributed with CS. Wish I'd known that earlier! LOL
I thought you've tried "obvious" solution and it hadn't worked😂 I haven't tried using it for other things than collecting files from disk to create a zip file.
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
SerializableDataExtension
enumerates a collection of managers and callsLoadData()
andSaveData()
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.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
SerializableDataExtension
)