Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


2D Random Terrain Generation


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
9 replies to this topic

#1 shadowgamesco   Members   -  Reputation: 326

Like
0Likes
Like

Posted 05 June 2012 - 09:24 PM

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.

Sponsor:

#2 Dawoodoz   Members   -  Reputation: 331

Like
0Likes
Like

Posted 06 June 2012 - 05:02 AM

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.

My open source DirectX 10/11 graphics engine. https://sites.google.com/site/dawoodoz

"My design pattern is the simplest to understand. Everyone else is just too stupid to understand it."


#3 TeaTreeTim   Members   -  Reputation: 181

Like
0Likes
Like

Posted 06 June 2012 - 08:14 AM

These pages are for 3D but might give you inspiration http://malleegum.com/timspages/TerrainPages.html

#4 kseh   Crossbones+   -  Reputation: 2159

Like
0Likes
Like

Posted 06 June 2012 - 12:16 PM

JTippetts has his Accidental Noise Library available on his website and outlines some various steps that he used to generate random 2D terrain.

#5 DemonRad   Members   -  Reputation: 290

Like
1Likes
Like

Posted 06 June 2012 - 12:31 PM

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!

Peace and love, now I understand really what it means! Guardian Angels exist! Thanks!


#6 FLeBlanc   Crossbones+   -  Reputation: 3109

Like
0Likes
Like

Posted 06 June 2012 - 12:31 PM

JTippetts has his Accidental Noise Library available on his website and outlines some various steps that he used to generate random 2D terrain.


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*

#7 shadowgamesco   Members   -  Reputation: 326

Like
0Likes
Like

Posted 08 June 2012 - 01:20 AM

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!

Perlin Noise Terrain Generation

Edited by breinygames, 08 June 2012 - 01:20 AM.


#8 Shenaynay   Members   -  Reputation: 134

Like
1Likes
Like

Posted 08 June 2012 - 09:14 AM

I'd be quite interested in that more in depth article you spoke of

#9 larspensjo   Members   -  Reputation: 1557

Like
0Likes
Like

Posted 08 June 2012 - 04:04 PM

If you need algorithms for perlin and simplex noise, see the glm library: http://glm.g-truc.net/api/a00148.html
Current project: Ephenation.
Sharing OpenGL experiences: http://ephenationopengl.blogspot.com/

#10 shadowgamesco   Members   -  Reputation: 326

Like
0Likes
Like

Posted 27 July 2012 - 08:42 PM

I ended up using a Perlin Noise algorithm. For anyone interested I have some source code I uploaded on Google Code here, and for a little more information on what I did read my blog post about it here. Thanks for all of your help!




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS