godotengine / godot

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

Weird behavior of 3x3 vs 3x3 minimal autotiling #27957

Open darthdeus opened 5 years ago

darthdeus commented 5 years ago

Godot version: v3.1.stable.official (installed via steam)

OS/device including version: Ubuntu 18.04, GTX 1080ti

Issue description:

The same tiling works well with "3x3 (minimal)" but breaks with "3x3", even though all the needed tiles are seemingly present.

This is what it looks like with "3x3 (minimal)"

image

and the exact same setup only switching the tilemap from "3x3 (minimal)" to "3x3"

image

Steps to reproduce:

  1. Create a tilemap with the following tileset buggy-tilemap
  2. Create an autotile region and set the bitmasks as shown in the screenshots above
  3. Set the Autotile bitmask to either "3x3" or "3x3 (minimal)"
  4. Draw the pattern as shown with the tilemap

Minimal reproduction project:

If this is a bug and not just my misunderstanding I can provide it.

isaacremnant commented 5 years ago

3x3 needs ALL combinations. 3x3 minimal disregards corners, but 3x3 does not. It checks the EXACT configuration around your tile so your bitmask would need to be image to get the desired behavior. 3x3 is supposed to give you more freedom, but you also need more tiles.

If you're trying to add only a few "new" cases to 3x3 minimal, the autotile system would need a revamp, see the discussion #18960. Maybe this issue could be turned into a feature request?

darthdeus commented 5 years ago

@isaacremnant ah that makes sense, thanks for the explanation! I guess this could at least be turned into a documentation request :) I'd offer to help but I really don't understand it enough to write it.

isaacremnant commented 5 years ago

I was about to document the 3x3 (minimal) vs 3x3 differences, but #27565 introduced wildcard patterns, so I'm not sure how they fit in the new picture.

golddotasksquestions commented 4 years ago

Apparently you need to use the complete bitmask tileset for either 3x3 minimal or 3x3 to work properly: https://github.com/godotengine/godot/issues/37360 This needs to be in the documentation: https://github.com/godotengine/godot-docs/issues/3316

guilhermefelipecgs commented 4 years ago

This is the correct setting you should use for your 3x3 bitmask example: Screenshot from 2020-05-18 19-04-15 3x3 bitmask must match exactly what you want, 3x3 minimal may disregard bit cornrers. see here https://github.com/godotengine/godot/issues/37360#issuecomment-630419223

You can also use wildcards if desired.