-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tilesets: add tools to automatically create tilesheets #34299
Conversation
This pull request has been mentioned on Cataclysm: Dark Days Ahead. There might be relevant details there: https://discourse.cataclysmdda.org/t/abandoned-32x32-msx-dead-people-tileset/18775/404 |
e03e87b
to
7f2fef3
Compare
This pull request has been mentioned on Cataclysm: Dark Days Ahead. There might be relevant details there: https://discourse.cataclysmdda.org/t/abandoned-32x32-msx-dead-people-tileset/18775/411 |
7cfe70d
to
c388407
Compare
bcfe09b
to
32b0676
Compare
I have a cleaned up DeadPeopleEdition with no MShock derived tiles in it but it needs a lot of clean up. |
I am beside myself with glee and nervous about the upcoming JSON I am going to need. |
This pull request has been mentioned on Cataclysm: Dark Days Ahead. There might be relevant details there: https://discourse.cataclysmdda.org/t/abandoned-32x32-msx-dead-people-tileset/18775/423 |
I've been using this to both compose and decompose tilesets, and it works well. I've got some additional enhancements based on using it, but I think given it is supplemental tooling, it should be merged as is. One question, @mlangsdorf: is the deadpngs.json file just a byproduct that snuck in? I don't see it referenced by the docs nor the scripts, so I'm not sure if it's something that needs to stick around. |
deadpngs was the list of pngs that needed to be removed from MSX++DeadPeopleEdition; I'll clean it out. thanks. please provide any suggestions for improvement; I am not a tileset designer nor a really great Python programmer. |
1. Reads all tile entries 2. generates unique png names for each index that is in use 3. replaces all indices with the unique names 4. writes all the tile entries out to folders by png size 5. uses ImageMagick to pull all the image tiles for each tile entry, using the unique names instead of the indices. A later commit will add a compositor script that will reverse this process to create a set of tilesheets from a collection of arbitrarily named files.
32b0676
to
84719d1
Compare
Add a script that generates tilesheet pngs and a tile_config.json from the pngs_ directories in a specified tileset directory. 1. walk through the directories, reading the tile_entry.json files and creating lists of the png files. 2. by rows of 16 images, merge all the images with the same dimensions into a tilesheet while creating dictionaries of image names to tilesheet indices. 3. go through the tile_entries and change the bg and fg image names to the tilesheet indices. 4. write the resulting tile_config.json TODO: write the config file as tile_config.json instead of test_tile_config.json
Add some minimal tileset documentation. Add some information on how tilesheets are indexed. Describe how tools/gfx_tools/decompose.py and tools/gfx_tools/compose.py work. Include some recommendations for setting up composite tilesets.
84719d1
to
7e94805
Compare
Summary
SUMMARY: Infrastructure "tilesets: add tools to automatically create tilesheets"
Purpose of change
Fixes #31417
Creating and especially maintaining tilesets, because all the tilesheets share a common, sequential index. Adding a new tile to the middle of a tilesheet requires updating all the indexes for every tile that follows.
Simplify the process through automation scripts.
Describe the solution
Add two new scripts: one decomposes an existing tilesheet into individual tile files with arbitrary names and corresponding tile_entry files, and the second composes the tile files and tile_entry files into tilesheets with dynamically generated indices.
Additional context
Sample automatically generated tilesheet from ChestHole16: