Godot: TileMap tile centering is changed compared to 2.1

Created on 1 Jan 2018  路  6Comments  路  Source: godotengine/godot

Godot 3.0
Windows 10 64 bits

I just gave a go at the tilemap node in 3.0 master and I quickly noticed that I was unable to reproduce the same tiles the same way as in 2.1, when they are centered. Was it intented?

Here is how my tiles look like in 2.1:

They are all centered,

image

And when a tile has bigger height, I move the center down to the "main" part of the tile:

image

Which gives the following desired behaviour in a TileMap, once "tile origin" is set to "center":

image

Now, in 3.0, I tried the same setup and got different results.
That's what the issue is about: ground tiles get offset, as if the tile's center was actually top-left (which none of them are):

image

And wall tiles too:

image

The only way I could remake this was to change all tiles in my tileset to have a top-left origin:

image

Which results in the same placement I expected.

bug core

Most helpful comment

Well.... it cost to me a lot (beeing not real programmer) but i change tile_map.cpp and tile_map_editor_plugin.cpp to get this result (left actual, right modifications):
TileMapFix
I have to adapt to a recent master... and i implore for the grace of the gods for a merge in 3.2 no mathers if this will be killed and rewrited for 4.0. because in the actual state... i think that if tilemap remains in the actual state, version 3 of godot will end their cycle without a real TileMap.

All 6 comments

This is probably not intentional. I believe this is the same problem that was mentioned in the last comment of @oreismatheus in issue #13062.

I am kind of fed up with all the changes to tilemap. @MarianoGnu and I were thinking of doing some extra simplification to tilemaps in 3.2 (or 4.0) and get rid of some (many) things including this. As such, kicking to that release.

You mean get rid of centering tiles?

Getting rid of alignment and offsets, with the new editor it's easier to create polygons now.
The changes on centering was intentional, someone thought that it was a good idea to align the rects instead of the tile pivot point... i dont agree with this since it's kind of more difficult to see mentally how things would fit.
I still think it's okay to have a pivot point (not a rect, like before) but having several offsets for collision oclusion and navigations is overkill and not needed.
I'm not sure if this could be solved meanwhile adding a process on the 2.1 to 3.0 export process to recalculate offsets of the collision, occlusion and navigations shapes and modivy the pivot to make sure it works now, but would actually depend on how the person who did the tilemap is aligning the tiles in the TileMap, so i'm not sure if that could be done

Getting rid of alignment and offsets, with the new editor it's easier to create polygons now.
The changes on centering was intentional, someone thought that it was a good idea to align the rects instead of the tile pivot point... i dont agree with this since it's kind of more difficult to see mentally how things would fit.
I still think it's okay to have a pivot point (not a rect, like before) but having several offsets for collision oclusion and navigations is overkill and not needed.
I'm not sure if this could be solved meanwhile adding a process on the 2.1 to 3.0 export process to recalculate offsets of the collision, occlusion and navigations shapes and modivy the pivot to make sure it works now, but would actually depend on how the person who did the tilemap is aligning the tiles in the TileMap, so i'm not sure if that could be done

I麓m too agree with that. Origin point meaning should be calculate the Z-Order point in the tilemap with other objects inside that tilemap and self, not offset texture and shapes. For me it can麓t be kiked to 4.0 because I needed. There is no option to perform some kind of isometric and top-down games with actual behavior. Offset individually every shape has no meaning. Offset texture with "Origin Point" has no meaning.

All of this come from some commits that mix origin point with offset.

This is the actual chaos of tilemap:
TileMapChaos
I have some "hacks" to fix this, i will try to accomplish a meaningful behavior to all of this. I麓m trying to follow godot history from the beggining of the "chaos", it took me time to have a "pushable" solution because c++ is "THE PAIN", but i can麓t wait to 4.0 to finish and test my map generator.
I will follow the issue in this thread:
https://github.com/godotengine/godot/issues/22989

Well.... it cost to me a lot (beeing not real programmer) but i change tile_map.cpp and tile_map_editor_plugin.cpp to get this result (left actual, right modifications):
TileMapFix
I have to adapt to a recent master... and i implore for the grace of the gods for a merge in 3.2 no mathers if this will be killed and rewrited for 4.0. because in the actual state... i think that if tilemap remains in the actual state, version 3 of godot will end their cycle without a real TileMap.

Was this page helpful?
0 / 5 - 0 ratings