Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Add support for height-maps / per cell y-offset #1255
Allowing a per-cell height offset would allow maps like this to be edited in Tiled:
Though, it would also require a stack-based rendering order.
I would like to attempt to do this.
My idea of the process would be (correct me if I'm wrong or you think of a different approach):
Some questions that I have:
The biggest issue here is in my last sentence, that the tiles would need to be rendered stack-based. This is necessary because even things like trees that are on top of the ground, may sometimes need to render below a ground tile. However, Tiled renders a map layer-by-layer. So first issue #1274 should be resolved before we can start on this.
I think tile stacks will be something to support within a single TileLayer, as would this height map. This keeps things straight-forward because they are interspersed with object and image layers as well. And in the future, different tile layers may have different tile sizes or orientations.
The ground height will default to 0, and there will be a tool to modify this. In addition, indeed each tile will need to define its height in pixels, so that the next tile can be rendered at the right place.
If the user wants to have some tile "hover" above the ground, it will need to be placed in a separate layer unless we add an additional per-stack-entry offset. But I think that would make things overly complicated in terms of editing.
Feel free to question any of my ideas!
referenced this issue
Mar 1, 2017
I'm willing to contribute to have this feature implemented. Considering the game project I have in mind this is the only feature currently missing in Tiled that I'm aware of. I'm rather new to making games so I may make stupid statements :)
A few references of what I've found on this topic for now:
I've more or less the same ideas as @MarceColl except that I don't think it's really useful to be able to have a flat view. At least it can come later once we have more feedback. And I can't see what's the problem with the ground (which I assume to be a layer where you put ground tiles).
Regarding what you mentioned @bjorn about the stack-based renderer, I don't get why it's needed. From what I understand, Tiled draws layer by layer. And for a layer, tiles are drawn starting from top left tile, going toward the right, then drawing next row below.
Can you show an example of what you'd want to achieve with "rendering a tree below a ground tile" ? To me if the tree is below (in Y axis) but still on a layer that is above, if should still display above the ground tile. If you want to have it displayed below the ground tile, you should put it on a layer that is under the ground layer. At least that's how it feels like with current layer concept.
As a side note, for now I cloned Tiled repo and successfully did a full build. Is there some doc/guides about Tiled architecture or do I have to read all sources that seem relevant?