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

Terrain sets do not work properly with staggered isometric maps #3617

Closed
AtlaStar opened this issue Mar 14, 2023 · 5 comments · Fixed by #3624
Closed

Terrain sets do not work properly with staggered isometric maps #3617

AtlaStar opened this issue Mar 14, 2023 · 5 comments · Fixed by #3624
Assignees
Labels
bug Broken behavior.

Comments

@AtlaStar
Copy link

As the title says, a misalignment occurs when using the terrain brush causing the tiles to not properly conform to the expected shape while using a corner set.

Steps to reproduce the behavior:

  1. Open the isometric_grass_and_water.tmx
  2. Change the map properties to Isometric (staggered)
  3. Try to use the premade corner set with your Terrain brush.

This is what happens
image

This is what should happen
image

Tiled Version: built from master, using Qt 6.2.4

Issue appears to be related to the WangBrush::mouseMoved function, as for corner and mixed sets it tries to perform some additional logic when a staggered renderer is being used. Simply removing that logic fixes the issues with the corner set, and appears to fix the issues with a mixed set as well (with limited testing, likely requires more)

@AtlaStar AtlaStar added the bug Broken behavior. label Mar 14, 2023
AtlaStar added a commit to AtlaStar/tiled that referenced this issue Mar 14, 2023
As noted there, the issue appears to be relate to whether a StaggeredRenderer is the current renderer, and performing differing logic. Removing that erroneous logic appears to resolve the issue.
@bjorn
Copy link
Member

bjorn commented Mar 17, 2023

2. Change the map properties to Isometric (staggered)

You seem to have switched the map to Hexagonal (Staggered) instead. Then I can reproduce the problem. But the fix in db0a488 does not look correct in the general case, unfortunately.

@AtlaStar
Copy link
Author

You can see in the above screen shot that it is on an isometric map, as you can see the iso grid lines. That said, I am wondering if there is a deeper issue then as it makes little sense that the issue would appear in my environment but not in yours.

@eishiya
Copy link
Contributor

eishiya commented Mar 17, 2023

(I mentioned this on Discord, but I'll post it here just for completion's sake.)
It's not possible to tell whether a map is iso or hex just from looking at the grid, because a staggered hex map with Side Length set to 0 looks identical to a staggered isometric map with the same tile size - but it behaves differently for the purposes of Terrains because its neighbours are counted differently - and incorrectly, since hex tiles have 6 sides, but Terrains currently only support 4 sides per tile.

So, please verify that your test map was actually Isometric (Staggered) and not Hexagonal (Staggered).
For me, in 1.10 and in a nightly from today (both Qt6), terrains work just fine for Isometric (Staggered) maps. I also remember this working fine in older Tiled versions (Qt5).

@AtlaStar
Copy link
Author

As I mentioned in the Discord, I retested and wasn't encountering the same issue, as previously the nightly I had built would not even render staggered hex maps with a side length of 0, suggesting I had some weird environment issue causing the problems previously.

So this does not appear to be a bug with staggered isometric maps as I initially thought.

bjorn added a commit to bjorn/tiled-dev that referenced this issue Mar 20, 2023
Now Hexagonal (Staggered) maps are treated the same way as Isometric
(Staggered) maps, which might be better than treating them as orthogonal
maps. It at least fixes the behavior when "hex side length" is 0, but it
does not mean hexagonal maps are actually supported by the Terrain
Brush.

Closes mapeditor#3617
@bjorn
Copy link
Member

bjorn commented Mar 20, 2023

In #3624 I've proposed a change that fixes the behavior for Hexagonal (Staggered) maps when the Hex Side Length property is 0 (so, for hex maps that actually look like isometric maps). Full support for hex maps will be more involved, but this may also be a small step towards that.

@bjorn bjorn self-assigned this Mar 20, 2023
bjorn added a commit to bjorn/tiled-dev that referenced this issue Mar 20, 2023
Now Hexagonal (Staggered) maps are treated the same way as Isometric
(Staggered) maps, which might be better than treating them as orthogonal
maps. It at least fixes the behavior when "hex side length" is 0, but it
does not mean hexagonal maps are actually supported by the Terrain
Brush.

Closes mapeditor#3617
bjorn added a commit that referenced this issue Mar 20, 2023
Now Hexagonal (Staggered) maps are treated the same way as Isometric
(Staggered) maps, which might be better than treating them as orthogonal
maps. It at least fixes the behavior when "hex side length" is 0, but it
does not mean hexagonal maps are actually supported by the Terrain
Brush.

Closes #3617
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Broken behavior.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants