[BONUS Plug-In] Gunnery Crew turret plugin - Version 3.02

The place to discuss scripting and game modifications for X²: The Threat.

Moderators: Moderators for English X Forum, Scripting / Modding Moderators

User avatar
3iff
Posts: 1085
Joined: Thu, 23. Oct 03, 09:52
x2

Post by 3iff »

Reven,

So you mean it's the players responsibility to keep away from friendly fixed items like stations and gates?

Makes sense, I suppose, and it saves the script having to worry about it.

I'll keep that in mind.

Must admit it's very strange flying an M2 without having my own guns to fire...I could jump into a turret but I'd prefer not to...
...locating mandolin strings in the middle of Austin.
User avatar
Reven
Posts: 1133
Joined: Thu, 10. Jul 03, 07:42
x4

Post by Reven »

stella wrote:How does the script handle target prioritisation?

For instance, if I'm attacking a KM3 in a Khaak sector, and an M1 comes into range, will my turrets see it as a greater threat and switch their attack, or will they carry on firing at their current target, while 6 Gamma Kyons rip me up?
In the public release, 2.11, there is no class-based target prioritization. A turret will first try to engage the ship's target, however, so in a capital engagement be sure to target the big ship.

In version 3 (which is in the signing process right now), I've implemented class-based prioritization. Target selection works in the following order:
  1. The ship's target is still a turret's first choice to engage.
  2. Next it looks at the ship's class in the order: M2, M1, OL (Orbital Laser), M6, M3, Pirate TS, TP, M4, TS, M5, Any other enemy (ie: bases)
  3. If there is more than one ship that is engagable of the same class, the closest one is selected.
This is pretty well tested, and works very well. I've spawned 8 of the largest clusters and a Khaak destroyer right on top of my titan and had it win.

What I am currently working on is code to make sure that there are never more than one turret targeting an M5 or M4 at one time. Be ensuring that turrets aren't ganging up on opponents that don't need multiple turrets, I think I can squeeze another 10-15% efficiency when engaging large groups of small fighters.

Something for you to look forward to (I hope). :)
You were warned... pirates will be hunted down like vermin.

Ex Turbo Modestum
User avatar
3iff
Posts: 1085
Joined: Thu, 23. Oct 03, 09:52
x2

Post by 3iff »

Sounds great...
...locating mandolin strings in the middle of Austin.
stella
Posts: 1004
Joined: Tue, 17. Feb 04, 18:41
x2

Post by stella »

bloody marvellous :D
Attack enemies in radius -here
User avatar
The Flash
Posts: 468
Joined: Tue, 2. Mar 04, 00:43
x3tc

Post by The Flash »

Arf Arf.... how long? how long? can't wait.....
Smith & Wesson: the original point-and-click device!
frymaster
Posts: 3008
Joined: Wed, 6. Nov 02, 20:31
x4

Post by frymaster »

as scripts could be considered as optional "gameplay patches" it really depends on how many times it gets bounced for balance tweaks / conflicts / bugs / behavior changes.

Reven being Reven I don't expect many bugs or conflicts, but balance and intended behaviour is very much about point of view and could take any amount of time
Z0diac
Posts: 213
Joined: Fri, 6. Aug 04, 19:43
x3

Post by Z0diac »

OOH! This script is gonna get signed? Nice! I always wanted to try it, but I absolutely don't want the "modified" tag.

Can't wait!
Signatures are for the wicked.
rfoote
Posts: 171
Joined: Thu, 18. Dec 03, 17:51
x3tc

Post by rfoote »

Z0diac wrote:OOH! This script is gonna get signed? Nice! I always wanted to try it, but I absolutely don't want the "modified" tag.

Can't wait!
There is NO modified tag!! It's great, and I can hardly wait for the signed version w/ the improvements!! Great work Reven!!!
User avatar
Pinger
Posts: 624
Joined: Thu, 31. Jul 03, 11:19
x2

Post by Pinger »

@rfoote any script you use that isn't signed gives you a modified Water Mark top left on your screen in the game, alsoshows in the stats listing at the bottom. Also triggered if you start the script editor.
User avatar
DeadlyDa
Posts: 1883
Joined: Mon, 5. Jan 04, 04:46
x4

Post by DeadlyDa »

You can also easily remove the "no modified" tag, if that is your only concern.
User avatar
Reven
Posts: 1133
Joined: Thu, 10. Jul 03, 07:42
x4

Post by Reven »

I just had the GREATEST IDEA!!!

I just finished implementing burst-fire mode (wow it's cool to see turrets firing mass drivers at 20 rounds per second - soon no one will ever slag a mass driver again).

Anyways, actually it's not the greatest idea. It's complete stupidity on my part for not seeing this sooner. Arghhh! How could I have been so blind?
[ external image ]

I need ticaki -- he'll need to approve this.

TICAKI WHERE ARE YOU? Not on devchat, not on ICQ. ARGH.
You were warned... pirates will be hunted down like vermin.

Ex Turbo Modestum
cynric
Posts: 354
Joined: Mon, 15. Dec 03, 02:24
x2

Post by cynric »

how exactly is that maximise capture command supposed to work? My fully loaded Ray (PPC, Ion D., APSG) kept on using the ion disruptors although the targets shields where down and the hull was still at 100%
User avatar
Pinger
Posts: 624
Joined: Thu, 31. Jul 03, 11:19
x2

Post by Pinger »

cynric wrote:how exactly is that maximise capture command supposed to work? My fully loaded Ray (PPC, Ion D., APSG) kept on using the ion disruptors although the targets shields where down and the hull was still at 100%
It uses the lost powered weapon, so if you want to capture move you Ion's to a M3 you have docked so its forced to use the PSG's.
frymaster
Posts: 3008
Joined: Wed, 6. Nov 02, 20:31
x4

Post by frymaster »

lol, that's the most excited I've ever seen Reven

this must be good :)
Math problems? Call 0800-[(10x)(13i)^2]-[sin(xy)/2.362x]
User avatar
3iff
Posts: 1085
Joined: Thu, 23. Oct 03, 09:52
x2

Post by 3iff »

Not sure if this has been reported...or if it's a feature.

In Thynns Abyss, attacking xenon with turrets on max captures and xenon set to foe. I decide to go into xenon 472 and set xenon to friendly so I don't accidentally blast the jumpgate. However, as the enemy ships are still red, my turrets engage them.

I have to set turrets to NONE to avoid my hired gunners attacking them.

Thinking about it, I'm not sure if I fly within range of a pirate ship and they're set to friendly, whether my turrets fire.

It would be nice if enemy ships weren't engaged unless they were also set to foe...if that's possible?
...locating mandolin strings in the middle of Austin.
cynric
Posts: 354
Joined: Mon, 15. Dec 03, 02:24
x2

Post by cynric »

3iff wrote:Not sure if this has been reported...or if it's a feature.

In Thynns Abyss, attacking xenon with turrets on max captures and xenon set to foe. I decide to go into xenon 472 and set xenon to friendly so I don't accidentally blast the jumpgate. However, as the enemy ships are still red, my turrets engage them.

I have to set turrets to NONE to avoid my hired gunners attacking them.

Thinking about it, I'm not sure if I fly within range of a pirate ship and they're set to friendly, whether my turrets fire.

It would be nice if enemy ships weren't engaged unless they were also set to foe...if that's possible?
you also have to set that "show as enemy if enemy to me" kinda switch to off. they won't be red anymore and your turrets shouldn't fire
User avatar
Reven
Posts: 1133
Joined: Thu, 10. Jul 03, 07:42
x4

Post by Reven »

From my latest turret script's debug log:

Code: Select all

FIRE- Starting on turret 1
FIRE- Starting on turret 4
FIRE- Turret 4 Main is Gamma Photon Pulse Cannon, WMD is Ion Disruptor, CIWS is Mass Driver, Tracking is Mass Driver
FIRE- Turret 4 Main refire is 270ms, Heavy refire is nullms, WMD refire is 200ms
FIRE- Turret 1 Main is Gamma Photon Pulse Cannon, WMD is Ion Disruptor, CIWS is Mass Driver, Tracking is Mass Driver
FIRE- Turret 1 Main refire is 270ms, Heavy refire is nullms, WMD refire is 200ms
FIRE- Turret 1 selected target Pirate Ship
SEEK-  Starting task 51 with PID 488002269 for target Pirate Ship
FIRE- Turret 1 tracking task started - awaiting a firing solution
SEEK- Turret 1 firing solution is FLRET_FIREFREE for target Pirate Ship
FIRE- Turret 1 obtained FLRET_FIREFREE solution in 300ms
SEEK- Turret 1 firing solution is FLRET_FIREFREE for target Pirate Ship
FIRE- Turret 1 firing Gamma Photon Pulse Cannon at target Pirate Ship
SEEK- Turret 1 firing solution is FLRET_FIREFREE for target Pirate Ship
... More of the above
SEEK- Turret 1 firing solution is FLRET_FIREFREE for target Pirate Ship
FIRE- Turret 1 firing Gamma Photon Pulse Cannon at target Pirate Ship
FIRE- Turret 4 selected target Pirate Ship
SEEK-  Starting task 54 with PID 488002735 for target Pirate Ship
FIRE- Turret 4 tracking task started - awaiting a firing solution
SEEK- Turret 1 firing solution is FLRET_FIREFREE for target Pirate Ship
FIRE- Turret 1 firing Gamma Photon Pulse Cannon at target Pirate Ship
SEEK- Turret 1 firing solution is FLRET_FIREFREE for target Pirate Ship
FIRE- Turret 1 firing Gamma Photon Pulse Cannon at target Pirate Ship
SEEK- Turret 4 firing solution is FLRET_FIREFREE for target Pirate Ship
SEEK- Turret 1 firing solution is FLRET_FIREFREE for target Pirate Ship
FIRE- Turret 4 obtained FLRET_FIREFREE solution in 650ms
FIRE- Turret 1 firing Gamma Photon Pulse Cannon at target Pirate Ship
SEEK- Turret 4 firing solution is FLRET_FIREFREE for target Pirate Ship
SEEK- Turret 1 firing solution is FLRET_FIREFREE for target Pirate Ship
FIRE- Turret 4 firing Gamma Photon Pulse Cannon at target Pirate Ship
... More of the above
FIRE- Turret 1 firing Gamma Photon Pulse Cannon at target Pirate Ship
FIRE- Turret 4 firing Gamma Photon Pulse Cannon at target Unknown Object
SEEK- Turret 4 firing solution is FLRET_NOCOMMANDS for target Unknown Object
SEEK- Turret 4 is terminating PID 488002735
SEEK- Turret 1 firing solution is FLRET_NOCOMMANDS for target Unknown Object
SEEK- Turret 1 is terminating PID 488002269
FIRE- Turret 1 firing Gamma Photon Pulse Cannon at target Unknown Object
I didn't really need to post all that - just wanted to show off a little. :oops: The point is, and this was the great idea I posted about earlier, I have solved the refire delay issue across the board. No matter what the weapon is, no matter what its refire rate is, the turret system will now be able to fire it at its maximum refire rate.

What the above log is showing is that I have made the firing system into two separate tasks for each turret. The main task does most of the work, figuring out the best weapons, selecting targets, and firing. The second task does nothing but "aim" the turret. It's this aiming that previously kept weapons from firing at their maximum rate - because no aim command can complete in less than 150ms (a mass driver could fire three times in that "wasted" interval). With two concurrent tasks, we can fire at the maximum rate for any weapon. It's also a LOT more lag resistant - and I won't sport with your patience any longer explaining why that is.

At any rate, it works! Thought I would share.
You were warned... pirates will be hunted down like vermin.

Ex Turbo Modestum
User avatar
3iff
Posts: 1085
Joined: Thu, 23. Oct 03, 09:52
x2

Post by 3iff »

Cynric,

I never bother changing that setting...I'll check it out. I half suspected it was something I had missed rather than a script bug/feature.

Thanks.
...locating mandolin strings in the middle of Austin.
nobby375
Posts: 151
Joined: Fri, 15. Oct 04, 13:37
x3

Post by nobby375 »

Revan, this sounds like such a good script but i am having problems :?
Ive purchased the ware but when i run it in my oddy(or any other ship) the crew appears to run around from turret to turret as if they are playing tig! :evil:
and they dont even bother firing the weapons.
So far i have only given them a verbal warning but if this happens again they will be getting a P45 and a lesson in how airlocks work!

Have u heard of this type of problem before or am i just special?

Im running version 1.4 eng. without any conflicting scripts(I think) and have not seen this sort of prob in the forums

Any help would be great! :roll:
User avatar
Reven
Posts: 1133
Joined: Thu, 10. Jul 03, 07:42
x4

Post by Reven »

nobby375 wrote:when i run it in my oddy(or any other ship) the crew appears to run around from turret to turret as if they are playing tig!
I'm not quite sure I understand the issue - running from turret to turret? Are you saying you don't get any weapons fire?
You were warned... pirates will be hunted down like vermin.

Ex Turbo Modestum

Return to “X²: The Threat - Scripts and Modding”