The Big Development Update on Vehicle Physics Pro

Finally, the code and features in Vehicle Physics Pro are ready to be released. I’m now completing the kit with the demo scenes, sample vehicles, scenarios, art, etc. as well as tutorials and feature demonstrators.

Here is a non-exhaustive list of the development progresses over the past months:

  • Replay with pause, flashback, slow motion, forward/reverse playback…
  • Mobile support
  • Xbox and Thrustmaster controllers supported
  • Performance Display and analysis tools
  • Fuel consumption model
  • Anti-lock Braking (ABS)
  • Traction Control (TCS)
  • Stability Control (ESC / ESP)
  • Anti Spin Regulation (ASR)
  • Steering Aids
  • Cruise Control and Speed Limiter
  • Easy joints: Vehicle Joint and Head Motion
  • Liquid Cargo model
  • Retarder brake

Experimental:

  • Dynamic suspension
  • Anti-roll bars
  • Rolling friction
  • Camera: auto-fov

Under the hood:

  • VehicleBehaviour
  • Full live script reload support
  • Fixed IL2CPP support
  • Visual interpolation everywhere
  • Unscaled time on user interactions

Keep reading for full details below.


Replay with pause, flashback, slow motion, forward/reverse…

This is an AAA+ level replay system working seamlessly with VPP vehicles. You can record a sequence of any length (limited by the available memory only), rewind, replay, play in reverse, play in slow motion, control the cameras during the replay, pause, frame-by-frame, and continue driving the vehicle from any point in the replay. You can also save and load replays to/from files or serialized streams.

Replaying a recorded sequence reproduces all the vehicle effects such as telemetry values, performance charts, tire marks, tire smoke… If you use a steering wheel device the wheel will also replay the steering movement!

Next video was initially recorded as VPP replay in my development computer, then replayed in a more powerful computer for actually capturing the video.

Mobile support

Vehicle Physics Pro works on low-end mobile platforms out-of-the-box. All you need are mobile-optimized graphics and a touch UI. You might need to configure the solver substeps as well. The Replay feature with rewind & continue also works on mobile devices. A handy touch-based interface is provided.

Xbox and Thrustmaster controllers supported

VPP includes a generic DirectInput wrapper with built-in mappings for the Logitech G27 (also valid for G29/G920) and Thrustmaster T300 (and its variants). A new XInput wrapper has been added so the XBox One and XBox 360 controllers are supported, including analog controls and rumble motors.

  
 

Performance Display and analysis tools

An awesome tool for diagnosing setup issues and configuring vehicles for performance. Actual racing teams of all levels use this kind of performance charts for finding the best car setup for each conditions. New charts may be added easily using the component’s API.

Anti-lock Braking (ABS)

ABS simulates the behavior of the relief valve that reduces the brake pressure when the wheel is detected to slip beyond a threshold. ABS provides several working modes and settings allowing a detailed calibration for each specific vehicle. As happens in reality, the ABS automatically unlocks the center transfer case in AWD vehicles.

The ABS setup may be calibrated using the ABS Diagnostic performance chart.

   

Fuel consumption model

Simulates fuel consumption and supports the out-of-fuel situation. The fuel efficiency of the engine is calculated based on the engine settings. The display shows it in the graph as the dashed purple line.

The fuel consumption is specified in grams per rev at full load. The Engine component then calculates the fuel efficiency as brake specific fuel consumption (BSFC) in grams per kilowatt hour (g/kWh).

The telemetry shows the actual fuel consumption rate in g/s and l/km:

Traction Control (TCS)

The TCS reduces the engine power to keep a given tire slip when the user applies throttle. This allows, for example, to keep the tire in the most performant point on situations like hot starts. In addition, it can be configured for allowing the vehicle to drift and powerslide in a nicely controlled manner.

The TCS system in the video drifting and powersliding is configured for limiting the tire slip to a maximum of 20 m/s. This provides a good handling on drifting and powersliding. An experienced driver would achieve the same effect with a precise application of the throttle:

Stability Control (ESC / ESP)

In real cars the ESC system (also named ESP) detects the understeer and oversteer situations and applies brakes to individual wheels in order to keep the vehicle under control while trying to do what the driver expects. In VPP the ESC system does exactly that. 

Understeer is detected by comparing the actual vs. expected yaw rate, then applying one of the rear brakes for forcing the vehicle to head into the desired direction. Oversteer is detected by comparing the forward direction of the vehicle vs. the direction is actually moving to (speed angle), then applying one of the forward brakes for forcing the vehicle to point in the direction of the speed.

Telemetry shows the lively detected values for oversteer and understeer. These values can be used for calibrating the ECS settings for the vehicle.

Anti Spin Regulation (ASR)

The ASR system compares the rotational speed of the wheels at both sides of the differential. If one of the wheels gains a lot of spin, then the ASR engages the brakes on the opposite wheel, allowing the other wheel to actually gain traction and push the vehicle forwards.

The typical situation for the ASR is having one wheel over slippery surface and the other over a regular surface. In an open differential, the wheel over the slippery surface would spin furiously preventing the vehicle to move. The ASR engages the brakes at this wheel, so the drive torque finds its route to the other wheel through the differential.

Steering Aids

This is one of the most awesome additions to VPP. Steering aids allow to drive the vehicle and keep it under control even when used with keyboard or touch devices. It can be configured in many ways for defining the actual behavior of the vehicle. From a race setup that keeps the vehicle moving forwards under control, to a drift setup that automatically keeps the drift direction stable. Combined with the TCS, these aids give a variety of ways for setting up the control of the vehicle depending of the expected behavior.

As example, this capture shows the car performing a perfect drifting circle thanks to the Steering Aid setup:

Here the input is applying throttle only. Steering is controlled by the Steering Aids (the performance chart shows the user-applied input). The drifting is so perfect that every car value is now uber-stable (see the performance display) and the tire marks of the rear wheels are drawing a perfect circle, passing over the same exact positions on each round.

The Steering Aids in combination with the Traction Control provides a powerful yet physically realistic way of configuring the vehicle’s driving physics and behavior.

Cruise Control and Speed Limiter

Encountered on most vehicles, this simple feature does exactly that. It controls the engine throttle for either keeping a specific speed, or ensuring that a speed is not surpassed as result of applying throttle.

Easy joints: Vehicle Joint and Head Motion

Never deal with complex Unity joint setups again.

Vehicle Joint makes easy to rig multi-body vehicles. Just set the anchor points, the motion constraints and you’re done.

 

Head Motion provides inertial head motion in first-person views. Just specify the type of movements allowed and their properties. The component takes care of creating, configuring and disposing the Rigidbody and ConfigurableJoint components for you.

 

Liquid Cargo model

A component that simulates liquid cargoes in vehicles. It accurately simulates mass, inertia, weight displacement and side effects of transporting a sloshing liquid inside a closed tank. You may specify the tanker shape (spheroidal, cylindrical, box), the maximum load, the fill level (%) and the viscosity of the fluid. This component may be used for simulating fuel tanks and even tanker trucks. All parameters may change in runtime (i. e. reducing fill level as fuel gets consumed).

 

Retarder brake

A special component typically used on heavy vehicles such as trucks, buses, semi-trailers, etc. The retarder brake injects braking torque right into the driveline. If you’re into truck mechanics, you’ll surely recognize this kind of curve:

    


Experimental

Dynamic suspension

Dynamic suspension is commonly used in heavy vehicles such as semi-trailers. This component dynamically adjusts the springs of a set of wheels for keeping a given contact depth value.

Anti-roll bars

Dynamically adjust the springs of the same axle for reducing the vehicle banking angle on curves.

Rolling friction

Applies a counter-force in the wheels based on the angular velocity and load. This complements the fuel consumption model, as fuel consumption has a great dependence of the rolling friction in real vehicles.

Camera: auto-fov

The field of view (zoom) is automatically adjusted for fitting the vehicle in the screen. Perfect for TV-like takes of the vehicles.


Under the hood

VehicleBehaviour

Easily design any component for your vehicles by deriving from VehicleBehaviour instead of MonoBehaviour. VehicleBehaviours receive notifications on the vehicle being enabled / disabled as well as many other events.  The lifecycle of a VehicleBehaviour is perfectly synchronized with the vehicle it belongs to in all situations. In addition, VehicleBehaviour-derived components can be located in any GameObject in the hierarchy of the vehicle so they can be easily managed (i.e. enabling / disabling a group of VehicleBehaviour components based on the vehicle settings).

Full live script reload support

The entire VPP code base is designed so scripts can be reloaded in play mode. This happens when you lively modify and save some script. Most importantly, this capability ensures all VPP components can be lively instanced, disposed, enabled, disabled anytime at runtime. Even the components Replay, Vehicle Joint and Liquid Cargo are designed this to work this way.

Fixed IL2CPP bug

A very rare floating-point precision bug in the wheel dynamics that only happened on IL2CPP has been identified and fixed.

Visual interpolation everywhere

Visual wheels, steering wheel, audio, and other parts are now interpolated. This means they play perfectly even on slow motion and replays with no performance or precision costs.

The overall design also has been reworked so all physics and dynamics stuff occur at FixedUpdate. This greatly increases the consistence and predictability of the simulation. All visual stuff is performed at Update, where frames may be skipped when necessary.

Unscaled time on user interactions

Camera movement and user interaction (i.e. browsing the performance display) are now done at natural speed even in slow motion or paused time.


More info Vehicle Physics Pro here: http://vehiclephysics.com