More autotiles: transitions between floor types
This is just a quick demo of a new visual feature: overlapping tiles for ground layer transitions. The problem before was that the transitions between the floor tiles were sharp and square. A square tile would either have e.g. a grass or dungeon floor tile. This was problematic when we have a non-full-square blocker tile occupying a border tile, such as these grass wall tiles, and the problem effect is shown here. What happens is that it looks like the grass border is gray, when it actually isn't. To counter the problem, a new pass is needed, that can ensure smooth transitions.
For this new pass, we need autotiles of the type "rug" (so, just 16 of them)
I've developed a small Python tool that allows me to easily do that from an input set of files, so I'm just loading up some tiles from an Oryx tileset and place them appropriately:
The layout can be then exported and embedded in a texture atlas, to be used by the game. So, in game, before we apply the layer, the background tiles look like this:
The new autotile layer is rendered after the background and before any other passes. My map tiles have zone IDs, so grass would be the outer zone (id == 1) and dungeon floor would be an inner zone (id == 2). If we are in an inner zone and we're on the boundary with an outer zone that has overlap tileset, we set the appropriate bits in a bitmask, that we're going to use to read the appropriate autotile. This results in the bottom image:
Now we can add the rest of the passes, resulting in a nicely smooth transition:
And for reference, here's the same view without the new overlap pass: