I'm new to game development and I need some advice. I'm building a web based 2d random map generator and I wonder which algorithms there are to create such random terrains in a simple matrix as seen in the images below. It would be great if anyone could point me to some terms/algorithms as I have absolutely no clue what to search for.

Note: I'm not interested in depth/biomes - just the generation of those 2d shapes that grow from a starting point.

I tried implementing it in several ways - but all attempts seem rather childish and don't really produce the desired result. First I started with a small pattern like a plus (5 cells) and replicated it always on the edges of the already generated cells. Another way was to define cubes in different sizes and then start to generate big cubes in any direction, after that put medium cubes on some random edges, then again with smaller ones etc.

Any tips are very much appreciated!

enter image description here enter image description here enter image description here enter image description here

  • 1
    Fractals, cellular maps, perlin/simplex noise maps – Nadir Apr 8 at 23:58

If you are interested in generating maps that grow from a starting point, the formal names of the relevant topics are:

  • cellular automata (for instance, using the 4-5 rule to generate caves)
  • L-systems & other replacement grammars
  • artificial life (for systems that model simple organisms such as yeast, etc)

That being said, it is not apparent what particular family of algorithm was used to generate the image you posted. Personally, I think it looks less like something that was 'grown' & more like a Perlin/simplex noise island, but it's not possible to come to any strong conclusions from the single image.

  • I updated my post with some more images in case you can now tell which it might be. I will also have a look at those algorithms you mentioned. Thanks! – codepushr Apr 9 at 7:04

Your Answer

 
discard

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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