|
zratchet
|
 |
« 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
|
|
|
|
Jasmine
Level 6
Location: England
|
 |
« 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
|
 |
« Reply #2 on: October 09, 2011, 10:34:57 AM » |
|
hrm, I'm wondering about all the resource generation too.
|
|
|
|
|
Logged
|
|
|
|
|
|
|
Momeka_
|
 |
« 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
|
 |
« 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
|
 |
« 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
|
 |
« 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
|
 |
« 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
|
 |
« 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
|
 |
« Reply #10 on: October 11, 2011, 07:44:35 AM » |
|
perlin noise
|
|
|
|
|
Logged
|
|
|
|
|
Ferago
|
 |
« 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
|
 |
« Reply #12 on: October 11, 2011, 08:31:29 PM » |
|
perlin noise
|
|
|
|
|
Logged
|
|
|
|
|
Greg
|
 |
« 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?
|
|
|
|