Volumes Of Fun
http://www.volumesoffun.com/phpBB3/

Infinite World Terrain Generation
http://www.volumesoffun.com/phpBB3/viewtopic.php?f=14&t=539
Page 1 of 1

Author:  kklouzal [ Thu Sep 19, 2013 2:11 am ]
Post subject:  Infinite World Terrain Generation

So I'm trying to wrap my head around how exactly I could go about making an infinite like type world that is generated on the fly using PolyVox, quite the undertaking but I have no doubts I can achieve such a feat.

I have a few questions and would love the communities input on the matter :)

First I'll lay out my thought process on the topic.

I have a volume say 1024x1024x256
Each mesh extracted is in 16x16x16 chunks
The surrounding 27 chunks are displayed, moving from 1 chunk to another would unload the ones behind you and load the ones in front of you. (the player does not see this as it is out of their view)

This is currently working but now I need to expand past the 1024x1024x256 region.

Route 1, I was thinking every time the player moved from 1 chunk to another it would essentially shift the voxels and everything would stay within the 1024x1024x256 region. However this sounds like a lot of looping and unnecessary processing.

Route 2, I was thinking of would be to have a smaller region, say, 512x512x256, we'll call this a sector to keep things simple, and have the sector the player is in plus the surrounding 26 sectors in memory at any given time, loading/unloading them as they are needed when the player moves from 1 sector to another like the chunk system. This seems more feasible but I've read in a few places you should only ever use 1 volume. I hope I'm wrong or there is an easier way to go about this.

I hope I explained my though process well enough, how do you think I should approach this? :)

Author:  David Williams [ Fri Sep 20, 2013 9:08 am ]
Post subject:  Re: Infinite World Terrain Generation

First up I should say I've never attempted truly unlimited terrain, so there may be some things I haven't anticipated. Secondly, I'm going to assume your terrain doesn't need to be truly infinite but just very large (e.g. a volume side length of billions of voxels).

The expectation is that you would use the LargeVolume for this, as you can create a LargeVolume with a side length of billions (again, I've never tried it!). The LargeVolume only keeps the most recently used blocks in memory, so in theory it doesn't matter how big it is.

Be sure to check the FAQ to understand why multiple smaller volumes would probably be a bad idea: http://www.volumesoffun.com/polyvox/doc ... l/FAQ.html

In a nutshell, route two is the expected approach (though route one is also interesting...) but LargeVolume will handle the loading/unloading for you. This only applies to the volume data, you need to handle loading/unloading of meshes yourself.

Also the LargeVolume has seen a lot of work recently and the documentation isn't quite up to date. Sorry anout that ;-)

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/