• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
Total_Titillation

Tweaking Heightmap Generation For Hexagon Grids

5 posts in this topic

Currently I'm working on a little project just for a bit of fun. It is a C++, WinAPI application using OpenGL.

I hope it will turn into a RTS Game played on a hexagon grid and when I get the basic game engine done, I have plans to expand it further.
At the moment my application consists of a VBO that holds vertex and heightmap information. The heightmap is generated using a midpoint displacement algorithm (diamond-square).

In order to implement a hexagon grid I went with the idea explained here. It shifts down odd rows of a normal grid to allow relatively easy rendering of hexagons without too many further complications (I hope).

hex_grid4.jpg

Allows for:

hex_grid5.jpg

After a few days it is beginning to come together and I've added mouse picking, which is implemented by rendering each hex in the grid in a unique colour, and then sampling a given mouse position within this FBO to identify the ID of the selected cell (visible in the top right of the screenshot below).

gVXMe.png

In the next stage of my project I would like to look at generating more 'playable' terrains. To me this means that the shape of each hexagon should be more regular than those seen in the image above.
So finally coming to my point, is there:
  • A way of smoothing or adjusting the vertices in my current method that would bring all point of a hexagon onto one plane (coplanar).
  • A better approach to procedural terrain generation that would allow for better control of this sort of thing.
  • A way to represent my vertex information in a different way that allows for this.
To be clear, I am not trying to achieve a flat hex grid with raised edges or platforms (as seen below).

11uBD.jpg

I would like all the geometry to join and lead into the next bit.

I'm hope to achieve something similar to what I have now (relatively nice undulating hills & terrain) but with more controllable plateaus. This gives me the flexibility of cording off areas (unplayable tiles) later on, where I can add higher detail meshes if needed.

Any feedback is welcome, I'm using this as a learning exercise so please - all comments welcome! Edited by Total_Titillation
0

Share this post


Link to post
Share on other sites

You won't be able to do vertical faces like that with a heightmap. If you want vertical faces, you'd be better off just going with simple hex meshes with a top face and a skirt (the vertical faces).

0

Share this post


Link to post
Share on other sites

He said that he's *not* trying to produce sides on the hexies.

 

I'm not sure that what you're trying to do is entirely possible - because if you force one hex to be 'flat' so that all its verts are coplanar, then the surrounding hexies which share more than one vertex will have very few options for being on different planes. It seems like somehow it can be done, but the variety of geometry won't be very awesome.

 

I think the best choice would be to make the center vertex of each hex as 'centered' as possible - averaging the surrounding verts to produce its vertical position. But making them literally flat/coplanar would be hard what-with the neighboring hexies connected to it, which the flat rule would have to somehow apply to as well.

 

Very nice work thus far, interesting :)

0

Share this post


Link to post
Share on other sites

Thanks for your suggestions.

 

Could you by any chance, point me in the direction of some material that explains or at least a phrase to search for.

 

Thanks!

0

Share this post


Link to post
Share on other sites
He said that he's *not* trying to produce sides on the hexies.

 

I'm not sure that what you're trying to do is entirely possible - because if you force one hex to be 'flat' so that all its verts are coplanar, then the surrounding hexies which share more than one vertex will have very few options for being on different planes. It seems like somehow it can be done, but the variety of geometry won't be very awesome.

 

I think the best choice would be to make the center vertex of each hex as 'centered' as possible - averaging the surrounding verts to produce its vertical position. But making them literally flat/coplanar would be hard what-with the neighboring hexies connected to it, which the flat rule would have to somehow apply to as well.

 

Very nice work thus far, interesting smile.png

 

Ah, sorry, I missed that. Typically when someone posts an image, they are showing what they want to do, not what they don't want to do.

 

Still, what I said stands, as you stated. With a heightmap, there are always going to be some slopes, as long as some hexes are raised and some are lowered. The hexes "in between" will be ugly. I still stand with my assertion that the best bet would be to ditch the heightmap and just use straight meshes.

 

Edit: Reading the OP more closely, I'm not sure there really is a way to do what you want. It seems like you don't really have a clear vision of what you want. It might help if you somehow manually constructed a mock-up of what you have in mind, since that might help you to visualize solutions to how to implement it.

 

If you are wanting to have a mix of rolling height-map terrain and cliffs both, then typically this is implemented using a combination of height-map for the rolling terrain, and meshes for the cliffs that are placed on the terrain to cover the "ugly" hexes where hexes slope from high to low.

Edited by JTippetts
0

Share this post


Link to post
Share on other sites

He said that he's *not* trying to produce sides on the hexies.
 
I'm not sure that what you're trying to do is entirely possible - because if you force one hex to be 'flat' so that all its verts are coplanar, then the surrounding hexies which share more than one vertex will have very few options for being on different planes. It seems like somehow it can be done, but the variety of geometry won't be very awesome.
 
I think the best choice would be to make the center vertex of each hex as 'centered' as possible - averaging the surrounding verts to produce its vertical position. But making them literally flat/coplanar would be hard what-with the neighboring hexies connected to it, which the flat rule would have to somehow apply to as well.
 
Very nice work thus far, interesting smile.png

 
Ah, sorry, I missed that. Typically when someone posts an image, they are showing what they want to do, not what they don't want to do.
 
Still, what I said stands, as you stated. With a heightmap, there are always going to be some slopes, as long as some hexes are raised and some are lowered. The hexes "in between" will be ugly. I still stand with my assertion that the best bet would be to ditch the heightmap and just use straight meshes.
 
Edit: Reading the OP more closely, I'm not sure there really is a way to do what you want. It seems like you don't really have a clear vision of what you want. It might help if you somehow manually constructed a mock-up of what you have in mind, since that might help you to visualize solutions to how to implement it.
 
If you are wanting to have a mix of rolling height-map terrain and cliffs both, then typically this is implemented using a combination of height-map for the rolling terrain, and meshes for the cliffs that are placed on the terrain to cover the "ugly" hexes where hexes slope from high to low.

 
 
Thanks, I think you're right.  I'm going to do a bit more reading, turn my application into a more flexible level editor and implement a few different approaches.
 
One thing I have come accross is Spinodal Decomposition on a Hexagonal Lattice. Which looks interesting and I have since found a few papers that explain plenty of interesting procedural techniques, This one in particular.
 

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0