Volumes Of Fun

PolyVox in Torque3D
Page 1 of 1

Author:  BillVee [ Wed Dec 26, 2012 1:39 pm ]
Post subject:  PolyVox in Torque3D

I have been working on an untitled game that uses PolyVox and have integrated it with Torque3D.
PolyVox is used to replace Torque3D's terrain system.

Features so far.
    Terrain is streamed from disk.
    Terrain collision.
    Real time shadows and Terrain Textures.
    "Unlimited" sized terrain.
    Edit terrain in real time. Very basic right now.
    Probably some other features I am forgetting right now.

Here is a list of blogs I have done about the game.
Real Time Procedurally Generated Terrain
Procedural Terrain update
Procedural Terrain Optimizing
Procedural Terrain networked
Demo for the Voxel Terrain System
Update on Demo
Unlimited Voxel Terrain Demo Update
Unlimited Voxel Terrain Demo Network Update

Some more info can be found at DayOfWar.com.
Or you can follow me on Twitter.

Author:  David Williams [ Thu Dec 27, 2012 9:08 am ]
Post subject:  Re: PolyVox in Torque3D

This is very cool - actually I've been following your blog/twitter for a while now but I had failed to realise you were using PolyVox.

In one of your posts you say that PolyVox has been modified, so can you elaborate on the kind of changes you had to make? We might be interested in putting similar functionality into the main branch.

It's also great to see you've got networking implemented as this is something I've never worked with. So at least it seems PolyVox can be used in a networked environment. Are there changes which you think PolyVox would benefit from in this regard? We'll never make networking part of PolyVox (it's too low-level for that) but if there are changes which might facilitate building networked applications on top of PolyVox then we'd be interested to hear about them.

Author:  BillVee [ Thu Dec 27, 2012 3:10 pm ]
Post subject:  Re: PolyVox in Torque3D

Thanks David.

The changes made to PolyVox were not that big actually. If I recall the main thing I needed to change was the Vector Template. It conflicted with a Template in Torque3D with the same name. I refactored PolyVox's Vector into PVector.
I think the only other thing I needed to change was adding boost::bind to my class to get the LargeVolume's load and unload to work right.

As for networking I keep track of changes on a chunk/region level. When a chunk is processed it is assigned a 24 bit unsigned int and a 8 bit unsigned int . The 24 bits is used to track the number of changes since it was first processed and the 8 bits is used to tell the results of the last build process( empty chunk , solid chunk or contains geometry ). I know the 8 bits is a lot just for 3 states but I will likely be using it for other things down the line.
The server keeps a master list of this data and the client keeps a copy. It is assumed that all chunks are at change level 0 unless the server says otherwise.
When the client needs to process a given chunk/region it send a chunk request to the server indicating the chunk position and that chunks update count and the client puts the chunk into its list of chunks to process. When the server gets the request it compares the clients update count with its own and if they match no response is given, if they don't match the server sends its update count along with all the volume data for that chunk.
On the client side if no response is given by the time it needs to process the chunk it continues as if the data is correct. If it receives an update on a chunk in the process list it waits for the updated data to be added then processes it. If it receives an update on a chunk not in the list it updates the data then adds the chunk to the list to be processed.

As far as adding to PolyVox something to help networking , a method to track changes on a chunk/region level would be helpful.

Author:  David Williams [ Fri Dec 28, 2012 9:49 am ]
Post subject:  Re: PolyVox in Torque3D

Interesting stuff, thanks. We're currently integrating PolyVox with Gameplay3D (which doesn't provide networking), but we're planning to try integrating with Unity next. I think at this point we'll try and do some experiments with a networked environment. It's come up a couple of times on the forums so it would be good to have some experience here.

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group