[SCR] Smart Turrets v4.7.2 (AP, 05-04-14), v2.6 (TC, 21-08-13)

The place to discuss scripting and game modifications for X³: Terran Conflict and X³: Albion Prelude.

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

Shimrod
Posts: 907
Joined: Tue, 18. Feb 03, 01:43
x4

Post by Shimrod »

I'll be playing through XRM for some time after 1.3 is done and looking at the laser selection, beams in particular. I want to keep the laser selection heuristic and avoid manual configuration where possible.

Noticed another issue, not sure if it's XRM specific or if I never noticed it before. Smart presently runs with empty turrets due to the way its structured, unless Idle Lasers is set. Ships under 'attack all enemies' just idle if their turrets are empty, looks like there's a laser strength == 0 check somewhere.

Should be an easy fix...

...Fixed :)

Just did a 10x10 M7 Reven Smart vs AI. Revens fully loaded (all laser volumes set to 1) and each with 3 falcons. Smart came through with the loss of 1 Reven :)
Last edited by Shimrod on Fri, 5. Aug 11, 01:50, edited 1 time in total.
Mizuchi
Posts: 806
Joined: Thu, 10. Feb 11, 05:48

Post by Mizuchi »

Shimrod wrote:Should be an easy fix...
"And that was the third time I died." :wink:
garrry34
Posts: 911
Joined: Sun, 17. Jul 05, 14:43
x3tc

Post by garrry34 »

Shimrod wrote:I want to keep the laser selection heuristic and avoid manual configuration where possible.
totally agree with you there, I was thinking like a manual overide for the player ship only...
PhenomII X4 940 black edition
8GB DDR2
ATI HD4890
Windows 7 64bit
Shimrod
Posts: 907
Joined: Tue, 18. Feb 03, 01:43
x4

Post by Shimrod »

Done a 10v10 loaded Reven fight vs the latest MARS enabled AI, separated by 15k all ships approaching head on.

Spectacular seeing the fleets antimissile vs incoming goblins, PALC shooting everywhere. In close quarters getting a bit of friendly fire from it...

MARS has an early game preference for taking out the M3's while Smart focusing on the M7's. Smart gains the upper hand in surviving revens, but MARS has more falcons left on its side...

I zoomed in on a Smart ship to see it passing by at close range getting some sneaky PBG shots in at the exposed underbelly...

2 MARS reven left versus 5 but the weight of fighters takes it do 1 vs 3. MARS ships appeared starved on laser energy but the smart gun throttling seems to be keeping a good contingency.

Finally its all over, 3 Smart revens emerge victorious, two with <50% hull and the other with barely any shields.

I reckon 1.3 is close to release :)

MARS is dominating the M6 20x20 arena though (HCP, Hyperion).
garrry34
Posts: 911
Joined: Sun, 17. Jul 05, 14:43
x3tc

Post by garrry34 »

I feel like I should watching boxing or something...
PhenomII X4 940 black edition
8GB DDR2
ATI HD4890
Windows 7 64bit
Shimrod
Posts: 907
Joined: Tue, 18. Feb 03, 01:43
x4

Post by Shimrod »

It's been a fun nights testing :)

I'm happy with laser selection and targetting versus M7, M2. Not too happy with selection versus M6 targets though, feels like it needs a hybrid approach somewhere between speed and DPS.

In early development before selecting from ordered lists I used an approach of preferring a laser's DPS if it had sufficient speed (3x max speed), or otherwise preferring best speed. Could be prepared as a cached list though ideally want to apply a range component to reduce speed requirement as range decreases.

I suspect I'll need to disable the drones though vs MARS for cleaner tests, or at least make a script to roll out 'attack capitals'. I've just been doing 'attack enemies' and noticed that tyr's were following drones. Might have resulted in reduced main gun use in earlier M6 tests if they were chasing drones around.

1.3 is looking stable from fight logs, and I've finished my todo list. Hopefully will be ready for a release tomorrow.
Last edited by Shimrod on Fri, 5. Aug 11, 04:10, edited 1 time in total.
User avatar
joelR
Posts: 2008
Joined: Mon, 9. Jul 07, 23:33
x3tc

Post by joelR »

I absolutely love the main guns option. Its tons of fun in fighter vs fighter dogfights when my weapons switch mid fight. Some of the choices seem odd (like using IRES!) but when coupled with the ships turrets somehow it works out.....great work here. Its really great having an alternative to MARS that also works with MARS!
Shimrod
Posts: 907
Joined: Tue, 18. Feb 03, 01:43
x4

Post by Shimrod »

Thanks for the feedback :)

The main guns use similar laser selection to turrets:

1. No target = strongest DPS
2. Have target, out of range = longest range
3. Have target, in range :-
a. M6+, station : best shield or hull DPS that can reach
b. Otherwise best bullet speed that can reach

The overall selection is also affected if there are friendlies in weapons range. In this case lasers in the collateral damage list (configurable from menu) are excluded from selection.

If it's picking IREs at M6 targets it might be that the DPS Cache hasn't got a laser delay sample for it yet, and it's calculating DPS based on a default 50ms refire rate which would boost its DPS value relative to other stuff you do have samples for.

The DPS cache only trains up when Smart turrets have shot that particular laser, as the delay sampling code is built into the firing loop. If it's going to be awkward (e.g. turrets can't mount that gun so you can't get a sampled DPS), you can set the cache delay value in manually via the menu.
garrry34
Posts: 911
Joined: Sun, 17. Jul 05, 14:43
x3tc

Post by garrry34 »

well I tend to command my ship to attack my target while using luicikes auto target, it is awesome, it will auto target the enemies in your area by strongest to weakest by default but you can change it for the reverse only works on the players ship though...
PhenomII X4 940 black edition
8GB DDR2
ATI HD4890
Windows 7 64bit
Shimrod
Posts: 907
Joined: Tue, 18. Feb 03, 01:43
x4

Post by Shimrod »

1.3 is up, the main changes:

- Offense, Defense, Attack My Target modes + mode cycling hotkey
- Performance enhacements
- Fixes
- An uninstall button :)

This is the biggest update so far and has done the circuit of XTC, Vanilla, XRM while being tested. My final test was patching from 1.2 to 1.3, and I tried a fleet battle using 1.2 beforehand. Performance is significantly better in 1.3!

Full changelist in the 2nd post of the thread.
garrry34
Posts: 911
Joined: Sun, 17. Jul 05, 14:43
x3tc

Post by garrry34 »

I shall give it a roll tonight and let you know my feedback in the morning...
PhenomII X4 940 black edition
8GB DDR2
ATI HD4890
Windows 7 64bit
Shimrod
Posts: 907
Joined: Tue, 18. Feb 03, 01:43
x4

Post by Shimrod »

Thanks man. Beware as an XRM user that this upgrade will clear out the collateral damage laser list in cases where the laser count differs significantly from vanilla.

I was tripping over bad default collateral damage lists too much in XRM fleet battle testing, forgetting to reset them. Seemed the lesser of evils to flush the list, than risk easily forgetting to adjust them on a new game and getting PBE's excluded with friendlies around.

I'm going to have a play with XRM before embarking on 1.4 :)
Halconnen
Posts: 831
Joined: Sun, 22. Feb 04, 12:55
x3tc

Post by Halconnen »

For the changed swarm missile calculations:

Does the script detect automatically what missiles are swarm missiles? XRM mucks with those a -lot-.
garrry34
Posts: 911
Joined: Sun, 17. Jul 05, 14:43
x3tc

Post by garrry34 »

loving the changes though I have to ask what way do the missile turrets work as in missile selection, if im using a missile ship loaded with shadows and ghouls it always goes for the shadows, In XRM the missile speeds have been ramped up could this be a factor, I guess I'm just used to litcubes missile boat where it will use the shadows for capital class and ghouls for fighter...
PhenomII X4 940 black edition
8GB DDR2
ATI HD4890
Windows 7 64bit
Kadatherion
Posts: 1021
Joined: Fri, 25. Nov 05, 16:05
x4

Post by Kadatherion »

A question related to missiles from me too: does setting the engagement radius to very high values (50-60 km) so the missile frigates fire their barrages from a safe distance have any detrimental effect to the efficiency of turrets mounting common lasers?

I just got blown by my own barrages in my Aquilo as Smart decided to fire its missile volleys only when I was near a Xenon fleet (15 km is the default value, and as such before I could be in range for it to fire against the cap ships I was already swarmed by fighters), so an higher engagement radius seems in order, but I wouldn't want to cripple the rest of the turrets for every ship - as it is a global value - just for the rare occasion when I take my M7M out for a stroll.

P.S. @Garrry: in this aforementioned test of mine, apart from the engagement radius "issue", Smart was quite... smart in selecting the missiles on the spot, firing Hammers at the cap ships and Flails at the fighters.
garrry34
Posts: 911
Joined: Sun, 17. Jul 05, 14:43
x3tc

Post by garrry34 »

Kadatherion wrote:P.S. @Garrry: in this aforementioned test of mine, apart from the engagement radius "issue", Smart was quite... smart in selecting the missiles on the spot, firing Hammers at the cap ships and Flails at the fighters.
aye I was jsut wondering if it took speed of missile into account, as in xrm shadows are faster than ghoul, if so I was going to adjust the ghouls...
PhenomII X4 940 black edition
8GB DDR2
ATI HD4890
Windows 7 64bit
Shimrod
Posts: 907
Joined: Tue, 18. Feb 03, 01:43
x4

Post by Shimrod »

Halconnen wrote:Does the script detect automatically what missiles are swarm missiles? XRM mucks with those a -lot-.
Yes, fortunately missile flags are available to scripts, unlike lasers (grumble)
garrry34 wrote:loving the changes though I have to ask what way do the missile turrets work as in missile selection
* For fighter targets the script will always select a swarm missile if available
* For 'bigship' targets the missile selection is unrestricted
* The missile with least amount of overkill (if exceeding target hull+shield dps) is selected. Else if no missiles kill the target outright, a multiple of the strongest missile is used in a barrage sufficient to exceed (hull+shield)
* Hull+Shield is modified by the configurable overkill percentage such so that extra missiles will get fired.

I checked with a Skirnir and it is shooting ghouls at M3 and shadows at M6. Seems to be working as intended, though if it makes more sense to include M6 in the fighter category I can look at that...

The barrage limit is to avoid lag. There's also a sanity check so missiles aren't shot if it'll take more than twice the barrage limit to kill the target.
Kadatherion wrote:A question related to missiles from me too: does setting the engagement radius to very high values (50-60 km) so the missile frigates fire their barrages from a safe distance have any detrimental effect to the efficiency of turrets mounting common lasers?
No harm in upping the radius at all, I was just conservative with the default settings. Wasn't sure if people would dislike potentially unloading barrages all over the place by default. Default settings afford good defence (self, wing/formation) and modest offence (15km fire free, self+wing/formation ship target assist).

I don't think it's in any way cheating to check all the boxes, it just depends how many missiles you're happy to expend. I should point out that the missile boat won't shoot engagement radius targets beyond its own max scan range, regardless of radius setting. I wanted to have it so that if the target is visible on the sector map then it would shoot it, allowing for shared visibility. However the 'visible' flag on the find operations doesn't work, so I either had to cap it at scan range or having it firing missiles off at unseen targets.

There's no range limit placed on shooting 'attackers' of self or friendlies (if configured to defend them), except for the missile range itself.

The script uses a simple check like the mosquito defense script as to whether or not to shoot at a target : it'll shoot a target if that target has no incoming missiles already, regardless of type and amount. Seems to work well enough in practice.

Each missile turret on a ship targets independently so the more turrets, the more concurrency in its barrages. I've used an arbitrary delay of 3-6 seconds between missile turret target evaluations.
garrry34 wrote:aye I was jsut wondering if it took speed of missile into account, as in xrm shadows are faster than ghoul, if so I was going to adjust the ghouls..
Speed isn't taken into account, though it can be if there are bad missile selections being made.

For the curious these are the relevant subroutines:

Target selection
glen.turret.smart.targetting:75 GetMissileTarget

Missile selection for target used by GetMissileTarget
glen.turret.smart.weapons:550 GetBestMissile
Last edited by Shimrod on Sat, 6. Aug 11, 19:33, edited 1 time in total.
Kadatherion
Posts: 1021
Joined: Fri, 25. Nov 05, 16:05
x4

Post by Kadatherion »

Thanks for the reply Shimrod :)

I made a rather extensive test with the Aquilo cleaning some Xenon sectors, and it definitely was effective. However, while the turrets were absolute killers to pretty much anything in range, they seemed to ignore the Z M0 class dreadnaugths (running on XRM).
Even though they sport a very high hull+shields sum, I had plenty of hammer torpedoes on board, more than enough to kill both, yet not a single one was fired. Still, I wonder if those particularly heavy ships combined with XRM's high hull pack (which multiplies hulls for M2 class ships by 12) might end up feeding such a high number to the Smart turrets that they don't even recognize 'em anymore as valid targets :roll:
Shimrod
Posts: 907
Joined: Tue, 18. Feb 03, 01:43
x4

Post by Shimrod »

Failure to shoot the Z might be linked to the check for not shooting the target if it'd require MaxBarrage*2 missiles. Don't want the missile boat firing hundreds of flails at M2's if it runs out of hammers, that wasn't a pretty sight when I was testing.

Upping the barrage cap, lowering overkill or using a more powerful torpedo/boat are options. Perhaps there's a better way to handle the situation, just didn't want to do anything crazy in like shoot a thousand mosquitoes at an m2.

I've repro'd the problem with an aquillo vs Z. The skirnir I had spawned for an earlier test did shoot it though. After that barrage had taken out its shields and when I raised up the barrage limit the aquillo shot it.

I'll look into it more, could be something weird like an integer overflow with the Z having so many HP :)
Kadatherion
Posts: 1021
Joined: Fri, 25. Nov 05, 16:05
x4

Post by Kadatherion »

Ah I see, that makes sense. I'll have another go at it tomorrow playing with the barrage cap a bit, thanks for the tip :wink:

Return to “X³: Terran Conflict / Albion Prelude - Scripts and Modding”