Hard Light Productions Forums

Modding, Mission Design, and Coding => The Modding Workshop => Topic started by: IceFire on May 17, 2002, 09:47:51 am

Title: POF Mass Errors
Post by: IceFire on May 17, 2002, 09:47:51 am
Ok....I've been noticing this for a while and its really starting to bother me because its actually a pretty big deal (even when it seems so small).

Part of the balance of FreeSpace 2 ships is in their mass value.  In my tests with new MOD ships (the GTF Banshee, BWO fighters, and so on and so forth) the mass values, although set to their FS2 equivalents....are not what they should be.

The Banshee and the Perseus, both interceptors, both set at the same mass value.  The Perseus takes a beam hit and gets knocked around (safely away from the center of the beam).  The Banshee takes the hit and keeps on going like nothing happened.

The calculations do work somewhat because I made the Banshee have a mass value of 5 and it works....because I was being tossed about like there was no tommorow.

Whats the cause?  How do we fix it?
Title: POF Mass Errors
Post by: Unknown Target on May 17, 2002, 01:49:33 pm
I think there's about 2 other factors that influence that.
Anyways, I special in .tbls, so I'll check when I get home...
Title: Re: POF Mass Errors
Post by: aldo_14 on May 17, 2002, 03:40:32 pm
Quote
Originally posted by IceFire
Ok....I've been noticing this for a while and its really starting to bother me because its actually a pretty big deal (even when it seems so small).

Part of the balance of FreeSpace 2 ships is in their mass value.  In my tests with new MOD ships (the GTF Banshee, BWO fighters, and so on and so forth) the mass values, although set to their FS2 equivalents....are not what they should be.

The Banshee and the Perseus, both interceptors, both set at the same mass value.  The Perseus takes a beam hit and gets knocked around (safely away from the center of the beam).  The Banshee takes the hit and keeps on going like nothing happened.

The calculations do work somewhat because I made the Banshee have a mass value of 5 and it works....because I was being tossed about like there was no tommorow.

Whats the cause?  How do we fix it?


Confuses me, too..... PCs autogenerates comparatively huge masses - so possibly mass is not a relative calculation (I'm assumijng PCs uses some functiopn to calculate mass)

The other thing is that big ships - no matter how large - tend to wobble like hell under heavy beam fire.  

Granted, it's not massively realistic, but I want my capships to sit still when hit.........  even realy high masses don't seem to work too well.

Oh, did you try the banshee with the Perseus tbl entry?  (to check it's not a convetor thingie)
Title: POF Mass Errors
Post by: IceFire on May 17, 2002, 05:11:11 pm
The changes in the table entry are so minor its not really worth testing.  I can anyways to be sure.

I'm pretty experience in tables myself so unless theres something im missing in like 8 different instances, this isn't a table problem.

My capital ships wobble too....infact a reconverted special Orion gets wopped around by Morningstars from a wing of Perseus fighters.  Thats not right either.  This is a fairly major problem.
Title: POF Mass Errors
Post by: Nico on May 17, 2002, 05:20:18 pm
PCS calculates mass according to the bounding box, and is very dodgy, you end uf with huge masses, which can coz very annoying bugs ( fly through, invisible walls on capships ). can be fixed easily.
Title: POF Mass Errors
Post by: CP5670 on May 17, 2002, 07:26:02 pm
I don't know a lot about the way POFs work, but Modelview has an editor for the mass, center of mass and moment of inertia, which are probably usable for fixing models with extreme values.
Title: POF Mass Errors
Post by: an0n on May 17, 2002, 07:32:47 pm
Yeah, there's an interia setting somewhere.
Title: POF Mass Errors
Post by: IceFire on May 18, 2002, 08:27:56 am
Ahh....center of mass.  That may be the key....
Title: POF Mass Errors
Post by: IceFire on May 18, 2002, 08:38:14 am
...and not the key.

Whats moment of inertia?  All of the user models I have don't have any values in there....
Title: POF Mass Errors
Post by: aldo_14 on May 18, 2002, 09:11:43 am
Quote
Originally posted by IceFire
...and not the key.

Whats moment of inertia?  All of the user models I have don't have any values in there....


dunno...but the Perseus has very small values there, anyway. All under 0.005.  The Hecate is even lower....certainly no large numbers used  - values in the order of 1/million.

Maybe a conversion thing.........bounding box seems the most like thing, what with your problems with the Orion......
Title: POF Mass Errors
Post by: CP5670 on May 18, 2002, 09:39:01 am
Quote
Whats moment of inertia?  All of the user models I have don't have any values in there....


It's a thing in physics, but I have no idea how it is calculated for FS2 ships. All the default models seem to have values here, but they are very small.
Title: POF Mass Errors
Post by: aldo_14 on May 18, 2002, 01:19:02 pm
Quote
- http://www.freespace-2.com/ddn/specs/pof/ -

Chunk specs  

Here is a breakdown of each of the chunk types:

 

'OHDR' (FreeSpace 1) and 'HDR2' (FreeSpace 2) - Object header info

#ifdef version2116orhigher
 // FreeSpace 2
 float max_radius           // maximum radius of entire ship
 int obj_flags              // object flags. Bit 1 = Textures contain tiling
 int num_subobjects         // number of subobjects
#else
 // FreeSpace 1
 int num_subobjects         // number of subobjects
 float max_radius           // maximum radius of entire ship
 int obj_flags              // object flags. Bit 1 = Textures contain tiling
#endif

vector min_bounding         // min bounding box point
vector max_bounding         // max bounding box point

int num_detaillevels        // number of detail levels
for each detail_level, i {
 int sobj_detailevels    // subobject number for detail level I, 0 being highest.
}

int num_debris              // number of debris pieces that model explodes into
for each debris piece, i
 int sobj_debris         // subobject number for debris piece i

#ifdef version1903orhigher
 float mass                 // see notes below
 vector mass_center         // center of mass
 float[3][3] moment_inertia // moment of inertia
#endif

#ifdef version2014orhigher
 int num_cross_sections     // number of cross sections (used for exploding ship) (*)
 for each cross_section, i {
  float depth
  float radius
 }
#endif

#ifdef version2007orhigher
 int num_lights             // number of precalculated muzzle flash lights
 for each light {
  vector location
  int light_type            // type of light
 }
#endif  

Notes:

for version<2009, mass is a volume mass
for version>=2009, mass is an area mass
conversion: area_mass=4.65*(vol_mass^2/3); also scale moment_inertia by vol_mass/area_mass
(*) if there is no cross_section data, num_cross_sections is -1 instead of 0, as one would expect.


Any help?
Title: POF Mass Errors
Post by: IceFire on May 18, 2002, 03:01:23 pm
Not sure....any code gurus want to tell me what this means ? :)

And whats the muzzle flash bit about?
Title: POF Mass Errors
Post by: aldo_14 on May 19, 2002, 07:08:22 am
Quote
Originally posted by IceFire

And whats the muzzle flash bit about?


The lighting effects when a fighter (or a turret)  fires a gun....basically the lights in the pof file (re  modelview-edit pof).  It seems as if you can specify them by default, like in the V pofs, but that the engine can also auto-determine lighting - re moddded ships.

AFAIK

the area mass / volume mass thing could be mportant, maybe.... have you tested a cop2pof file against a PCs file with the same mass values?  Maybe there's a diference in one of the 2's mass type that has an effect.
Title: POF Mass Errors
Post by: IceFire on May 19, 2002, 09:01:50 am
Well...the Banshee was converted by Woomister who still uses the antiquated COB2POF while some of the other models I've tested were converted by Bobboau using POF CS.  

I've tried editing the Mass values with POF CS and ModelView32.
Title: POF Mass Errors
Post by: IceFire on May 19, 2002, 10:05:50 pm
Moment of Inertia!  That seems to be it.  I added the values from the Perseus to that of the Banshee and now its much better!