Godot version:
from github: faa49c182978b3fe74e7aad65fb761c2881f009c
OS/device including version:
linux/ubuntu
Issue description:
As discussed here and here, when dealing with hexagonal tiles in godot, there seems to have two main issues:
get_cell
is buggy, and when adding tiles to a tilemap, the tile is located at some offset on the lower right part of the actual tile.Steps to reproduce:
Select the tilemap in the hexmap demo and try to add more tiles, the tile will be displayed at some offset of the current tile grid cell.
Minimal reproduction project:
Witnessed on the official site release and recent github compilation
I though I was going crazy, I couldn't figure out what was happening there with the offsets, glad I was just not doing something wrong. But yes, I confirm the same issue and that it has been happening for a very long time.
After 3.1 is out, I advocate for a simplification of TileMap, given how unnecesarily complex it got.
Is this a reoccurrence of #4206?
For 3.2/4.0 it could even be worth having sepparate nodes and resources for hexagonal and isometric tiles, even if it's possible to have them all toghether like now, having them splitten up would much more straightforward for a final user imho, and since you will never have topdown+isometric+hexagonal tiles on the same tileset anyway there's no need for this anyway
I'd like to see improved hexagon support, as well. Unity supports both square and hexagon tilemaps, so perhaps that could provide guidance.
Is this still reproducible in the current master branch?
@akien-mga I downloaded 3.0.6 last week and am seeing this issue.
The only workaround I have found is custom hex grid implementations
https://github.com/romlok/godot-gdhexgrid
Also even custom module (Not sure if its compatible with 3.1)
https://github.com/cefleet/HexModule
Couldn't this be solved by having a custom offset for the 'Tile Origin' style property for the TileSet node?
Hex sprites have unusable space on the top left corner; setting 'Tile Origin' to center, you can see the offset clearly. Wouldn't a centered 'Tile Origin' with (-64, -64) offset (since demo pngs are 128x128px) perfectly center it for the sprites in the demo?
Fixed by #30231, you should enable "Centered Textures" on the TileMap.
Most helpful comment
For 3.2/4.0 it could even be worth having sepparate nodes and resources for hexagonal and isometric tiles, even if it's possible to have them all toghether like now, having them splitten up would much more straightforward for a final user imho, and since you will never have topdown+isometric+hexagonal tiles on the same tileset anyway there's no need for this anyway