Building A Tank Rig

This is how I created my Panzer 2 'Luchs' dynamics-driven rig. For basic info, it is important to note that this rig is built in Cinema 4D R13 using the default physics system (dynamics) and is then being run on a PC with an Intel Core i7 2600k (early 2011 CPU); so decent hardware, but nothing incredible.

As you can see, the tank (in all it's ~70k poly glory) drives around, reacts to terrain bumps, turns and does pretty much what you would except a tank to do. So, how does this work?

Breakdown

Well, this is it. As you can see, the rig is broken down into a few key components. The overall entity (so you can move it around as a single piece), the Geo (in case you want to change it) and the dynamics (the parts that do the work). On screen we have a single controller (the cross on the left) that the turret points at, and on the right we have the overall controls for the vehicle.

The controls are fairly basic: the RPM controls the speed for each track, the torque controls how much power you are giving the tracks, the breaks can be applied via a percentage, and the suspension stiffness and damping can be easily adjusted. With these controls it is very easy to quickly set up the movements you want the vehicle to perform. Overall, this rig ends up being a 2.8mb file.

The way it actually works is also very simple: physics proxies. This is a techique often used in video games to simplify the physics calculations being done in order to improve performance: you essentially give the engine a rough estimate of the objects being used, and then disguise these basic physics proxies with more complicated objects. In this case, the actual physics rig actually looks like this:

Physics

This certainly seems a lot more simple. What's actually happening is that there are three key proxies being used. Firstly, there are the roadwheels: in this case, very simple cylinders. These are what control the movement and track physics. These wheels are large enough to clip through the tracks and contact the ground directly: thus the tank is actually a 'wheeled' vehicle instead of a 'tracked' one. These wheels provide the traction, the physical interaction and track physics. The tracks are created via a spline (not shown) wrapped around these wheels, with vertices directly above and below each wheel. When a wheel goes up due to terrain variation, these points move up and down with the wheel, bringing the track links up and down as if they were actually contacted by the wheel. To create the movement of the individual track links, each link is actually an instanced object along this spline: the position of each link is then offset via a ratio with the wheel rotation, keeping the tracks in sync with wheel movement.

To handle the vertical movement of the wheels, I have simply used the 'wheel suspension' connector, with it connection the wheel proxies and a locator to which the hull and other parts are attached. The exception to this being the front and rear wheels, which are not attached via suspension (as in the real tank). Each wheel is also given its own motor to give it power, and all these motors are linked to the master controls; as are the suspension connectors.

The large rectangular 'skis' are used to create terrain deformation. When these come in contact with a specific ground plane (must be marked as deformable), the plane is simply pushed out of the way. How? Cloth dynamics. The ground is actually a fairly low poly plane with a cloth deformer attached to it. This 'cloth' is set to have no rebound and no other movement influences: once deformed it stays deformed. With the proper settings, it can create a fairly realistic approximation of snow or mud being displaced by the tank's tracks.

Lastly, the antennas: these are actually just giant 'hairs'. Using a spline with a length segments, each antenna is given a spline dynamics tag and a fairly high degree of stiffness. This results in 'hairs' that act like large wires, or antennas. The turret works on an even simpler system: it's just a target tag with a locator set as the target.

Realtime Use

This is how it looks in practice (this is the first frame from the video at the top). We have a very low poly ground plane (non-deformable base for the wheels to interact with) which can be hidden in the final render (it is in the video). On top of that we have a deformable snow layer, which is being depressed by the 'skis' shown earlier, and finally we have the tank itself, being controlled by the various physics proxies. It ends up being quite simple.

So is it really real time? Yes, it can be. When experimenting with movement, the vehicle is being run entirely in real-time. You can keyframe the controls and each time you run it the simulation will be accurate. However, I would not recommend using real time in the final render: real time physics are by nature not 100% repeatable. As such, there is the option to cache the physics: either entirely (every wheel, terrain, antenna, etc.) or only partially. I usually use the partial option, where only the location of the hull and terrain deformation are cached, leaving the tracks and antenna to run in real-time. This allows for accurate camera placement (since the tank location will not change each run) as well as easy render comparisons (for the same reason).

Regardless, it ends up being fairly fun to create simple test tracks for the tank to drive around in.

Note: The antennas only act 'strange' when seeking through the timeline. During playback/rendering, they are fine.