Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TileMap.set_cells_terrain_connect() ignores diagonal tiles connections #89844

Open
Igorrreha opened this issue Mar 24, 2024 · 5 comments
Open

Comments

@Igorrreha
Copy link
Contributor

Igorrreha commented Mar 24, 2024

Tested versions

  • Reproducible in: Godot v4.2.1.stable, Godot v4.3-dev5

System information

Godot v4.2.1.stable - Windows 10.0.19044 - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1650 (NVIDIA; 31.0.15.4633) - Intel(R) Core(TM) i5-10300H CPU @ 2.50GHz (8 Threads)

Issue description

Terrain sets with mode "match corners and sides" don't connect diagonal tiles as their peering bitmask describes.

Expected pattern:
expected pattern

Real pattern:
real pattern

Video:

demo.mp4

Bitmask:
bitmask

Steps to reproduce

Open MRP

  1. Open "res://demo.tscn" scene
  2. Go to tilemap window
  3. Open "terrains" panel
  4. Select "ground" terrain
  5. Select "connect mode" tool
  6. Try to draw some tiles on terrain
    reproduction

Minimal reproduction project (MRP)

diagonal-tiles-bug.zip

@Igorrreha
Copy link
Contributor Author

Igorrreha commented Mar 25, 2024

Important thing!

I wrote this tool script and found out that TileMap.set_cells_terrain_path() works fine and only the TileMap.set_cells_terrain_connect() method works buggy.

@tool
extends EditorScript


func _run() -> void:
	var tilemap = get_scene() as TileMap
	tilemap.clear()
	
	_terrain_path(tilemap, [
		Vector2i(0, 0),
		Vector2i(1, 1),
		Vector2i(2, 2),
	])
	
	_terrain_connect(tilemap, [
		Vector2i(4, 0),
		Vector2i(5, 1),
		Vector2i(6, 2),
	])


func _terrain_path(tilemap: TileMap, cells: Array) -> void:
	tilemap.set_cells_terrain_path(0, cells, 0, 0, false)


func _terrain_connect(tilemap: TileMap, cells: Array) -> void:
	tilemap.set_cells_terrain_connect(0, cells, 0, 0, false)

Test result:
test result

@Igorrreha Igorrreha changed the title Diagonal terrain tile connections is not working TileMap.set_cells_terrain_connect() ignores diagonal tiles connections Mar 26, 2024
@VIRTUALXN
Copy link

Hello friend, I have also noticed that this function seems to have some issues, but I am not sure if it is the type you described, but it does not work properly

@VIRTUALXN
Copy link

image
image

@VIRTUALXN
Copy link

image
image

@VIRTUALXN
Copy link

The set_cells.terrain_path I am using is also abnormal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants