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 tile centering is changed compared to 2.1 #15249

Closed
Zylann opened this issue Jan 1, 2018 · 6 comments · Fixed by #28896
Closed

TileMap tile centering is changed compared to 2.1 #15249

Zylann opened this issue Jan 1, 2018 · 6 comments · Fixed by #28896
Assignees
Milestone

Comments

@Zylann
Copy link
Contributor

Zylann commented Jan 1, 2018

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.

@hoelzl
Copy link
Contributor

hoelzl commented Jan 2, 2018

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

@reduz
Copy link
Member

reduz commented Sep 6, 2018

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.

@reduz reduz modified the milestones: 3.1, 3.2 Sep 6, 2018
@Zireael07
Copy link
Contributor

You mean get rid of centering tiles?

@MarianoGnu
Copy link
Contributor

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

@Ranoller
Copy link
Contributor

Ranoller commented Apr 13, 2019

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:
#22989

@Ranoller
Copy link
Contributor

Ranoller commented May 7, 2019

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.

myhalibobo pushed a commit to myhalibobo/godot that referenced this issue Sep 3, 2019
…FT and CENTER and other casuistry

This commit fix godotengine#22989 fixing displaced textures and not coincident shapes in tilemap. Fix too: godotengine#15249, godotengine#28206, godotengine#28610 and probably others
myhalibobo pushed a commit to myhalibobo/godot that referenced this issue Sep 3, 2019
…d compatibility mode

This commit fix godotengine#22989 godotengine#15249 godotengine#28206. Main problem is that tilemap displace textures in different tile origins in a strange way and doesn´t respect coincidence between texture and shapes in not uniform tiles. This issue is present in godot 3.0 and godot 3.1. To maintain compatibility are added a compatibility mode and a center texture option. Other related issues and pull request: godotengine#28896 godotengine#29487 godotengine#29519 godotengine#29961. Idications of godotengine#30204 are added
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants