Monday 4 April 2011

Islands

I am really interested in generative landscapes (and creatures, but creatures are much harder) so I have been messing about with using a controlled random walk to build me islands. I plan to compose these nicely as a scene for Project 2, plus some other factor that is more surprising and unexpected (yet to be decided).

It makes maps! The circle is to test the radius which I think I am restraining it too. It is fairly elastic though, so this isn't really a big help.

Letting it off the leash. Also with a small step size. Looks smokey!

Shows the distribution well. Random walk has an advantage over random points, for landmasses, because everything is by default connected. Using some alpha to show how often it retraces it's steps shows up well how much foot traffic ends up in the centre.

3D! Heightmaps! I had to store all the visited points in a dictionary to do it, so I could index them by their location, and then store the 'frequency of visits' next to each point so I could measure how 'dark' each square is. The random walk might be 5000 steps, but the dictionary only has a few hundred entries, since it goes over old terrain often. I can use this 'darkness' information to determine the height of each location.


Colours! Mapping the frequency to saturation is nice too.


Adding in some directional lighting and letting the walk breathe a bit, I get some nice harbour cities.


Changing a few things and scaling up, we get some very nice landscape happening. Perhaps a few too many holes to be realistic, but still interesting.


Hue! This is about the point where I add all kinds of fun mouse and keyboard controls! There are tons in this one, perhaps I should post the code just so people can play with it.



Reducing the size of the elements (without reducing the space between them) creates some nice effects. 




No comments:

Post a Comment