x


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.

more ▼

asked Apr 12 '10 at 06:42 AM

Roy gravatar image

Roy
34 7 7 11

(comments are locked)
10|3000 characters needed characters left

4 answers: sort voted first

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.

more ▼

answered Apr 12 '10 at 11:23 AM

KvanteTore gravatar image

KvanteTore
1.5k 8 15 33

(comments are locked)
10|3000 characters needed characters left

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!

more ▼

answered Apr 12 '10 at 10:30 AM

Dwair gravatar image

Dwair
358 1 2 4

I did not put rigidbody component to the shovel. I tried but it fell apart from the excavator and made funny movements when i drove my excavator (i attached First Person Controller to the Cab of excacvator, both were attached box colliders but not rigid bodies).

Apr 13 '10 at 01:16 PM Roy
(comments are locked)
10|3000 characters needed characters left

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?

more ▼

answered Apr 12 '10 at 07:37 AM

StephanK gravatar image

StephanK
6k 39 53 93

The thing is actually like this: when the shovel digs into the soil (rigidbodies + box colliders), soil must stay at the concave of the shovel by gravity; when the shovel is upside down, the soil must be poured out. So what can i do? Will OnMouseDown() help ?

Apr 12 '10 at 10:28 AM Roy
(comments are locked)
10|3000 characters needed characters left

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

more ▼

answered Nov 18 '10 at 11:20 AM

Jean Fabre gravatar image

Jean Fabre
3.1k 68 75 103

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x1880
x1706
x65
x1

asked: Apr 12 '10 at 06:42 AM

Seen: 2009 times

Last Updated: Apr 12 '10 at 12:44 PM