So, instead of only complaining about the large size of the savegames, I thought I’d share a few of my ideas on reducing this size. Maybe the dev’s are already ahead of me, that is hard to tell without looking into the system itself.
First of all, I want to point at the way PNG files work. Instead of saving the colour of every pixel, they store the colour of the first pixel and then only save the difference to the next pixel each time. These numbers are often smaller, but more importantly, it is much more likely that consecutive values are equal. When you then ZIP this data, these consecutive numbers can be compressed very efficiently, resulting in significant smaller files on average.
I am uncertain if the effects on the terrain saving in Train Fever savegames would benefit from this technique significantly, but after explaining some other things, I will coming back to this.
The terrain is generated completely generated deterministic given the map seed. It feels to me that generating a new map is just as fast as loading one from a file, and a map seed is a lot easier to save. “Now…”, I hear you think, “but what happens with the terrain that changes?” Well, that is an issue… maybe. It is still possible to store the differences in the terrain with the original terrain and only save that. And now I want to point back at my initial technique: we will get lots of zeroes (because even if you change quite some terrain, there is a lot more terrain that doesn’t change!), so compressing that “difference map” will not take up a lot of space!
If generating the terrain every time is too expensive (I do not expect so), the developers could choose to cache the terrain. I have seen the solution before to have the terrain stored separately, to make the actual savegames smaller. This would essentially be caching the terrain.
Hopefully the developers find this insight interesting, but once again: this is all just in my mind. I can not tell what the main problem with the savegames is, or if my technique is possible in their engine at all, but I just couldn’t bear not sharing this with you guys.
Viewing 1 post (of 1 total)
The forum ‘General Discussion’ is closed to new topics and replies.