Hard Light Productions Forums

Community Projects => The FreeSpace Upgrade Project => Topic started by: Admiral Nelson on October 16, 2005, 08:04:31 pm

Title: Default Gun Barrel Angle
Post by: Admiral Nelson on October 16, 2005, 08:04:31 pm
I really hate the default 90 degree orientation of turret gun barrels.  Having seen Stratcomm post the animation code for fixing this issue, I started going through ships and putting the appropriate codes in.  Howeer, I also seem to recall comething about new builds altering the default elevation.  Is it worthwhile to carry on with these table edits?

(http://img.photobucket.com/albums/v106/NelsonAndBronte/FS2/OrionTurrets.jpg)

(http://img.photobucket.com/albums/v106/NelsonAndBronte/FS2/AeolusTurrets.jpg)

(http://img.photobucket.com/albums/v106/NelsonAndBronte/FS2/HecateTurrets.jpg)
Title: Default Gun Barrel Angle
Post by: Trivial Psychic on October 16, 2005, 09:33:19 pm
There was some code to do this, but it had been broken for a while.  The last time it worked was for Goober's 07/28 build, which contained a fix by WMC.  Unfortunately, for some strange reason, no build since then has had this functioning.  I reported it for the first few builds following this, but no one seemed to listen, so I stopped reporting it.
Title: Default Gun Barrel Angle
Post by: Nuke on October 16, 2005, 09:40:42 pm
use the animation code, let me dig it up here really quick

Code: [Select]

$Subsystem: Turret01-base,1,1.0
$Default PBanks: ( "SG-12 Buckshot" )
$animation=triggered
$type="inital"
+relative_angle: 90,180,0 ; this is to make an underside turret point forward
Title: Default Gun Barrel Angle
Post by: Admiral Nelson on October 16, 2005, 09:53:42 pm
Oh, sure, I am using that code, as you see in the screenshots.  However, it would take a while to do all the prominent turrets, which would be a waste of time if FSO is going to change the default angle in the code itself.  Thus, I'm wondering if I should carry on and fix up the other vessels or not....
Title: Default Gun Barrel Angle
Post by: WMCoolmon on October 16, 2005, 10:22:44 pm
Quote
Originally posted by Trivial Psychic
There was some code to do this, but it had been broken for a while.  The last time it worked was for Goober's 07/28 build, which contained a fix by WMC.  Unfortunately, for some strange reason, no build since then has had this functioning.  I reported it for the first few builds following this, but no one seemed to listen, so I stopped reporting it.


Partly because even when I tried to do it the same way as Bobb's animation code, it still broke turrets.

Edit: Make it as an XMT, if you can get it done before I release the mediaVPs I'll include it as well. If not then it'll be fully compatible with them.

To use Nuke's example as the base:

data/tables/nuke-shp.tbm
Code: [Select]
#Ship Classes
$Name: Unknown    ;;I don't recognize his ship. Sue me.
+nocreate        ;;Don't create the ship, just change the attributes
$Subsystem: Turret01-base  ;;We can skip the other numbers. :D
$animation=triggered
$type="inital"
+relative_angle: 90,180,0 ; this is to make an underside turret point forward
#End
Title: Default Gun Barrel Angle
Post by: Nuke on October 16, 2005, 10:34:35 pm
what do those numbers mean, i know one is % of hull, but whats the other do?

btw that was off the apis attack fighter, its like an a-10, but more vasudan. :D
Title: Default Gun Barrel Angle
Post by: Admiral Nelson on October 16, 2005, 10:50:09 pm
Do I need to include all tags in an XMT?  I used:

Code: [Select]

#Ship Classes
$Name:                          GTC Aeolus
+nocreate        ;;Don't create the ship, just change the attributes
$Subsystem:                     turret01
$animation=triggered
$type="inital"
+relative_angle: 70,180,0
$Subsystem:                     turret02
$animation=triggered
$type="inital"
+relative_angle: 70,0,0
$Subsystem:                     turret03
$animation=triggered
$type="inital"
+relative_angle: 70,180,0
$Subsystem:                     turret04
$animation=triggered
$type="inital"
+relative_angle: 70,0,0
$Subsystem:                     turret05
$animation=triggered
$type="inital"
+relative_angle: 70,0,0
$Subsystem:                     turret06
$animation=triggered
$type="inital"
+relative_angle: 70,180,0
#End


and got:

Code: [Select]

Error: Nelson-shp.tbm(3):
Error: Required token = [$Species:], found [$Subsystem:                     ]
in ship: GTC Aeolus.


So obviously it want species to appear in here too -- does that mean I need to repeat all mandatory tags?

Incidentially, you'll note I put the turrets at a 20 degree slant, not perfectly flat, as I thought that looked unnatural.  Comments?
Title: Default Gun Barrel Angle
Post by: Axem on October 16, 2005, 10:50:32 pm
Quote
Originally posted by Nuke
what do those numbers mean, i know one is % of hull, but whats the other do?


Rotation time I think. The time in seconds to make one revolution.
Title: Default Gun Barrel Angle
Post by: Trivial Psychic on October 16, 2005, 11:39:27 pm
Just to clear things up, there are 2 sets of figures for one turret entry with initial position data.

The first line with the subsystem entry would have your subsystem strength, followed by a the rotational data.  The line that starts with "+relative_angle:" has first the angle of the barrels in degrees, the second is the rotation angle of the base in degrees, followed by a figure which I assume would be a rotation time, used in other cases.  Its probably for where a specific movement is triggered, so a time figure must be in to control its speed.  Since the useages being discussed here are for turret initial positions, only a "0" is required.
Title: Default Gun Barrel Angle
Post by: FireCrack on October 16, 2005, 11:58:17 pm
I beleive the third figure is a roll value, as a iremember seeing +time: in one of these.
Title: Default Gun Barrel Angle
Post by: WMCoolmon on October 17, 2005, 12:35:17 am
Use a Recent CVS build, I implemented XMTs shortly after 3.6.7
Title: Default Gun Barrel Angle
Post by: Nuke on October 17, 2005, 01:28:11 am
did the spelling of relitive change in any recent builds :D

oh yea and the angle is pitch,yaw,roll, for setting initial position of turrets roll is not typically used. the +time: is more for other animations.

oh and can we integrate the python scripting into the animation system as well. seems like an easy way to make it more versitile.
Title: Default Gun Barrel Angle
Post by: StratComm on October 17, 2005, 01:55:00 am
Incidentally, roll doesn't work, nor does scripted animation act on any axis other than the axis of rotation as specified in the POF.  I consider this a bug, and I thought it worked differently at some point in the past, but having recently tested it on current CVS builds, I can verify that this is no longer the case.

And do go ahead and define values for the turrets (including turning them around when that makes sense), even if the defaulting-to-depressed code gets reintroduced.  Defining the angles to what looks good will always be better than having a hardcoded default.
Title: Default Gun Barrel Angle
Post by: Nuke on October 17, 2005, 02:24:43 am
i think theres a line that needs to be in the subobject props for it to work. you need to add :$triggered:" to the subobject properties of any subobject that is animated. (i dont think its nessicary for initial angles though).
Title: Default Gun Barrel Angle
Post by: StratComm on October 17, 2005, 02:28:45 am
This is exactly why I wish the submodel animation was documented somewhere that wasn't only indexed by the board's search feature.

That makes sense, though.  I'll have to test it.  Though IMHO, that seems like a silly restriction.
Title: Default Gun Barrel Angle
Post by: Admiral Nelson on October 17, 2005, 10:26:28 am
The post 3.6.7 builds all crash on me.  First it complained about not being able to find 'shockwave.pof,' so I installed DaBrains shockwave release, and got by that.  Next it crashes on:

Warning: Couldn't open texture 'Shornetd'
referenced by model 'New_Qutrob.pof'

and

Warning: Couldn't open texture 'THRUSTER01'
referenced by model 'fighter2t-03.pof'

None of the older builds complain about this.  Also is it right to put a file only supported by post 3.6.7 builds in the media VPs?  Everything works fine when I am just editing ships.tbl directly.

Also, the line "$Subsystem: Turret01-base  ;;We can skip the other numbers. " implies that the values after the turret subsystem name can be skipped.  FS2 would crash on me here, complaining about a missing float until I restored the numbers.
Title: Default Gun Barrel Angle
Post by: StratComm on October 17, 2005, 10:34:28 am
The THRUSTER01 bug is really a non-bug, and that's being taken care of.  The Shornetd texture error has been around for a while, though I can't remember what causes that.  However, both warnings should be non-fatal (press the middle button, cancel IIRC, to return to the game) so you should be able to get past them.

And I'd always put in the numbers as even if it is valid to have them missing (I don't think it is) the defaults would probably not be what you want anyway.  And be careful with dashes in subobject names; those can end up behavinig in very strange ways across different builds.
Title: Default Gun Barrel Angle
Post by: Admiral Nelson on October 17, 2005, 10:59:50 am
Well, it seems there is also a:
Warning: Null vec3d in vec3d normalize.
Trace out of vecmat.cpp and find offending code.

in there.  FS2 always locks up for me in the post builds.  The first mission in the game dies complaining about an extra LOD in the Satis; my little test mission dies complaining about this null vec3d.
Title: Default Gun Barrel Angle
Post by: Starman01 on October 17, 2005, 01:11:48 pm
Quote
Originally posted by Nuke
use the animation code, let me dig it up here really quick

Code: [Select]

$Subsystem: Turret01-base,1,1.0
$Default PBanks: ( "SG-12 Buckshot" )
$animation=triggered
$type="inital"
+relative_angle: 90,180,0 ; this is to make an underside turret point forward
[/B]





Damn, how could I missed that ? :) I thought this feature has never been finished and finally skipped because it didn't worked in the code-update. I just tested it, and the turrets work fine with this table change.

So now more turret erection for the WCS-Ships at all, I have to change the ships.tbl right now :)
Title: Default Gun Barrel Angle
Post by: WMCoolmon on October 17, 2005, 01:14:49 pm
Quote
Originally posted by StratComm
The THRUSTER01 bug is really a non-bug, and that's being taken care of.  The Shornetd texture error has been around for a while, though I can't remember what causes that.  However, both warnings should be non-fatal (press the middle button, cancel IIRC, to return to the game) so you should be able to get past them.

And I'd always put in the numbers as even if it is valid to have them missing (I don't think it is) the defaults would probably not be what you want anyway.  And be careful with dashes in subobject names; those can end up behavinig in very strange ways across different builds.


Who's fixing the THRUSTER01 bug & when will it be fixed?
Title: Default Gun Barrel Angle
Post by: StratComm on October 17, 2005, 02:39:48 pm
Taylor, and it should be fixed in the next build.  It's a case of checking for a texture name with case sensitivity in a check for thruster glows in general from what I understand.  Check your Mantis bug, as he and I have talked about it there.

I guess it was technically a media issue to begin with, but since filenames have been pretty cleanly established as case insensitive in FSO, it does make sense to fix it in code.  Of course, fixing both would be a piece of cake (again, read the bug report; it's a 10-second fix in PCS) if you want to take care of 3.6.7 media in a way that's best for 3.6.7.
Title: Default Gun Barrel Angle
Post by: Goober5000 on October 17, 2005, 02:47:24 pm
Quote
Originally posted by Nuke
did the spelling of relitive change in any recent builds :D
It's spelled "relative".  Look it up.
Title: Default Gun Barrel Angle
Post by: Nuke on October 17, 2005, 02:55:13 pm
Quote
Originally posted by Goober5000
It's spelled "relative".  Look it up.


it was a joke dude, remember how bobb didnt know how to spell it when he implemented the feature. :D i think its gotten to where if you fixed the spelling of the variable name, modders would complain :D

wait i think it was changed [/moron]
Title: Default Gun Barrel Angle
Post by: Admiral Nelson on October 17, 2005, 07:24:34 pm
Well, I am continuing to work with plain ole ships.tbl for now -- it will be a trivial matter to copy and paste into an XMT file later.

Here are screenies so you can validate the choices of turret position I made.  Comments / feedback welcome.

Aelous: Four foward turrets face forwards, after turrets aft.  Barrels angled up 20 degrees.

(http://img.photobucket.com/albums/v106/NelsonAndBronte/FS2/AeolusTurrets.jpg)

Deimos: Two foremost dorsal turrets face forward, after turret faces aft. Barrels angled up 20 degrees.  Ventral turret faces forward with barrels at 45 degrees to clear ship structure.

(http://img.photobucket.com/albums/v106/NelsonAndBronte/FS2/DeimosTurrets.jpg)

Hecate: Forward three dorsal turrets face forward; barrels at 20 degrees.

(http://img.photobucket.com/albums/v106/NelsonAndBronte/FS2/HecateTurretsForward.jpg)

After turret faces aft.  This turret doesn't seem to work properly, or is just so poorly constructed as to stand out badly. The new Hecate will be 100,000 times better.

(http://img.photobucket.com/albums/v106/NelsonAndBronte/FS2/HecateTurretsAft.jpg)

I did not touch the short barreled ventral turrets, which are also horribly constructed and look awful altered.

Iceni: Turrets arranged logically according to position on the ship.

(http://img.photobucket.com/albums/v106/NelsonAndBronte/FS2/IceniDorsal.jpg)

The ventral side turrets face out their respective sides.

(http://img.photobucket.com/albums/v106/NelsonAndBronte/FS2/IceniVentral.jpg)
 
Orion: Forward turrets are all facing forward, barrels at 10 degrees.

(http://img.photobucket.com/albums/v106/NelsonAndBronte/FS2/OrionTurretsFore.jpg)

I go back and forth on which way to face the after turrets.  For now, the upper after turret faces aft.

(http://img.photobucket.com/albums/v106/NelsonAndBronte/FS2/OrionTurretsAftDorsal.jpg)

As does the midships ventral turret.

(http://img.photobucket.com/albums/v106/NelsonAndBronte/FS2/OrionTurretsAftVentral.jpg)
Title: Default Gun Barrel Angle
Post by: StratComm on October 17, 2005, 09:36:04 pm
That hecate turret is the same as all of the others, except that :v: mounted it backwards in the geometry.   Bad :v:
Title: Default Gun Barrel Angle
Post by: Admiral Nelson on October 21, 2005, 08:25:45 pm
Oddly, some turrets don't play nice with the animation code.  The gun barrels depress to the proper angle, and the turret itself rotes to the right place, but the gun barrels don't rotate with the rest of the turret!  The hi poly Satis and Aten are both like this:

(http://img.photobucket.com/albums/v106/NelsonAndBronte/FS2/SatisTurretError.jpg)

(http://img.photobucket.com/albums/v106/NelsonAndBronte/FS2/AtenTurretError.jpg)

Any ideas?
Title: Default Gun Barrel Angle
Post by: StratComm on October 21, 2005, 09:32:23 pm
Oh great, are those heirarchies not right?

Barrels should be children of their turrets.  Those might just be siblings.  I'll look in to it.

EDIT: Yep, they are.  I think I can fix them though without needing to have access to the scenes to compile them.
Title: Default Gun Barrel Angle
Post by: StratComm on October 21, 2005, 10:34:51 pm
Ok, Fixored.

heirarchy_matters.zip (http://www.duke.edu/~cek6/heirarchy_matters.zip)

I didn't get a chance to check the Aten properly, so give it a thurough go-over.  I did look at the Satis though and it should be all good.  Props to Raa for hooking me up with the fixed model.  (I would have done it myself, but Raa mounted the whole turret backwards :rolleyes: )  If you run in to this elsewhere, let me know.

Admiral Nelson, make sure you include the fixed models with your final release, as they're necessary for proper operation.  Galemp may re-work the Aten some more because of some random turret targeting errors, but we'll deal with that when both have been released.
Title: Default Gun Barrel Angle
Post by: Admiral Nelson on October 22, 2005, 11:47:53 am
OKay, that fixed the issue, thanks! :)  I should be done later in the weekend.
Title: Default Gun Barrel Angle
Post by: Admiral Nelson on October 22, 2005, 07:27:19 pm
Okay, here's another issue.  I think that the animation code assumes that any given turret faces forward.  A turret which faces aft on the model itself confuses the system.  Look at the Medusa for instance -- the gun turret is always turned away from the gun barrels regardless of which way you instruct the turret to point via the animation code:

(http://img.photobucket.com/albums/v106/NelsonAndBronte/FS2/MedusaForward.jpg)

(http://img.photobucket.com/albums/v106/NelsonAndBronte/FS2/MedusaBackward.jpg)
Title: Default Gun Barrel Angle
Post by: StratComm on October 22, 2005, 07:43:08 pm
That's a problem with the model, not the animation code.  Topside turrets must ALWAYS face forwards, or even when you don't specify an angle the game will do that.  Same with the oddball turret on the Hecate.  Note it for the HTL conversion of those ships, but it's not something you can fix with the submodel animation code.
Title: Default Gun Barrel Angle
Post by: Admiral Nelson on October 22, 2005, 07:52:52 pm
D'oh.  The Medusa and Ursa are both that way.  The high poly Aten's ventral turret is also backwards on the model (meaning that it is facing towards the prow, that is).
Title: Default Gun Barrel Angle
Post by: StratComm on October 22, 2005, 08:06:38 pm
It's a well-documented rule, but everyone forgets now and then.  Unfortunately, unlike submodel offset and parent, I can't fix a backwards turret by editing the raw data.  We'll have to live with them being backwards until a HTL rendition (or in the Aten's case, Galemp's reconversion if/when he ever gets around to it).
Title: Default Gun Barrel Angle
Post by: Admiral Nelson on October 23, 2005, 09:22:29 pm
All right, here it is:

Download (http://www.fileh.com/NelsonAndBronte/TurretAngleFix.zip)

This release includes angle fixes for:
GTFR Triton
GTC Fenris
GTM Hippocrates
GTC Leviathan
GTD Orion
GTD Hecate
GTD Orion#2 (Bastion)
GTVA Colossus
GTCv Deimos
GTC Aeolus
NTF Iceni
GTT Argo
GVFr Satis
GVC Aten
GVC Mentu
GVCv Sobek
SC Cain
SC Lilith
SFr Mephisto
SD Demon

Some ships with crude geometry or turrets haven't been fixed; its not worth the trouble until they are high pollified.

Try it and let me know what you think.

(http://img.photobucket.com/albums/v106/NelsonAndBronte/FS2/OrionTurrs.jpg)
Title: Re: Default Gun Barrel Angle
Post by: redmenace on November 12, 2005, 01:16:44 am
Could we move this thread to the FSU forum?
Title: Re: Default Gun Barrel Angle
Post by: Pnakotus on November 12, 2005, 03:50:52 pm
Were the earlier issues with 3.6.7 builds resolved, or will these only work with new cvs builds?
Title: Re: Default Gun Barrel Angle
Post by: Admiral Nelson on November 12, 2005, 09:15:30 pm
AFAIK the support for XTM files such as this one is only present in post 3.6.7 builds.  The entries I made do work in older builds, but would have to be placed in ships.tbl.  That would mean that mods using a different ships.tbl would also have to be edited to see the effect.
Title: Re: Default Gun Barrel Angle
Post by: Admiral Nelson on December 09, 2005, 10:16:06 pm
I have made a tiny edit to the XMT file to support the new Hecate's ventral turrets.  The original release left them vertical as they were so crude and blocky the actually looked worse.  This edit depresses the barrels on these two turrets in an appropriate manner.

http://www.fileh.com/NelsonAndBronte/TurretAngleFix.zip
Title: Re: Default Gun Barrel Angle
Post by: Galemp on December 10, 2005, 02:21:38 am
Wow, really nice! I'm glad you did this.
Title: Re: Default Gun Barrel Angle
Post by: Admiral Nelson on December 22, 2005, 10:40:34 am
12/22/2005 update:
Added support for Stratcomm's new Medusa.  I do not actually have access to FS2 at my current location, so I'd appreciate it if someone would be kind enough to try this out for me real quick and make sure there is no issue.

Thanks!

http://www.fileh.com/NelsonAndBronte/TurretAngleFix.zip
Title: Re: Default Gun Barrel Angle
Post by: starfox on December 22, 2005, 11:21:43 am
I'd like to check'em out, but the link is not working....
*Works now*
Title: Re: Default Gun Barrel Angle
Post by: starfox on December 22, 2005, 11:40:34 am
As far as I see, no issues here....
Title: Re: Default Gun Barrel Angle
Post by: Admiral Nelson on December 22, 2005, 12:52:14 pm
Thanks for checking for me!  :yes: