0
\$\begingroup\$

Is there a good reference or tutorials available for adding world generation into a 2D game? I've gotten to the point where I have most of the resources available to add world generation but I don't really understand the concepts of creating a random world generation based map. Any tips and guides can help.

\$\endgroup\$
1
1
\$\begingroup\$

Almost every game that features procedural generation uses Perlin Noise function. Perlin noise produce very natural looking noise and it is very customizable.

Implementing Perlin noise is also very easy but you need to customize it to your requirements which may take a little time and research. After you generated the noise matrix you can use any kind of conditional checks and processing on per-pixel basis to get what you want.

Here are some good tutorial and references that will help you:

http:// anthonypigeot.com/experiments-perlin-noise-2d-and-3d-worlds/

http:// devmag.org.za/2009/04/25/perlin-noise/

http://www.java-gaming.org/index.php?topic=31637.0

\$\endgroup\$
4
  • \$\begingroup\$ This looks great! But would Perlin Nose help for the pre-generated sprites that I already have in the game? \$\endgroup\$
    – BlueJet
    Dec 28 '15 at 23:21
  • \$\begingroup\$ @BlueJet To place entities on the 2D map you can use multiple layers of noise. For example you can generate different types of biomes by generating two noise matrix one represents the temperature and other represents the humidity then merge them together to generate a new matrix which defines the biome at that place. Where the intensity of both temperature and humidity is high becomes forest and where temperature is high but humidity is low becomes desert. Contd.. [2] \$\endgroup\$
    – rajiv
    Dec 29 '15 at 5:31
  • \$\begingroup\$ @BlueJet After that generate another noise map with high variance to signify the position of trees, create multiple such noise maps for different entities and place them, you can apply some filtering using the method mentioned here: reddit.com/r/gamedev/comments/1g4eae/… \$\endgroup\$
    – rajiv
    Dec 29 '15 at 5:32
  • \$\begingroup\$ I understand now, thanks for helping out :) Now I can begin working on the world generation using Perlin Noise, and it seems much more simpler than just making random tiles appear on the map. Thanks! \$\endgroup\$
    – BlueJet
    Dec 30 '15 at 16:34

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