Terrain Generator

Published July 26, 2006
Advertisement
terrain.png
Download the thing if you want. An approximation on how long it takes to generate a map might be useful if you feel like sharing.

It's the roots of a simple random map generator. It works decently. Not great, but.. decent. Hit space (or most other keys) to generate a map. Escape is exit. Now if I could just make this kind of progress every day, I might actually be closer to getting this damned thing done.

Enjoy.
Previous Entry Place Bad Pun Here
Next Entry Learning Experience
0 likes 3 comments

Comments

Texas Brigade
It took my pretty low-end computer a second or two each map. They look pretty good and fairly realistic. I did notice perfect hexagonal islands appearing every five or so maps, which was interesting. Roughly how does it work? I worked on generating random maps for my now frozen TBS project, and it would be interesting to hear your overall method.
July 28, 2006 08:44 AM
VPellen
It's a bit weird, but I'll try to explain it best I can.

The basic gist of it is the generator spitting out random patches of "earth" on a map of water. The patches are mutilations of hexagons, which is a result of using my heuristic to determine the basic shape and size of the land patches. That'd explain the hexagonal islands you described. Alterable variables include random size generators, and how much the generator is to favor trying to place earth on existing earth instead of water. I could send you the code if you want, but it's vague and uncommented.

I'll actually probably be ditching the code eventually. It's horribly inefficient, and a little too limited for my liking. But it got my brain flowing, so.
July 29, 2006 09:08 AM
Ravuya
Pretty cool; I should write a land generator too and we can have a hoedown.
August 02, 2006 08:34 AM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement
Advertisement