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

Add support for height-maps / per cell y-offset #1255

Open
bjorn opened this Issue Apr 17, 2016 · 4 comments

Comments

Projects
None yet
3 participants
@bjorn
Owner

bjorn commented Apr 17, 2016

Allowing a per-cell height offset would allow maps like this to be edited in Tiled:

http://lanebrownart.blogspot.de/2011/12/isometric-game-art.html

display_3 2

Though, it would also require a stack-based rendering order.

@bjorn bjorn added the feature label Apr 17, 2016

@MarceColl

This comment has been minimized.

Show comment
Hide comment
@MarceColl

MarceColl Feb 27, 2017

Contributor

Hello!

I would like to attempt to do this.
Got any directions on where do you think it's best to start? I will follow up from there

My idea of the process would be (correct me if I'm wrong or you think of a different approach):

  • Add a heightmap to the map (formats to discuss)
  • Possibility to toggle between height-affected (to preview) and flat view (to edit)
  • Everything on every layer in a specific tile gets the offset.
  • Add offset value to the export file.

Some questions that I have:

  • How do we deal with the ground under every tile?
  • Should the tile height be editable from Tiled?
Contributor

MarceColl commented Feb 27, 2017

Hello!

I would like to attempt to do this.
Got any directions on where do you think it's best to start? I will follow up from there

My idea of the process would be (correct me if I'm wrong or you think of a different approach):

  • Add a heightmap to the map (formats to discuss)
  • Possibility to toggle between height-affected (to preview) and flat view (to edit)
  • Everything on every layer in a specific tile gets the offset.
  • Add offset value to the export file.

Some questions that I have:

  • How do we deal with the ground under every tile?
  • Should the tile height be editable from Tiled?
@bjorn

This comment has been minimized.

Show comment
Hide comment
@bjorn

bjorn Feb 28, 2017

Owner

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!

Owner

bjorn commented Feb 28, 2017

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!

@bjorn

This comment has been minimized.

Show comment
Hide comment
@bjorn

bjorn Feb 28, 2017

Owner

Here's a snippet of the custom map editor used for the example map I posted originally:

https://youtu.be/Eo3Uc97vCDA?t=76

Owner

bjorn commented Feb 28, 2017

Here's a snippet of the custom map editor used for the example map I posted originally:

https://youtu.be/Eo3Uc97vCDA?t=76

@Ceylo

This comment has been minimized.

Show comment
Hide comment
@Ceylo

Ceylo Apr 2, 2018

Hello!

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).

This is necessary because even things like trees that are on top of the ground, may sometimes need to render below a ground tile.

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?

Ceylo commented Apr 2, 2018

Hello!

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).

This is necessary because even things like trees that are on top of the ground, may sometimes need to render below a ground tile.

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment