Elaborate?

Published August 29, 2007
Advertisement

Directed Randomness


Okay, so as I mentioned previously, I'm using the diamond-square algorithm (similar to "midpoint displacement") to generate the terrain heightfield. Instead of starting with a single square and subdividing as needed, I start with a "seed" field of whatever dimensions I desire. I then perform diamond-square as many times as needed to get the desired level of detail. Currently I just have the seed field being randomly-generated, but what I plan to do is allow the user of my editor to set those heights so they can have control over the rough layout of the map. If further control is needed, they can edit some of the values further down the iteration chain. Here's a pic of one three-iteration run (the seed values are iterated three times):

Here I started with 20 x 20 cells (21 x 21 height values) and finished with 160 x 160. Note that the map does not need to be square in shape. The amplitude and falloff of amplitude of the random values can be set by the user. I can imagine that I'll be doing lots of tweaking these values to get the desired result.

Next on the list is to generate and display the heightfield in 3D. Shouldn't be too difficult. SlimDX has been quite nice to use so far, btw. [smile]
Previous Entry Been snowin'
Next Entry In the rough
0 likes 2 comments

Comments

Jason Z
Looks pretty interesting. Have you considered adding different techniques to your tool - i.e. perlin, fBm and so on?

It would be cool to see a screen shot of the interface as well if you want to throw one up there. I'm always interested in seeing how others approach the whole 'useability' issue.

Keep up the good work!
August 30, 2007 05:24 AM
LachlanL
Hey Jason. Yeah, I originally considered using libnoise for my terrain generation, but it's a cpp library and I wanted more control over the layout of my maps. I could add more techniques, but I'd probably only bother doing that if diamond-square doesn't give me the results I'm after. This is meant to be a level-editor for a game after all, not a general heightmap editor.

As for the UI, one does not exist yet. The image is just a collage of bitmaps that I output from my program for debugging purposes. Just to check that the algorithm is working correctly. However, the editor functionality is next of my list of "things to do".
August 30, 2007 05:38 PM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement

Latest Entries

Advertisement