I've gotta yell about turrets. Suggestion/rant.
Moderator: Moderators for English X Forum
-
- Posts: 190
- Joined: Sun, 25. Dec 05, 08:16
I've gotta yell about turrets. Suggestion/rant.
TL;DR version: Please can Egosoft make turrets less dumb in the future?
Begin rant:
One of the most frustrating things that I've witnessed over all of the X: games since X2, is the really, really bad turret AI. Back in X2 we had mods that were able to resolve most of the turret issues with basic ray casting and some math. It got even more awesome in X3 with some of the really good work of modders that proved that even on 'medium grade' systems that much more 'intelligent' turret scripts worked and didn't murder our computers.
Since then Turret scripts have mostly died off. In X4 it seems that turret scripts are nearly impossible to implement. With GPUs having the ability to run game code these days, and the fact they're stupidly good at these types of calculation, can we pretty please in X5 or whatever the next game is, get non idiot turrets?
The reasoning for this frustrated post is the fact that after running my rep up to 20 with teladi, on the way to get the blueprints I was aiming for, a Xenon M flew near the Teladi trade ship and the build storage for a defence plastform I was building -- to protect Teladi space from the Xenon that were wrecking them. The defence platform killed the M with enough bleed-through in missiles that it hit the trade ship and killed it dropping my rep to -10 after counting up all the loss from the trader plus all its drones.
Really really irks me cause I've managed to not have any turbo annoying bugs or anything worse than the (funny at times) "Autopilok, epicly failed", this whole save, and now I've gotta install a cheat to fix my rep, which I'd hoped to not do this time 'round.
All because the turrets on the station decided that it could lob plasma at a fighter that it had no chance of hitting, with a trade ship and its various drones in the direct path of the turret fire. There is absolutely no reason for the turrets to be this stupid. If we could mod the turrets to be smart back in X2 in scripting, unoptimized on a CPU, there isn't much excuse for them progressively getting worse as hardware has become better at doing these calculations.
Honestly with all of the stuff that is a bit derpy in X4 this turret thing annoys me to no end. Please get them un-dumbed for next X (or in a future patch? plz?)!
Begin rant:
One of the most frustrating things that I've witnessed over all of the X: games since X2, is the really, really bad turret AI. Back in X2 we had mods that were able to resolve most of the turret issues with basic ray casting and some math. It got even more awesome in X3 with some of the really good work of modders that proved that even on 'medium grade' systems that much more 'intelligent' turret scripts worked and didn't murder our computers.
Since then Turret scripts have mostly died off. In X4 it seems that turret scripts are nearly impossible to implement. With GPUs having the ability to run game code these days, and the fact they're stupidly good at these types of calculation, can we pretty please in X5 or whatever the next game is, get non idiot turrets?
The reasoning for this frustrated post is the fact that after running my rep up to 20 with teladi, on the way to get the blueprints I was aiming for, a Xenon M flew near the Teladi trade ship and the build storage for a defence plastform I was building -- to protect Teladi space from the Xenon that were wrecking them. The defence platform killed the M with enough bleed-through in missiles that it hit the trade ship and killed it dropping my rep to -10 after counting up all the loss from the trader plus all its drones.
Really really irks me cause I've managed to not have any turbo annoying bugs or anything worse than the (funny at times) "Autopilok, epicly failed", this whole save, and now I've gotta install a cheat to fix my rep, which I'd hoped to not do this time 'round.
All because the turrets on the station decided that it could lob plasma at a fighter that it had no chance of hitting, with a trade ship and its various drones in the direct path of the turret fire. There is absolutely no reason for the turrets to be this stupid. If we could mod the turrets to be smart back in X2 in scripting, unoptimized on a CPU, there isn't much excuse for them progressively getting worse as hardware has become better at doing these calculations.
Honestly with all of the stuff that is a bit derpy in X4 this turret thing annoys me to no end. Please get them un-dumbed for next X (or in a future patch? plz?)!
X games - addictive as heck. Always something to come back to.
-
- EGOSOFT
- Posts: 54322
- Joined: Tue, 29. Apr 03, 00:56
Re: I've gotta yell about turrets. Suggestion/rant.
As always, "make the AI less dumb" doesn't give us much to work with. If you have situations in the game where it's not doing what you'd like or expect it to do, make a report in Tech Support and provide a savegame. That way we can see not only what is happening, but why it's happening, and see whether we can do anything about it. 

-
- Posts: 190
- Joined: Sun, 25. Dec 05, 08:16
Re: I've gotta yell about turrets. Suggestion/rant.
I've described what and why the issue happens. Pretty sure it's been repeated ad nauseum for years now.
And I've seen you around for years, so I'm pretty sure you've seen and know the issue.
For reference though, here are some posts that describe and solve the issue for older X games:
X2:
Can't find the one for X2, probably doesn't exist any longer, IIRC it was called AEGIS or something along those lines. Don't think it had raycasting but might have had some basic "is there a friendly ship nearby".
X3: viewtopic.php?t=217470
MARS - This script was awesome and did some basic raycasting calculations alongside doing all the turret swapping and stuff that we could do back then.
Quoted from that page:
Specifically lists friendly-fire avoidance as a feature.
Unfortunately the only mod that seems to do anything about this in X4 is nearly a cheat, and isn't a turret script but a friendly-fire rep-loss avoidance.
https://www.nexusmods.com/x4foundations/mods/708
I'd been avoiding installing this as I noted a few times where rep-loss and a fight should have broken out but didn't.
So long story short, the turret scripts in the game(s) have long been known to be really good at reducing allies to enemies. Scripts often attempt addressing this, with MARS and BetterTurrets probably being the best examples of a turret script that accounts for friendlies.
I'd like to see this implemented inside the game itself instead of as a script, as I'm sure there are losses incurred with the scripts vs something coded into the game directly - so even more performant. It can even utilize the GPU to do the calculations for a relatively low cost especially with newer GPUs specifically designed for ray calculations.
And I've seen you around for years, so I'm pretty sure you've seen and know the issue.
For reference though, here are some posts that describe and solve the issue for older X games:
X2:
Can't find the one for X2, probably doesn't exist any longer, IIRC it was called AEGIS or something along those lines. Don't think it had raycasting but might have had some basic "is there a friendly ship nearby".
X3: viewtopic.php?t=217470
MARS - This script was awesome and did some basic raycasting calculations alongside doing all the turret swapping and stuff that we could do back then.
Quoted from that page:
X:R viewtopic.php?t=373031Turret Scripts are stupid.
They gleefully fire a 30 sec salvo on an M5 when the proverbial snowball in hell would have a higher chance of hitting.
This was too depressing to watch so I set forth on my personal crusade to create the perfect turret script. (YMMV =)
One that only fires on those targets that it can hit.
Specifically lists friendly-fire avoidance as a feature.
Unfortunately the only mod that seems to do anything about this in X4 is nearly a cheat, and isn't a turret script but a friendly-fire rep-loss avoidance.
https://www.nexusmods.com/x4foundations/mods/708
I'd been avoiding installing this as I noted a few times where rep-loss and a fight should have broken out but didn't.
So long story short, the turret scripts in the game(s) have long been known to be really good at reducing allies to enemies. Scripts often attempt addressing this, with MARS and BetterTurrets probably being the best examples of a turret script that accounts for friendlies.
I'd like to see this implemented inside the game itself instead of as a script, as I'm sure there are losses incurred with the scripts vs something coded into the game directly - so even more performant. It can even utilize the GPU to do the calculations for a relatively low cost especially with newer GPUs specifically designed for ray calculations.
X games - addictive as heck. Always something to come back to.
-
- EGOSOFT
- Posts: 54322
- Joined: Tue, 29. Apr 03, 00:56
Re: I've gotta yell about turrets. Suggestion/rant.
Yes, you have described a situation, but we can't see from a description or screenshot, or link to something from a previous game, exactly what is happening in the specific situation you're describing, or more importantly why it is happening and whether or not that's what we would expect. We also can't identify whether the reason it's happening in your situation is the same as the reason it's happening in some other situation that we've heard about before. The only way we can do those things is with a report that includes a savegame.
-
- Posts: 1375
- Joined: Tue, 28. Nov 23, 15:38
Re: I've gotta yell about turrets. Suggestion/rant.
Uh.CBJ wrote: ↑Thu, 26. Sep 24, 18:24 Yes, you have described a situation, but we can't see from a description or screenshot, or link to something from a previous game, exactly what is happening in the specific situation you're describing, or more importantly why it is happening and whether or not that's what we would expect. We also can't identify whether the reason it's happening in your situation is the same as the reason it's happening in some other situation that we've heard about before. The only way we can do those things is with a report that includes a savegame.
What:
"Turrets cause friendly fire", "Friendly fire causes reputation loss spiral".
Why/Reason:
"Turret doesn't check if it hits friendlies"
Solution:
"Make turret check if there's a friendly in line of fire using a raycast. Do not fire if there is a friendly.".
P.S. I'm not the OP.
-
- EGOSOFT
- Posts: 54322
- Joined: Tue, 29. Apr 03, 00:56
Re: I've gotta yell about turrets. Suggestion/rant.
Turrets do check if they have line of fire. Not only that but when a turret accidentally hits something it's not aiming at, the tolerance of the ship that has been hit is massively increased precisely to avoid a reputation loss spiral.
False assumptions are exactly the reason that we need to see savegames.
False assumptions are exactly the reason that we need to see savegames.
-
- Posts: 1375
- Joined: Tue, 28. Nov 23, 15:38
Re: I've gotta yell about turrets. Suggestion/rant.
That's not what I said. Line of fire implies a check if the target is blocked, which is not enough. Turret should check if there's a friendly ON the line of fire. In front of or BEHIND the target. Because most shots will miss.
The claim about tolerance does not match in-game experience. Because in the game the rule of the thumb is "you should not ever approach neutral/friendly ship or station in any ship with turrets during combat". Because said friendly will inevitably get hit, and will get angry at you. That happens all over the place, including timelines missions, where during assault on the xenon ship, I had to fight both xenon and 3 angry argon ships I hit too many times with turrets. The situation is worse with stations. "You scratched our paint, Hero of Argon Federation? I'll murder you and then report you for high treason!" This is a long standing problem.
That's why those mods exist, by the way:
https://www.nexusmods.com/x4foundations/mods/708
-
- EGOSOFT
- Posts: 54322
- Joined: Tue, 29. Apr 03, 00:56
Re: I've gotta yell about turrets. Suggestion/rant.
You didn't say that, and doing what you are now suggesting would mean that turrets would hardly ever be able to fire in many busy battle situations. What I said about the tolerance is not a "claim"; it's a fact.
That said, I'm not going to post any more in this thread. I gave the OP some advice on the best way to report problems in such a way that something can actually be done about it, and I am not going to engage in any further "hostile" discussion about it.
That said, I'm not going to post any more in this thread. I gave the OP some advice on the best way to report problems in such a way that something can actually be done about it, and I am not going to engage in any further "hostile" discussion about it.
-
- Posts: 1375
- Joined: Tue, 28. Nov 23, 15:38
Re: I've gotta yell about turrets. Suggestion/rant.
That is not true, as space is mostly empty, plus it is possible to add some sort of "aggression" setting. However that is why I pointed out the mod which address second part of the issue - the reputation system.
-
- Posts: 22587
- Joined: Sat, 23. Apr 05, 21:42
Re: I've gotta yell about turrets. Suggestion/rant.
Line of fire? That is why I have a shotgun; no "line".
Back in 3.x version of X4 I had Raptor -- the teeny-weeny dinghy with "just a couple" turrets -- practically touching Xenon Station. At point blank range the L turrets were shooting at the station and the Gravitons were shooting back. Nobody hit anything.
I don't want to re-test that, for I have a feeling that the turret scripts are "less stupid" today.
That, obviously, does not say anything about shooting friendly fish in a barrel that seems to be the issue here.

Back in 3.x version of X4 I had Raptor -- the teeny-weeny dinghy with "just a couple" turrets -- practically touching Xenon Station. At point blank range the L turrets were shooting at the station and the Gravitons were shooting back. Nobody hit anything.

That, obviously, does not say anything about shooting friendly fish in a barrel that seems to be the issue here.
Goner Pancake Protector X
Insanity included at no extra charge.
There is no Box. I am the sand.
Insanity included at no extra charge.
There is no Box. I am the sand.
-
- Posts: 677
- Joined: Sat, 25. Apr 09, 11:06
Re: I've gotta yell about turrets. Suggestion/rant.
Uh, yes this is true. Most turrets in the game don't hit near instantanously. Between the time it fires, the time the shot would intersect with the target's current flightpath and the continued flightpath on a miss there are a LOT of ships that could wander into the firing lane and get hit by coincidence. If you'd want to eliminate that possibility, each individual turret (not just turret groups) would need to check against a cone (the dimension of which are determined by the projectile speed and lifetime) and if ANY ship or drone is within this cone when the turret wants to fire, it can't or else it risks hitting something other than the target. And yes, this means that in a battle with defense drones, S and M ships zipping around plus possibly multiple capital ships the downtime forced on turrets with such an interruptor mechanism would be noticable and in bigger battle quite substantial.
Okay, let's say you would tolerate *some* unintended hits and base this off of an arbitrary propability percentage of hitting your target. Problem is with anything short of 100% hitchance (which I don't think is achievable even with beam turrets), you have a chance of hitting other stuff, so you'd need a combination trigger of checking against hit propability on intended target AND a cone check against non-targets in the line of fire.
Even if you solely base turret targeting on hit chance propability, you'd run into situations where your turrets would refuse to fire since the target doesn't meet the threshold. And when, not if, that happens you'll have a flood of players asking "why are my turrets not working".
The simple matter of fact is that that friendly fire will happen. You can't eliminate the problem and you can't make a turret smarter than the dumb projectile you're shooting. Feel free to switch to guided missiles only and you won't have to deal with friendly fire incidents (outside of splash damage from explosion AoE ... so I guess you can't completely avoid it anyhow).
The only thing you could possible deal with are the consequences of these hits. And there at least I'm in agreement with you: if the AI can accidentally hit me and just shrug it off with a "whoops, sorry and watch where you're going next time" voiceline, then conversely the AI shouldn't complain when my shots go astray and reputation loss for hitting anything other than the locked target shouldn't be a thing at all.
Can that be used to cheese some stuff in the game? Yes, but it's a singleplayer sandbox so ultimately who cares? We can board ships and sell them off to their own faction for cash with barely any reputation loss and that's a normal game mechanic working as intended. If someone wants to try and cheese a station destruction by luring a bunch of Xenon S fighters near a station and then open up with a plasma turret only Raptor, go ham, not my problem.
-
- Posts: 1375
- Joined: Tue, 28. Nov 23, 15:38
Re: I've gotta yell about turrets. Suggestion/rant.
The point is not to eliminate ALL friendly fire, but reduce it to manageable level.
Consider the situation with a SLOW ship of station in the line of fire. The game does not check that. A human player will avoid firing at a ship if there's station behind the firing point. Because most shots miss and they'll meet the station. AI turret controller in this situation does not care and fires away.
A typical situation is when a miner/trader is harrassed by KHK or XEN. If you're in a ship with turrets, and attempt to "help", the miner will inevitably get hit by your turret fire. There's also not much of control over turrets.
-
- Posts: 126
- Joined: Mon, 12. Nov 07, 05:48
Re: I've gotta yell about turrets. Suggestion/rant.
Typical scenario is small target: Xenon M, and a large 'ally' - Teladi L habitatvvvvvvvv wrote: ↑Fri, 27. Sep 24, 19:41 Consider the situation with a SLOW ship of station in the line of fire. The game does not check that. A human player will avoid firing at a ship if there's station behind the firing point. Because most shots miss and they'll meet the station. AI turret controller in this situation does not care and fires away.
You have a perfect unbroken line of effect to target, but either:
- weapons engaged will overkill
- weapons are likely to miss at this range, AND 'ally' is so large it absolutely will get hit.
a smart AI (like MARS) will retarget plasma / dumbfire turrets because each weapon type would have a pre-calculated 'expected damage' like this:
expected damage = chance of hitting * (weapon single shot damage at given range)
- xenon M: 5% * 420 dmg plasma = 21
- L Habitat: 95% * 420 = 399
21 < 399 so either retarget or disable the turret
The object selection cone is defined by the range and dispersion of the firing gun/turret.
The likelihood of hitting an object is it's "range adjusted size" (integrated over) a normal distribution function from the "dead-center-line" of the cone
That will just reduce to some simple math equations (which are a little beyond me in 3d)
You could opt to devolve all this into a load-time pre-calculated matrix of (projectile class, target class, distance (250m buckets) )
Also possibly create an 'aggression' setting that multiplies ('reckless') or divides ('careful') the target's expected damage
and optionally apply a lower bound for expected damage (ex: dumbfire missile efficiency might require 25% of full damage)
This would appear to the player to simulate a real pilot's decisions and better - most of the turret settings go away.
-
- Posts: 1375
- Joined: Tue, 28. Nov 23, 15:38
Re: I've gotta yell about turrets. Suggestion/rant.
(-_-)Phezzan wrote: ↑Mon, 30. Sep 24, 21:21Typical scenario is small target: Xenon M, and a large 'ally' - Teladi L habitatvvvvvvvv wrote: ↑Fri, 27. Sep 24, 19:41 Consider the situation with a SLOW ship of station in the line of fire. The game does not check that. A human player will avoid firing at a ship if there's station behind the firing point. Because most shots miss and they'll meet the station. AI turret controller in this situation does not care and fires away.
You have a perfect unbroken line of effect to target, but ...
* Raycast from gun position through (predicted) enemy position.
** If line of sight is blocked, do not fire.
** If line of sight is not blocked, and there's nothing behind (predicted) position, fire.
*** If there's a neutral or friendly behind, and aggression is low, do not fire
*** If there's a neutral or friendly behind, and aggression is high, fire
-
- Posts: 4
- Joined: Tue, 3. Sep 24, 11:57
Re: I've gotta yell about turrets. Suggestion/rant.
There's travel time to consider too. After firing, the bullets don't make contact instantly. So, the "improved" check may determine that there is no obstruction and fire, then comes friendly flying in, taking the hit anyway.
As suggested, turrets are fine for what they do, the consequences should be improved.
"You gunned down my pilot that was trying to assist you in a fight!"
"Correction, your pilot flew into friendly fire and I have no control over turret projectiles."
"Understood. It was a case of fratricide. Your reputation will remain unchanged."
Even if I hit a small fighter with my primary guns and one shot kill it because it flew into the line of fire should be overseen. If I actively hunt down and kill several friendlies, that's a different matter.
The problem is more in the reputation logic. It's too easy to gain or lose reputation because action has a simple "add or subtract x points" mechanism. Some actions should have more detrimental consequences that requires more than just shooting down criminal traffic to correct.
This discussion has multiple topics.
As CBJ mentioned, submit a technical report with an accompanying save file and it will be investigated.
As far as what construes ethical behavior and how consequences should be established, that's another discussion.
As suggested, turrets are fine for what they do, the consequences should be improved.
"You gunned down my pilot that was trying to assist you in a fight!"
"Correction, your pilot flew into friendly fire and I have no control over turret projectiles."
"Understood. It was a case of fratricide. Your reputation will remain unchanged."
Even if I hit a small fighter with my primary guns and one shot kill it because it flew into the line of fire should be overseen. If I actively hunt down and kill several friendlies, that's a different matter.
The problem is more in the reputation logic. It's too easy to gain or lose reputation because action has a simple "add or subtract x points" mechanism. Some actions should have more detrimental consequences that requires more than just shooting down criminal traffic to correct.
This discussion has multiple topics.
As CBJ mentioned, submit a technical report with an accompanying save file and it will be investigated.
As far as what construes ethical behavior and how consequences should be established, that's another discussion.
-
- Posts: 8361
- Joined: Sat, 14. Feb 04, 23:07
Re: I've gotta yell about turrets. Suggestion/rant.
Yep, makes a huge difference. Turrets with slow projectile speeds have a far greater risk of friendly fire than more accurate weapons. Those with AOE damage are a much greater risk too. Noticed that particularly in the difference between my current game & the last one. In my previous game I was using Teladi capitals with full beam turret loadouts. Friendly fire incidents were vanishingly rare. In contrast current game is Boron & it's been far, far more frequent. Main culprits I suspect are the Ion Flaks & Ion Nets on my Rays - their special effects in terms of speed reduction & travel/boost disruption were far too tempting. As far as I'm concerned though that's just part of the Think aspect of the game - other turrets are available, I could have made different choices. I specifically chose turret options that tend to annoy pilots of other factions & have to live with the consequences (including occasionally having to slaughter otherwise friendly fleets that have finally had enough of my ships switching their engines off).DissonantDivergence wrote: ↑Tue, 1. Oct 24, 04:06 There's travel time to consider too. After firing, the bullets don't make contact instantly.
-
- Posts: 1375
- Joined: Tue, 28. Nov 23, 15:38
Re: I've gotta yell about turrets. Suggestion/rant.
There's a KISS principle. Most of FF incidents are from hitting a SLOW ship or station that doesn't move. As I said, the idea is not to make it perfect, but to make it manageable. Handling it the way I described above is a trivial thing. Trying to include path prediction makes it non-trivial. So it is better to stick with trivial solution, as it'll be good enough.DissonantDivergence wrote: ↑Tue, 1. Oct 24, 04:06 There's travel time to consider too. After firing, the bullets don't make contact instantly. So, the "improved" check may...
Regarding slow moving projectiles...
I have never seen plasma hit anything by accident, even when it was fired in a volley by a station. AOE ordinance is instant FF incident, sure, but the risk comes from faster projectiles, because fast projectiles typically have high rate of fire. Lots of bullets per second means higher chance of hit per second.GCU Grey Area wrote: ↑Tue, 1. Oct 24, 09:56 Yep, makes a huge difference. Turrets with slow projectile speeds have a far greater risk
-
- Posts: 8361
- Joined: Sat, 14. Feb 04, 23:07
Re: I've gotta yell about turrets. Suggestion/rant.
Think plasma brings additional factors into the mix, the targeting option set for the turrets (i.e. usually anti-capital/station) & that both firing platform & target are often either slow moving or completely stationary. Means, even with a slow projectile, it tends to be fairly accurate because it often has an easy shot. It's not generally sprayed around liberally at every S, M or drone in the vicinity. While I agree that rate of fire is a factor, accuracy is also an important consideration, since a shot which hits it intended target does not carry much of a risk of friendly fire. Hence, for example, bolt tends to be more of an FF risk than pulse, the latter being more likely to hit it's target due to that target having less opportunity to move unexpectedly between the shot being fired & it arriving at/near the target (takes roughly 3 seconds for a bolt turret shot to reach max range, compared to about 1.8 for pulse).vvvvvvvv wrote: ↑Tue, 1. Oct 24, 11:59 I have never seen plasma hit anything by accident, even when it was fired in a volley by a station. AOE ordinance is instant FF incident, sure, but the risk comes from faster projectiles, because fast projectiles typically have high rate of fire. Lots of bullets per second means higher chance of hit per second.
-
- Posts: 766
- Joined: Sat, 23. Nov 13, 15:50