Author Topic: Turrets not tracking properly  (Read 5423 times)

0 Members and 1 Guest are viewing this topic.

Offline Kusanagi

  • A man, a van, a plan, Vanama!
  • 27
  • Enemy vessel captured
Turrets not tracking properly
Greetings, ya'll!

While working on and importing some homeworld ships, I've ended up converting and importing the Taiidani Destroyer. I've used Scooby's and JGZinv's method for exporting Collada format to PCS2.

The problem comes when converting these turrets. Scooby's tutorial stated that you could position the turrets and their normals along non-Z-axis lines. My turrets are set at a 45 degree angle with the corresponding normals, as shown here.



Both the turrets and the arms are set to rotate along the Z axis as they are in most multipart turrets and the normal firing points look ok. I've given them a 90 degree FOV.

When I run the game, I get an interesting error. The flak fires out of the ends of the barrels jut fine, but the barrels don't track the target properly. The turrets will rotate in random directions including almost fully backwards (which they should not do) and the flak will fire out of the barrel at a 90 degree angle as if it's making a sharp left of right when leaving the barrel and it won't elevate properly. Here's two screenshots to show what I mean. You can see the flak guns firing, but they are firing AT ME.



[IMG=http://img710.imageshack.us/img710/3342/screen0008td1.jpg][/IMG]

Can someone explain why it does this? I haven't seen it do this on retail ships. If someone can also explain http://www.hard-light.net/wiki/index.php/Turret_setup to me, I would appreciate it. It looks like the engine has been upgraded to allow the FOV to have more options, but after searching I have no clue how to implement it.

Cum historia
mutat valde Razgriz
revelat ipsum
primum daemon scelestus est.

 

Offline Commander Zane

  • 212
  • Spoot Knight of Anvils
Re: Turrets not tracking properly
I've seen it on many occasions with Retail ships. Though I recall reading there was a flag that forced the weapon to shoot only in the direction the barrel was pointing, it would make it nearly impossible for them to ever fire at moving fighters / bombers.

 

Offline General Battuta

  • Poe's Law In Action
  • 214
  • i wonder when my postcount will exceed my iq
Re: Turrets not tracking properly
I believe blowfish has some clue how to handle this.

  

Offline blowfish

  • 211
  • Join the cult of KILL MY ROUTER!!!!!!!!!!1
Re: Turrets not tracking properly
Okay, here's the thing:

The barrels should be facing UP in the model, not at an angle like you have them.  If you want to change their rest orientation, you can do that in the tables, but freespace requires them to be pointing up in order to work properly.

 

Offline FUBAR-BDHR

  • Self-Propelled Trouble Magnet
  • 212
  • Master Drunk
    • 165th Beer Drinking Hell Raisers
Re: Turrets not tracking properly
Not up but it the direction of the uvec.  Uvec = axis of rotation = direction barrels need to point. 
No-one ever listens to Zathras. Quite mad, they say. It is good that Zathras does not mind. He's even grown to like it. Oh yes. -Zathras

 

Offline chief1983

  • Still lacks a custom title
  • 212
  • ⬇️⬆️⬅️⬅️🅰➡️⬇️
    • Skype
    • Steam
    • Twitter
    • Fate of the Galaxy
Re: Turrets not tracking properly
I've seen it on many occasions with Retail ships. Though I recall reading there was a flag that forced the weapon to shoot only in the direction the barrel was pointing, it would make it nearly impossible for them to ever fire at moving fighters / bombers.

If you're going to enable that for point defense turrets (which it should, to be realistic) you better enable those turrets to have some chance of tracking fighters and bombers.  But that does give a nimble fighter the ability to outmaneuver a turret, which also does make some sense.  I think it would be cool if turret rotations were damped too.
Fate of the Galaxy - Now Hiring!  Apply within | Diaspora | SCP Home | Collada Importer for PCS2
Karajorma's 'How to report bugs' | Mantis
#freespace | #scp-swc | #diaspora | #SCP | #hard-light on EsperNet

"You may not sell or otherwise commercially exploit the source or things you created based on the source." -- Excerpt from FSO license, for reference

Nuclear1:  Jesus Christ zack you're a little too hamyurger for HLP right now...
iamzack:  i dont have hamynerge i just want ptatoc hips D:
redsniper:  Platonic hips?!
iamzack:  lays

 

Offline Kusanagi

  • A man, a van, a plan, Vanama!
  • 27
  • Enemy vessel captured
Re: Turrets not tracking properly
So the only way the guns will track is if the guns point straight up? Damn. Then how do I set it so the turret only fires in the upper front quadrant? I had thought that it had something to do with the turret setup page I linked, but I haven't been able to find any helpful information on that.
Cum historia
mutat valde Razgriz
revelat ipsum
primum daemon scelestus est.

 

Offline FUBAR-BDHR

  • Self-Propelled Trouble Magnet
  • 212
  • Master Drunk
    • 165th Beer Drinking Hell Raisers
Re: Turrets not tracking properly
You use a combination of uvec/fvec, animation code (for the initial turret position) and fov or other subsystem flags for the elevation and base rotation.
No-one ever listens to Zathras. Quite mad, they say. It is good that Zathras does not mind. He's even grown to like it. Oh yes. -Zathras

 

Offline Kusanagi

  • A man, a van, a plan, Vanama!
  • 27
  • Enemy vessel captured
Re: Turrets not tracking properly
Is there a model with a working example or a link to a setup that shows how to do this? It sounds like you would just give the turret a 180 degree field of vision and then restrict its movements via the tables, but aside from that page I linked, I haven't been able to make sense of it and can't find any information in the ships or weapons tables wiki entries.
Cum historia
mutat valde Razgriz
revelat ipsum
primum daemon scelestus est.

 

Offline FUBAR-BDHR

  • Self-Propelled Trouble Magnet
  • 212
  • Master Drunk
    • 165th Beer Drinking Hell Raisers
Re: Turrets not tracking properly
Is there a model with a working example or a link to a setup that shows how to do this? It sounds like you would just give the turret a 180 degree field of vision and then restrict its movements via the tables, but aside from that page I linked, I haven't been able to make sense of it and can't find any information in the ships or weapons tables wiki entries.

Pics work better:



This turret faces forward, the base can only turn so far, and it has limited elevation (inverse FOV). 
This is what it looks like in PCS2.  In this case the barrels are facing up but if they were on the side of the ship they could be facing left and the UVEC would then be 1,0,0.  Note the FVEC and UVEC x axis is -x show in PCS2.   

As for the rotation that is handled via tables.  Specificially these entries:
Code: [Select]
$Maximum Barrel Elevation: 50
$Turret Base FOV: 115
......................
$animation: triggered
$type: initial
+relative_angle:       90,52.5,0

Note the fvec is 52.5 degrees off of forward and can rotate 115 degrees.  The 90 lowers the barrels to level with the base at mission start.  So both the barrels and base face forward in game.  Now if you want the turret to rotate from the uvec down instead of the fvec up as this one does you use FOV in PCS2 instead of Maximum Barrel Elevation:

Hope this makes it a bit clearer.
No-one ever listens to Zathras. Quite mad, they say. It is good that Zathras does not mind. He's even grown to like it. Oh yes. -Zathras

 

Offline chief1983

  • Still lacks a custom title
  • 212
  • ⬇️⬆️⬅️⬅️🅰➡️⬇️
    • Skype
    • Steam
    • Twitter
    • Fate of the Galaxy
Re: Turrets not tracking properly
It's not tracking that fixing their orientation fixes, it's whether they point in the right direction when they fire at all I believe.
Fate of the Galaxy - Now Hiring!  Apply within | Diaspora | SCP Home | Collada Importer for PCS2
Karajorma's 'How to report bugs' | Mantis
#freespace | #scp-swc | #diaspora | #SCP | #hard-light on EsperNet

"You may not sell or otherwise commercially exploit the source or things you created based on the source." -- Excerpt from FSO license, for reference

Nuclear1:  Jesus Christ zack you're a little too hamyurger for HLP right now...
iamzack:  i dont have hamynerge i just want ptatoc hips D:
redsniper:  Platonic hips?!
iamzack:  lays

 

Offline Kusanagi

  • A man, a van, a plan, Vanama!
  • 27
  • Enemy vessel captured
Re: Turrets not tracking properly
That seems to make sense, that picture was worth a thousand words.

So, basically, I want to have the $uvec at 0,1,0 and the $fvec at 0,0,1 to have the turret face forward.

Looking at the turret setup page, I want the turret to have a maximum elevation of 90 degrees and a limited base rotation of 180 degrees. That should cover everything in the forward firing arc...do the related flags go in the subsystem properties in PCS2 or do they go in the entry in the ships.tbl file?

I'm very glad for that explanation as those things you mentioned aren't in the wiki and I can't find them in the search.
Cum historia
mutat valde Razgriz
revelat ipsum
primum daemon scelestus est.

 

Offline FUBAR-BDHR

  • Self-Propelled Trouble Magnet
  • 212
  • Master Drunk
    • 165th Beer Drinking Hell Raisers
Re: Turrets not tracking properly
Well in that case you can do either FOV 180 or the limited elevation at 90 in the tables.  Both come out the same.
No-one ever listens to Zathras. Quite mad, they say. It is good that Zathras does not mind. He's even grown to like it. Oh yes. -Zathras

 

Offline Kusanagi

  • A man, a van, a plan, Vanama!
  • 27
  • Enemy vessel captured
Re: Turrets not tracking properly
Well in that case you can do either FOV 180 or the limited elevation at 90 in the tables.  Both come out the same.

   $Maximum Barrel Elevation:   50
   $Turret Base FOV:      115
......................
   $animation:       triggered
   $type:          initial
    +relative_angle:       90,52.5,0

Where do these go? In the subobject properties in PCS2 or in the ships.tbl?

This is what I have for the turret in the ships.tbl:

Code: [Select]
$Subsystem:                     turret01,4,2.0
$Default PBanks:        ( "Long Range Flak" )
$Maximum Barrel Elevation: 90
$Turret Base FOV: 180
$animation: triggered
$type: initial
+relative_angle:       90,0,0

I either got the order wrong or something else wrong as well, because it crashes.
Cum historia
mutat valde Razgriz
revelat ipsum
primum daemon scelestus est.

 

Offline FUBAR-BDHR

  • Self-Propelled Trouble Magnet
  • 212
  • Master Drunk
    • 165th Beer Drinking Hell Raisers
Re: Turrets not tracking properly
Run debug and post the message it crashes with.
No-one ever listens to Zathras. Quite mad, they say. It is good that Zathras does not mind. He's even grown to like it. Oh yes. -Zathras

 

Offline Kusanagi

  • A man, a van, a plan, Vanama!
  • 27
  • Enemy vessel captured
Re: Turrets not tracking properly
Run debug and post the message it crashes with.

Code: [Select]
Error: ships.tbl(line 9155:
Error: Required token = [#End], [$Subsystem:], [$Name], or [$Template], found [$Maximum Barrel Elevation: 90].

File: PARSELO.CPP
Line: 670


Call stack:
------------------------------------------------------------------
------------------------------------------------------------------


It then gives me a dozen more errors for every line of code for the two turrets.
Cum historia
mutat valde Razgriz
revelat ipsum
primum daemon scelestus est.

 

Offline FUBAR-BDHR

  • Self-Propelled Trouble Magnet
  • 212
  • Master Drunk
    • 165th Beer Drinking Hell Raisers
Re: Turrets not tracking properly
You using 3.6.12final or a 3.6.13Knightly?  This feature wasn't in 3.6.10.
No-one ever listens to Zathras. Quite mad, they say. It is good that Zathras does not mind. He's even grown to like it. Oh yes. -Zathras

 

Offline Kusanagi

  • A man, a van, a plan, Vanama!
  • 27
  • Enemy vessel captured
Re: Turrets not tracking properly
...oy, that was the problem? According to the wiki the animation code was in 3.6.10.

I was trying to use it in 3.6.10. I just tried using it with the 3.6.12 INF SSE2 build and now the turrets don't show up at all.
Cum historia
mutat valde Razgriz
revelat ipsum
primum daemon scelestus est.

 

Offline FUBAR-BDHR

  • Self-Propelled Trouble Magnet
  • 212
  • Master Drunk
    • 165th Beer Drinking Hell Raisers
Re: Turrets not tracking properly
Animation was but the base rotation and elevations were added in 3.6.11.
No-one ever listens to Zathras. Quite mad, they say. It is good that Zathras does not mind. He's even grown to like it. Oh yes. -Zathras

 

Offline Kusanagi

  • A man, a van, a plan, Vanama!
  • 27
  • Enemy vessel captured
Re: Turrets not tracking properly
Ok, that explains that. There was no information on it or I'm out of the loop :P

Now the turrets don't show up ingame at all!  :mad:
Cum historia
mutat valde Razgriz
revelat ipsum
primum daemon scelestus est.