Automapping: Check for empty tile?

(Red Eagle Lxix) #1

Is there a way to structure a rule such that it only activates if one of the tiles defined in the region is actually empty?

I have a rule file with a 2x2 area in my regions:

On the input I have 2 diagonal blocks using the top left and bottom right corner for input_Ground:

On the output I have a 2x2 output set of tiles for my output_Ground:

I know the rule will work and replace the 2 corners correctly if the 2 empty spots are populated with any other tile from any tile set. However, I want to create a rule that says those 2 spots must be empty and have no tile at all.

Perhaps a variant on inputNOT_Ground could be used? Something like inputEMPTY_Ground where one could specify certain tiles as part of a defined region as being required to be empty? Since by default a defined region is inputANY unless a specific tile is placed in one of the input layers.

(Red Eagle Lxix) #2

Example of the inputEMPTY_Ground (if such existed).

Below is an example of a map to demonstrate:

With the above rule currently the output is as follows:

However this is the output I desire (hence the question about checking for a tile being empty):

(Stefanbeller) #3


The Automapping was originally designed to only work in places where there are tiles, such that you can apply that to a very small region of a map.


Bumping this. Did some update actually break automapping here? The official example of automapping here requires the feature OP is mentioniong. In the very first example, after the “basic shoreline” headline, an input rule is defined where the bottom part is empty, and an output rule is defined where the top part is empty. But if you actually try out this rule in the editor, it doesn’t even work since Tiled doesn’t seem to match empty regions anymore. If you try to work around it by having different input and output regions, it messes up the map because it will place the bottom shoreline below any point where the water tile is detected.

edit: it appears it actually still works, but you just have to have non empty tiles in the place where there are empty tiles in the rule definition.

(Raoul Wols) #5

Bumping this again. I too need Automap regions to be able to detect truly “null” tiles. Right now, a workaround for me is to fill the whole input layer with a fully transparent tile, which feels very hacky.

(Erik Schilling) #6

For deleting a tile go into your rule file. Open the Map Properties there and create a propert DeleteTiles with the value true. Make sure that this property is of the type string (apparently it does not work with a bool property currently). All tiles which are are matches by the output region are deleted then if there is no tile in the output layer.


(Alan) #7

This is still happening on latest tiled.
Autotile won’t match ‘null’ tile when the rule has a null tile, it matches any tile except when it’s null, so the example in the documentation doesn’t work with the latest tiled.

(Thorbjørn Lindeijer) #8

The example does work, because in the example there are no empty tiles in the set layer.

However, in general the issue described in this topic is valid in that there was no way to have either an “input” or an “inputnot” layer check against an empty tile. I’ve tried to address this by adding a “StrictEmpty” option to input layers:

If anybody here would still benefit from such a change, I welcome you to try it out and let me know if this approach works for your rules.