Voxel engine discussion and question!

Hello everyone!

Together with a friend i created a Voxel system for unity. It is fully destructible , it draws the mesh just fine for each chunk, you can create chunks in the scene view with our editor (and save them as prefabs), and you can even feed it images, from which it will create a level based on the pixels. You can also change color for each voxel in a chunk, and chunks can have different voxel sizes.

Overall it works really great! And here is a picture from a multiplayer 2d shooter prototype using the system (everything can be destroyed).

1177251--45221--$Prototype.jpg

But! i am not really happy about the use of colliders. We started by re writing the mesh collider when a chunk was edited. But with big chunks this is a no go performance wise.

So at the moment we have a parented game-object with voxel class and collider on for each visible voxel in a chunk. And it works quite fine. But i just dont like the idea of so many game-objects in a large scene with 500.000+ voxels.

Does anyone know a nice method for collisions? :face_with_spiral_eyes::smile:

Kindest regards BFGames.

you can try inventing your own collision. honestly this would be a complex aproach for me as i am still trying to figure out ways of expanding my knowledge. sucks that it isn’t easy to say things like “voxel engine tutorials blah blah”. lol or else i would probably learn how to code it too.

I could code my own collision np. But i want it to work with Unity’s physics, and then it gets tricky!

Bump! No one have any input for this :frowning:

Collision mesh optimization might help:
http://forum.unity3d.com/threads/63149-After-playing-minecraft/page18?p=628470&viewfull=1#post628470
http://forum.unity3d.com/threads/63149-After-playing-minecraft/page52?p=948733&viewfull=1#post948733

Yeah look at:

http://forum.unity3d.com/threads/63149-After-playing-minecraft/

Also, as alex pointed out, you can optimize the mesh and use MeshCollider or you can write your own collision detection (AABB Sweep vs AABB). There are pros and cons to both approaches. I’m about done writing the later approach for my game and it’s fantastically fast, however, it did take a decent amount of time to learn.

P.S. Check out http://www.amazon.com/Real-Time-Collision-Detection-Interactive-Technology/dp/1558607323

<

thanks alot, that helped a lot so far!

Do anyone know if this is still a problem?

http://forum.unity3d.com/threads/57493-VBO-VRAM-memory-increase-CombineChildren-issue-(Solved)?p=374652#post374652