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

1.2.0 breaking change out of box creating tileset (GDScript) #6

Closed
JSchrepp opened this issue Mar 30, 2023 · 11 comments
Closed

1.2.0 breaking change out of box creating tileset (GDScript) #6

JSchrepp opened this issue Mar 30, 2023 · 11 comments
Labels
bug Something isn't working

Comments

@JSchrepp
Copy link
Contributor

Describe the bug
When using isometric tiles that are a different size from the grid tile (e.g. double height tiles for trees as pictured in example below)
image
version 1.1.2 would import the tiles with expected alignment (matching how Tiled interprets them when painting to a map)
image
In version 1.2.0 (and onwards) tiled imports the tileset assuming the boundary for where to place the tile is centered
image
This results in tiles being painted half a tile lower than expected as depicted below
image

Additionally, their collision physics are now completely distorted, see below for comparison:
image
image

To Reproduce
Steps to reproduce the behavior:

  1. Use the provided sample map (no extra configuration used)
  2. Import using version 1.2.0 or later

Expected behavior
Tileset should import as expected, like it used to.

Desktop (please complete the following information):

  • OS: Windows 10
  • Version 1.2.0
  • Godot Version 4.0.1
  • Tiled Version 1.10.0

Example map (zipped)
tempfarm.zip

Additional context
Add any other context about the problem here.

@JSchrepp JSchrepp changed the title 1.2.0 breaking change out of box creating tileset 1.2.0 breaking change out of box creating tileset (GDScript) Mar 30, 2023
@JSchrepp
Copy link
Contributor Author

I notice a couple places is TilesetCreator.gd where the condition if _tileset_orientation == "orthogonal" was added that seem to transform some things about texture mapping. Removing those branches almost reverts behavior. The first tile still exhibits the shift but the rest are realigned. Perhaps this helps you narrow down the culprit.
image

@Kiamo2
Copy link
Owner

Kiamo2 commented Mar 30, 2023

Hi, I'm sorry that you've just stumbled upon my current construction site (isometric tiles) and that I seem to have temporarily made things worse here as well.
Actually I am in the process of completely reworking isometric so that it is correct for all displacements and height/width ratios etc. including the collision polygons, whose .tmx/.tsx geometry data (in the case of isometric tilesets) the devil has seen.
Could possibly take more than a few hours, as I really want to be thorough this time.
Thank you for your example, that will help me a lot.

@Kiamo2
Copy link
Owner

Kiamo2 commented Mar 30, 2023

Interestingly your .tsx is NOT set to 'isometric'.
That's one more combination (isometric map, non-isometric tileset) to be handled.
(And that's most probably the reason why in 1.1.2 it works but no longer in 1.2.1)

@JSchrepp
Copy link
Contributor Author

Interestingly your .tsx is NOT set to 'isometric'. That's one more combination (isometric map, non-isometric tileset) to be handled. (And that's most probably the reason why in 1.1.2 it works but no longer in 1.2.1)

Interesting! I must have missed this property as it wasn't available on creation in Tiled like it is on maps. In fact, setting the tileset back to isometric with appropriate grid dimensions creates the exact collision-box distortion in the issue description.

When making this adjustment on my end to label the tileset as it should be, I notice my collision import is as desired, but the centering of the tile on the grid still exists, rather than snapping to the bottom as it used to. Updated tileset below works with tiled as expected but is still offset by half a tile vertically in godot.
testset.zip

@Kiamo2
Copy link
Owner

Kiamo2 commented Mar 30, 2023

Concerning "... to label the tileset as it should be". I'm not sure that this is a strict 'should be'. I assume that it's depending weather one likes to have the automatically skewed rectangles or not. The overall map (in Tiled) seems to work both ways so I have to ensure that both ways are importable and have the absolutely same result.
The offset by half a tile is another animal having not exactly to do with the tileset being isometric or orthogonal.
It probably was introduced by the condition if _map_orientation == "orthogonal" in TilemapCreator.gd as well as that one mentioned by you.
I will remove that and find another way to correct that isometric test design of mine which is then off :-)
The challenge is: All contingencies must work.
Please give me some time...

@JSchrepp
Copy link
Contributor Author

There's no rush, I'm just trying to give information that may help. For my own work, I've reverted to 1.1.2 as I can work with just that while I am still experimenting with my own project.

Honestly my goal is to be able to submit PRs for issues like these, but I don't understand tilemaps in these two programs that well yet and so don't have the knowledge to learn your codebase.

@Kiamo2
Copy link
Owner

Kiamo2 commented Apr 1, 2023

Hi, just have released v1.2.2 and hope that the issues discussed here are solved.
Thanks for all your input.

@JSchrepp
Copy link
Contributor Author

JSchrepp commented Apr 1, 2023

This solves most of the issue! Isometric tiles are once again properly aligned in the imported tileset. However, collision information is not properly transferred, as depicted below in the TileSet window in Godot. The reproduction assets I sent you should already have this collision info in the .tsx file, so I imagine you should be able to reproduce this.
image

@Kiamo2
Copy link
Owner

Kiamo2 commented Apr 2, 2023

Ooops! I've typed in one single sign wrong when translating from C# to GDScript (I'm developing in C#).
And in the tests I must have missed exactly that, perhaps only checked the orthogonal version.
I'm very sorry for that, that really should not happen!!
(Edit: and this will not happen any more, from now on I'll compare the .tscn files)
Fixed in v1.2.3.

Kiamo2 added a commit that referenced this issue Apr 2, 2023
@Kiamo2 Kiamo2 added the bug Something isn't working label Apr 2, 2023
@Kiamo2
Copy link
Owner

Kiamo2 commented Apr 5, 2023

I'd like to close the issue. Ok?

@JSchrepp
Copy link
Contributor Author

JSchrepp commented Apr 5, 2023

I haven't had a chance to test this yet but it seems like you've identified and solved the issue. I can reopen if it doesn't work for me.

@JSchrepp JSchrepp closed this as completed Apr 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants