A window, not a world.

Well, to generate the terrain for my android game I did a bit more research.

Fractal terrain looks nice, but you have to generate it somehow. One way of doing this is to generate a noise map and tile a smaller version of it onto itself. But if I want my terrain to scroll up and down infinitely and loop itself (and I do! Otherwise the work I did on the tile manager would be a bit useless!), so you can scroll the map up or down, to the left or right, and end up where you started, AND look natural (without any breaks/seams), you need to have a seamlessly tiling noisemap!

Turns out, there is a technique which allows this: 4D simplex noise. Simplex noise is a rethink of the famous Perlin noise, created by Mr Perlin himself to fix the problems and limitations  Perlin found in his own Perlin noise. To make this Simplex noise tillable in the x and y directions, you use an incredibly clever technique where you take your noise from a looping circle over these four dimensions.

There’s a paper by Perlin himself and an even better explanatory paper by a mr Gustavson which helped me a lot. But the most helpful so far has been a guy/girl who goes by the handle of JTippetts, whose many posts on the internet have been a revelation.

To be really honest, I kind of understand what’s going on and how it is done. But not yet enough to explain it 🙂 As Albert Einstein said, you only really understand something when you can explain it to your grandmother 🙂

And, just to prove I only partially understand the technique, here’s the proof. I can use the technique to generate terrain … I just can’t get it to tile yet!


This entry was posted in android, programming and tagged , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s