godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
89.8k stars 20.91k forks source link

Symbol is used instead of Priority in AutoTiles when using Centerpiece bitmaps only #55435

Open creadicted opened 2 years ago

creadicted commented 2 years ago

Godot version

3.4

System information

Windows

Issue description

This is most likely related to https://github.com/godotengine/godot/issues/36972

I used the example Project also provided in this issue to show the bug. I have 8 tiles with the same priority. I create an AutoTile set and add only center bitmasks: image

I have the Simbol set to the first tile. I start drawing and this happens.

preview

I only get the same tile as mentioned in this issue: https://github.com/godotengine/godot/issues/36972

But if I then change the symbol:

image

The Symbol will be used to draw the tiles: preview2

Steps to reproduce

Create a Tileset. Create an autotile. Set the bitmask to 3x3 minimal and only use the center bitmask.

Minimal reproduction project

Priority_Tileset_Issue.zip

golddotasksquestions commented 2 years ago

The Autotile symbol is always the default tile. It is also chosen if Godot does not know what tile to set.

You can work around this by setting the wildcard in the bitmask as described by guilhermefelipecgs here To set a wildcard, go to the Bitmask tab in the Tileset panel, then hold Shift while you left click on the bitmask.

Note however with Autotiles you will still have this issue of changing neighboring tiles when you set tiles.

So generally speaking when you just want to paint random tiles from a group of tile that follow the priority setting, it is advised to use an AtlasTile rather than an Autotile.

It's also easier: you just click "New Atlas", then drag the region over all the tiles you want in your Atlas tile group, then click on the TileMap node in the Scene Tree and make sure you have "Priporty enabled", and start drawing.

The downside of the Atlas tile approach is, it's only working in the editor, but not if you set tiles in code. If you want to set random tiles in code from a group of tiles, you either need to use the Autotile with wildcards as described above, or code the random picking yourself with GDscript.

creadicted commented 2 years ago

The Autotile symbol is always the default tile. It is also chosen if Godot does not know what tile to set.

You can work around this by setting the wildcard in the bitmask as described by guilhermefelipecgs here To set a wildcard, go to the Bitmask tab in the Tileset panel, then hold Shift while you left click on the bitmask.

Note however with Autotiles you will still have this issue of changing neighboring tiles when you set tiles.

So generally speaking when you just want to paint random tiles from a group of tile that follow the priority setting, it is advised to use an AtlasTile rather than an Autotile.

It's also easier: you just click "New Atlas", then drag the region over all the tiles you want in your Atlas tile group, then click on the TileMap node in the Scene Tree and make sure you have "Priporty enabled", and start drawing.

The downside of the Atlas tile approach is, it's only working in the editor, but not if you set tiles in code. If you want to set random tiles in code from a group of tiles, you either need to use the Autotile with wildcards as described above, or code the random picking yourself with GDscript.

Thank you for the detailed description!