It is currently Sat Aug 22, 2020 4:13 am


All times are UTC




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: Terrain volume generation articles
PostPosted: Sun Nov 28, 2010 11:20 am 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
I found these a couple of weeks ago and thought they would be worth sharing. JTippetts has written some journal entries on GameDev discussing his experiments with procedurally generating fully 3D terrain volumes, with the associated images being rendered with PolyVox and Blender. There's details of the various functions you can use and the way in which they can be layered to create some very interesting shapes (with underground cave systems for example). I'll take the liberty of linking to one of his images:

Image

They are pretty small volumes, but being procedural the ideas apply easily to volumes of any size. You can read the two articles so far:

http://www.gamedev.net/blog/33/entry-2225133-minecraft/
http://www.gamedev.net/blog/33/entry-2227887-more-on-minecraft-type-world-gen/
http://www.gamedev.net/blog/33/entry-2249106-more-procedural-voxel-world-generation/

Very cool stuff!


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Terrain volume generation articles
PostPosted: Sun Nov 28, 2010 2:09 pm 

Joined: Sun Oct 03, 2010 10:13 pm
Posts: 73
David Williams wrote:
Very cool stuff!

That's absolutely right! Thanks for the information. I think this will be useful when I'll change my landscape.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Terrain volume generation articles
PostPosted: Wed Dec 08, 2010 4:17 pm 

Joined: Wed Dec 08, 2010 5:54 am
Posts: 27
I've used random walk to create my caverns. Tight corridors, small to big rooms (I scale by height the size of the walking "ants"), long and winding caves... And it's fast too =)

Image

The only problem I've found is that my ants don't move from chunk to chunk yet...


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Terrain volume generation articles
PostPosted: Tue Apr 19, 2011 6:26 pm 

Joined: Sun Oct 03, 2010 10:13 pm
Posts: 73
Currently I'm trying to use the article's information in my game. But as the author was not talking about libNoise but his own library (which I'm not sure is available anywhere) I have some difficulties realizing the noise "pipelines" in Noise++ (which I'm using and which works similar to libNoise). Let's take this one for example:
Code:
{name="GroundGradient", type="gradient", y1=0, y2=1},
{name="GroundShape", type="fractal", fractal_type="FBM", basis_type="GRADIENT",
 interp_type="QUINTIC", num_octaves=2, frequency=1.75},
{name="GroundTurb", type="turbulence", main_source="GroundGradient",
 y_axis_source="GroundShape", y_power=0.30},
{name="GroundBase", type="select", main_source="GroundTurb",
 low_source="ConstantNeg1", high_source="Constant1", threshold=0.2, falloff=0},

Does anyone know how this "translates" to libNoise/Noise++ ?
I'm using Perlin noise for "GroundShape" and Turbulence for "GroundTurb". I'm not seeing anything like what "GroundGradient" is, however. Any ideas on that?


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Terrain volume generation articles
PostPosted: Wed Apr 20, 2011 5:44 pm 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
Wish I could help here but I don't hve any experience with this library. Is there a forum for libNoise or Noise++? Maybe you can get more helpful info there.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Terrain volume generation articles
PostPosted: Wed Apr 20, 2011 7:07 pm 

Joined: Sun Oct 03, 2010 10:13 pm
Posts: 73
From what I know both do not have any forum. Well, libNoise does have a SourceForge forum, however there's barely any activity.
I'll try to contact the article's author about this as he is obviously creating his library similar to libNoise. Thanks anyway!


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Terrain volume generation articles
PostPosted: Thu Apr 21, 2011 5:00 am 

Joined: Sat Sep 18, 2010 9:45 pm
Posts: 189
I tried to follow his tutorial along using noisepp. I didn't get it to work either, although I only spent half a day on it. This was awhile back, I remember trying to decipher his xml file and map the concepts into noisepp, things like looking at what are the domain and range of his function and doing the same thing in noisepp.

I will probably try again in the next couple of days.

Edit: Actually, I may have had something working in the end. I don't really remember.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Terrain volume generation articles
PostPosted: Thu Apr 21, 2011 6:33 am 

Joined: Wed Nov 10, 2010 11:50 pm
Posts: 1
Hi there, I'm the author of the terrain generation articles being discussed. AndiNo recently contacted me for clarification of some things, so I thought I would respond here as well.

For the most part, most of what I used in the articles has a 1 to 1 mapping with the functions provided by libnoise, with the chief exception being the gradient function, so I will paste the explanation of the gradient function that I gave to AndiNo.

Here is the basic structure of the gradient function:


Code:
    double dx=x-m_gx1;
    double dy=y-m_gy1;
    double dz=z-m_gz1;
    double dp=dx*m_dx+dy*m_dy+dz*m_dz;
    dp=clamp(dp/m_vlen,0.0,1.0);
    return lerp(dp,1.0,-1.0);


The function maintains 2 control points which are set when the function is initialized. The second point (m_gx2, m_gy2, m_gz2) is subtracted from the first point (m_gx1, m_gy1, m_gz1) to obtain the length of the segment, m_vlen, as well as the vector components (m_dx, m_dy, m_dz) which represent the vector of the line-segment (not normalized, since the normalization operation occurs when dp is divided by m_vlen). Basically, every time you call get(x,y,z) on the function, the input point is projected onto that line segment using a dot-product operation with (m_dx,m_dy,m_dz), and the result is normalized and clamped to the range [0,1] then used to interpolate from -1 to 1 for the output. This creates a gradient field, aligned along the axis defined by the segment, where values that lie beyond one end fall in the -1 range, values that lie beyond the other end fall in the 1 range, and values inbetween fall in a smooth gradient from -1 to 1.

When this gradient is modified by a threshold, or step, function you get the result that somewhere within that gradient range, the function value changes abruptly from -1 to 1, rather than the smooth gradient. Since I align the gradient along the Y axis, this has the effect of creating a ground plane at the value of Y corresponding to the value of output that I set the threshold of the step function to. When this ground plane is deformed by turbulence, that is where the hills and valleys occur, as turbulence applied along the Y-axis of the gradient function "pushes" and "pulls" values above or below that threshold.

Additionally, you can implement a domain transformation function (I believe libnoise implements that as ScalePoint) with a scale for the Y-axis of 0. This has the effect of making the Y-axis turbulence act more like a traditional heightmap, pushing entire columns of cells/voxels up or down the gradient, rather than each voxel separately. I have found this useful as a starting point to implement more traditional and less "frothy" features.


Other than that, I believe that most of the other modules are similar to libnoise, just with a different interface. Select maps to libnoise::Select, and so forth.

If anyone has additional questions, I can be reached over at the gamedev.net forums.

Thanks,
Josh Tippetts


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Terrain volume generation articles
PostPosted: Fri May 06, 2011 8:05 pm 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
I've just noticed that JTippetts' articles have been publised in the April 2011 edition of Game Developer Magazine, under the title of 'Creator Of Worlds'. I'm not sure if they add anything over what was written on his blog, but they might be interesting for some people.


Top
Offline Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Theme created StylerBB.net