Choco31415 / DFTileConverter

DFTileConverter is a python program that converts a Dwarf Fortress screenshot to a new tileset.
MIT License
4 stars 0 forks source link

Support Graphical Tilesets #3

Open Choco31415 opened 6 years ago

Choco31415 commented 6 years ago

Right now, I don't know how tilesets with edited raws work, or how to integrate them.

It's very simple to detect that a tile comes from a specific tileset (with edited raws), but the problem is then converting the input screenshot to a new tileset.

This will require manually blacklisting some DF wiki tilesets so that they can be handled in a more manual approach.

Edit: Renamed issue.

enzanki-ars commented 6 years ago

The only tilesets that require changes are listed under a header: http://dwarffortresswiki.org/Tileset_repository#Square_tilesets_for_edited_raws Most of these only changes colors or a few minor visual setting changes. The only changes that may be worth looking into would be the ability to change colors.

See http://dwarffortresswiki.org/index.php/DF2014:Color_scheme for more information on how that works. That may also help improve the color detection. Not sure though, as I have not had a chance to read though all of the source code.

Choco31415 commented 6 years ago

The Color Scheme page only lists released combos of tileset colors. Right now, the goal is to be able to support any color scheme, whether listed there or not. (Btw, the color detection right now is surprisingly accurate! ± a few r, g, b ) Although if there were a flag... That's a possibility.

Good catch, I forgot that tilesets needing edited raws were clumped like that. None the less, it currently throws the algorithm off enough that even with lenient checks, it fails. When tested with the following, only ~15% of the image was converted properly: https://i.redd.it/afsquh2zjyd11.png

enzanki-ars commented 6 years ago

I do not belive that sample is using a tileset, I think it is using a graphic set (http://dwarffortresswiki.org/index.php/DF2014:Graphic_set and http://dwarffortresswiki.org/index.php/DF2014:Graphics_set_repository), more specifically the "Phoebus' Graphics Set." The example photo you gave matches perfectly with the one on the wiki, and is the graphic set I have used. If you look at the space that has not been where there are gems visible, the are the same. Supporting graphic set would most likely be extremely hard to get right given the nature of how they work as you would have to parse the entirety of the raw files used for the graphic set. In graphic sets, there is a lot more possibility for customization and allows more distinct visual icons for a large number of objects, characters, and creatures.

Choco31415 commented 6 years ago

Ah, finally I know what they're called. Thank you.

(As you can see, I don't play with graphics sets... 😛 )

I'll still be looking into the possibility of supporting them. I can make the checks more lenient, but hopefully there is a more intelligent approach.