Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

Managed to get something like this using a simplexnoise port i made from the original javacode to php:

enter image description here

Used some tips from other post:

Understanding Perlin Noise

basically, lowered the frequency to get more flat terrain.

Now, how could i foce the map to be a huge Pangea? If i manualy set for example, if (x < 5) set height = 0 (water), when i normalize all the map to 0...1 the value 0 get higher (as my simplexnoise function returns -1 1). If i force it to -9999, does not work either.

Has to me something elegant to sneak into the height generation code to make the borderline squares, water.

With MDP algorithm i could seed the sides of the map to -500 for example and then pretty coast would be made, but with simplex/perlin does not seem the case as i can not enter pre-seeded cells with artificial heights.

Any tips?

share|improve this question

1 Answer 1

Maybe I'm not seeing the whole picture, but can't you just the apply the border (by setting those values to 0 / water) after normalizing?

And I suppose you're normalizing correctly e.g: [0,1] = ([-1,1] + 1) * 0.5

Some aditional ideas... last time I generated something like this, I used probabilities and a random number generator.

I simply choose the center of my island, and a maximum radius. Then for each pixel, there was a probability of it being land or water based on its distance from the center and the maximum radius. At the end I also applied a few post processing passes, to detect oceans and remove inner lakes, etc.

Maybe you could keep your current simplex noise approach, but afterwards do a similar post-process on your map in order to make it more "continent-like".

This could consist of going through every pixel, and depending on a random probability convert some of them back to water (by setting the value to 0) e.g. 100% chance of water at the border and decrease to 0% about 20 pixels in). This way it would still look kinda organic.

You could then apply a second pass to remove small islands or something, if you wanted.

Just for reference, using probabilities generates shapes such as this (of course this is in a much lower resolution that yours because it's tile based, not pixel based):

enter image description here

Edit

Even if you don't want to use probabilities (which are just there to give a little extra bit of variation) you'll still need to work with a radius and combine it with your perlin noise in order to get something that looks like an island.

The very least you need to do is take your perlin noise, and apply a radial filter to it so that pixels closer to the border become water. Using a radius will be better for sure than your idea of doing for instance "x < 5 becomes water".

And another thing you could do is ignore the height values in your perlin noise for now. Set a thresold and let the result decide only where there's land and where there's water, nothing else.

You can add mountains as a second pass (e.g by measuring the distance from the coast on each pixel). Then add some lakes, rivers, different biomes in separate passes. Your perlin noise doesn't need to provide all the information at once.

I just found an old link I used before when I worked with this:

http://www-cs-students.stanford.edu/~amitp/game-programming/polygon-map-generation/

I'm sure you'll enjoy it.

share|improve this answer
    
I dont think i will get good results with your binary and probabilistic method, as the mountails will go to the edge of the island which is unrealistic. But stupidly never tried to filter the values after the normalization, i'll give it a try! haha. This happens when you program late in the night after long work hours >_< –  Gabriel A. Zorrilla Dec 16 '11 at 18:31
    
Well that depends on how you apply it. If you don't want cliffs near the water, then just change the method so that mountains become plains, and plains become water. I.e. instead of setting it to zero straight away, subtract a certain height, and if it falls below a certain thresold, then it becomes water. –  David Gouveia Dec 16 '11 at 18:35
    
And just a bit of trivia, it's not that unrealistic to have mountains reach the edge of an island. I'm an islander myself and we have plenty of those here. :-) –  David Gouveia Dec 16 '11 at 18:38
    
Check my edit, and I also added a nice article on this subject. –  David Gouveia Dec 16 '11 at 18:59
1  
Amit P.'s article is great, I'm currently porting it to Unity3D; there's also a C#/.NET version based on Amit's code from Baran Kahyaoglu at barankahyaoglu.com/blog/post/2011/07/27/… –  chrish Dec 16 '11 at 19:21

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.