← Back to context

Comment by 1313ed01

19 hours ago

Tiled has some mode where you can paint the tile corners or/and edges to automatically insert tiles. When using only the corners to paint (and only a single terrain type) that would be equivalent to shifting the visual grid by a half tile trick, if I understand correctly?

Adding multiple types of terrain and also making it possible to paint the edges of course will add an explosion of possible tile types that are required. Looks like there is support in Tiled for optional automatic mirroring or rotations to add missing tile variations.

https://doc.mapeditor.org/en/stable/manual/terrain/

> Looks like there is support in Tiled for optional automatic mirroring or rotations to add missing tile variations.

Tiled uses tile "Global IDs" that encode booleans for flip and rotation into the upper bits: https://doc.mapeditor.org/en/latest/reference/global-tile-id...

It's kind of a pain in the ass to implement IMHO because you need to strip these bits and iterate all of your tilesets to find the correct tileset and tile for the GID for every ID (which is what the tile layers actually store) but a lot of the inherent performance issues can be improved upon by caching the last result, since consecutive tiles in a tilemap are likely to repeat.

Also I found this page useful: https://eishiya.com/articles/tiled/