RPG Maker Auto-Tile/Terrain Converter for TileD

If you use TileD regularly for making RPG Maker maps, you might have noticed the auto-tiling/terrain conversion isn't great. You end up with edges and center regions that don't look right, and patterns that don't line up. It's passable, but if you've got eye for detail, it might be driving you crazy.

When RPG Maker uses its own tiles, it divides each of the 9 squares into four 'mini-tiles' and does some internal compositing. when you paint with your auto-tile, you'll notice tile shapes that don't exist on your tile sheet! How? Well, they were composited from those "mini-tiles."

TileD is unaware there are special "rules" governing which mini-tiles can go together in which order. It ends up picking randomly, which is what creates all the distortions.

There's a couple ways around this, but one way is to composite the tiles yourself, exactly the way RPG Maker would do internally, output a tile sheet, and use that in TileD. Easy, right? No. No, it's a horrible, god-awful amount of copy pasting that I wouldn't wish on anyone. Which is why I created a Python script to do it for you at the touch of a button.

I have two versions. 1.0 is less intimidating but has much less functionality: Version 1.0

2.0 allows you to recombine autotiles into big 1024x1024 or 2048x2048 tilesets. And you can also use it on just a tile by tile or rectangle by rectangle basis to merge any tilesets with big blank spaces together: Version 2.0

It's available via Google Collab, which means no need to install or download anything; you can run it right in your browser. You have to upload your files, follow the instructions to change a few variables, and voila: It will output every possible tile shape you need. You can run it on every auto-tile in a tilesheet, all at once, and you can run it on any resolution of tile (16x16, 32x32, 48x48 and so on)

It will turn a tileset laid out like this...
RPGMakerComposite.png


Into one laid out like this...

RPGMakerComposite_output0.png


This is 47 tiles in a 6x8 grid (with one empty slot), and contains every conceivable shape.

Note that if you perform this conversion, you no longer will want to work at half-sized map resolutions. For example, if your tiles are 48x48, you were probably working in TileD at 24x24 (to account for all the mini-tiles). If you decide to use this converted 47-tile tileset instead, you will return to working in 48x48.
That's way clearer than the status post was. Very cool!
Update:

I have created a better version of this that can also take tiles from any tileset and stitch them into giant 1024x1024 or 2048x2048 or whateverxwhatever tilesets, as needed.

The updated link is here.
This is really useful but I do not understand where to put the terrain rules for this...some are easy to understand and some are not.

Original thread: https://forums.rpgmakerweb.com/threads/rpg-maker-auto-tile-terrain-converter-for-tiled.164875/