Leaps and bounds! After yesterday’s breakthrough with the Voronoi polygon generation, I’ve made significant improvements. One of the things that I was getting stuck on was the proper distribution of landmass using a Perlin noise library. I ended up stumbling upon a clue hidden in the code of someone else who had been doing something similar, which incorporated the noise with the distance of the polygon to the center of the map, combined with a factor of the land vs water ratio. I couldn’t easily incorporate what I had found into my own script, but once I stumbled across it, it was like inception, it was only a matter of time. Take a look below at an example. These are 4000 random polygon sites on a 1024×768 canvas, looped twice through the Lloyds relaxation algorithm.
I’ve been able to identify land, water (ocean) and water (lake), and I also have elevation down. Many people suggest that I shouldn’t let elevation depend on Perlin, but let it depend on the distance to an ocean, but for now I’m going to go with the randomly generated noise and see where that takes me. If it doesn’t work out I can always come back to it. Hopefully tomorrow I’ll be able to use that elevation and generate a moisture variable for each polygon and combines those into different biomes.
Awesome map generator. Been trying to work out how to do that haha. Is there any chance we could get the source code for that?
Oh yeah, I’m absolutely thinking of releasing the sources for it. Unfortunately, due to time constraints, I haven’t worked on it for the last three weeks or so. I’ve got a few more features in it, but I haven’t finished them yet. I’ll see if I can put up another post about it, and I’ll try to include the sources in it.