Now that we're using CSV, compression of map data can happen at a higher level.
git is likely to use deltas between versions of a file, and *may* use deltas between two different files if they are similar enough.
the .zip is format is not capable of cross-file compression, but .7z is (calling it "solid compression"), and is supported by physfs since 1.1, which was released in 2005.
Unfortunately, cross-file compression is impossible if identical high-level data (which tileset is this from?) differs at a low level due to the order tilesets are imported.
---
What should happen:
Reorder the tilesets in every map file to a canonical ordering.
The collision tileset should come first so it gets tile IDs 1 and 2; any instances of 1 (the transparent tile in the collision tileset) should then be replaced by tile 0 (the global empty tile)
There should be a canonical ordering for every clime: desert, woodland, snow, cave, and whatever indoors versions we need. Every map in those climes should import every tileset of that clime, even if it does not use it. The exception is if the unused tileset is at the end of the tileset; in that case it can be dropped.
Tilesets that are map-specific, or nearly so, should be added at the end - such as the graveyard tileset.
Finally, all tilesets should have there name changed to something canonical. I suggest the exact name of the tileset (no capitalization or replacing underscores with spaces), minus the extension.
---
Suggested attack plan:
- fix tileset names
- Edit all maps to remove tileset they aren't using. To alleviate boredom, also canonicalize the exact name and visibility of map layers. I suggest "Collision" and "Objects" be invisible.
- Do stats to find out the most used tilesets, and put them first in their noncolliding sets.
Code: Select all
grep '<tileset' maps/*.tmx | sed 's/:.*name="/\t/;s/".*//' | sort -k 2
Code: Select all
grep '<tileset' maps/*.tmx | sed 's/.*name="/\t/;s/".*//' | sort | uniq -c
- Edit all maps to add and order the canonical tilesets
Future possibilities, not considered at this time:
switch all images to an uncompressed format (tga?)
split images into smaller files, so partial changes don't force large data updates.