Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

 
Advanced search

880050 Posts in 33019 Topics- by 24385 Members - Latest Member: jhewitt

May 25, 2013, 04:28:08 PM
TIGSource ForumsDeveloperTechnical (Moderators: Glaiel-Gamer, ThemsAllTook)Where to start with procedurally generated terrain?
Pages: [1]
Print
Author Topic: Where to start with procedurally generated terrain?  (Read 1161 times)
zratchet
Level 0
***

zratchet2
View Profile WWW Email
« on: October 09, 2011, 09:46:00 AM »

Are there any recommended resources past the top 10 results on Google for tutorials or example algorithms for terrain similar to that in Terraria or King Arthur's Gold?
Logged

Cofounder/Creative/Production Lead - Zeolite Studios

http://facebook.com/ZeoliteStudiosInc
Jasmine
Level 6
*


Location: England


View Profile
« Reply #1 on: October 09, 2011, 10:14:21 AM »

Isn't it just a matter of creating a curve to define the boundary between land and sky?
Logged

I ain't pushing no moon buttons.
zratchet
Level 0
***

zratchet2
View Profile WWW Email
« Reply #2 on: October 09, 2011, 10:34:57 AM »

hrm, I'm wondering about all the resource generation too.
Logged

Cofounder/Creative/Production Lead - Zeolite Studios

http://facebook.com/ZeoliteStudiosInc
st33d
Guest
« Reply #3 on: October 09, 2011, 11:29:53 AM »

You would want some cave generation below the horizon. Once you have some good caves going you'll probably get an idea of where resources would be best buried.

Plenty of cave algos in this thread: http://forums.tigsource.com/index.php?topic=5174.msg166909#msg166909
Logged
Momeka_
Level 0
***



View Profile WWW Email
« Reply #4 on: October 10, 2011, 01:57:58 AM »

Roguebasin ( http://roguebasin.roguelikedevelopment.org ) have some articles about generating terrain. The Procedural Content Generation Wiki ( http://pcg.wikidot.com ) have plenty of articles and links so check them out too.

Also check the procedural generation thread on this forum that st33d linked. Plenty o' good stuff there.
Logged

Ashking
Level 10
*****


king of kings


View Profile
« Reply #5 on: October 10, 2011, 02:10:07 AM »

Keep in mind that there's not just one algorithm to do it all: most landscapes in games like Terraria are made using a variety of algorithms all meshed together. Or, rather, I assume so!
Logged
MattG
Level 5
*****

Pictures Of Trains


View Profile Email
« Reply #6 on: October 10, 2011, 07:25:02 AM »

start with a flat surface then add rnd function to each cooridinate Y with a value limiter that creates flatter or more deformed 
Logged
Richard Kain
Level 10
*****



View Profile WWW Email
« Reply #7 on: October 10, 2011, 08:35:47 AM »

A major part of procedurally generated terrain is the limitations of the mechanics in your game. You have to make sure that your terrain generation algorithm doesn't create terrain that your player is incapable of traversing. If there is a limit to how high your player can jump, you have to take that into account.

A method for getting around this is to eventually give the player the ability to get anywhere. (whether this is by a flying power-up, or a drilling power-up, or whatever) But not all games would work with such mechanics. Consider how your player is going to traverse the terrain before starting in on your procedural generation. It might be advisable to play around with a few non-procedurally generated levels just to see what the limitations of your system are.
Logged
Greg
Level 0
***


has a compass, lost my map


View Profile
« Reply #8 on: October 10, 2011, 11:28:45 AM »

A couple weeks ago, I generated a heightmap (random number for each point on a grid) and then rendered tessellated triangles from it, just to see if I could do it. (took an afternoon). 


Logged

A day for firm decisions!!! Or is it?
Jasmine
Level 6
*


Location: England


View Profile
« Reply #9 on: October 10, 2011, 11:38:14 AM »

hrm, I'm wondering about all the resource generation too.

Choose a random point on the map. Calculate depth below surface. Check there are no other resources in the immediate vicinity. Select resources suitable for that depth. Put resources at that location.
Logged

I ain't pushing no moon buttons.
Nix
Level 10
*****



View Profile
« Reply #10 on: October 11, 2011, 07:44:35 AM »

perlin noise
Logged
Ferago
Level 0
**


View Profile
« Reply #11 on: October 11, 2011, 08:28:23 PM »

A couple weeks ago, I generated a heightmap (random number for each point on a grid) and then rendered tessellated triangles from it, just to see if I could do it. (took an afternoon).  

You should try the Diamond-Square algorithm. It's pretty simple and gives a smoother terrain with peaks and valleys instead of just a flat, bumpy surface.

Edit:
http://gameprogrammer.com/fractal.html This site discusses midpoint displacement (probably what you're looking for, OP) as well as Diamond-Square for heightmaps.
Logged
Nix
Level 10
*****



View Profile
« Reply #12 on: October 11, 2011, 08:31:29 PM »

perlin noise
Logged
Greg
Level 0
***


has a compass, lost my map


View Profile
« Reply #13 on: October 17, 2011, 08:09:32 AM »

A couple weeks ago, I generated a heightmap (random number for each point on a grid) and then rendered tessellated triangles from it, just to see if I could do it. (took an afternoon).  

You should try the Diamond-Square algorithm. It's pretty simple and gives a smoother terrain with peaks and valleys instead of just a flat, bumpy surface.

Edit:
http://gameprogrammer.com/fractal.html This site discusses midpoint displacement (probably what you're looking for, OP) as well as Diamond-Square for heightmaps.

Beautiful link.  That's definitely of interest to me.  Thank you.
Logged

A day for firm decisions!!! Or is it?
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic