Advertisement

Voxel worlds and physics engines

Started by July 21, 2020 10:06 AM
7 comments, last by dotnka 4 years, 5 months ago

Hello everyone,

I've been working on a small Voxel world game for some time, a very Minecraft like world with 1 meter cubes, not small voxel systems. I've started with no need for physics but now I am actually looking into adding some vehicles and more dynamic objects in the scene. While most of the objects I can simulate by just querying the voxel world and deciding whether I hit something or I am falling it starts getting complicated with bigger structures, like a free floating voxel structure that spans across multiple chunks. I've never written a physics engine so I might end up doing cube-to-cube tests all around for what I need but I get the gut sense it's rather barbaric.

Because of this at this point I would rather offload this workload to a physics library. I've worked with both Bullet and PhysX in the past and I am more inclined to go the PhysX way. Does anyone have any advice on this issue? Is it overkill to get a full physics system for a Cube-only world? Is there a better voxel-oriented physics library out there?

Just to clear it even more up, right now I am only looking into collision detection, no actual dynamics simulation though I can imagine some use for some floating voxel island collisions in the future.

Any ideas/suggestions/arguments would be greatly appreciated

Thanks

dotnka said:
Just to clear it even more up, right now I am only looking into collision detection, no actual dynamics simulation though I can imagine some use for some floating voxel island collisions in the future.

Related to that i remember a discussion about Minecraft alike voxels on the forum of the physics engine i'm using (Newton), and the dev proposed to implement static scene collisions using user collision callbacks exposed by the engine. Might be faster than build in static geometry support because of perfect cubes, and might also help with adding and removing cubes without a need to rebuild internal collision acceleration structures.

Now i don't know how it is for PhysX, but probably similar and this raises some questions.
My opinion: If i want dynamics simulation, i would use a physics engine but add some custom collision detection if necessary. Otherwise i would not be sure as well.

Advertisement

You guys, I know this isn't a constructive solution or anything, but have you played around with Ken Silverman's Voxlap Cave demo?

http://advsys.net/ken/voxlap/voxlap03.htm

It has some awesome physics - especially for when+how it was made.
It doesn't leave the detached bodies in the game though - they dissappear shortly after breaking off.
Still a sweet demo, though - big Awesoken fan here.

@SuperVGA Tread lightly and carefully

Website blocked due to a Trojan

Your Malwarebytes Premium blocked this website because it may contain a Trojan.

We strongly recommend you do not continue.

AtomicWinter said:

@SuperVGA Tread lightly and carefully

Website blocked due to a Trojan

Your Malwarebytes Premium blocked this website because it may contain a Trojan.

We strongly recommend you do not continue.

That's pretty harsh. Might be a misunderstanding on Malwarebytes' side.

SuperVGA said:

That's pretty harsh. Might be a misunderstanding on Malwarebytes' side.

I just copied the message from Malwarebytes, other than the tread lightly and be careful part (I put their message in italics to kind of portray that). I apologize if you think I was trying to be harsh as it wasn’t my intent; just trying to give a friendly heads up. Like you said, it could be a false positive.

Advertisement

AtomicWinter said:

SuperVGA said:

That's pretty harsh. Might be a misunderstanding on Malwarebytes' side.

I just copied the message from Malwarebytes, other than the tread lightly and be careful part (I put their message in italics to kind of portray that). I apologize if you think I was trying to be harsh as it wasn’t my intent; just trying to give a friendly heads up. Like you said, it could be a false positive.

Sure, I meant that MalwareBytes was being harsh. :-)

Could be due to something like the domain name, or perhaps Ken has finally turned himself in to the dark side

Thank you for the feedback @joej For now I ended up using PhysX and will follow the suggestion to add user-specific callbacks for performance in the future. Even so, honestly it might be overkill, the number of objects actually interacting with the hulls is rather small, the way it gets resolved might be irrelevant at this stage.

This topic is closed to new replies.

Advertisement