[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: Scripting / Modding Moderators, Moderators for English X Forum

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

Post by Shimrod »

what does target stations mean?
Whether turrets should target red stations. Most significant for missile boats.
all options under missile turrets, any explanation on that?
The menu itself includes info text describing every option. Replicated from the menu text:

Fleet/Wing Support
Formation Support
Support All
The Fleet/Wing/formation/all support options causes the missile turret to assist wing ships, formation ships, and all player property in the sector respectively with attackers and attack targets.
Player Target Support
Player target support will cause the missile turret to shoot at the playership target when Smart is not in defense mode on that turret.
Engagement Radius (km)
The Engagement Radius setting specifies the radius at which the Smart enabled missile turret will fire at will when not in defense mode.
Overkill Percent
The overkill setting increases the amount of missile damage to be sent to a given target as a percentage of the targets combined hull and shield health. Note that if only a powerful missile is available to shoot a weak target this may still only fire one missile.
NPC missile interception and anti missile target limit, what exactly does that do?
Missile interception is where a ship will shoot missiles incoming to other ships of that race, whereas normally in the game turrets will only shoot missiles incoming to themselves. This is not without processing cost, particularly when many missiles m pass near a cluster of ships s. This can incur m*s*s.turrets 'target in firing arc of turret' calculations.

Regarding the performance menu settings, from the menu help text:

NPC Missile Interception
NPC missile interception requires each race running Smart in the sector to scan for missiles incoming to ships of that race. Disable this setting to avoid the scanning and have NPCs target only missiles incoming to themselves.
Anti Missile Target Limit
The anti missile target limit crops the number of missiles tracked by Smart enabled ships, reducing anti missile processing performed by turrets. This can be a problem particularly when clustered ships are tracking large swarms of missiles. The player ship is exempt from this cap.
Vayde
Posts: 850
Joined: Fri, 6. Feb 04, 21:02
x3tc

Post by Vayde »

I've enjoyed using this script pack for a while now, some observations.

As you enter a sector, and if enemy ships are in range and start targeting you, the turrets let fly and don't consider gates to be an issue :( I use the no rep loss for gates to compensate.

Terran turrets with EMPC's installed can't hit nippy m4's or m5's although they can get a few missiles. Commonwealth ships with high velocity weapons, vaporise them in short order.

In my current Terran play through with AP 3.0, missile usage to swat these pests is the only way to go, until my ships can upgrade to MAML.

Only a few niggles on what is an excellent set of scripts.
Still life in the old dog yet...
Shimrod
Posts: 907
Joined: Tue, 18. Feb 03, 01:43
x4

Post by Shimrod »

Re gates some options spring to mind.
1. Smart changes ownership of jumpgates to 'neutral race' like in Gazz's no notoriety loss from hitting jumpgates AL plugin. Should have no negative consequences.
2. Add a gate avoidance mode like station avoidance, where the turret won't shoot if a gate is anywhere in its firing arc. Less elegant than #1.

With EMPCs do you mean terran turrets prefer to shoot EMPC at fighters instead of SSC?

Do you mean MAML is also a better choice to shoot fighters (in vanilla?) than EMPC? ISTR the bullets were a lot slower than EMPC in vanilla, unless they have fragmentation behaviour I've overlooked.
Vayde
Posts: 850
Joined: Fri, 6. Feb 04, 21:02
x3tc

Post by Vayde »

Having a jump gate set to neutral would seem to be the correct thing to do. However are TOA's checked and set to neutral also?

I always believed that a MAML round, even if it misses, still detonates with a small blast radius.

From Rogey's AP site
A weapon usually found equipped by corvettes or frigate-sized ships. The Matter/Anti-Matter Launcher fires a bomb-like projectile which contains a small amount of anti-matter suspended in an energy field. When the energy field is disrupted by impact or fails after a period of time, the anti-matter mixes with surrounding matter, resulting in a large explosion.
Ships that don't pack SSC are at a major disadvantage. Only the Springblossom can equip it in the m6 class range. Which means Terran m6's using EMPC's, get chewed up and spat out by small pirate and Xenon raiding parties when engaged in sector and without human intervention.

I believe this is more the fault of Terran weapon design than your turret scripts, not allowing for a small fast weapon, for point defence duties, was a major cockup in their technology tree imo.

I've seen what the big Terran ships can do on their own, even against a small fleet, and never having played the Terran side before :oops: I was hoping your turret scripts would alleviate the issue of only having the EMPC as the weapon of choice.

I've seen a few mods now which add to the Terran weapon selection. I think I may have to look at incorporating a point defence weapon into my game at some point. That being the case, would your scripts pick it up and use it without modification?

Thanks for reading.

Vayde
Still life in the old dog yet...
Shimrod
Posts: 907
Joined: Tue, 18. Feb 03, 01:43
x4

Post by Shimrod »

Yes Smart is designed to handle game data modifications and should rebuild its caches and use the new laser after reload.

I think you're right about MAML having a blast radius. In vanilla AP, 'get bullet flags of laser' reports:

MAML (Bullet.SelfDestruct)
FAA (Bullet.SelfDestruct | Bullet.FireDelay)

Some interesting comparisons
- SSC has no flags.
- Cluster FAA has (Bullet.Fragment | Bullet.FireDelay)
- PSP has (Bullet.SelfDestruct | Bullet.FireDelay) - same as FAA

Google doesn't offer any details on what the flags mean precisely, but self destruct does strongly suggest AOE damage.

So I owe some experimentation with Smart, though for the moment I've got quite a full schedule of OK Traders enhancements to occupy my time.
Vayde
Posts: 850
Joined: Fri, 6. Feb 04, 21:02
x3tc

Post by Vayde »

No worries Shimrod, like I said, I don't think your scripts are at fault, just the Terran weapons system.

I've been around these games for a long time now and have spent years of my life testing and retesting other peoples mods and scripts. I know enough to be able to add the new Terran light laser I've been thinking about. Just been to lazy to implement it until now.


Vayde
Still life in the old dog yet...
nap_rz
Posts: 1383
Joined: Sun, 25. Dec 05, 10:42
x3tc

Post by nap_rz »

Shimrod wrote: Missile interception is where a ship will shoot missiles incoming to other ships of that race, whereas normally in the game turrets will only shoot missiles incoming to themselves. This is not without processing cost, particularly when many missiles m pass near a cluster of ships s. This can incur m*s*s.turrets 'target in firing arc of turret' calculations.

Regarding the performance menu settings, from the menu help text:

NPC Missile Interception
NPC missile interception requires each race running Smart in the sector to scan for missiles incoming to ships of that race. Disable this setting to avoid the scanning and have NPCs target only missiles incoming to themselves.
Anti Missile Target Limit
The anti missile target limit crops the number of missiles tracked by Smart enabled ships, reducing anti missile processing performed by turrets. This can be a problem particularly when clustered ships are tracking large swarms of missiles. The player ship is exempt from this cap.
several further questions regarding that

1. NPC will only intercept incoming missiles to their races' ships? not even to friendly ships or neutrals?
2. what about player ships, does smart have this feature for player ships?
3. I'm not sure I understand your explanation about anti missile target limit, this particular line about reducing anti missile processing performed by turrets confuse me, and what do you mean by player ship exempt from that cap, why?

another thing I'd like to know is, what smart status do NPC have? offense, defense?
Shimrod
Posts: 907
Joined: Tue, 18. Feb 03, 01:43
x4

Post by Shimrod »

1. NPC will only intercept incoming missiles to their races' ships? not even to friendly ships or neutrals?
Yes, NPC ships only check for missiles incoming to ships of their own race.
2. what about player ships, does smart have this feature for player ships?
Yes. In the player case, the scan is more detailed, and includes
a. missiles incoming to player ships
b. missiles incoming to non-hostile ships a player ship is protecting or following
c. missiles incoming to player stations
3. I'm not sure I understand your explanation about anti missile target limit, this particular line about reducing anti missile processing performed by turrets confuse me
A missile scan is performed periodically by a master ship of each race with Smart enabled in the sector, producing a potentially large array of missiles.

A task running on each Smart enabled ship of a race will periodically go through that list, calculate distance between missile and itself, trim out any missiles outside 10km, then populate 2 sets of incoming missile arrays ordered by distance: a. light missiles (swarm or S ware class), b. heavy missiles.

The cropping is applied to the light missile array. Only the nearest <MissileTargetLimit> missiles are retained. The heavy missile array is not cropped.

Each Smart turret on the ship during its antimissile phase will walk these 2 lists of < 10km missiles it's ship task has sorted by range and try to shoot them.

The cropping means Smart on ships other than the player ship will be less effective at taking out large swarms of light missiles, as a tradeoff for improved performance.
what do you mean by player ship exempt from that cap, why?
The cropping improves performance when barrages of missiles pass by clusters of ship which can cause a slowdown. There is no need to include the player ship in the cropping, and it will be more effective in antimissile when processing the full set.

The cropping was put in place when playtesting the AP forces in legends home defending against a Xenon fleet which I spawned, with Smart NPCs enabled on all ships. Swarm missiles sent into the bunched fleet from argon missile destroyers would noticeably impact performance.
another thing I'd like to know is, what smart status do NPC have? offense, defense?
Big and huge ships get offense mode, fighters get 'attack target' mode, everything else gets defense mode.
nap_rz
Posts: 1383
Joined: Sun, 25. Dec 05, 10:42
x3tc

Post by nap_rz »

do npc m8 and m7m use smart missile turrets roo?
Shimrod
Posts: 907
Joined: Tue, 18. Feb 03, 01:43
x4

Post by Shimrod »

Yes. They can be pretty nasty, so there's a config option to disable running Smart on anything the script API identifies is a 'missile boat'.
nap_rz
Posts: 1383
Joined: Sun, 25. Dec 05, 10:42
x3tc

Post by nap_rz »

another question : smart and console attack shield command

does they work together automatically or do I need to use smart capture mode or I can just leave it in offense/defense/custom mode if I decide to use turreted ships to attack shield?
Shimrod
Posts: 907
Joined: Tue, 18. Feb 03, 01:43
x4

Post by Shimrod »

Turrets running Smart's capture mode on every ship cooperate to regulate the amount of damage they put out to any given target.

The default auto setting performs shield suppression on big ships while trying to make anything smaller bail by damaging the hull. If you use big ship bailing addons, then you probably want to set the capturing turret command profile to 'bail only'.

Smart's capture mode caches type and amount of bullets of any given type it shoots at a target. Useful lifetime of each cached bullet is estimated by relating bullet speed and distance to target, whereafter it is assumed to have hit or missed. This is used to estimate the amount of in-flight shield and hull damage, so that the bailing or shield suppression algorithm can control the amount of shield and hull damage. Since the game only provides a timer granularity of 1 second, and distance travelled is only an estimate, error can creep in, but for the most part the system works ok.

Bullets fired by the ship's main guns on attack runs, by any other turret script - including Smart's non-capturing modes, are not tracked in this cache, so consequently Smart's capture mode does not take this into account. In other words, Smart's capture mode will only cooperate with turrets running capture mode. If you have a turret running Smart offense it will still try to kill the target, and capture mode turrets will not be aware of any in flight damage output, same with any other ship attack command that makes it shoot the main guns, or any other turret script.

Do note that this tracking system only applies to in-flight bullets. Naturally if actual shield and hull damage has been caused by some other script, the capturing mode will see this and take account of it when deciding whether to shoot.
nap_rz
Posts: 1383
Joined: Sun, 25. Dec 05, 10:42
x3tc

Post by nap_rz »

actually I'm not asking about main guns... I'm asking about smart turrets mode and ship console command attack shield, once again, ship console command attack shield.

smart offense + attack shield command = ?

vs

smart capture + attack shield command
Shimrod
Posts: 907
Joined: Tue, 18. Feb 03, 01:43
x4

Post by Shimrod »

There's no interaction between Smart and any other attack shield commands. If the ship is commanded to attack shields, this won't automatically set Smart Capture mode on the turrets, it needs done manually.
nap_rz
Posts: 1383
Joined: Sun, 25. Dec 05, 10:42
x3tc

Post by nap_rz »

Shimrod wrote:There's no interaction between Smart and any other attack shield commands. If the ship is commanded to attack shields, this won't automatically set Smart Capture mode on the turrets, it needs done manually.
I wasn't even thought that...

however, if a ship commanded to attack shield WILL IT BE ANY DIFFERENT if that ships' turret set to smart offense or capture mode?

that is ultimately what I'm actually asking, sorry english isn't my native language.
Shimrod
Posts: 907
Joined: Tue, 18. Feb 03, 01:43
x4

Post by Shimrod »

Sorry for misunderstanding the question, here's another stab at it. I read the question as:

If I set ship command "Combat-> Attack Shields Of...", does:
a. This influence the behaviour of any Smart enabled turrets on that ship? -> No
b. Smart influence the behaviour of the "Combat-> Attack Shields Of..." command? -> No
nap_rz
Posts: 1383
Joined: Sun, 25. Dec 05, 10:42
x3tc

Post by nap_rz »

so whether a ship is using smart offense or smart capture it doesn't affect it's capability in executing attack shield command?
Shimrod
Posts: 907
Joined: Tue, 18. Feb 03, 01:43
x4

Post by Shimrod »

Correct, Smart won't interfere with the attack shields of command.
Shimrod
Posts: 907
Joined: Tue, 18. Feb 03, 01:43
x4

Post by Shimrod »

AP version 4.6.0 uploaded. No change to TC version.

Internally there is much refactoring to improve maintainability, primarily using constants to replace literals most notably in the menu code. The version number system has been changed like OK Traders, including 3 display components mapped into a single integer for internal comparison. The improved heuristic laser selection algorithm added in the latest TC version has also been carried forward, which seems to perform fine on XRM an vanilla.

4.6.0
- Added a throttling setting to control whether Smart will reduce number of mounted lasers when laser energy is low. By default throttling will only be applied to turrets not main guns.
- Avoid rapidly firing lasers when the mode cycling hotkey is spammed.
- Add a gate rep loss avoidance setting, default on. When on, gates in the active sector are set to neutral race ownership.
- When avoiding stations, display command as COMMAND_DEFEND_STATION so the player can tell why its not shooting.
- Pick lasers more intelligently vs TS, TP, TM class targets.
- Fire amidships at huge ships when the target is estimated to be unlikely to outrun the bullet, intended to reduce miss rates from shooting at the very nose of a long ship.
User avatar
alt3rn1ty
Posts: 3421
Joined: Thu, 26. Jan 06, 19:45
x4

Post by alt3rn1ty »

Shimrod wrote:- Fire amidships at huge ships when the target is estimated to be unlikely to outrun the bullet, intended to reduce miss rates from shooting at the very nose of a long ship.
Thank you Shimrod
I haven't noticed any of the other new features being used in game yet but the quoted feature is working really well for me.
I am following the Shady Business plot, and a couple of factions are not too impressed with my choice of allegiance ( avoiding spoilers )
While waiting a period of 6-12 in game hours for the next bit, I have two sectors which are getting attacked periodically with an assortment of ships up to including Cerberus so far ( the size and amount of ships seems to be increasing, fortunately before this part of the plot developed I have some good patrol defences setup ) ..

Anyway, long story short, 4.6.0 is working well for all my ships and personal ship in sector. And my defences out of sector when I get attacked on two fronts simultaneously are doing well too.

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