CitiesSkylinesMods / TMPE

Cities: Skylines Traffic Manager: President Edition
https://steamcommunity.com/sharedfiles/filedetails/?id=1637663252
MIT License
571 stars 85 forks source link

Optimize data size #179

Open VictorPhilipp opened 5 years ago

VictorPhilipp commented 5 years ago

Custom data saving/loading should be optimized regarding memory consumption because custom mod data must be represented with less than 16711680 bytes (~16 MB, see ColossalFramework.IO.DataSerializer.WriteByteArray) and because the deserialization process might take a long time.

https://github.com/VictorPhilipp/Cities-Skylines-Traffic-Manager-President-Edition/issues/160

brunoais commented 4 years ago

Maybe it can be compressed using something like lz4 or zstd before saving... Does the game allow just a stream of bytes? If so, any these two should be able to save much. zstd can do the best squeeze of space out of these two and can be tweaked to very high compression speed and a bit more compressed than lz4

kvakvs commented 4 years ago

@brunoais I think even if the problem exists it never was raised as serious and requiring immediate solution. Plus we don't really expand map data yet, maybe new traffic lights and roundabouts become more popular so the game saves will grow for all TMPE users.

brunoais commented 4 years ago

Fair enough.