Tileset Tool Improvements

I’ve been looking to work on tilesets again, and I want to do it in the new way of decomposing them into individual files so they can be composed when Cataclysm is compiled. My journey has begun with the two main tools in question, decompose.py and compose.py. I’d like them to do more of the organizational work for me so I don’t have to sift through thousands of files when I want to find or edit something.

The reason I’m writing this post is because I’m stuck. I want them to work with auto-tile images, the files that contain every piece of a multi-tiled graphic like a wall or a table. I want decompose.py to build them. I want compose.py to read from them. But there are different ways to implement multi-tile graphics. For example, when Ultica has a wall there are 4 corners, 4 t-sections, and 2 edge-pieces where as Retro Days has 1 each. How can I write the python scripts to recognize which method is in use especially in the compose step.

I’m thinking there will be an auto-tile image with the 12 top-left tiles filled in for Ultica. Retro Days would only have 5 of them filled in. Checking for alpha on each tile would be possible but cumbersome. I’m hoping someone has a better idea.

A generic auto-tile image for reference: