turrets

Discuss the Star Trek mod(s) for the Vega Strike Engine

Moderators: tillias, Jennos, peteyg

Deus Siddis
Elite
Elite
Posts: 1363
Joined: Sat Aug 04, 2007 3:42 pm

Re: turrets

Post by Deus Siddis »

So then there's a very misleading problem wtih the commenting--
units.csv wrote: Sub_Units
{filename(string);x(meters);y(meters);z(meters);forex(meters);forey(meters);forez(meters);upx(meters);upy(meters);upz(meters);restricted(meters)}
From the looks of the values, that should be restricted(degrees). The orientation is defined by vectors as you said, but the rotation restriction is measured in degrees and needs to be labeled as such in the column documentation.
esgaroth
Confed Special Operative
Confed Special Operative
Posts: 317
Joined: Mon Jan 19, 2004 12:48 pm
Location: Konstanz, Germany

Re: turrets

Post by esgaroth »

Ups. I fear i cant follow this thread very far - cause I dont understand most of what you say here. One thing, though:
Turrets are destructible, but phaser banks not so much.
Sorry, but they are. There are numerous events in Star Trek when they specifically target phasers or shields or whatever subunit you imagine, and then specifically damage this subumit. So this feature would fit perfectly.
What questions do you have regarding turrets?
What I would need would probably be the example settings for a turret firing in x (and y and z and -x and -y and -z) direction, angle of fire 45°. The coordinates where to put it I could figure out myself, and I hope i can manage to make a phaser turret in the unist.csv, but i have no clue about the variables (direction pointing, angle of fire etc).
Deus Siddis
Elite
Elite
Posts: 1363
Joined: Sat Aug 04, 2007 3:42 pm

Re: turrets

Post by Deus Siddis »

esgaroth wrote: What I would need would probably be the example settings for a turret firing in x (and y and z and -x and -y and -z) direction, angle of fire 45°. The coordinates where to put it I could figure out myself, and I hope i can manage to make a phaser turret in the unist.csv, but i have no clue about the variables (direction pointing, angle of fire etc).
I think I can help you here...

Turret:
First thing you need for a basic turret (actually a swiveling gun) is a unit in units.csv, that has (non-zero) values set for the Maneuver_Yaw, Maneuver_Pitch, Yaw_Governor and Pitch_Governor columns. This allows it to rotate left, right up and down. Then add your phaser(s) weapons for the Mounts column. Now your turret can turn and shoot.

Vessel:
The type of turret that is installed, its position, orientation and rotation limits are all defined in the Sub_Units column for the ship the turret is being installed on. A vector is used to define the direction the turret is pointing and another vector defines the direction the turret considers to be up (in other words, this sets the turret's roll orientation). The rotational limits of the turret are defined in degrees, which applies to every direction, so if you want a 90 degree field of fire then you should set this to 45, which will allow it to rotate only 45 degrees left, right, up or down.

The vessel's Sub_Units column takes a curly-brace-enclosed, semicolon-separated list that is defined as this:
units.csv Sub_Units Column wrote:{filename(string);x(meters);y(meters);z(meters);forex(meters);forey(meters);forez(meters);upx(meters);upy(meters);upz(meters);restricted(meters)}
Which for you might look like this--

Code: Select all

{
Phaser_XGL    # the turret unit that will be installed at this point
;
50.2    # X position of turret on ship
;
26.4    # Y position of turret on ship
;
15.0    # Z position of turret on ship
;
0.0    # X ordinate of directional vector turret is facing
;
1.0    # Y ordinate of directional vector turret is facing
;
0.0    # Z ordinate of directional vector turret is facing
;
0.0    # X ordinate of directional vector turret considers "up"
;
0.0    # Y ordinate of directional vector turret considers "up"
;
1.0    # Z ordinate of directional vector turret considers "up"
;
45.0    # turret has a 90 degree field of fire
}
Put one of those lists in the ship's Sub_Units column for every turret the ship should have.
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Re: turrets

Post by klauss »

esgaroth wrote:
Turrets are destructible, but phaser banks not so much.
Sorry, but they are. There are numerous events in Star Trek when they specifically target phasers or shields or whatever subunit you imagine, and then specifically damage this subumit. So this feature would fit perfectly.
Read the whole paragraph.
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
TBeholder
Elite Venturer
Elite Venturer
Posts: 753
Joined: Sat Apr 15, 2006 2:40 am
Location: chthonic safety

Re: turrets

Post by TBeholder »

esgaroth wrote:
Turrets are destructible, but phaser banks not so much.
Sorry, but they are. There are numerous events in Star Trek when they specifically target phasers or shields or whatever subunit you imagine, and then specifically damage this subumit. So this feature would fit perfectly.
"Subunit" doesn't mean what you seem to assume it means. I'm about shields here. A subunit is a full-on unit with its own AI and separate ROLE glued to another unit and disregarded in some cases. As such, turrets have shields, but must produce power for them in the subunit, i.e. separately from the ship's and as this works now, they help only against shots at the turret. Yup, messed up. That's why it needs fixing.
As to the weapons, mounts lumped into banks can be damaged just like any other mounts. Crank up damage_player_chance and/or definite_damage_chance in config, and this will happen more often.
Of course, you can lump a turret's mounts into bank just as well, but the difference will be visible only when you switch to the turret cockpit.
esgaroth wrote: What I would need would probably be the example settings for a turret firing in x (and y and z and -x and -y and -z) direction, angle of fire 45°. The coordinates where to put it I could figure out myself, and I hope i can manage to make a phaser turret in the unist.csv, but i have no clue about the variables (direction pointing, angle of fire etc).
try to copy turret_90. Then again, franklin_pd already aims in a 2DoF cone and not 1DoF+1DoF, so look into Franklin.
"Two Eyes Good, Eleven Eyes Better." -Michele Carter
esgaroth
Confed Special Operative
Confed Special Operative
Posts: 317
Joined: Mon Jan 19, 2004 12:48 pm
Location: Konstanz, Germany

Re: turrets

Post by esgaroth »

OK, thanx for the hints, I´ll try to take turret_90 as a model and will see whether i manage to get it to work.
TBeholder
Elite Venturer
Elite Venturer
Posts: 753
Joined: Sat Apr 15, 2006 2:40 am
Location: chthonic safety

Re: turrets

Post by TBeholder »

TBeholder wrote:
esgaroth wrote:As the phaser banks dont seem to work with the current engine
Really? That's weird. I certainly remember writing a patch that indicated the number of still-functional weapons in a bank - and testing it on tweaked VS data, too.
Weapon banks do need more support on upgrade installation side, however.
Ah, here it is, among some other things - banks should be indicated as e.g. "Laser x4". See also Mount::Fire in src/cmd/unit_generic.cpp - there's some special case processing for banks, though somewhat weird.
"Two Eyes Good, Eleven Eyes Better." -Michele Carter
esgaroth
Confed Special Operative
Confed Special Operative
Posts: 317
Joined: Mon Jan 19, 2004 12:48 pm
Location: Konstanz, Germany

Re: turrets

Post by esgaroth »

# X ordinate of directional vector turret considers "up"
Actually, why does the turret needs this ? is the angle of fire only for "left" and "right" and not for up and down ?
TBeholder
Elite Venturer
Elite Venturer
Posts: 753
Joined: Sat Apr 15, 2006 2:40 am
Location: chthonic safety

Re: turrets

Post by TBeholder »

For an arbitrary subunit (like skatecargo), obviously the mesh isn't radially symmetrical thus it's important where which axis goes.
A typical 2-piece turret rotates around upXYZ, from foreXYZ where it's initially pointed, to restricted degrees. Thus all these variables matter.
With 2-DoF turrets like Franklin's the choice of a normal to "fore" vector shouldn't matter... until you'll switch to subunit's cockpit to look what it does. :) At which point it's "how your screen will be oriented".
"Two Eyes Good, Eleven Eyes Better." -Michele Carter
Deus Siddis
Elite
Elite
Posts: 1363
Joined: Sat Aug 04, 2007 3:42 pm

Re: turrets

Post by Deus Siddis »

esgaroth wrote:As the phaser banks dont seem to work with the current engine, it would be a nice idea to switch the phasers of the large ships to turrets.
klauss wrote:Why wouldn't they?

I don't remember any phaser-breaking changes. In fact, there were phaser-fixing ones.
Ah, I think I have seen now what esgaroth meant. Auto-tracked beams don't affect their targets.

This is why the main guns on the vigilance do no damage then. I had thought it was because they were too widely spaced but it is some bug with the auto-trackering beams. They visibly shoot straight through the center of the target vessel but no damage is dealt whatsoever. Yet beams work fine normally.
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Re: turrets

Post by klauss »

So I gather you can reproduce this on VS?

Do you have a savegame that reproduces it?
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
Deus Siddis
Elite
Elite
Posts: 1363
Joined: Sat Aug 04, 2007 3:42 pm

Re: turrets

Post by Deus Siddis »

klauss wrote:So I gather you can reproduce this on VS?
Yes indeed, the bug occurs everywhere that a beam is used on an auto-tracking mount in VS.
Do you have a savegame that reproduces it?
I just created a special test case to demonstrate this bug:
save.zip
It is a save with a modified Gawain as your ship, armed with one auto tracked particle beam and one fixed particle beam. Try shooting a target with aim that is off enough that only the auto tracked weapon hits it. You'll see no real damage is done. Then aim directly at it and hit it with the fixed particle beam. You should suddenly see significant results. It is like night and day.
You do not have the required permissions to view the files attached to this post.
TBeholder
Elite Venturer
Elite Venturer
Posts: 753
Joined: Sat Apr 15, 2006 2:40 am
Location: chthonic safety

Re: turrets

Post by TBeholder »

Yup, it's an old beam collision hack. Weird, yes, but before removing it got to fix problems it obviously solves.
1) When the old target is destroyed, new one is selected unpredictably and immediately, so if autotrackers just followed the current non-locked target, it would be very easy to cook non-hostile units in the cone before you unpress "fire".
2) I also suspect that otherwise turrets aren't hittable at all.

IMO, a sane solution is to have autotracker do nothing at all unless the target is locked. This leaves subunit collision hack, but removes weird behaviour out of sight.
There already is variable "physics/must_lock_to_autotrack" set to true as default, but it's not used in one of the places where it should be. Someone forgot what the arcane concept of "procedural programming" is about. Again. :wink:

Edit: done - here's a patch.
"Two Eyes Good, Eleven Eyes Better." -Michele Carter
Deus Siddis
Elite
Elite
Posts: 1363
Joined: Sat Aug 04, 2007 3:42 pm

Re: turrets

Post by Deus Siddis »

TBeholder wrote: 1) When the old target is destroyed, new one is selected unpredictably and immediately, so if autotrackers just followed the current non-locked target, it would be very easy to cook non-hostile units in the cone before you unpress "fire".
But auto tracked guns with decent re-fire rates have the same problem, so isn't the best solution to simply not select a new target automatically after the current one is gone?
2) I also suspect that otherwise turrets aren't hittable at all.
Why do auto tracked beams need a special collision routine to hit turrets if normal beams and guns do not?
esgaroth
Confed Special Operative
Confed Special Operative
Posts: 317
Joined: Mon Jan 19, 2004 12:48 pm
Location: Konstanz, Germany

Re: turrets

Post by esgaroth »

Edit: done - here's a patch.
And what do I do with this patch ? Dont know what to do with a .patch file.......
TBeholder
Elite Venturer
Elite Venturer
Posts: 753
Joined: Sat Apr 15, 2006 2:40 am
Location: chthonic safety

Re: turrets

Post by TBeholder »

Apply it, of course. :) In Penguinux, patch probably is already installed (as a dependency of subversion package, for one), so all you need is

Code: Select all

/wherever/you/keep/the/working/copy.../trunk/vegastrike$ patch -p0 -i /wherever/you/saved/that/patch.../TargetTracked_01.patch 


Edit: added it to wiki.
Last edited by TBeholder on Wed Jul 17, 2013 9:32 am, edited 1 time in total.
"Two Eyes Good, Eleven Eyes Better." -Michele Carter
esgaroth
Confed Special Operative
Confed Special Operative
Posts: 317
Joined: Mon Jan 19, 2004 12:48 pm
Location: Konstanz, Germany

Re: turrets

Post by esgaroth »

Sorry, I have windows only. .....
TBeholder
Elite Venturer
Elite Venturer
Posts: 753
Joined: Sat Apr 15, 2006 2:40 am
Location: chthonic safety

Re: turrets

Post by TBeholder »

Then see windows section in wiki.
"Two Eyes Good, Eleven Eyes Better." -Michele Carter
esgaroth
Confed Special Operative
Confed Special Operative
Posts: 317
Joined: Mon Jan 19, 2004 12:48 pm
Location: Konstanz, Germany

Re: turrets

Post by esgaroth »

Image
Every one of the four patched files gives such an error message.......
TBeholder
Elite Venturer
Elite Venturer
Posts: 753
Joined: Sat Apr 15, 2006 2:40 am
Location: chthonic safety

Re: turrets

Post by TBeholder »

If it recognizes format, but rejects all of them? Are you sure you're applying patches to the right place (in this case base path, obviously, is trunk/vegastrike) and not anywhere else?
If not that, try to convert EOL to windows standard (via text editor with CR/LF option or something). This should be adjusted automatically, but who knows.
"Two Eyes Good, Eleven Eyes Better." -Michele Carter
esgaroth
Confed Special Operative
Confed Special Operative
Posts: 317
Joined: Mon Jan 19, 2004 12:48 pm
Location: Konstanz, Germany

Re: turrets

Post by esgaroth »

Are you sure you're applying patches to the right place (in this case base path, obviously, is trunk/vegastrike) and not anywhere else?
No, I am not sure, but I applied it to the vegatrek main directory. Actually, when I was looking at the pic, I recognized "src/cmd/unit_generic.cpp" . Vegatrek has a src folder, but no cmd subfolder etc. In this src folder, we have some helpful stuff (Stuniverse program) and some remnants from tillias but nothing else.... We have no source code cause we have noone who understands this stuff or can compile...
Post Reply