how to display an objects current applied force as a hud readout

Hi all,

I’ve been making progress with my racing game, thanks to folks here and elsewhere I have a functional speed bar, speed limits and health. But one thing has me puzzled, how to I get the currently applied force (either from servo or dynamic forces) into a variable I can use, sort of like an rpm indicator?

Plus, what relationship is there between the forces applied via actuators and the objects velocity?? I mean,e.g. I have a dynamic motion force of 10,with an object that has a top speed of 10? Are the force units the same as speed (ie 1bu per sec)?

Thanks for your insight!


I think you have to take the values of the forces directly from your actuators (at least that makes the most sense).

There is no rpm because there is no real engine ;). In a real car, you could try to guess the forces that the engine applies to the vehicle from the rpm (there is a relation between rpm, gear and engine force). As far a s I know that is usually done by experimenting. The result is a curve that tells the engineer what forces the engine produces under wich conditions (mass, resistance, rpm, temprature, gear etc.). But I’m not such an engineer so I can’t tell you the details. But I know that an engine does not produce the same forces all the time.

But the BGE does so. If you apply a force it is always the same (that what the actuator applies). You could apply logic that simulates the forces of a real car. This could also include virtual RPM (still, there is no engine with any rotation).

The other side is the behaviour of the vehicle in response to the applied forces.
You need to add air resistance, ground friction, inner friction (inside the vehicle) etc…
This are counterforces that reduce the forces applied by the engine. You know faster drive = stronger counterforces. These produce the speed limit.

The connection between forces and the speed is simple physics. Something like

a = F / m

a = acceleration
F = (engine force + counterforces) [these are vectors! and can point into different directions)
m = mass

You have top speed when a = 0. This is usually the case when (engine force + counter force) = 0 as described above

I forgot to mention: if the vehicle does not move at all then a = 0 too ;). But this is maxspeed too (without forces from engine :D).
I hope it helps somehow

Hmmm, very interesting! Thanks for that Monster!