Skip to main content
gamedev.net
🔒 Locked

Extended heightmap

Started by Funkyjive 1 reply 1.2k views
Original Post
Funkyjive
Funkyjive
In the design phase right now for how I will model the terrain in the current game I am creating. I need some advice on doing a heightmap with some extended properties.

The type of terrain I am doing is a 3d heightmap similar to that in Rollercoaster Tycoon 3. The aspect in particular that I want to model is the ability to have vertical faces. This means that there will be multiple height values for each x,y node in the grid.

What is the best type of data structure for modeling a terrain like this? Should I just have 4 "height" values for each grid square or is there a more elegant way to model the terrain?

Thanks in advance!
"I would rather be in the boat with a drink on the rocks, than in the drink with a boat on the rocks" -Unknown
Lloydg
Lloydg
well if the terrain is going to be static the whole game you could actually model it. but if u want to do it with a height map you could have a vector every point on the height map rather then just a height.
Funkyjive
Funkyjive
Sorry, I didn't specify but the terrain will not be static so a model is out of the question. I am think of two possible solutions...

1) Each square tile will have 4 "heights" representing the height of each corner of the tile.

2)Like rollercoaster tycoon, the tiles will have a small finite set of states or slopes and angles they can have. For example... edge 1 raised, edge 2 raised, ..., corner 1 raised, flat, etc. I could then represent each square tile of the world with 2 values, an elevation and an enumeration representing one of the slope types. This option would use half the memory as it is 2 values instead of 4. I am not sure how big my maps might get so this might be a good time for me to think about it.

Here is an example of what I mean by enumerating the terrain slopes. There are pieces of flat land, some that slope to an edge (N,S,E,W), some that slope to a corner (NW,NE,SE,SW), some with a corner raised while the opposite corner is lowered, etc.


In either option if any modifications is made to the terrain I will have to rebuild the vertex array for level geometry that I will render.

I am just trying to figure out what kind of data structures might be best to replicate this behavior.

Any thoughts?
"I would rather be in the boat with a drink on the rocks, than in the drink with a boat on the rocks" -Unknown

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.