Motor vehicles come in a huge variety of shapesand designs each tailored for a specific purpose.
Whether that be simply getting you from Ato B in comfort and safety, travelling around a well paved race track in the shortest timepossible, crossing difficult terrain, or sliding sideways around a corner.
Each have been carefully crafted by theirengineers to excel in their disciplines.
Last month Ubisoft invited me to the Red BullRing in Austria to drive in 4 incredibly different vehicles.
The KTM x-bow, an ultra-lightweight trackcar, driven by a professional driver.
An 0ff-road buggy, a Land Rover defender, and a Porsche Cayman S, driven by a complete idiot.
All this to get a better idea of how thesevastly different vehicles perform in real life, and to discuss with the programmersof Ubisoft’s new game, the Crew 2, about their process for programming their vehicleshow to behave in game.
“So, my name is Stephane Janjowski and I’mproducer at Ivory Tower, Ubisoft Studio, and the Crew 2 obviously.
” Speaking with Stephane, I started to get amuch better idea of the relationship between real world physics and in game physics, andjust how developers programme vastly different vehicles like these to perform like theirreal life counterparts.
Unlike real life, where boy racers love todestroy their cars with modifications that negatively affect performance, the in gameengine separates the physics model from the 3D model.
“When we do the 3D model that’s one partof the vehicle and then we have the pure physics model, that is seperate from the 3D.
” The physics model creates a model where thingslike the wheels are independent physics objects, with their own friction and mass modelled.
The separate 3D model allows the developerto pick and choose what cosmetic changes to the vehicle affect performance, for examplespoilers are not treated as aerodynamic surfaces in the Crew 2, so your inner idiot can applyspoilers on front wheel drive cars to your heart’s content.
One of the few cosmetic features in game, that does affect the performance of the vehicle, is the suspension.
Suspensions are a system of springs, shockabsorbers and linkages that connect the vehicle body to it’s wheels, with a goal of keepingthe tires in contact with the ground while minimising the transfer of that motion tothe vehicle body.
This provides provides comfort for the passengersof the vehicle, not much of a concern for a video game, but they also determine howthe vehicle will handle bumps and corners.
Off road vehicles have incredibly soft suspension.
This allows them to run over rugged terrainat high speed without transferring too much force to the body of the vehicle, but withone significant drawback.
While cornering, or driving over slanted ground, a large amount of weight of the vehicle is shifted onto one side of the car.
With suspension this soft the vehicle is extremelysusceptible to roll, as the body is fairly free to tilt upon the wheels, combine thatwith a fairly high centre of mass and it’s a disaster waiting to happen, especially whenyou put an attention seeking australian vlogger in the driving seat.
And while you can’t roll-over your vehiclein game, as the physics engine applies a torque to car, when it rolls too far, but it doesallows enough roll for the suspension model to behave realistically, which feeds intotraction physics model.
Cars designed for tracks will always havestiff suspensions.
This helps them keep their tires in contactwith the ground, ensuring traction is not lost in corners through tilting, while maintaininga consistent ride height, an important characteristic for vehicles like the x-bow, as it’s undercarriageforms a significant part of it’s downforce generation though it’s rear diffuser.
It’s important to maintain a low centreof gravity too, as this minimises that rolling effect we saw earlier.
The one draw of back stiff suspension likethis is ride comfort.
I was in the passenger seat of the cross-bowfor a couple of laps, and boy do you feel every bump.
You can see the effect of suspension stiffnessand weight distribution, which is simulated in the physics model accurately, on tractionvery well in game with front engined, rear wheel drives like the Ford Mustang GT, thatis particularly easy to drift around a corner.
By lifting off the accelerator and hittingthe brake at the apex of a turn, the g-forces of deceleration causes the heavy front endof the vehicle be pushed downwards, lifting the rear axle and causing the rear tires tolose grip, thus initiating over-steering.
This is a lot of fun, and the penalties onspeed in game are fairly miniscule, but in real life this is something the designersof racing vehicles want to avoid as you cannot apply full power if your wheels are slippingand you lose forward velocity by sliding sideways, so most racing cars are mid engined to maintaingrip on the rear tires during braking, and keep the suspension stiff to ensure the balancebetween tires is as close to the ideal as possible.
Keeping the weight evenly distributed betweenthe front and rear tires in corners is important because it creates a vehicle which does notover or understeer.
Over steering being drifting, where the backwheels lose traction, and understeering is where the front tires lose traction, diminishingthe steering tires ability to dictate the direction of the car.
Allowing momentum to take over.
In a race you want neither, but this is steera video game, so you can adjust both your front axle grip and your rear axle grip toencourage these effects, this slider simply adjusts the coefficient of friction beingapplied to the tires in the in game physics engine, which adjusts the traction force thetires can apply to the ground.
Traction is one of the primary tools the developerswill play around with to change the feel of the game, as this is the one that dictateshow the vehicle will interact with the road.
More realistic games, like simulators, willdo their best to model traction as realistically as possible, but may give you optional drivingassistance to make the game easier, for example at higher speeds the max steering angle willbe limited to help with overtaking with clumsy thumbstick controls.
Leading to many cars behaving like understeeringcars, where if you take corners at too high speed you will end up crashing into the barrier.
But without the driving assist the resultwould have been pretty similar anyways, you may have just spun a few times instead likeI did when driving the Porsche with the traction control off.
You just need to learn to manage your speedin corners better.
Games aiming for an arcade feel may do awaywith this mechanic and separate traction from steering mechanics all together, allowingyou to take corners at any speed with no worry.
The Crew 2 lands somewhere in the middle, it’s obviously an arcade game.
You can take ridiculous jumps like this ina Ford F-150 Raptor race truck at 180 km/h and land without destroying your car, andthen take a turn take a turn at 200 km/h on a dirt track without losing lateral traction.
The traction here has just been boosted tomake the game easier and more fun to play Next up let’s look at how the power of theengines are handled.
Now obviously the computer programmers donot simulate an entire engine and transmission system to determine vehicle performance.
Take this Porsche 911 GT3 RS, in this clipit does 0-100 km/h in 3.
2 seconds, pretty much identical to it’s real life counterpart, even with the nitrous boost.
The programmers want the relative performancebetween vehicles to be relatively accurate, as it would make no sense if a Mazda RX-7was beating a Porsche 911 GT3 RS in acceleration and top speed.
To understand how acceleration and top speedare programmed, we first need to examine what forces are acting to slow the vehicle down.
The top speed of a car is primarily dictatedby the drag force acting on the vehicle, which is something we examined before in my helicopterversus car top speed video.
The equation for drag force is provide bythis equation, and the equation for power is simply force times velocity.
By rearranging these variables we get thisequation for top speed, which the physics engine uses to limit the vehicle's top speed.
The programmers can adjust the top speed ofeach vehicle simply by adjusting it’s max power, coefficient of drag or frontal area.
If they really wanted to they could changethe air density with elevation on the map too.
Adjusting the acceleration is slightly moredifficult as the acceleration is determined by several factors which vary with the vehiclesspeed.
The primary variable that are concerned withis wheel torque, which varies dramatically for internal combustion engines across differentengine rotation speeds and gear ratios.
The force applied by the wheel to the ground, if there is no tire slip, will vary with the torque applied divided by the wheel radius.
The wheel radius is just one part of the internalgearing system that needs to be considered when calculating the force the wheels willimpart on the ground.
The vehicle will have several gears it cancycle through at different speeds to change the applied wheel torque and will have onepermanent drive ratio that is determined by additional gearing in things like the differential.
All these parameters will be programmed intothe in game vehicle, and the final wheel torque will be determined by this equation.
Where Te is the engine torque.
The engine torque varies across differentrevolutions per minute of the engine, and we define that variation with a torque curve, like this one for a Porsche Cayman S.
The programmers will again actually input thevehicles torque curve into the vehicle parameters to ensure if performs like the real deal.
Designing games like this is always a delicatebalance between realism and fun.
The developers don’t always go for ultrarealism, programmers will often play around with their world’s physics variables likethe lateral traction to give a more arcadey feel with exaggerated drifting, or simplyto make the car easier to drive around corners at high speed.
Or like in this game you can switch from beinga plane to being a boat in mid air.
There is no real ad read here, I simply wantto say thank you to Ubisoft of inviting me out to such an exciting event and allowingme to chat with the programmers of the game.
If you are into car video games, The Crew2 is out now.