Fully Destructible Levels - New website and domain!

A place to show off your latest screenshots and for people to comment on them. Only start a new thread here if you have some nice images to show off!
Post Reply
User avatar
PolyVox
OGRE Contributor
OGRE Contributor
Posts: 1316
Joined: Tue Nov 21, 2006 11:28 am
Location: Groningen, The Netherlands
x 18
Contact:

Re: Fully Destructible Levels - Now in Game Engine Gems 1

Post by PolyVox »

Great, you'll probably frin the interface is rather lacking/fiddly in the last release. But as I write this I'm also working on scripting support (via QtScript) which is going well. The idea is that when you run Thermite you'll just get a black window, and then you can write QtScript code to create volumes, modify voxels, etc. You can also create/edit Ogre entities and lights. A release demonstrating this is probably just a few weeks away...
LBDude
Gnome
Posts: 389
Joined: Mon Jul 26, 2010 10:53 pm
x 22

Re: Fully Destructible Levels - Now in Game Engine Gems 1

Post by LBDude »

So how do you do pathfinding using this thing?

Do you provide a method to compute distance fields?

What is the performance like?

Thanks.
My blog here.
Game twitter here
User avatar
PolyVox
OGRE Contributor
OGRE Contributor
Posts: 1316
Joined: Tue Nov 21, 2006 11:28 am
Location: Groningen, The Netherlands
x 18
Contact:

Re: Fully Destructible Levels - Now in Game Engine Gems 1

Post by PolyVox »

Hi,

I haven't implemented any kind of pathfinding/AI, and I would expect it to be quite application specific. The use of a disance field would certainly be useful in may cases and I may well add this in the future. My experience in the past was that you can generate a distance field of a 256^3 image in about a second, but that was a couple of years ago so I might be remembering it wrong.

The problem is that the whole distance feld can be invalidated when a single voxel changes. Most likely I would down sample the volume to a lower resolution and generate the distance field from that.
LBDude
Gnome
Posts: 389
Joined: Mon Jul 26, 2010 10:53 pm
x 22

Re: Fully Destructible Levels - Now in Game Engine Gems 1

Post by LBDude »

Cool. You seriously kick ass!

So I assume Polyvox (sorry haven't checked it out yet, plan to spend today downloading and compile; already played with Thermite demo) supports down sampling. (Don't worry about it, I will figure it out.)

You said it supports "cubing" the world right like Minecraft? My question is what happens when you restrict your modifying shape to cubic only and of constant size (say size of the 'atomic' block size of the world) and that you use it in conjunction with surface extraction via Marching Cubes (simply asking here for a quick answer; I should try to figure that out myself). Will that still work? Or should I just forget about surface extraction and go with a pure voxel approach via rendering cubes. Also, does your engine (either Polyvox or Thermite) support efficient rendering of voxels as cubes? Actually this is a dumb question, I assume if I use Polyvox then I have to write my own voxel renderer and query it for the world. I'm hoping Thermite does this already--efficiently rendering the world using cubes.

Either way, thanks so much for this!
My blog here.
Game twitter here
LBDude
Gnome
Posts: 389
Joined: Mon Jul 26, 2010 10:53 pm
x 22

Re: Fully Destructible Levels - Now in Game Engine Gems 1

Post by LBDude »

Well, I think the surface around the cube in question would intersect the cube. So it should work. However, I'm not sure how that would look, I guess I will have to try it out to see. I guess another option is when generating the world simply discretize the world into cubes to begin with. I think this would give me the Minecraft look also. I'm not sure about efficiency issues when generating the world as cubes. I guess it would be the same right? It's just now the surface is made purely out of cubes.
My blog here.
Game twitter here
User avatar
PolyVox
OGRE Contributor
OGRE Contributor
Posts: 1316
Joined: Tue Nov 21, 2006 11:28 am
Location: Groningen, The Netherlands
x 18
Contact:

Re: Fully Destructible Levels - Now in Game Engine Gems 1

Post by PolyVox »

LBDude wrote:Cool. You seriously kick ass!
Thanks :-D
LBDude wrote:So I assume Polyvox (sorry haven't checked it out yet, plan to spend today downloading and compile; already played with Thermite demo) supports down sampling. (Don't worry about it, I will figure it out.)
Kind of... there is a VolumeSampler::getSubSampledVoxel function which I used to use for LOD before deciding it didn't really work out that well. It computes the voxels value on the fly but I doesn't take account of densities (it just returns the min material value). It fact I don't think I've used it since I added support for voxel densities, so it probably won't work at all...
LBDude wrote:You said it supports "cubing" the world right like Minecraft? My question is what happens when you restrict your modifying shape to cubic only and of constant size (say size of the 'atomic' block size of the world) and that you use it in conjunction with surface extraction via Marching Cubes (simply asking here for a quick answer; I should try to figure that out myself). Will that still work? Or should I just forget about surface extraction and go with a pure voxel approach via rendering cubes. Also, does your engine (either Polyvox or Thermite) support efficient rendering of voxels as cubes? Actually this is a dumb question, I assume if I use Polyvox then I have to write my own voxel renderer and query it for the world. I'm hoping Thermite does this already--efficiently rendering the world using cubes.
PolyVox always uses surface extraction. But it has two kinds of surface extractor - one gets a nice smooth surface via marching cubes while the other gets a 'jagged' mesh which looks exactly like cubes (but isn't). There is currently no demo showing the cube like version (but hopefully within the month). Thermite uses PolyVox for the surface extraction and for any scene it uses only one of the extractors. I think it would be possible to combine the two but I haven't tried it yet, in theory this would allow a nice smooth terrain covered with building built from cubes.
User avatar
EricB
Bronze Sponsor
Bronze Sponsor
Posts: 360
Joined: Fri Apr 09, 2010 5:28 am
Location: Florida
x 213
Contact:

Re: Fully Destructible Levels - Now in Game Engine Gems 1

Post by EricB »

Good morning Mr. Polyvox, or evening, depending on the time you read this :D

i'm putting together a tech demo for someone who wishes to use polyvox,
I was wondering, being that there is a lack of tutorials/literature/or example code for polyvox, If you had a simple example of polyvox in ogre laying around anywhere?

I'm finding the usage of QT :evil: and the layout in Thermite much harder to follow than It should be. (Then again, it might be because it's 3am, and i've had like 4 hours of sleep in the last 30 hours :lol: )
Image
User avatar
PolyVox
OGRE Contributor
OGRE Contributor
Posts: 1316
Joined: Tue Nov 21, 2006 11:28 am
Location: Groningen, The Netherlands
x 18
Contact:

Re: Fully Destructible Levels - Now in Game Engine Gems 1

Post by PolyVox »

Hi, Thermite is indeed quite complex as it includes support for scripting, threading, etc. But PolyVox itself is quite simple. In particular you should look at the BasicExample which comes with PolyVox and is documented here. The documentation isn't quite up to date but if you look at the BasicExample as well you should understand how it works.

The easiest way to combine it with Ogre is using the ManualObject class and you can see some example code here. You might want to read some more of the thread. Just ask if you have any questions.
User avatar
EricB
Bronze Sponsor
Bronze Sponsor
Posts: 360
Joined: Fri Apr 09, 2010 5:28 am
Location: Florida
x 213
Contact:

Re: Fully Destructible Levels - Now in Game Engine Gems 1

Post by EricB »

PolyVox wrote:Hi, Thermite is indeed quite complex as it includes support for scripting, threading, etc. But PolyVox itself is quite simple. In particular you should look at the BasicExample which comes with PolyVox and is documented here. The documentation isn't quite up to date but if you look at the BasicExample as well you should understand how it works.

The easiest way to combine it with Ogre is using the ManualObject class and you can see some example code here. You might want to read some more of the thread. Just ask if you have any questions.

Thank you much, That's exactly what I was looking for.

Works pretty well :D You'll probably be hearing from me soon again :)
Image
yaxinhoo
Gremlin
Posts: 173
Joined: Sun Jun 06, 2010 4:34 pm

Re: Fully Destructible Levels - Now in Game Engine Gems 1

Post by yaxinhoo »

i can't download the http://www.david-williams.info/VoxelSce ... -0.0.1.zip . anyone can provide the other address. let me download it ?
User avatar
PolyVox
OGRE Contributor
OGRE Contributor
Posts: 1316
Joined: Tue Nov 21, 2006 11:28 am
Location: Groningen, The Netherlands
x 18
Contact:

Re: Fully Destructible Levels - Now in Game Engine Gems 1

Post by PolyVox »

Sorry, it looks like it's got lost. I don't have it anymore. But it's just an older version of the code from SVN if you check out a version from four years ago. See also the post you made on the Themite forums.
fayt
Gnoblar
Posts: 13
Joined: Fri Dec 17, 2010 8:31 pm

Re: Fully Destructible Levels - Now in Game Engine Gems 1

Post by fayt »

Nice! reminds me of the classic game Worms.
User avatar
tdev
Silver Sponsor
Silver Sponsor
Posts: 244
Joined: Thu Apr 12, 2007 9:21 pm
Location: Germany
x 14

Re: Fully Destructible Levels - Now in Game Engine Gems 1

Post by tdev »

just wanted to say that the polyvox engine is great :)

hacked together a minecraft -> polyvox importer, which runs great performance wise:



slow framerate because of fraps, was super fluid otherwise :)

Code: Select all

voxels used: 2654208
Tidying memory...done.
Time taken = 1.123s
setting the voxels and iterating over the map data took however some 5 minutes...
User avatar
PolyVox
OGRE Contributor
OGRE Contributor
Posts: 1316
Joined: Tue Nov 21, 2006 11:28 am
Location: Groningen, The Netherlands
x 18
Contact:

Re: Fully Destructible Levels - Now in Game Engine Gems 1

Post by PolyVox »

Hey, cool stuff! Minecraft has created a lot of publicity for this project :-) I know the Minecraft format is publically available but I haven't looked at it... was the code to convert from Minecraft to PolyVox complex? If not then I'd be interested to see it or even add it to the PolyVox Wiki.
tdev wrote:setting the voxels and iterating over the map data took however some 5 minutes...
Really? And was this because of PolyVox? It seems unlikely... I usually fill a few million voxels in a second or so.
User avatar
tdev
Silver Sponsor
Silver Sponsor
Posts: 244
Joined: Thu Apr 12, 2007 9:21 pm
Location: Germany
x 14

Re: Fully Destructible Levels - Now in Game Engine Gems 1

Post by tdev »

PolyVox wrote: Hey, cool stuff! Minecraft has created a lot of publicity for this project :-)
yes, cause minecraft is the first "voxel" project that is a huge success (see http://minecraft.net/stats.jsp)
PolyVox wrote: I know the Minecraft format is publically available but I haven't looked at it...
i was reusing code from this project:
https://github.com/udoprog/c10t

i spoke with the author and we might create a minecraft import library.
PolyVox wrote: was the code to convert from Minecraft to PolyVox complex? If not then I'd be interested to see it or even add it to the PolyVox Wiki.
was straight forward i would say, based it on your opengl example:
http://modclub.rigsofrods.com/thomas/mi ... olyvox.zip
PolyVox wrote:
tdev wrote:setting the voxels and iterating over the map data took however some 5 minutes...
Really? And was this because of PolyVox? It seems unlikely... I usually fill a few million voxels in a second or so.
well, this was a 3 hour hack-together thing, haven't even analysed where the performance went. Also, unsolved would be the paging of voxel pages in the background. (do you have something for that already?)

maybe this hack could involve into a nice ogre-polyvox-minecraft viewer :)
User avatar
PolyVox
OGRE Contributor
OGRE Contributor
Posts: 1316
Joined: Tue Nov 21, 2006 11:28 am
Location: Groningen, The Netherlands
x 18
Contact:

Re: Fully Destructible Levels - Now in Game Engine Gems 1

Post by PolyVox »

tdev wrote:i spoke with the author and we might create a minecraft import library.
Yep, I'm sure lots of people would like that. There's so many Minecraft-related projects around that I'm sure it would get used by someone.
tdev wrote:Also, unsolved would be the paging of voxel pages in the background. (do you have something for that already?)
Not really, but the question has come up a few time before on our forums. I'm planning to vastly improve the volume compression in PolyVox to allow very large volumes, but I'm not currently looking at infinite volumes and/or streaming. But maybe very large volumes are enough?
User avatar
PolyVox
OGRE Contributor
OGRE Contributor
Posts: 1316
Joined: Tue Nov 21, 2006 11:28 am
Location: Groningen, The Netherlands
x 18
Contact:

Re: Fully Destructible Levels - Now in Game Engine Gems 1

Post by PolyVox »

I haven't been very good at updating this thread recently, which is a shame because the project has never been more active (visit http://www.thermite3d.org if you want to get involved). However, I mentioned a year ago that I had written an article in Game Engine Gems Volume 1 about the work I had been doing, and recently I discovered that this article is actually now on Google Books so anyone can view it :-)

You can read the article here: http://books.google.com/books?id=WNfD2u ... &q&f=false

Hope someone finds it intresting!
User avatar
PolyVox
OGRE Contributor
OGRE Contributor
Posts: 1316
Joined: Tue Nov 21, 2006 11:28 am
Location: Groningen, The Netherlands
x 18
Contact:

Re: Fully Destructible Levels - Book chapter now on Google B

Post by PolyVox »

After a long quiet period I can now announce that this project has moved to a new website and domain! You can find full details and downloads at http://www.volumesoffun.com. In particular you should see this page.

Up until this point there have been two parts to the project - the PolyVox voxel terrain library and the Thermite3D engine which uses it. Going forward the focus will be shifted to PolyVox only, although we also have a game built on PolyVox which will be announced soon. It uses Ogre, so you'll hear about it here :-)
User avatar
Mind Calamity
Ogre Magi
Posts: 1255
Joined: Sat Dec 25, 2010 2:55 pm
Location: Macedonia
x 81

Re: Fully Destructible Levels - Book chapter now on Google B

Post by Mind Calamity »

I take it it works with OGRE 1.8 ?
Last edited by jacmoe on Thu Nov 10, 2011 1:54 am, edited 1 time in total.
Reason: Quote Removed
BitBucket username changed to iboshkov (from MindCalamity)
Do you need help? What have you tried?
- xavier
---------------------
HkOgre - a Havok Integration for OGRE | Simple SSAO | My Blog | My YouTube | My DeviantArt
LBDude
Gnome
Posts: 389
Joined: Mon Jul 26, 2010 10:53 pm
x 22

Re: Fully Destructible Levels - New website and domain!

Post by LBDude »

PolyVox is rendering agnostic. It has a few templatized Volume class which is used to manage Volumetric data. It has several extractors which one can use to extract a polygonal mesh from via different mesh extraction algorithms (marching cubes, cubic). After you have the mesh, you can plug that into any ol' rendering pipeline.

Check out a screen of my project: http://twitpic.com/7cbk67. All running in 1.8.
My blog here.
Game twitter here
User avatar
PolyVox
OGRE Contributor
OGRE Contributor
Posts: 1316
Joined: Tue Nov 21, 2006 11:28 am
Location: Groningen, The Netherlands
x 18
Contact:

Re: Fully Destructible Levels - New website and domain!

Post by PolyVox »

Yes, what LBDude says is true. PolyVox just provide vertex/index data for you to pass to the API/engine of your choice. I know people are using it with OpenGL, Direct3D and Irrlicht, but I think Ogre is the most popular choice.
drwbns
Orc Shaman
Posts: 788
Joined: Mon Jan 18, 2010 6:06 pm
Location: Costa Mesa, California
x 24

Re: Fully Destructible Levels - New website and domain!

Post by drwbns »

I get an error when trying to compile PolyVox - OpenGLExample

Code: Select all

error C2782: 'PolyVox::Vector<Size,Type> PolyVox::operator /(const PolyVox::Vector<Size,Type> &,const Type &) throw()' : template parameter 'Type' is ambiguous	c:\Users\Andrew\Downloads\polyvox-polyvox-master\polyvox-polyvox\examples\OpenGL\Shapes.cpp
drwbns
Orc Shaman
Posts: 788
Joined: Mon Jan 18, 2010 6:06 pm
Location: Costa Mesa, California
x 24

Re: Fully Destructible Levels - New website and domain!

Post by drwbns »

Is there a small example of how PolyVox can be used for terrain editing?
User avatar
PolyVox
OGRE Contributor
OGRE Contributor
Posts: 1316
Joined: Tue Nov 21, 2006 11:28 am
Location: Groningen, The Netherlands
x 18
Contact:

Re: Fully Destructible Levels - New website and domain!

Post by PolyVox »

drwbns wrote:I get an error when trying to compile PolyVox - OpenGLExample
Can you give the complete compiler output, rather than just that one line? And which compiler are you using?
drwbns wrote:Is there a small example of how PolyVox can be used for terrain editing?
Not really, but the principle is quite simple. You load whatever data you want into the volume and then generate the mesh and use it for rendering (the tutorial covers this much). If you then make any further changes to the volume then you need to regenerate the surface and render the new one instead.
User avatar
PolyVox
OGRE Contributor
OGRE Contributor
Posts: 1316
Joined: Tue Nov 21, 2006 11:28 am
Location: Groningen, The Netherlands
x 18
Contact:

Re: Fully Destructible Levels - New website and domain!

Post by PolyVox »

For those who are interested, we just released a new version of our PolyVox voxel terrain library. This isn't really Ogre related anymore as PolyVox is now standalone (and Ogre has it's own voxel terrain implementation), but this thread is where it began six years ago so I thought it was worth mentioning. It can still be integrated with Ogre of course as it's engine/API independent.
Post Reply