Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

TL;DR:

Where should elevation be anchored on a civ-style hexagonal grid? Center, side or vertex? (Or more complex?)

Question proper:

Consider for a moment a classic game we all know and love (maybe?), Sid Meier's Alpha Centauri. The map model introduced the brand new concept of visible terrain elevation to the classic Civ formula. In SMAC, every vertex of the game board had an elevation, allowing the map beautiful rolling hills, a complete necessity, considering the mind worm boils waiting around every corner.

Would a vertex-only elevation map translate neatly to a hexagonal grid?

The obvious alternatives are side-based elevation mapping and center-based elevation mapping; as well as inner-vertex elevation mapping (giving the opportunity for cliffs! Yay!)

The last option is applying a triangular lattice to the game grid encompassing centers and vertices, and having vertex-only or inner-vertex elevation.

Which of these options is likely to work well? Which are likely to suck all the juice out of the CPU and RAM in a hurry?

share|improve this question
add comment

1 Answer 1

up vote 9 down vote accepted

Would a vertex-only elevation map translate neatly to a hexagonal grid?

It depends on the tessellation of the grid. If you tessellate your plane like so, then yes.

Grids

In this case, you can change the green triangle (x6) any way you like: hextri

Which of these options is likely to work well?

They all work well. Chances are that you'll be using multiple methods, anyway. You can't just use mid-point elevation unless you just want one-tile mountain features, you'd have to "raise" the edges as you go up a mountain if you want multiple-tile topography.

Which are likely to suck all the juice out of the CPU and RAM in a hurry?

This is a non-issue (unless you're writing this for some sort of embedded system?) as all the map generation work will be done before anyone plays the game, during the loading phase.

share|improve this answer
    
By midpoint elevation I mean a situation where you can only set and store the elevation for the midpoint; if two hexes have different enough elevations, edges around them would be lifted to match the elevations of their faces. (e.g. 1,1 has an elevation of 3; 1,2 has an elevation of 5: the face 1,1:1,2 has an elevation of 4 when rendered). –  Williham Totland Nov 4 '10 at 14:47
1  
It's not a non-issue at runtime because you'll need to be able to calculate paths for movement, height differences for combat advantage, and so on. It might be a non-issue at runtime because a dozen more floats per hex aren't really that bad on most platforms, but the data still needs to be there to use the map. –  user744 Nov 4 '10 at 15:40
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.