[SCR] Smart Turrets v4.7.2 (AP, 05-04-14), v2.6 (TC, 21-08-13)
Moderators: Scripting / Modding Moderators, Moderators for English X Forum
-
- Posts: 907
- Joined: Tue, 18. Feb 03, 01:43
Smart (4.4) only prioritizes missiles alongside ships if the antimissile mode is disabled, or in scenarios where no lasers available to that turret are fit for light / heavy antimissile duty.
Instead Smart divides its time between antimissile and firing at a primary target.
Main Loop
-- Evaluate targets
-- Antimissile (fire a gun at each missile in arc)
-- Pick a primary target
-- Pick laser to shoot it with
-- Firing loop: minimum of 2 shots and 1 second elapsed
So antimissile operates at a reduced output when also shooting at ships, but I'd not expect torpedoes to be ignored completely. Shots per missile will be reduced.
In TC this wasn't so much an issue because 1 bullet would always kill a missile, and never fail to hit. Not so in AP with the missile hitpoints. XRM bullet accuracy and missile hitbox sizes may also be a problem factor.
Are you observing zero antimissile defence, or a reduced defence consistent with the timeslicing behaviour?
Instead Smart divides its time between antimissile and firing at a primary target.
Main Loop
-- Evaluate targets
-- Antimissile (fire a gun at each missile in arc)
-- Pick a primary target
-- Pick laser to shoot it with
-- Firing loop: minimum of 2 shots and 1 second elapsed
So antimissile operates at a reduced output when also shooting at ships, but I'd not expect torpedoes to be ignored completely. Shots per missile will be reduced.
In TC this wasn't so much an issue because 1 bullet would always kill a missile, and never fail to hit. Not so in AP with the missile hitpoints. XRM bullet accuracy and missile hitbox sizes may also be a problem factor.
Are you observing zero antimissile defence, or a reduced defence consistent with the timeslicing behaviour?
-
- Posts: 14163
- Joined: Sun, 16. May 04, 13:01
Where is that ? I've looked all over and I cant find any sort of options for Smart. (No mention of it at all in fact.)Shimrod wrote:Smart (4.4) only prioritizes missiles alongside ships if the antimissile mode is disabled
I know its running, because my turrets are taking out missiles now, but it wont swap my guns. Either gun swapping is turned off, or it thinks my modified PBE's are better than my modified PPC's for cap ships, as it keeps using the PBE's. Which is odd, because the PPC's take down a cap ship far faster than the PBE's do.
So I'm wondering where the options are, in case I have most of it turned off.
-
- Posts: 1383
- Joined: Sun, 25. Dec 05, 10:42
[quote="Shimrod]
Are you observing zero antimissile defence, or a reduced defence consistent with the timeslicing behaviour?[/quote]
timeslicing?
all I feel is that smart need to focus more on missiles with big warhead than pesky hostile m4 and m5 circling my smart capital ship; if enemies firing mosquitos or other low damage missiles at my m2 it's okay for mars to ignore them and focus on these m4, m3 or even m6 near it but if it detect tomahawks or hammerheads then smart need to prioritize the missiles first.
Are you observing zero antimissile defence, or a reduced defence consistent with the timeslicing behaviour?[/quote]
timeslicing?

all I feel is that smart need to focus more on missiles with big warhead than pesky hostile m4 and m5 circling my smart capital ship; if enemies firing mosquitos or other low damage missiles at my m2 it's okay for mars to ignore them and focus on these m4, m3 or even m6 near it but if it detect tomahawks or hammerheads then smart need to prioritize the missiles first.
-
- Posts: 907
- Joined: Tue, 18. Feb 03, 01:43
Ship and wing Combat menus should contain an entry for Smart as long as they have fight cmd software mk2. All the settings are under there, defaults should be sensible.apricotslice wrote:Where is that ? I've looked all over and I cant find any sort of options for Smart. (No mention of it at all in fact.)
The Smart Offense turret command has laser switching enabled by default. If modified PBE has higher DPS than PPC, then Smart will surely never pick PPC.
By this I mean where the turret loop divides its time between antimissile and shooting a primary target, instead of focusing exclusively on one or the other.nap_rz wrote:timeslicing?
I'll take a look at how it behaves if/when exscriptor has the 2.0 issues fixed or Mr.Bear's editor is done. Smart is otherwise unmaintainable without an external editor.
-
- Posts: 14163
- Joined: Sun, 16. May 04, 13:01
No, they dont. Neither menu has any smart reference. And all ships have fight 2 on. (I load them with practically everything).Shimrod wrote:Ship and wing Combat menus should contain an entry for Smart as long as they have fight cmd software mk2. All the settings are under there, defaults should be sensible.apricotslice wrote:Where is that ? I've looked all over and I cant find any sort of options for Smart. (No mention of it at all in fact.)
I dont have anything else running combat commands either, so it cant be anything overwriting your command slot.
-
- Posts: 907
- Joined: Tue, 18. Feb 03, 01:43
Sounds most like a smart scripts install location issue. Check this post where a similar scenario was resolved:
http://forum.egosoft.com/viewtopic.php? ... 12#3809212
Also Smart 4.4 won't install into a TC game as its AP only. The setup script will print a message into the player message log and exit if this is the case.
http://forum.egosoft.com/viewtopic.php? ... 12#3809212
Also Smart 4.4 won't install into a TC game as its AP only. The setup script will print a message into the player message log and exit if this is the case.
-
- Posts: 14163
- Joined: Sun, 16. May 04, 13:01
Ok, well thats bizarre.
The text file was missing, most of the scripts were missing, but the setup script was there. Explains why I've got a 9050 readtext error on my player log as well. The unzip must have not worked and I didnt notice.
BTW, its 'normal' to do your zips so they are unzipped into the Terran Conflict folder, not addon. So addon should really be in the path name within the zip. That way, all zips unpack into the same place. (and not everything goes in addon, so the higher level is often essential.) Saves confusion. A lot of people will automatically unpack this into TC, and thus their scripts and the text file will be in the wrong place for AP. Up to you, but I'd suggest a repack.
The text file was missing, most of the scripts were missing, but the setup script was there. Explains why I've got a 9050 readtext error on my player log as well. The unzip must have not worked and I didnt notice.
BTW, its 'normal' to do your zips so they are unzipped into the Terran Conflict folder, not addon. So addon should really be in the path name within the zip. That way, all zips unpack into the same place. (and not everything goes in addon, so the higher level is often essential.) Saves confusion. A lot of people will automatically unpack this into TC, and thus their scripts and the text file will be in the wrong place for AP. Up to you, but I'd suggest a repack.

-
- Posts: 14163
- Joined: Sun, 16. May 04, 13:01
Working nicely now. 
But it still wont switch guns for cap ships.
It has the choice between a PBE style gun and a PPC style gun, but it never uses the PPC. The PBE fires a great deal faster, is significantly less accurate but has about the same range (6km). So the PPC is a more reliable, harder hitting gun than the PBE is for cap ships and stations. But its never selected.
What do i need to tweak on the guns to get the PPC selected for M7 and above targets ?

But it still wont switch guns for cap ships.
It has the choice between a PBE style gun and a PPC style gun, but it never uses the PPC. The PBE fires a great deal faster, is significantly less accurate but has about the same range (6km). So the PPC is a more reliable, harder hitting gun than the PBE is for cap ships and stations. But its never selected.
What do i need to tweak on the guns to get the PPC selected for M7 and above targets ?
-
- Posts: 94
- Joined: Sun, 23. Jan 11, 14:45
I seem to have the opposite problem:
I am running XRM1.19 and MARS is installed, but not activated on any ships. Smart is activated for AI ships. I just watched a small OWP with a large selection of useable lasers in the cargobay shoot at a Q in under 1 km range. There are no other targets in the area but it appears to switch lasers every 1-2 seconds apparently randomly. The available lasers include PPC to flak to concussion to PRG to Tri Beam and as a result after a weapon is selected only 1-2 shots get fired.
A full complement of PPC and anti corvette weapons is available, why does it not stick to the big guns? Why does it change so often to weak guns despite there being only 1 large target at very close range. Using PPCs the OWP would have killed the Q, but the Q had half shield remaining when the OWP blew up due to the above.
OWPs are classified as an M1, I suspect I will see such behaviour on all ships. Any idea on how to stop this or optimize it?
I am running XRM1.19 and MARS is installed, but not activated on any ships. Smart is activated for AI ships. I just watched a small OWP with a large selection of useable lasers in the cargobay shoot at a Q in under 1 km range. There are no other targets in the area but it appears to switch lasers every 1-2 seconds apparently randomly. The available lasers include PPC to flak to concussion to PRG to Tri Beam and as a result after a weapon is selected only 1-2 shots get fired.
A full complement of PPC and anti corvette weapons is available, why does it not stick to the big guns? Why does it change so often to weak guns despite there being only 1 large target at very close range. Using PPCs the OWP would have killed the Q, but the Q had half shield remaining when the OWP blew up due to the above.
OWPs are classified as an M1, I suspect I will see such behaviour on all ships. Any idea on how to stop this or optimize it?
-
- Posts: 907
- Joined: Tue, 18. Feb 03, 01:43
Apricot: there's no laser accuracy factor exposed to scripts, Smart only goes off the laser DPS. E.g. (60000 / delay in ms) * damage per shot (actually th's DPM but 1000/delay is zero for slow lasers since it's not floating point)
If your modified PBE has higher shield DPS than PPC and the target shields are >0%, then Smart will pick the PBE.
Black: are you using TC with Smart 2.2, or AP with Smart 4.4? If it's TC/Smart 2.2, what you might have seen was Smart measuring the laser delays on the OWP by shooting each laser in turn. There is no laser delay sampling in the 4.4 AP version though.
If your modified PBE has higher shield DPS than PPC and the target shields are >0%, then Smart will pick the PBE.
Black: are you using TC with Smart 2.2, or AP with Smart 4.4? If it's TC/Smart 2.2, what you might have seen was Smart measuring the laser delays on the OWP by shooting each laser in turn. There is no laser delay sampling in the 4.4 AP version though.
-
- Posts: 14163
- Joined: Sun, 16. May 04, 13:01
Heres the 2 sets of figures
PBE, PPC
hull 5000, 10000
shield 12000, 50000
energy 15, 576
delay 0, 500
lifetime .5, 1.5
speed 12000, 4000
If I understood what you said, and I'm not sure I did, then the PPC should be the chosen gun. But I sat there one battle with the gun screen up and it never changed from the PBE. Changed from 1 gun showing to all guns showing and back, but never went PPC.
Overall, I'd say less than 15% of fired PBE rounds actually hit anything, thats probably not "accuracy" per se, just a case of firing so fast most of them get wasted.
PBE, PPC
hull 5000, 10000
shield 12000, 50000
energy 15, 576
delay 0, 500
lifetime .5, 1.5
speed 12000, 4000
If I understood what you said, and I'm not sure I did, then the PPC should be the chosen gun. But I sat there one battle with the gun screen up and it never changed from the PBE. Changed from 1 gun showing to all guns showing and back, but never went PPC.
Overall, I'd say less than 15% of fired PBE rounds actually hit anything, thats probably not "accuracy" per se, just a case of firing so fast most of them get wasted.
-
- Posts: 94
- Joined: Sun, 23. Jan 11, 14:45
Yeah, AP 2.0 and Smart 4.4 here.
Since the OWPs are somewhat useable in XRM and work OOS now, I included them in the XRM ship creation config sript and gave them racial weapons. So now they spawn with a load of weapons to choose from and I specifically make sure they all have a minimum of a PPC style complement and whatever flak style complement the respective race uses in addition to some frigate and fighter class weaps.
As they are technically M1s with 0 speed, the "Use SMART on AI ships" option will make their turrets run SMART which is great. Except they can´t seem to be able to decide which gun to choose vs a Q and I suspect others
Since the OWPs are somewhat useable in XRM and work OOS now, I included them in the XRM ship creation config sript and gave them racial weapons. So now they spawn with a load of weapons to choose from and I specifically make sure they all have a minimum of a PPC style complement and whatever flak style complement the respective race uses in addition to some frigate and fighter class weaps.
As they are technically M1s with 0 speed, the "Use SMART on AI ships" option will make their turrets run SMART which is great. Except they can´t seem to be able to decide which gun to choose vs a Q and I suspect others

-
- Posts: 907
- Joined: Tue, 18. Feb 03, 01:43
@Apricot - is there really a 0 ms refire delay on PBE? I guess that'd produce a divide by zero in the DPS calculation, which probably yields null DPS. Passing a null in an array sort array probably puts the things with nulls at one end of the sorted array or the other, so that might explain why it's first choice. Surprised that Smart doesn't lock up the game when trying to shoot with a 0 refire delay as it'd be spinning in a tight loop.
-
- Posts: 907
- Joined: Tue, 18. Feb 03, 01:43
If your FPS can handle it, sure go ahead and shoot them every millisecond. I'd go for something like 20 minimum though.
Shield DPS with 1ms delay PBE:
PBE: 1000 / 1 * 12000 = 12,000,000 shield DPS
PPC: 1000 / 500 * 50000 = 100,000 shield DPS
As Smart knows nothing of the miss rates it just picks the highest DPS.
Note that standard turret scripts have an inherent refire delay floor because the turret turning is done within the loop. They won't shoot rapid lasers to their full potential. Smart will though because it turns the turret in a separate task, so you might observe Smart firing much more rapidly and being more laggy than a normal turret script with that 1ms delay laser.
Shield DPS with 1ms delay PBE:
PBE: 1000 / 1 * 12000 = 12,000,000 shield DPS
PPC: 1000 / 500 * 50000 = 100,000 shield DPS
As Smart knows nothing of the miss rates it just picks the highest DPS.
Note that standard turret scripts have an inherent refire delay floor because the turret turning is done within the loop. They won't shoot rapid lasers to their full potential. Smart will though because it turns the turret in a separate task, so you might observe Smart firing much more rapidly and being more laggy than a normal turret script with that 1ms delay laser.
-
- Posts: 14163
- Joined: Sun, 16. May 04, 13:01
-
- Posts: 907
- Joined: Tue, 18. Feb 03, 01:43
Smart is unlikely to pick PPC for fighters as it prefers faster bullet speed lasers.
The fighter laser selection algorithm factors in fighter speed and distance as well as bullet speed. But ISTR from last balancing act if the bullet is slower than 550 m/s, then it'll always be least preferred even if the fighter is stationary at point blank range.
45ms refire PPC would make it a godly engine of destruction, at 10x the vanilla DPS (and using laser energy 10x faster). It might be balanced just right against the modified PBE, but it's be imbalanced vs everything else in the game
But how you want to tweak the lasers is entirely down to your own tastes of course 
Just to note that refire delay (in TLasers, how frequently the turret will fire projectiles) is entirely unrelated to bullet speed (in TBullets, how fast the projectile moves).
The fighter laser selection algorithm factors in fighter speed and distance as well as bullet speed. But ISTR from last balancing act if the bullet is slower than 550 m/s, then it'll always be least preferred even if the fighter is stationary at point blank range.
45ms refire PPC would make it a godly engine of destruction, at 10x the vanilla DPS (and using laser energy 10x faster). It might be balanced just right against the modified PBE, but it's be imbalanced vs everything else in the game


Just to note that refire delay (in TLasers, how frequently the turret will fire projectiles) is entirely unrelated to bullet speed (in TBullets, how fast the projectile moves).
-
- Posts: 14163
- Joined: Sun, 16. May 04, 13:01
The refire I quoted was in bullets. I havent looked at lasers. All that was from bullets.Shimrod wrote:Just to note that refire delay (in TLasers, how frequently the turret will fire projectiles) is entirely unrelated to bullet speed (in TBullets, how fast the projectile moves).
Should I be checking lasers for the refires ? Or am I getting confused ?
-
- Posts: 907
- Joined: Tue, 18. Feb 03, 01:43
The refire delay is referred to in X3 Editor 2 as 'Rate of fire', in TLaser. This program expresses it in rounds per minute, but if you double click it and select 'show raw value' you'll see it expressed as delay in milliseconds between shots.
Its the rate of fire * dmg per shot that makes the DPS, and Smart picks lasers based on best DPS for shooting capitals.
Its the rate of fire * dmg per shot that makes the DPS, and Smart picks lasers based on best DPS for shooting capitals.