Sign in to follow this  
cbreiny

2D Random Terrain Generation

Recommended Posts

cbreiny    327
I am working on a World Generator for a 2D, Tile Based RPG. I need some help finding an algorithm to help me generate these random worlds, region by region, making forrests, rivers, mountains, and small open areas where I could later put towns or villages. I've looked a little into Perlin Noise Generation, would that be the best way to do it? I'm not sure what you guys think but any help / tips would be great.

Share this post


Link to post
Share on other sites
Dawoodoz    461
If you want to make a square island to keep the player inside, you can paint millions of additive soft sprites at random positions and skip every sprite that touch the end of the map. Edge detection by comparing the height with 8 neighbours can be used to create erosion. This can easily be implemented using pixel shaders to make it fast.

Share this post


Link to post
Share on other sites
TeaTreeTim    467
These pages are for 3D but might give you inspiration [url="http://malleegum.com/timspages/TerrainPages.html"]http://malleegum.com/timspages/TerrainPages.html[/url]

Share this post


Link to post
Share on other sites
kseh    3838
JTippetts has his Accidental Noise Library available on his [url="http://accidentalnoise.sourceforge.net/index.html"]website[/url] and outlines some various steps that he used to generate random 2D terrain.

Share this post


Link to post
Share on other sites
Dario Oliveri    290
You can invent you algorithm easily.
Perlin noise can create initial areas -> for example forest/mountains/sea/villages.

Then you can start planting seeds for grass/trees. simulate wind for seed displacement (with care for obstacles like mountains/rivers etc.)

Pelin noise is good for lot of things, after first mountains are placed you can use erosiond and sedimentation for making canyons etc (don't know how will look with square tiles, for example removing a piece of mountain making it grassy and the put some rocks below).

For roads you can still use border of regions/areas. But a random spline is fine too!

Share this post


Link to post
Share on other sites
FLeBlanc    3141
[quote name='kseh' timestamp='1339006600' post='4946826']
JTippetts has his Accidental Noise Library available on his [url="http://accidentalnoise.sourceforge.net/index.html"]website[/url] and outlines some various steps that he used to generate random 2D terrain.
[/quote]

I found these journal entries of his pretty useful:

http://www.gamedev.net/blog/33/entry-2249260-procedural-islands-redux/
http://www.gamedev.net/blog/33/entry-2249282-hooking-into-the-tree-to-build-a-map/
http://www.gamedev.net/blog/33/entry-1895315-rivers/

He hasn't really updated his accidental site in awhile, though. I keep hoping he will some day. *wink wink, nudge nudge*

Share this post


Link to post
Share on other sites
cbreiny    327
Thanks for all the help guys, I acutally implemented my own Perline Noise generator into a world generator. It works really well and fast too! I even went as far as to have it generate random islands too, so I can ensure that there isn't a walkable tile at the edge of the map, so the player can't "walk off" the map. Here is my post about it for more details and some pictures of the results!

[url="http://breinygames.blogspot.com/2012/06/generating-terrain-using-perlin-noise.html"]Perlin Noise Terrain Generation[/url] Edited by breinygames

Share this post


Link to post
Share on other sites
larspensjo    1561
If you need algorithms for perlin and simplex noise, see the [url="http://glm.g-truc.net/"]glm [/url]library: [url="http://glm.g-truc.net/api/a00148.html"]http://glm.g-truc.net/api/a00148.html[/url]

Share this post


Link to post
Share on other sites
cbreiny    327
I ended up using a Perlin Noise algorithm. For anyone interested I have some source code I uploaded on Google Code [url="http://code.google.com/p/perlin-noise-island-generator/"]here[/url], and for a little more information on what I did read my blog post about it [url="http://breinygames.blogspot.com/2012/06/generating-terrain-using-perlin-noise.html"]here[/url]. Thanks for all of your help!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this