Hi! I''m developing an isometric engine but I''ve have a problem with the elevation of the terrain... I''ve seen how Age of Empires 2 resolves the problem (7 different levels of elevation) but I can''t imagine how to do it... Can anyone help me please?
2d game Terrain with elevation
Started by face08, Aug 07 2012 02:14 AM
6 replies to this topic
Sponsor:
#2 Members - Reputation: 108
Posted 07 August 2012 - 10:58 AM
Hi face,
I think this depends a bit on your plans.
I never played AOE 2, but I know that in AOE 1 the tiles are sloped in such a way, that higher tiles can't overlap sprites that are (spatially) below them. I will try to make a screenshot later on to demonstrate it. Anyway, this means that you can place all tiles next to each other and render them in one layer which can be drawn as a background.
But...
If you want your tiles to be sloped in a different way or uninclined (I'm not quite sure about the existence of that word ^^), you will have to render each tile individually.
I think this depends a bit on your plans.
I never played AOE 2, but I know that in AOE 1 the tiles are sloped in such a way, that higher tiles can't overlap sprites that are (spatially) below them. I will try to make a screenshot later on to demonstrate it. Anyway, this means that you can place all tiles next to each other and render them in one layer which can be drawn as a background.
But...
If you want your tiles to be sloped in a different way or uninclined (I'm not quite sure about the existence of that word ^^), you will have to render each tile individually.
#4 Members - Reputation: 199
Posted 08 August 2012 - 12:33 AM
I think you should just give certain tiles a slope value, which will be used for your characters when they pass over it.
Let them do a check before they walk over it, just like you do when they want to pass a water tile or any other non-accessable terain, and animate them differently when they walk on a hill.
Let them do a check before they walk over it, just like you do when they want to pass a water tile or any other non-accessable terain, and animate them differently when they walk on a hill.
Edited by vleugel, 08 August 2012 - 12:34 AM.
#7 Members - Reputation: 108
Posted 08 August 2012 - 05:59 AM
It'll be quite exhausting if I made up an algorithm here, from scratch. But I can give you a simple impression.
Assuming you're using 2D this means that you'll need tile graphics that fit perfectly (and nothing less) on each other.
You can give each tile a value for it's base coördinate (not elevated) and a value for it's height (and much more other values, as the slope value mentioned by vleugel), to indicate where the graphic will be drawn. Then you make sure each tile is being in the right order (with Z-index values for example) - And voila you will have a map.
The prerendering method as I mentioned early, will probably not work quite well with these editors, as the whole map has to be re-rendered each time you heighten the terrain.
Assuming you're using 2D this means that you'll need tile graphics that fit perfectly (and nothing less) on each other.
You can give each tile a value for it's base coördinate (not elevated) and a value for it's height (and much more other values, as the slope value mentioned by vleugel), to indicate where the graphic will be drawn. Then you make sure each tile is being in the right order (with Z-index values for example) - And voila you will have a map.
The prerendering method as I mentioned early, will probably not work quite well with these editors, as the whole map has to be re-rendered each time you heighten the terrain.








