Wednesday, February 19, 2014

Zity - The Island



Procedural Content Generation. The words alone send shudders down my spine. I have spent the past 5ish days working on getting an island generated. Not a full blown, tile based, streets-and-all island; but simply an image of the island that I'll use to create the previously said features. I wanted a land mass that was surrounded entirely by water and had an interesting coastline and possibly smaller islands nearby. Sounds easy. It's not.

I've trawled through dozens on dozens of sites and forums and blogs looking at different methods from complex polygon ones, to cellular automata, to perlin noise and gradients, and finally to perlin noise and particle gradients. There's a lot of information in a lot of different programming languages using a lot of different methods. Needless to say, my brain melted a little. I flip-flopped from gradient, to particle gradient, to polygon (hahahaha, no, I'm no genius), to automata, and finally settled back on particle. I'm happy with the results.


(The right picture is of the images that combine to form the picture on the left, each island has these)

Basically what this means is that I'll be able to control how the world will look like and can generate new worlds on the fly with only a few parameters. Another huge bonus to this method is that the amount of data the map needs to save is minimal since we can regenerate the map procedurally from it's parameters every time instead of saving the data to the disk.

I had wrote a draft of a blog post yesterday outlining how I was becoming frustrated with PCG (Procedural Content Generation) and basically had given up and moved on to the inventory, but after taking another crack at it today (I'm glad I did) I've finally made some progress.

Next up - Lakes/Rivers (or a break to work on the inventory)

No comments:

Post a Comment