Important Message

You are browsing the archived Lancers Reactor forums. You cannot register or login.
The content may be outdated and links may not be functional.


To get the latest in Freelancer news, mods, modding and downloads, go to
The-Starport

Big ships spinning and bouncing on collisions

The general place to discuss MOD''ing Freelancer!

Post Tue Aug 21, 2007 2:58 pm

Big ships spinning and bouncing on collisions

Hi pals.

Can anyone please assist me to solve this problem of very large ships with mass over 1,000,000 bouncing around and spinning when hit by a small fighter with mass of 50 - 200??

I saw a couple of topics in this forum on the same subject but none gave conclusions or clear solutions?

I've tried many many mass combinations, and torque / inertia / drag combinations without success.

I also changed the x, y & z inertia in the .sur files - still no change to handling.

What effect should increasing or decreasing these inertias in the .sur file have?

I also noticed the standard ones are not in line with the ship's mass, many are set to 1.412 - ?

It's very possible I missed something because I made so many test changes, but didnt notice a big difference - maybe because of the number of hours I put into this problem, burning the midnight oil is not being mentally sharp!

Many thanks in advance.

Roleplay: - the art of self-deceipt!

Edited by - StarTrader on 8/21/2007 4:02:05 PM

Post Tue Aug 21, 2007 5:14 pm

The capships work well on the 24/7 FREELANCER UNIVERSE server. You could download our mod from the website at www.freelancer-universe.com and try using its values.

Robo

Post Tue Aug 21, 2007 6:24 pm

Thanks Robo, but that would be piracy wouldn't it? lol

Unless you wrote it and you are giving me permission to do that?

If I can get some pointers to what settings to use for one ship, e.g. a liberty-dreadnought-sized ship, then I can modify that to suit the handling I want for the other larger ships I have.

But as I have tried and failed it may be more complex than just shiparch.ini settings?

Thanks again.

Roleplay: - the art of self-deceipt!

Post Wed Aug 22, 2007 4:19 am

Try this on your Battleships

steering_torque = 420000000000, 420000000000, 420000000000
angular_drag = 5000000000000, 5000000000000, 5000000000000
rotation_inertia = 45000000000, 45000000000, 45000000000

This on your Cruisers

steering_torque = 60000000.000000, 60000000.000000, 60000000.000000
angular_drag = 120000000.000000, 120000000.000000, 120000000.000000
rotation_inertia = 16800000.000000, 16800000.000000, 16800000.000000

and this on the Gunboats

steering_torque = 600000.000000, 600000.000000, 600000.000000
angular_drag = 1200000.000000, 1200000.000000, 1200000.000000
rotation_inertia = 168000.000000, 168000.000000, 168000.000000

Let me know who they work for you.

Edited by - FlyByU on 8/22/2007 5:20:07 AM

Post Wed Aug 22, 2007 7:14 am

Another way is just to stick this string into it

phantom_physics = true

but as we all know this makes it go through stuff, which means the sur file of the ship is completely ignored as if it was deleted, however this sur file will still have the feature of the ship taking damage. Therefore this means that nothing will collide or make physical contact with the ship and go through it like a ghost, except for live, active weapon ammunition. So weapons fire will contact the ship and the ship will take damage although objects and ships can go through it.

Phantom_physics in case nobody has found it anywhere is used on jumpholes. Jumpholes have these strings

I did this for a while then I thought it was really unrealistic and brought down the fun of the game for me.

I will try your values flybyu and see what comes out.

Happy modding guys and to everybody !!!!

I hope the outcome is positive and in your favour startrader! Thanks for all your help in my creation of the tutorial





Edited by - futuristic m1 on 8/22/2007 8:14:41 AM

Edited by - futuristic m1 on 8/22/2007 8:18:00 AM

Post Wed Aug 22, 2007 7:38 am

Many thanks guys. You're welcome, Futuristic, good work. Hope they fixed the link though?

Flybyu - Settings - The dreadnought was better when colliding, in that it didn't spin around like crazy like before. But it shot off away from the other ship at about 800 m/s!!

The cruiser settings were better but got spin on collisions. It also gave me a couple of FL Server crashes when I was testing in asteroids.

The gunboat settings seemed to be the best, minimal spin and no shooting off at high speeds.

The spinning is to do with the inertia setting being too high, but it seems that if it's too low the ship is more stable but jitters when using Goto, the autopilot can't stabilise the ship to aim it at the destination.

Shooting off is to do with the drag I think. So it's a balance between all of them. I went through Argh's Freelancer Physics but no real conclusion of my own as yet.

Still working on it, I'll update more when I have some results.

Edited by - StarTrader on 8/22/2007 9:08:15 AM

Edited by - StarTrader on 8/22/2007 9:10:06 AM

Post Wed Aug 22, 2007 12:41 pm

Well, I don't know if it would be piracy or not. I know I and my team wrote most of the mod but to be honest a huge amount of the learning process involved gleaning information from here. There are sections in the mod that have been incorporated from other's work but credit is given in the readme.txt file where we have done so.

Is this not appropriate?

Robo

Post Wed Aug 22, 2007 2:41 pm

Many thanks Robocop, I appreciate it.

I've now been caught by the bug to sort this problem out so that I can understand it, and once I have it pegged better I'll write up my findings here too.

If I give up I'll take a look at yours too.

All the best.

Post Fri Aug 24, 2007 12:08 pm

I used to use phantom_physics on my NPCs (they have slightly different ships than player-ships for equipment-drop fuses), which worked great (and NPCs don't normally collide with objects anyways) - until I realized no form of ordinance (mines, missiles, torpedoes, etc.) could ever hit the ship, so it had to be tossed.

However, I bring this up because I thought of the possibility of editing some of the DLLs to trick FLServer into thinking that the missile, mine, etc. collision types are the same collision types as lasers, which should accomplish the task of ordinance hitting the phantom'd ship the same way lasers do.

This won't solve the problem of players spinning large ships, but you can design your ships in a way so that little players are plowed around by large players like they should be (add lots and lots of 0s onto your force and drag for steering and engine for the large ships). The problem with NPCs is that no matter what, they always get right-of-way from FLServer, which is why I think they'd need some sort of phantom_physics solution.

Post Sat Aug 25, 2007 4:31 am

i would post my own #'s but last time i did so the ingrates asking for help never got back to me about whether it worked for them (yeah right, i know it did - they just had their mouthes stuffed to the brim with crow) and I'm not interested in repeating myself here

it is entirely possible to make capships that behave in a rock solid manner, however to get a complete fix you need to treat the fighters too - they have a rather ridiculous amount of force at the engine for such small ships

one immediate fix for asteroid bouncing, nothing else for you:
constants.ini
{PhySysConsts}
DEFAULT_ANGULAR_DAMPING = 15, 15, 15
DEFAULT_LINEAR_DAMPING = 10
MIN_TIME_BETWEEN_COLLISIONS = 0.250000 <-don't 'freak out' in asteroid fields
MATERIAL_ELASTICITY = 0.150000 <-less bounce
MATERIAL_FRICTION = 0.600000 <-friction eats inertia
ANOM_LIMITS_MAX_ANGULAR_VELOCITY_PER_PSI = 100

Post Wed Sep 05, 2007 1:21 pm

Many thanks as always cold_void.

I haven't tried your method yet, but I will, at the moment lack of time prevails.

I had to repeat other peoples' good work just so I could understand the relationships better, so sorry for not using yours, please don't be offended. Here are my own findings, with some easy definite formulae for those that prefer them...

The original Rotational_Inertia value was too high. It MUST be 10%-20% of the angular_drag to work correctly. If it's less than 10% (even at 8%!!) the ship will oscillate when trying to GOTO a target destination (such as a distant jumphole or station). If it s too hight then the ship shoots off at high speed when its hit by another even much smaller ship.

The angular_drag must also be higher per mass unit for the bigger ships than for smaller ones or else impacts will still send the big ships bouncing away as if they were little fighters.

With a lot of time spent in trials, I worked out some "drag/mass coefficients" of my own for this:-
<pre><font size=1 face=Courier>
Mass: 1-199 200-299 300-399 400-529 530-899 900-1,999 2,000-4,999 5,000-9,999
Coeff: 200 320 500 800 220,000 110,000 55,000 1,800,000

Mass: 10,000-14,999 15,000-24,999 25,000-49,999 50,000-199,999 200,000+
Coeff: 1,100,000 800,000 500,000 300,000 200,000
</font></pre>
There are some anomalies in my coefficients as you can see, this is because I wanted to leave the vanilla ships' ratios as they were designed. They are all stable with these coefficients anyhow.

For the ship's handling, the Steering_Torque divided by the Angular_Drag gives us the angular velocity of the ship (i.e. how many radians it can turn per second).

So - this work gave me some easy-to-use formulae that I was able to put into Excel, to compute stable values for all of my ships, using the ship's total mass (hull mass plus cargo capacity), as follows:-

Let's use one of my ships whose mass is 529 (hence my coefficient boundary is at 530 above, I wanted it to be in the lower mass/drag category!)...

1. Set angular_drag = total ship mass x drag/mass coefficent :-

529 x 800, rounded to the nearest 1,000 = 423000

2. The angular inertia is kinetic energy that makes the ship want to continue in its direction of motion, and it works against the drag that tries to stop that motion - for good behaviour it should be maximum 20% of angular_drag, so:-

rotational_inertia = drag x 0.2 = 85000 (rounded to nearest 1,000 again)

3. Your Steering torque should be enough to turn your ship at the rate you want, so for easy numbers let's say we want this ship to turn at a rate of 115 degrees per second, this is about 2 radians, so torque must be 2 x the drag:-

Steering_torque = 2 x drag = 846000 (again rounded to nearest 1,000)

OK so far in theory, but in practice this was a too-simple model, and I had some discrepancies in how some of the fighters rotated in flight - some were very sluggish.

So again trying to keep the model as simple as possible, for ships weighing less than 600 total mass, I used 2 x the X and Y values for the Z (roll) axis steering torque, and 1.8 x the X and Y values for the Z drag.

Here are the final figures then for this ultra-heavy "fighter" weighing in at 529 "tons":-
<pre><font size=1 face=Courier>
steering_torque = 296000, 296000, 592000
angular_drag = 423000, 423000, 762000
rotational_inertia = 85000, 85000, 152000
</font></pre>
EDIT - SORRY! WRONG VALUES ABOVE! That is for a turn rate of 0.7 radians/second. OK for a gunboat. Thanks Strail
Here are the correct ones for this example, turn rate of 2 radians / sec.
<pre><font size=1 face=Courier>
steering_torque =846000, 846000, 1693000
angular_drag = 423000, 423000, 762000
rotational_inertia = 85000, 85000, 152000
</font></pre>
All of my ships now work well using these formulae, from my lightest ship, the "A-Wing" at 115 "tons", up to my Borg Cube weighing in at 2,500,000 "tons".

Many thanks to everyone, your input was not ignored but very much appreciated.

Roleplay: - the art of self-deceipt!

Edited by - StarTrader on 9/5/2007 3:05:30 PM - thanks Strail.

Edited by - StarTrader on 9/10/2007 3:01:57 AM

Post Mon Sep 10, 2007 2:14 am

Shucks!! Must have been tired. Just for clarity then...

Once we have a certain ship size / total mass, the drag and inertia will be the same for any number of different ships with the same mass.

We can then change the ship handling by increasing or decreasing the Steering Torque only. This ratio of steering / drag is the turning rate (angular velocity) and is in radians per second. As above, 1 radian = 57 degrees approx.

So here again is our example for a ship of 529 mass and desired turn rate of 2 radians (115 degrees) per second:-
<pre><font size=1 face=Courier>
steering_torque =846000, 846000, 1693000
angular_drag = 423000, 423000, 762000
rotational_inertia = 85000, 85000, 152000
</font></pre>
And if we want 0.7 radians (40 degrees) per second:-
<pre><font size=1 face=Courier>
steering_torque = 296000, 296000, 592000
angular_drag = 423000, 423000, 762000
rotational_inertia = 85000, 85000, 152000
</font></pre>
So it's now clearer that all you need to change to change a ship's handling, is its steering torque. Steering_torque = (desired radians/sec) * (angular_drag).

And for small ships (I use less than 600 total mass) I needed to set my Z values as follows:-
<pre><font size=1 face=Courier>
steering_torque = (radians per sec) / (angular_drag), (radians per sec) / (angular_drag), 2 * (radians per sec / angular_drag)
angular_drag = mass * (mass:drag coefficient), mass * (mass:drag coefficient), 1.8 * mass * (mass:drag coefficient)
rotational_inertia = 0.2 * (x) angular_drag, 0.2 * (y) angular_drag, 0.2 * (z) angular_drag
</font></pre>
Sorry for the mistake(s) - another one corrected, now looks sound.

Let me know if you find differently, I am still interested.

Edited by - StarTrader on 9/11/2007 11:58:21 AM

Post Mon Sep 10, 2007 5:02 am

wow! Thanks for figuring it out, I always kinda played with the torque values since I didnt know the exact relations between the numbers

Post Mon Sep 10, 2007 5:12 am

Nice work!

Post Thu Sep 20, 2007 9:19 am

Moderators: Is this topic worth stickying in your views, as it provides a reasonable solution?

Thanks either way.

Roleplay: - the art of self-deceipt!

Return to Freelancer General Editing Forum