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

Large ships - several questions

The general place to discuss MOD''ing Freelancer!

Post Thu Dec 07, 2006 12:14 pm

Large ships - several questions

First of all, turret view...

I'm looking at the cockpit settings for my capship but I don't understand what they mean.

Right now when I go to turret view it looks as though I'm sitting inside the ship with the hardware of the ship all around me. I'd like to get a more normal view of the outside when in turret view. What should I be doing?

Second, Ctrl-V mode...

When I'm in normal view I can fly the ship just fine. The problem is that the ship is so large it takes up a good chunk of the screen. Yet when I go to Ctrl-V mode to get rid of my own ship in front of me I have no control. When I maneuver nothing happens. No Solars shift and there's no direction indicator on mouse movement. What's missing there?

Third, forward firing guns on gunboats, cruisers, and destroyers.

These guns fire forward even if your aiming reticule is not in that direction. If you go to turret view and fire aft the forward gun still fires forward. How do you make it so that it only fires when it's bearing on the target?

Fourth, ship mass?

It seems like the smallest things in space as well as missiles seem to have a huge impact on my ship. A Liberty Police Patriot can fire a Slingshot at me and my ship gets knocked off course. Same with bumping into the movable debris in space. What's the best way to reduce that phenomenon?

Thanks for your input.

Robo

Ogu

Post Thu Dec 07, 2006 3:50 pm

1/2. There are camera settings for each ship. You can choose where the camera sits behind the ship when you're flying in third person, and if you hit CTRL-V there is another camera mean't for looking backwards. I think the values are just regular spacial x,y,z coords. I don't remember where they are right off.

3. In weapon_equip.ini, change "force_gun_ori = true" to "force_gun_ori = false". Then you can move it around like a normal gun.

4. I think you need to increase the mass on your ship. There should be a few fixes for larger ships (to stop battleship spinning) - talk to Dev about that. I'm pretty sure he's aced it for his mod.

Post Thu Dec 07, 2006 4:07 pm

With the forward gun, I just want it to fire forward at the target directly in front of it. I only want it to fire when the target is directly ahead of the ship and the aim point is on it. Do you think changing that value will do that or will the forward gun (which should be a stationary gun) start shooting off at angles?

With the cockpit view...

This is my cockpit for the dreadnought

[Cockpit
mesh = cockpits\bretonia\models\br_freighter_cockpit.cmp
int_brightness = 0.250000
head_turn = 30, 10

[CockpitCamera

[TurretCamera
tether = 0.000000, 20.000000, 200.000000
yaw_rotate_speed = 2.000000
pitch_rotate_speed = 1.500000
accel_speed = 5

[RearViewCamera
view_position = 0.000000, 80.000000, 420.000000

When in normal view (ship flying in front of you), everything is fine.
When in turret view you're surrounded by your own ship. turret view works fine, just looking at the insides of your ship and the backsides of your turrets can be distracting and it just doesn't look right.
When in Ctrl-V view (you're looking out your own front window instead of following your ship) nothing happens. You're still in motion but you have no control and you can't tell that you're in motion unless you switch to turret view.

I don't see any missing entries in the file.

Which mod is Dev's mod? I seem to remember an addon to FL mod that added most of the big ships but also added two versions of the Battlestar (Battlestar Galactica et. al.). I think turrets worked fine in that one. Anyone remember which mod that was?

Edited by - robocop on 12/7/2006 4:20:28 PM

Dev

Post Thu Dec 07, 2006 4:46 pm

"Which mod is Dev's mod?"

SHAMELESS PLUG

1/2:
For starters, make sure your ship has a hardpoint named HpCockpit (usually you will want to place it where the ship's cockpit is, though you don't have to). If you don't have this hardpoint, when you switch to cockpit view (ctrl+v) the game will freak out and the camera get screwed up, as you have observed. Also note that the cockpit offset that you set in shiparch.ini is based on the position of HpCockpit, not the center of the ship. For the uninformed, the camera offset in the ship's definition looks like this:
camera_offset = 70, 320
The first value is the Y offset (+ up/- down) and the second is the Z offset (+ back/- forward).

The cockpit file is also specified in shiparch.ini, by a line such as this:
cockpit = cockpits\liberty\l_freighter.ini
I'm pretty sure the game will crash if you don't have a valid cockpit file specified for every ship. Here's a look at a cockpit file:

[Cockpit
mesh = cockpits\civilian\models\cv_cockpit.cmp
int_brightness = 0.500000
head_turn = 30, 5

[CockpitCamera

[RearViewCamera
view_position = 0, 20, 400

[TurretCamera
tether = 0, 0, 450
yaw_rotate_speed = 3
pitch_rotate_speed = 3
accel_speed = 5


The important ones:
mesh = model. This is the model you see when you switch to cockpit view. The normal model of your ship will disappear, though visual effects and (possibly, don't remember) mounted equipment will still be visible.

view_position = X, Y, Z. If you go to rear-view mode (I think it's v by default), this is where the camera gets placed relative to the center of your ship.

tether = X, Y, Z. This is where the turret camera gets placed when you switch to turret view. If X and Y are 0, the center of rotation will be the ship's center, with Z specifying how far away from the center the camera is. Nonzero X and Y values will move the center of rotation away from the ship's center, if you want that.

yaw_rotate_speed = how fast the camera can rotate horizontally

pitch_rotate_speed = how fast the camera can rotate vertically

accel_speed = how fast the camera rotations accelerate; use a higher value for greater responsiveness.


3:
If you look in weapon_equip.ini, you will find that the weapons that exhibit this behavior have force_gun_ori = true. This means that the gun will always fire directly where it is pointing regardless of where your mouse pointer is (however, a rotating weapon will still try to aim where you are pointing). Setting this to false will make the gun fire only when the mouse pointer is within the cone of fire of the barrel (this is set in constants.ini, MUZZLE_CONE_ANGLE; it's in degrees).


4:
Freelancer doesn't handle collisions with large objects very elegantly. Increasing the mass of your ship can reduce how badly your ship gets thrown when it hits a lighter ship (usually it causes the smaller ship to take more damage as well); increasing the rotational inertia will make it more difficult for a torque imparted by a collision to rotate your ship. However, collision detection cannot run continuously; everything has to happen periodically, maybe 10 or 20 times a second (I honestly have no idea how often Freelancer does it, and I suspect that you might be able to adjust this rate). So, what I suspect happens with larger ships is that an incoming object gets deep inside the surface of your ship, making the registered collision force very large. Because the ship is large, the distance from the center of mass to the point of impact is also large. This results in an enormous torque that spins your ship far more than it should. However, that's just a guess, I don't know for sure one way or the other.

The guaranteed hack to cut down on ship spin is the following. In constants.ini, you can add this constant under [PhySysConsts:
ANOM_LIMITS_MAX_ANGULAR_VELOCITY_PER_PSI = (value)
This is an absolute cap on how fast anything in the game can rotate. So, all you have to do is set this value just above how fast your ship can rotate naturally and you're set. Sure, you'll still get dinked a bit when something hits you, but it's nothing that you can't match with your ship's rotational thrusters.

But wait! What about all the OTHER ships? Won't they be affected to? The answer is that yes they will... in single player. If you are playing on a server that does not have this value set, then all NPCs, missiles, etc will not be subject to the angular velocity cap, just you and you alone. This also means that different players can use different values, corresponding to what ships they are flying.

However, what value to set this constant to is not obvious. Experimentally I have found that the value should approximately equal max_turn_rate * 0.001/0.045, where max_turn_rate is in radians. For those not familiar with Freelancer ship physics, the max turn rate exactly equals (steering_torque / angular_drag).

For example, the default liberty dreadnought turns at ~0.114 radians/second max, so if you were flying one you would set ANOM_LIMITS_MAX_ANGULAR_VELOCITY_PER_PSI to about 0.0025. If you find that your natural turn rate was a bit impaired you could try 0.0026 or 0.0027; 0.003 should be more than high enough.

Edited by - Dev on 12/7/2006 4:47:20 PM

Post Thu Dec 07, 2006 5:19 pm

Wow

Thanks for the post Dev. Looks like I have something to work with now.

I'm guessing that if I change the muzzle_cone_angle it will affect everyone's guns, not just the cruiser forward gun...

Edited by - robocop on 12/7/2006 5:21:47 PM

Dev

Post Thu Dec 07, 2006 5:39 pm

Yes, it's a global effect.

Post Fri Dec 08, 2006 1:30 pm

On larger capital class ships, the mass of the Liberty Dreadnought and the Reinland Battleship will handle just about any collisions with smaller objects.
Trick is, you have to use the engines that go with their particular ship mass.
Here is what I use with the Hammer_pb3 and 3 Reinland Battleship engines.

mass = 100000.000000
linear_drag = 1.000000
steering_torque = 1501900032.000000, 1501900032.000000, 1501900032.000000
angular_drag = 13200000000.000000, 13200000000.000000, 13200000000.000000
rotation_inertia = 15000000512.000000, 15000000512.000000, 15000000512.000000
nudge_force = 3000000.000000
strafe_force = 160000

It's steady as a rock and the only things that can effectively move it are ships of equal or greater mass.

Edited by - Rankor on 12/8/2006 1:33:16 PM

Post Sat Dec 09, 2006 7:26 am

So, I could use that on all of the battleships? (dreadnought, bretonia, kusari, rheinland, osiris)

What about the cruiser/destroyer class ships?

(liberty cruiser, bretonia destroyer, kusari destroyer, rheinland cruiser, prison liner, luxury liner)

I presume gunboats would just be step down from the cruiser/destroyers.

Post Sat Dec 09, 2006 8:09 am

I tested this out on the Osiris mod, and it made a huge difference how the ship handled. Like night and day. I'd say with a confident YES that you can use those stats on large capital ships.

Regarding the mass of cruisers;
since they are smaller capital ships, they have smaller masses and the engines that go with them. The Reinland Cruiser seems to have the best handling characteristics for this and I've used it on that type.
For my Nautilus_S1, it has the mass of a Reinland Cruiser and it mounts the Reinland Cruiser Engines. It too is rock solid against smaller impacts, but tends to give a little when coming against larger masses like battleships. That's physics. Smaller ships that are in cruise when they collide with it tend to bounce off, but the result is a little "nudge" and not an out of control spin.

Take a look at your ships\ini files and look for the related masses that go with them. It's useful information.
In a kind of reality, you can't have a capital ship manuver like a fighter and expect it to remain rock solid. I've seen this mistake happen alot in modding.

You're right about the gunboats. For them, I lean toward the Reinland Gunboat engine and ship mass. It gives a top sub-cruise speed of about 120 and allows it to transverse debris/ateroid field in relative ease.

Edited by - Rankor on 12/9/2006 8:16:52 AM

Post Sat Dec 09, 2006 12:31 pm

I just noticed that those stats were for a battleship and 3 rheinland BS engines. Do they change if you're using only one?

One other thing. The only performance information in the engines file is the

volume = 400.000000
mass = 10
max_force = 3000000
linear_drag = 100000
reverse_fraction = 0.100000

section, correct?

Edited by - robocop on 12/9/2006 12:36:10 PM

Dev

Post Sat Dec 09, 2006 2:30 pm

"On larger capital class ships, the mass of the Liberty Dreadnought and the Reinland Battleship will handle just about any collisions with smaller objects.
Trick is, you have to use the engines that go with their particular ship mass."
etc.

Out of curiosity I tried this out on some capital-sized ships. Sadly, there was no observable difference in collision behavior; little fighters could still spin the ships like nobody's business. This actually is not terribly surprising; if you remember back to the early mods that made capital ships flyable without doing any extra tinkering, fighters could spin battleships then, too. If you have battleships that don't spin ever, there has to be something more going on.

Anyway, while toying with the above approach, I remembered another way to cut down on ship spin that was presented a while back. It's really simple; you increase angular acceleration so that even if you get a strong push from a collision you will quickly come to a stop. However, it has the side effect of... well... increasing angular acceleration. Depending on how picky you are about how your capships handle, you might not want that.

Increasing the acceleration is accomplished by dropping rotation_inertia. Well, more specifically, you increase acceleration by increasing the ratio of torque to inertia. However, increasing torque will also increase the torque to drag ratio, increasing the ship's max angular velocity. So really, if you just want to increase angular acceleration and not velocity, you want to increase the ratio of drag to inertia without touching torque; thus you just drop the inertia. Also, a word of caution: if you increase the ratio of drag to inertia beyond approximately 20:1, the physics engine will probably start screwing up and your ship will turn faster than it should.

Anyway, give that a shot and see if you like it. If it still doesn't work out, ANOM_LIMITS_MAX_ANGULAR_VELOCITY_PER_PSI is a reliable fallback.

Post Sat Dec 09, 2006 3:15 pm

from Arghs XML toolkit:

;/////////////////////////////////////////////////// ESSENTIAL GAME-BALANCE STATS
;/Please note that fighters and other low-mass craft do NOT need so many zeros.
;/I have put 5 zeroes (00000) after *every* turning variable in this section for this ship
;/because the Rheinland Cruiser is big and heavy, and we do *not* want it to spin when it hits
;/something much lighter than itself! Read Ship_Stat_Changes.txt for more about this stuff.
;///////////////////////////////////////////////////
linear_drag = 1
mass = 1000
hold_size = 100
steering_torque = 610000000, 610000000, 610000000
angular_drag = 1000000000, 1000000000, 1000000000
rotation_inertia = 100000000, 100000000, 100000000
nanobot_limit = 999
shield_battery_limit = 999
hit_pts = 50000
nudge_force = 150000
strafe_force = 50000
strafe_power_usage = 2

->these are the critical ones
angular_drag = 1000000000, 1000000000, 1000000000
rotation_inertia = 100000000, 100000000, 100000000

as you can see, drag is 10x greater than inertia- rotational inertia is a capital ships (as well as the server's) worst enemy - keep fighter mass, drag, and force very low compared to capships. here's my stat for the rheinland battleship, with an insane drag-to-inertia ratio which seems to be increasingly necessary as you bump up the mass to ludicrous level.

>my rh bs:
linear_drag = 0
mass = 35000
hold_size = 750
nanobot_limit = 0
shield_battery_limit = 15
max_bank_angle = 5
;///////////////////////////////////////////
steering_torque = 420000000000, 420000000000, 420000000000
angular_drag = 5000000000000, 5000000000000, 5000000000000
rotation_inertia = 45000000000, 45000000000, 45000000000
nudge_force = 30000000
strafe_force = 1500000
strafe_power_usage = 200

my stats are very very solid(and bumping material friction up/elasticity down may be helping a lot) - i can plow right into an asteroid field and when i hit a rock i just stop, no insane spinning out of control lol.

we miss ya Argh, wherever you are

Post Sat Dec 09, 2006 4:21 pm

@ Dev,
There could be something else going on then that perhaps I'm not aware of or perhaps something I've done that I forgotten about.
I noticed the profound change in this when fighters and transports collided with the Hammer_pb3. They simply bounced off or were deflected by the collision and this ship just plain did not move. (if it did move, it must have been imperceptable to me)

@ Robocop,
I just used the 3 Reinland battleship engines for "visual" accuracy since the ship has three exhaust ports. I don't think it makes much difference there since the Ship Scripter adds the stats relating to one engine only. I did however change the engine "volume" of the all the capital ships to "0" since that was taking up cargo space and causing erroneous cargo readings for me. (I also changed the volume of the Infinate power supply to 0 )
I have a little "smuggler class" cargo vessel where I had to use 7 reinland gunboat engine (hardpoints) to provide the necessary viusal effects. Still, even with 7 "engines"...it still handles as though it had only one engine mounted.




Edited by - Rankor on 12/9/2006 4:40:21 PM

Post Sat Dec 09, 2006 5:28 pm

what about trying this, making 7 differenet engines, putting each one on, and keeping all the cruise valuse the same? would this not have the same eeffect as having 2 thrusters mounted? double the speed?

Cheese On Toast:
Like the name
Beware the player

Dev

Post Sat Dec 09, 2006 6:25 pm

The trouble with mounting multiple engines (not adding more engine hardpoints, which is purely visual, but adding actual pieces of equipment) is that the game only partially supports them. You will get the thrust (and drag?) from both engines when flying normally, but when you engine kill you will lose all engine drag and also the thrust from your first engine... but not from your others. So, if you have only a small amount of drag on your ship hull (which is common in Freelancer), hitting engine kill will cause your ship to drastically accelerate. I seem to recall there being some other problem with multiple engines, though what exactly I don't remember offhand.

Return to Freelancer General Editing Forum