Vehicle max speed formula

Place to get help with not working mods / modding interface.
User avatar
Adil
Filter Inserter
Filter Inserter
Posts: 945
Joined: Fri Aug 15, 2014 8:36 pm
Contact:

Vehicle max speed formula

Post by Adil »

Does anybody know which formula is used to define the vehicle maximum speed?
There's no explicit definition of top velocity in the prototype, so I've figured it's some sort of balance between friction and engine power, but attempts to approximate friction with linear and square functions did not succeed.

I've tried to describe the following vehicles
Vehicles
with these formulae:

Code: Select all

max_speed= math.sqrt( effectivity*consumption/ weight / friction / const)

Code: Select all

max_speed= effectivity*consumption / p.weight  / p.friction/const
which stand for viscous friction and linear one (assuming that friction value in prototype stands for friction force coefficient: F=velocity^some_power * friction).
I used car as a reference point to set a constant multiplier.
However, first one undershoots the speed of raven vehicle and the second one is wrong for a tank.

edit: the cube formulae doesn't seem to work either.
I do mods. Modding wiki is friend, it teaches how to mod. Api docs is friend too...
I also update mods, some of them even work.
Recently I did a mod tutorial.
Post Reply

Return to “Modding help”