Friday 11 May 2012

Fractal terrain generation

Back in March 2012, I received an assignment from my game design class. The assignment told me to design a game world map for any type of game. People who know me in real life would know that I'm not very artistic. So I took a lazy approach to this assignment; I generated it.

World generation is something that has always interested me; I blame Minecraft. I have spent countless nights reading about different ways of generating terrain. This assignment was the first time I ever used this knowledge. I decided to use the diamond-square algorithm (this is explained very well here), for the generation of the map. In short, the algorithm takes a flat map and moves the middle points up or down by a random amount.

It needs to said that the algorithm generates a height map. This height map was used to make an image. For my assignment, I used negative numbers as water and positive number for land. Here was one of the test results for the algorithm:
Of course the final generation was edited in photoshop; removing unnecessary green points and other minor changes.

No comments:

Post a Comment