Godot: Support for dynamic autotiling (minitiles)

Created on 20 May 2018  路  6Comments  路  Source: godotengine/godot

I think that a useful addition to the autotile system would be a "minitile" mode, I believe RPG Maker has a similar feature, and would greatly ease the creation of tilesets as long as they are compatible with being corner based. It would behave very similar to the 2x2 bitmask but each tile contains 4 tiles, one for each corner, there would be 5 corner types for different neighbor combinations: corner, inside corner, vertical, horizontal, and solid which are used for generating the required tile based on it's neighbors. With only 5 tiles this technique gives a similar level of flexibility as the 3x3 tile mode, but with a far smaller sprite sheet than the 47 (aprox.) tile sized ones the full 3x3 set. I implemented a proof of concept of this technique in love2d a while ago.

Tile sprite structure:
Imgur
Full image/video set
source
corner tile demo

archived feature proposal core editor

Most helpful comment

you can override the virtual function _forward_subtile_selection with a tool script asigned to your TileSet to pick what tile place while drawing. if gives you information of the tilemap and the tiles around the one you are drawing. There's no explanation on the docs yet, but meybe you can figure it out from the arguments
http://docs.godotengine.org/en/3.0/classes/class_tileset.html#class-tileset-forward-subtile-selection

All 6 comments

You could achieve the same outcome with a 2x2 bitmask at the expense of using four times as many tiles. If you need center based tiles, it's not difficult to extend your sprites to the full 47 tileset (as you(?) posted on reddit). This is a better idea since you'll most likely want to edit the tiles to smooth transitions and so on.

My opinion is that the 2x2 and 3x3 autotiles implementations are sufficient and consistent. To implement what you described directly (without relying on 2x2 and 3x3), edge-based information would have to be implemented in addition to neighbors (what is done currently with the bitmask).

I think this task is best thought of as asset creation, which I don't think is the goal of Godot.

CC @MarianoGnu

Slice your 16x16 tileset into 8x8 tileset and configure the bitmasks, it will work like what you describe.
RPG-Maker tileset's was my first idea for implementing tilesets, but has a terrible problem, you have to setup collision shapes for every tile quarter, so in practice is the same than just making your tilesize the half using 2x2 bitmask mode and set the collisions.

Ah, yes I was the one who posted the Reddit thread. The problem I experienced with using a corner tile style sprite as 2x2 tiles scaled down in Godot was the repeating edges were randomly placed. So instead of a pattern like [][][][][] where all the tiles are placed in the right order, they are randoly placed and you end up with something more like this [[][[]]]][]][], which is a problem if each tile depends on being neighbored to another as in the case of corner tiles. instead of being standalone seamless tiles.

But I think that you are both right in that it's better to simply assemble a larger tileset and work with that, especially since that can be automated.

you can override the virtual function _forward_subtile_selection with a tool script asigned to your TileSet to pick what tile place while drawing. if gives you information of the tilemap and the tiles around the one you are drawing. There's no explanation on the docs yet, but meybe you can figure it out from the arguments
http://docs.godotengine.org/en/3.0/classes/class_tileset.html#class-tileset-forward-subtile-selection

Feature and improvement proposals for the Godot Engine are now being discussed and reviewed in a dedicated Godot Improvement Proposals (GIP) (godotengine/godot-proposals) issue tracker. The GIP tracker has a detailed issue template designed so that proposals include all the relevant information to start a productive discussion and help the community assess the validity of the proposal for the engine.

The main (godotengine/godot) tracker is now solely dedicated to bug reports and Pull Requests, enabling contributors to have a better focus on bug fixing work. Therefore, we are now closing all older feature proposals on the main issue tracker.

If you are interested in this feature proposal, please open a new proposal on the GIP tracker following the given issue template (after checking that it doesn't exist already). Be sure to reference this closed issue if it includes any relevant discussion (which you are also encouraged to summarize in the new proposal). Thanks in advance!

Was this page helpful?
0 / 5 - 0 ratings