How to define the soil in excavator game ?

I intend to develop an excavator game. Excavator modeling based on cinema4d (trial version)

I try to define the soil as lots of small cubes (rigid bodys with box colliders), also i add the box collider to the shovel of the excavator.

But they two can't collide with each other when the small cubes are defined to be very small and with big weight.

Having lots of small cubes simulating dirt appears to me to maybe not be a good plan. As Dwair pointed out, having many small colliders can be quite a nightmare for the physics engine.

You could consider having a mesh for the excavation site and procedurally modifying the mesh when the player digs. It will probably take a lot of tweaking to get right though.

Why do they need to collide with each other? Can't you just make the shovel tool follow the mouse cursor and use OnMouseDown() of the soil-cube to determine which cube to scale?

Did you put rigidbody component to the shovel too?

It is very important both phys colliders have mass, if you don't want the shovel to bounce or make funny movements, just use isKinematic and there you go!

The other part about "Small colliders" worries me most, small colliders are a headache for any physics engine, the only thing I can think of is modifying physics settings: You'll probably need to reduce min penetration for penalty and increment solver iteration count...

Another useful thing if colliders are moving fast is DontGoThroughThings

Anyway, interesting game you are making!

I have made an excavator using only rigid bodies and I can pick up thing fine with the bucket,

http://www.fabrejean.net/projects/excavator

for forum entries: http://forum.unity3d.com/threads/66871-Excavator-simulation

in french: http://www.unity3d-france.com/unity/phpBB3/viewtopic.php?f=12&t=1016

if you need help with your build, let me know. the picking things was not the hard part, the rigging of the arms was for a totally predictable, stable and reliable rig.

basically the big trick is to increase the solver Iteration count and adapt the time settings. Otherwise, joints are not tight and it becomes utterly unstable. My demo has quite large objects to pick up, but I tried with smallers during build phase and it can handle it fine.

Bye,

Jean

https://play.google.com/store/apps/details?id=com.SimG.SimExcavatorBeta

credit: simglab.com