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

Implement depth-first sorting algorithm for mapnodes #897

Open
SimplyLiz opened this issue May 4, 2022 · 2 comments
Open

Implement depth-first sorting algorithm for mapnodes #897

SimplyLiz opened this issue May 4, 2022 · 2 comments
Labels
core affects the core / engine

Comments

@SimplyLiz
Copy link
Contributor

Currently the mapnodes are sorted by a Z-index. which works fairly well for 1x1 tiles.
For multitile buildings, it's not possible to calculate a Z-index that will work. Instead, mapNodes should be sorted by a depth search.

I think it's safe to assume, that only the BUILDINGS layer will inhabit multitile buildings. We will still need a basic Z-Order for the overlapping terrain tiles.
Worst case, we'll have two containers (with mapnode*) in two orders, and move the rendering to Map to render each layer.

I found this article:
http://shaunlebron.github.io/IsometricBlocks/
Source Code:
https://github.com/shaunlebron/IsometricBlocks

@SimplyLiz SimplyLiz added the core affects the core / engine label May 4, 2022
@iaGuoZhi
Copy link
Member

Hi, I'd like to help with this issue. But I found that current implementation doesn't use Z-index. Is it ture? And why there will has multiple buildings in one node?

@SimplyLiz
Copy link
Contributor Author

I'm refactoring mapNode soon to help with this as preparation. I'll tell you when i'm done and we can discuss the details.

But I found that current implementation doesn't use Z-index
This is true, nodes are ordered in "calculateVisibleNodes" in a for loop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core affects the core / engine
Projects
None yet
Development

No branches or pull requests

2 participants