Help "island-ify" my perlin heightmaps. (pics) update

Started by
11 comments, last by Eelco 18 years, 1 month ago
Here's a very crude version of my perlin noise based random map generator: Map It looks surprisingly good considering how little time it took to get this, however it's not optimal for what it will be used for. My question is this: What do I do to this poor noise to make sure that I get islands or continents, and make -very- sure that the map edges are all water (-1.0f in this particular case). I tried simply scaling based on distance from center, but this, as expected, looked like total garbage. I would like something that generates more continental layout, in the above map everything is tied together as a single large landmass. I would like to break it up a bit more. I tried raising the level of the waterplane, but that forces me to loose most, or all of the little islands scattered around, and I'd like to keep them as much as possible. Has anyone made anything like this and would like to help me out? [Edited by - Bad Maniac on March 19, 2006 6:34:13 PM]
JRA GameDev Website//Bad Maniac
Advertisement
Since you said your using Perlin Noise (witch by nature is average weighting) have you tried setting the fringe areas to lower then normal values (ie: -0.3~-0.11) and then running your noise generation in additive mode? This should give a nice falloff all the way around the fringe and allow for islands and continents to be well formed.

Just an idea :)

- Jeremy
As was said above, rather than just getting the perlin value and using the -1->1 value as the texture/height value, pre-sample the surface first.

Work around the edges, starting at a low value (say -2), and slowing increase this value as you move inwards, then stop at 0. This should have the effect of creating a pre-sampled surface that dips around the edges (the severity of the dip could be changed by altering the increase value of the pre-sample value.

Then as you generate your Perlin noise, add the perlin value to the pre-sampled surface. As you do this, cap anny values around the edge that are <-1 to -1, and you shoudl have an edge of water.

I've never done this, so it might not work as easily as the above but it is a solution.

As for creating continents and islands. You might be able to modify the perlin cloud noise generator (http://freespace.virgin.net/hugo.elias/models/m_clouds.htm) to create something to your liking.

Hope that helps
Spree
Try using some really low frequency noise as a basis to get your larger landmasses (suitably biased around the edges if you don't want any land there as others have mentioned). You can then clamp your landmass noise to a reasonable range to get large blobs rather than a continous gradient everywhere before combining (probably by multiply or add) with your existing noise generation.
to summarize: play around with it.

you can choose yourself which frequencies you want, with which amplitude, and you dont need to add them all up linearly, but exponentiating (or whatever) certain terms can create really nice effects aswell.
Quote:Original post by jdarlinghave you tried setting the fringe areas to lower then normal values (ie: -0.3~-0.11) and then running your noise generation in additive mode?
The problem with this is that islands near the edges of the map will never have as high peaks as islands closer to the center. This isn't an ideal solution.

I'll give it a whirl and see what comes out. Thanks for your replies so far.

JRA GameDev Website//Bad Maniac
Perlin noise gives great results, doesn't it? But don't restrict yourself... :)

Your procedural world consists of any number of "fields" added together, with octaves of perlin noise being one option. Because I want to simplify this post, I'm going to be using a water level of 0.

So, we want the edge to always be below 0, so let us have a field which is 0 for a large centered square, and near the edge drops in a gradient to -4.

We want a general kind of island shape, so add an octave of very low frequency perlin noise with values between -2 and 2.

We want a good random edge and rocky look, so add a load more perlin noise octaves at much higher frequencies, with a total possible range between, say, -1 and 1 (this is, in fact, the image you already have, being used as a detail map).

Now, the maximum range you have is -3 to 3 for the islands, so in most of the map it goes from -3 to 3, and near the edges drops away to between -7 and -1. An island near the edge will probably end in a cliff, but there's not much you can do about that really - the restriction is fairly arbitrary ;)
After a couple of days of hacking and tweaking along the replies so far here's what I've got today:
Map2

I must especially thank Squirm who helped me get started in the right direction. This is what I currently do to generate this:
* Initialize a floating point array to 0.0, dropping off to -2 in a gradient along the edges.* Add a two octave, low frequency, low persistence noise.* Subtract a single octave low freq noise at a slightly higher persistence and scale(more zoomed out.* Smooth the map to help get rid of sharp edge dropoffs as much as possible.* Add a 5 octave, 0.6 persistence noise to give the details.* Normalize the noise to a -1.0 - 1.0 range.


Have to say I'm incredibly pleased with the results so far. Any ideas or improvements you guys can think of?
JRA GameDev Website//Bad Maniac
Quote:Original post by Bad Maniac
Have to say I'm incredibly pleased with the results so far. Any ideas or improvements you guys can think of?


Looks good. Perhaps you should consider switching to using fixed point numbers/integers, it would possibly be faster, if performance is an issue.
I might switch to somthing like 8.24 fixed point in the end of all this when I am happy with the final results. Not only for speed(fixed point is definately faster), but for consistency on different clients. Fixed points is exact on any PC or platform whereas floats might give slight inconsistencies.

But currently I'm just trying to tweak the generated maps to be suitable for a tile based game. So any feedback or ideas would be apreciated.
JRA GameDev Website//Bad Maniac

This topic is closed to new replies.

Advertisement