godotengine / godot

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

TileMap Navigation map synchronization error because of different `cell_size` #79474

Closed mohe2015 closed 1 year ago

mohe2015 commented 1 year ago

Godot version

4.1.dev.custom_build [e709ad4d6407e52dc62f00a471d13eb6c89f2c4c]

System information

Godot v4.1.dev unknown - NixOS 23.11 (Tapir) - Vulkan (Forward+) - integrated AMD Radeon Graphics (RADV RENOIR) - AMD Ryzen 7 4700U with Radeon Graphics (8 Threads)

Issue description

I expected that a TileMap with two navigation layers simply works. But when running the project the following error is thrown:

ERROR: Navigation map synchronization error. Attempted to update a navigation region with a navigation mesh that uses a different `cell_size` than the `cell_size` set on the navigation map.
   at: update_polygons (modules/navigation/nav_region.cpp:118)

Steps to reproduce

  1. Create TileMap root node
  2. Add a second layer to the TileMap
  3. Add TileSet to the TileMap
  4. Add two navigation layers to TileSet
  5. Drag res://icon.svg into the TileSet tiles to create an atlas out of it.
  6. Select top left tile and reset to default shape for both navigation layers.
  7. Add the top left tile somewhere on the TileMap
  8. Run the project

Minimal reproduction project

TileMapNavigationBug2.zip

AThousandShips commented 1 year ago

See there for the solution

mohe2015 commented 1 year ago

See there for the solution

I have a few questions to that:

  1. What are the correct values for which project settings for my provided reproduction project? Could you maybe quickly try it please because I tried setting all settings containing cell_size to 1 and all to 0.25 and both didn't seem to work.
  2. In the project settings for navigation/2d/default_cell_size I can't set decimal numbers but only integers. Is this intended?
  3. Could the error message show the differing values so you know which value you need to set to which value? Because currently it's more blind guessing.
  4. I would expect that this seemingly super basic setup would work by default and not fail with this unclear error message.
AThousandShips commented 1 year ago

CC @smix8