Author Topic: Bobboau's last build has given me 'turrets' syndrome!  (Read 2340 times)

0 Members and 1 Guest are viewing this topic.

Bobboau's last build has given me 'turrets' syndrome!
At least, every time I try to get this to work, I end up randomly swearing and cursing!

I want to make a bow turret, and have it able to target anything ahead of the ship. I downloaded Bob's build with the 'point them anywhere' turret code. All seems to be working fine ( after I had realised what a de-bug build did, and how shoddy some of my tabling was!!! )

It seemed to work fine with the parameters I put in, and the turret and gun barrels moved exactly how I wanted them to. Only trouble is, they don't seem to track targets correctly, and the guns fire in directions other than the way the barrels are pointing. I know I must be close, since it is working just about right...I just need to control the direction the guns actually fire! They don't seem to do it all the time....just when the target ship seems to get out of view.

The parts are rigged up OK, and I have the parameters for the code as follows:
this is in the turret bas, which is attached to the front of the ship.

$special=subsystem
$fov=180
$name=GunTurret
$orient:
$uvec: 0,1,0
$fvec: 0,0,1

I set the rotation as Z axis ... don't know if this actually has any kind of effect!

Gun barrels have no code in them. By default, the turret base is a simple cube on the front of the ship, and the barrels point straight out front on the basic POF file. I assumed that 'up' was ....er...up ( +y )and front was +z, and 180 fov would allow the ship to target a 180 degree arc centred around straight ahead. Normals on both firepoints were 0,0,1

Have I got this right?

 

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
Re: Bobboau's last build has given me 'turrets' syndrome!
which build specifically, I haven't released a build in a month or two, you should try a CVS build.

try adding this to the barrel object properties
$uvec: 0,0,1
$fvec: 0,-1,0
IIRC the off axis code fires along the uvec, not the fvec (cause most people have there turrets pointing straight up relative to the base)
« Last Edit: February 22, 2007, 10:54:45 pm by Bobboau »
Bobboau, bringing you products that work... in theory
learn to use PCS
creator of the ProXimus Procedural Texture and Effect Generator
My latest build of PCS2, get it while it's hot!
PCS 2.0.3


DEUTERONOMY 22:11
Thou shalt not wear a garment of diverse sorts, [as] of woollen and linen together

 
Re: Bobboau's last build has given me 'turrets' syndrome!
Thanks... I'll try this tonight.

The build I used was the one you released with the link in the 'recent builds' forum. This is the link to the thread :
http://www.hard-light.net/forums/index.php/topic,43524.0.html

If there is a more polished and stable release with the turret pointing in any direction, then I would gladly use that. For my Homeworld mod, though, I REALLY need to have this facility. The Taiidan Light corvette has guns on the nose... the defenders need this for working turrets, the Kushan Frigate has side mounted turrets ... and so on! All of these things can be bodged with fake button turrets, but can be made to work well with this code! It's what really inspired me to start working on a Homeworld mod!

 
Re: Bobboau's last build has given me 'turrets' syndrome!
Drat and double drat! This hasn't done the trick.

I set the uvec on the base to be 0,0,1 and the fvec to be 0.-1,0 which I thought should be telling the turret that 'up' in the conventional turret sense was straight ahead. The fov should then be measured around a 'normal' that was pointing along +z. 180 degree fov should cover the whole area forward of the ship ( the turret is on the nose ) .

I set the barrel uvec and fvec as you suggested, and it hasn't stopped the problem. The barrels swivel around fine....but it still has a tendancy to fire in completely different directions to the one the gun is pointing in!

I also noticed that the turret base, no matter how I set the rotation al axis for the sub-model rotated around the Y axis! Since I don't know any way of limiting that rotation to less than 360 degres, I could do with changing that so it rotated around the z axis instead!

I can send the POF if that would help!

 

Offline Trivial Psychic

  • 212
  • Snoop Junkie
Re: Bobboau's last build has given me 'turrets' syndrome!
Just a suggestion... would you try to use the subsystem flag that forces turrets to fire down the normals?  The older method has +fire-down-normals added to the subsystem entry, though the newer method uses a $flags line added to the subsystem data, with ( "fire-down-normals" ) included.  Note, that this is all added into the ships.tbl file, not the model's subsystem data.
The Trivial Psychic Strikes Again!

 

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
Re: Bobboau's last build has given me 'turrets' syndrome!
can you post a pic of the ship so I can see what it is you want? from what you said it sounded like the base was origonaly set up properly but you were doing something unusal with the barels. you are aware the turret needs to be in the center of it's fov right?
Bobboau, bringing you products that work... in theory
learn to use PCS
creator of the ProXimus Procedural Texture and Effect Generator
My latest build of PCS2, get it while it's hot!
PCS 2.0.3


DEUTERONOMY 22:11
Thou shalt not wear a garment of diverse sorts, [as] of woollen and linen together

 
Re: Bobboau's last build has given me 'turrets' syndrome!
This is the 'test' ship I am using. I haven't bothered making a proper vessel, since I need to sort out things like this before I spend hours making something that won't work!



The turret is on the front of the ship. At rest, the barrels point straight forward, and the base of the turret is just a block, also facing forward.

EDIT:
I managed to sort out the unexpected rotational element of the turret! I had made it in the traditional pose, and then rotated it into it's desired position. I had forgotten to reset the axes to the world system, so that was confusing the thing a bit! With that fixed, it rotates as I expected it to... but still fires wherever it feels like! I would like to try the flag ... but I can't figure out where and how the syntax should go. I put a $flag line after the turret subsystem but it didn't like that...and it won't have it in the normal flags bit either!

I did notice, though, that the problem seems to start after a ship is tracked by the turrets. It seems to be able to move the barrels outside of the 180 fov so the guns point backwards! When it does this, the guns seem to lose co-ordination and the firepoints wander. This might be a red-herring... but the guns on the turret should NOT be able to point backwards...with uvec set to +z, the fov should be relative to that
« Last Edit: February 24, 2007, 04:23:06 am by FlareBaffled »

 

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
Re: Bobboau's last build has given me 'turrets' syndrome!
ok then assumeing it's sitting on top of the hull (and the base is suposed to rotate arount the up vector of the ship and not the forward vector)

then the properties of the base should look something like:
$special=subsystem
$fov=180
$name=GunTurret
$orient:
$uvec: 0,1,0
$fvec: 0,0,1

and the barel properties should look something like:

$orient:
$uvec: 0,0,1
$fvec: 0,-1,0

and the pof turret data for this turret should have a normal pointingg in the 0,0,1 direction

if you do all that then it should work properly, note that there is code that will cause turrets to fire directly at there target if they are within a few degrees of perfict if you are seeing anything ove about 10 degrees I'd say that may be a problem.

if you still cant get it to work upload a copy of it and let me look at it, I'll be able to figure out if you model or my code is broken a lot better with the model in question in hand.
Bobboau, bringing you products that work... in theory
learn to use PCS
creator of the ProXimus Procedural Texture and Effect Generator
My latest build of PCS2, get it while it's hot!
PCS 2.0.3


DEUTERONOMY 22:11
Thou shalt not wear a garment of diverse sorts, [as] of woollen and linen together

 
Re: Bobboau's last build has given me 'turrets' syndrome!
I was considering it to be a front mounted turret ( like a Lancaster bomber nose turret ) and not on top of the model. I don't know if it makes a difference in terms of setup, but it needs to be able to fire straight up, straight down and forward. Mounting it 'on top' implies no firing down!

EDIT: I emailed a copy to the hotmail address in your profile. I included a copy of the stuff in the ship table too, just for completeness!
« Last Edit: February 24, 2007, 04:54:17 am by FlareBaffled »

  
Re: Bobboau's last build has given me 'turrets' syndrome!
I tried your code, and all seemed to be fine..... until I actually targetted a particular ship. The turet was behaving itself and only engaging targets in it's fov...but when I targetted a particular ship, the guns tracked around to point behind the plane of it's fov, and the fire started at an angle out of line with the barrels.

 

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
Re: Bobboau's last build has given me 'turrets' syndrome!
well I was asking that mostly to know which way it should rotate, looking at it it could be set to rotate either way. well looking at it you don't have anything in the properties of the barrel object, but the way you have the base should allow it to work, the base will rotate around the z axis of the ship though, which you may or may not have wanted. I'm gona try to get it in game and see what's wrong.
Bobboau, bringing you products that work... in theory
learn to use PCS
creator of the ProXimus Procedural Texture and Effect Generator
My latest build of PCS2, get it while it's hot!
PCS 2.0.3


DEUTERONOMY 22:11
Thou shalt not wear a garment of diverse sorts, [as] of woollen and linen together

 
Re: Bobboau's last build has given me 'turrets' syndrome!
Thanks! I really appreciate the help here :D

 

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
Re: Bobboau's last build has given me 'turrets' syndrome!
I found one line that seems realy odd, that was throughing things out of wack, I'm thinking there was some CVS merge screwyness, as this would have caused a lot of problems if it is what it looks like, I made the change and the turret seemed to move more or less as you'd expect for the minute or two I tested after, I uploaded this build so you could try it and give it a more proper test, while I check CVS logs to see if this was like this the whole time or what. I find it hard to beleive what I found was causeing the problem...
« Last Edit: February 24, 2007, 06:34:33 am by Bobboau »
Bobboau, bringing you products that work... in theory
learn to use PCS
creator of the ProXimus Procedural Texture and Effect Generator
My latest build of PCS2, get it while it's hot!
PCS 2.0.3


DEUTERONOMY 22:11
Thou shalt not wear a garment of diverse sorts, [as] of woollen and linen together

 
Re: Bobboau's last build has given me 'turrets' syndrome!
Trying it now ... and :(

There seem to be a couple of persistant issues.....

1) The turret seems to have a mind of it's own when it comes to where it can point the guns! The uvec is set as 0,0,1 ... which means straight ahead. The fov should restrict the guns to pointing anywhere but aft of the turret... but it can do this :


2) Then there is the fire-points... it still does this for me:

I have not attempted to target anything, just moved the ship to bring the enemy vessels into the fov. The guns have not swung round to face the target...but it is firing at it.
« Last Edit: February 24, 2007, 07:12:15 am by FlareBaffled »

 

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
Re: Bobboau's last build has given me 'turrets' syndrome!
is it still fireing in that image? turrets will overshoot there fovs a bit, but it shouldn't be doing anything if there isn't a bad guy in his fov (it also take's it's radius into consiteration, but it will keep trying to shoot the center), the thing is there is a bit of a random factor added to the enemy position and it's changed every few seconds, so the turret might think the target is somewere outside it's fov when it's not and it'll keep turning untill it's out of it's fov, and if the target DOES leave the fov at this point, it'll stay there, although that looks prety severe.

and turrets will start fireing right away, that's just the way they are, you can force the weapon to not get corected with that "fire-down-normals" turret flag TP mentioned, but it'll still start fireing right away.
« Last Edit: February 24, 2007, 07:44:02 am by Bobboau »
Bobboau, bringing you products that work... in theory
learn to use PCS
creator of the ProXimus Procedural Texture and Effect Generator
My latest build of PCS2, get it while it's hot!
PCS 2.0.3


DEUTERONOMY 22:11
Thou shalt not wear a garment of diverse sorts, [as] of woollen and linen together

 
Re: Bobboau's last build has given me 'turrets' syndrome!
It had stopped firing in that picture.

The other picture, that seems reuctant to show up for some reason, would have shown that it is still firing off line with the barrels. I will give the fire down normals thing a go if someone can tell me exactly where I have to put the command in the table... I couldn't work it out!

 

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
Re: Bobboau's last build has given me 'turrets' syndrome!
http://www.hard-light.net/wiki/index.php/Subsystems

flags section is at the very bottom of the subsystem entree.
Bobboau, bringing you products that work... in theory
learn to use PCS
creator of the ProXimus Procedural Texture and Effect Generator
My latest build of PCS2, get it while it's hot!
PCS 2.0.3


DEUTERONOMY 22:11
Thou shalt not wear a garment of diverse sorts, [as] of woollen and linen together

 
Re: Bobboau's last build has given me 'turrets' syndrome!
IT seems to be a lot more controlled with the 'fire along normals' flag in place. The ship does a lot less firing ( which is to be expected ) since the targets are spending alot less time in it's arc of fire. I will try this on my Defender model, and see if I can get that to perform as I need.

Looking good so far though!