Motion Value Wizard
-
Gentlemen, as many of you one day I was, too, trying to get the right values for ship engine forces, strafe forces, masses and the steering torques.
I found out, that the physics engine in Freelancer worked pretty close to Newtonian physics; however, the motion patterns given in the vanilla game were ridiculously unrealistic. It is not science fiction or a question of imagination, that a human being would not survive accelerations of multiple dozen G’s, and even if there was a space suit that would compensate the force through pressure, the pressure would be too high for the pilot to survive.
Besides, the values we found for mass, where some fighters have a mass of 150kg, are, too, ridiculously low.
So what I did was researching on the Newtonian physics for linear and angular motion, estimating how many G’s there are imaginable on what ship class, and what masses are realistic to fighters and freighters and other ship types. After that I used the formulae I found and unsurprisingly I could end up with motion patterns still fast enough to provide a good gameplay and fun combat full of action, but on the other hand such, that the player would experience the forces and the mass and power of the object he is flying, more realistic than the trial-and-error results so far used on the major mods (where mostly these were used to support capship controls). Just like the player, the NPC, too, has to fight the inertia and to handle the ship appropriately to keep out of fire (the NPC’s aren’t actually weaker through the disadvantage, they handle it just as good as they flied before) and the player capship captains will have to rely almost entirely on their firepower for they are not combat capable.Now, unlike the way some of us did before, I will not just give the values I think are ideal for each kind of ship. What I have to offer you is a Pascal based application, that gives you realistic motion values for any ship and what it needs are the positive offsets of the concerned point from the Y and the Z center, the multiplier of G accelerations you want for your ship, the mass you give it and the maximum speeds you want it to achieve.
E.g. with the vanilla fighters masses ranging around 10 tons and accelerations from 8 to 10 G I get values similar to modern ace maneuverability but not slow enough for the game to get boring.Also, I experienced that for freighters the equipmass plugin by Adoxa works perfectly without mass alterations of equipment and cargo units, if the ship masses are based on real world transports.
Please, use this wisely
Gisteron
edit: BTW, a realistic mass is relevant for the equipmass plugin. You would get realistic motion values with an unrealistic mass, too, if the G-Force setting is realistic. However, if you have a surreal G-Force value, the mass won’t make your motions better either.
edit: Tool updated!
- For both, inputs and output floats the Wizard now uses the ‘dot’ character as decimal separator.
- The G-Force (G-acceleration) entry now is a float for both linear and angular calculations, not an integer.
- Documentation added.
- Code redesigned to be more ordered and smooth.
- Wrong acceleration interpretation for torque calculations fixed.
-
it doesn’t really depend on their size but on the rate you want them to accelerate and decelerate (G-Force = 9.81m/s² as hardcoded into this application). since motion on a curved path is also an accelerated motion, the G-Force setting also applies to how fast your ship can turn (depending ofc on the radius of the point concerned).
so, yes, you can make them as fast as you wish and if you chose the right settings it works out pretty well. in some cases in vanilla you may have more than 1000G, which is destructive even to the ship itself, no matter what its made of.
when i worked this out i actually used an excel table. it just contained many other formulae and data i used and i was too lazy to assemble a new one that’d do only this job and do it right. besides, i was concerned about whether the german operators would work in american office versions. a “computer language” solution always does -
Good work, Gisteron.
-
Erm… Why are you using 9.81m/s^2 when that’s only valid when in close proximity to the Earth’s surface?
The real gravitational constant is G = 6.67e-11 m^3 kg^-1 s^-2 used in the formula F=Gm1m2/r^2. Using the approximation F=mg is really poor when you’re trying to simulate space ships.
-
Any force F = m*a and while I could have asked for the absolute acceleration with 1 being 1m/s², my software asks for the same but using the unit 9.81m/s² for on stats sheets for combat aircraft and the like they usually give the acceleration capacity in multiples of this value.
Mathematically there is no difference, physically neither, though physically using the SI unit 1m/s² for acceleration would have made more sense.
Anyway, simulating space ships there is only one reason to count in any gravitation and that would be if we could simulate any in FL. As long as we cannot, G is not earth gravitation but a unit of acceleration.No more comment on this in particular. It gives good results and that’s what it is about. It could be criticized this far more, for instance stating that indeed a more correct conventional standard value is 9.80665m/s². That’s not what it is made for
-
Could you make a tutorial? Cause it’s a little bit foggy.
Edit : Sorry I din’t say please… So please.
-
Thank you it surely will help us.
-
Good philosophy, hat off, and tons of applause! Really well said!
-
There is one idea I had, that included a code I am not familiar with. Precisely what I think of, is the option to load the compound file to be checked for the absolute HpPilot position (i.e. checking its coordinates and, if required, the offset of the part it is attached to). Optional this should stay, because if it isn’t every ship would have to have a HpPilot and that’s waste of all those modders’ time, who don’t want pilot models to be sitting in their battleship bridges.
Is anyone out there familiar to the compound configuration readout algorithms who would like to help me with this?
-
Gisteron wrote:
Hm, I maybe should make it integrate the values directly to freelancer ini files… JONG, please, throw me a PM with questions you have - I can’t spot what might be missing in the readme, maybe I could help you better in interaction.Oh, I don’t know how to input the values to get I want.
Ex:
My ships mass is 400, and I don’t know how to input those values to get my ships values.
Sorry for my poor English.
-
On a side note, stress testing the program myself (basically using it for very much its purpose, but extensively), I found a few bugs easy to play around but which definately must and will be fixed when i figure a new formula for angular motions. Please keep them in mind so far:
1 - The input of mass is interpreted as an integer, so any float values will give an error message.
2 - The angular values output field gives a spelling error that doesn’t quite crash freelancer or even cause a message in the FLSpew, but does affect motion unless corrected: It says “rotation_intertia” instead of “rotation_inertia”.
3 - For some reason in the list of functions under the linear calculation button I inattentively put also one requesting values from angular calculations. Since however the linear values are not affected by angular calculation, the float values in the cockpit offsets and calculation of angular values is merely a formality that by the version uploaded here must be done prior to linear calculations.
4 - Apparently the formula I have been working with for angular motions is imperfect. It takes into account linear accelerations during angular motion or rather motion around a different point. With slow accelerations and high cockpit radii (as on larger ships) the issue is insignificant; however the closer the cockpit gets to the pivot point the more the ship becomes immaneurverable which makes the values more or less useless. Technically there is a div by 0 error when the cockpit has a 0 radius for some axis.A new build including all the bug fixes will be available once i have combined and implemented a solution to problem #4. If anyone wishes to help me understanding the forces during rotation, their relation to newtonian linear physics and most importantly forces affecting a pilot in angular motion, you are certainly welcome to. Also, I am open to suggestions for additional features to be added in the next version.