Questiona to Egosoft about X4 combat AI and prevalent issues (ever since X2)

This forum is the ideal place for all discussion relating to X4. You will also find additional information from developers here.

Moderator: Moderators for English X Forum

User avatar
mr.WHO
Posts: 8577
Joined: Thu, 12. Oct 06, 17:19
x4

Questiona to Egosoft about X4 combat AI and prevalent issues (ever since X2)

Post by mr.WHO » Mon, 18. Jun 18, 18:00

Hi,
I'd love if Lino or someone from Egosoft could adress some prevalent AI issues that I reckognize since X2 and confirm or not that these would be resolved in X4.


1) Distinquish between normal attack and "artillery attack" - basically ever since X2 (including X-Rebirth) all ships follow same attack script which is "get close and fire whatever is in range/firing arc".

This makes some ships that were created as long range (e.g. Bombers) were useless in hands of AI pilots.

It would be great if X4 would have separate "Artillery attack" script, where ships try to keep at maximum range of it's weapon. Such case would really make both fighters and bobmers much more useful:
Capship very vunerable to bombers due to bomber speed and range advantage.
Bombers vulnerable to fighters due to speed and weapon advantage.
Fighters vulnerable to Capships due to obvious firepower advantage (there also would be good niche for heavy fighters designed for supressing capship turrets).

2) Disinquish between "forward facing" attack and "broadside" attack scripts. Same as above, but empasis not on attack range, but approach vector and facing the enemy. Forward facing ship will not work with broadside attack script and broadside oriented ship will not work with forward attack script (this is painfully visible with Sucellus in X-Rebirth).

3) Squads not attacking as squads - another bad code that I see since X2 and still a thing in X-Rebirth. Basically it looks like this:
- you put ships in the squad.
- you give squad an attack order.
- you (incorrectly) think squad will attack.
- you end up with only squad leader actually attacking, while everyone else only act according to "protect squad leader" script. This means if squad leader will not be fire upon, the entire squad will be completely idle.

4) AI fighters/bombers blowing themselves up with their own missiles. The simplest and most resonable solution would be to keep missile destroyable, but remove missle dammage from intercepted/destroyed missile - I mean COME ON! Missile safety is actual thing in real life since decades - missiles actually do not arm untill they are in safe disance from whatever launched them.
This would still leave the problem of AI shooting down their own missiles, but I can live with waste of 50k Cr torpedo instead of the waste of both 50k Cr torpedo and 5 mil Cr fighter.

5) Inballance of dedicated missile platform - either they are OP missile spam (TC/AP) or severely handicaped borderline useless (Balor in X-Rebirth due to no artillery attack script).

IMO The Balor from X-Rebith would be OK (long range missile platform) if not terrible AI. COnsidering if there would X3-like be anti-missile logic then Balor salvo (4x missile) could be increase in size (in X-Rebirth, due to fact that only player was actively capable of missile defence the 4x salvo was ok).


I want to repeat myself - almost all of above in various form are the issues since X2. It would be great if these would be finally resolved in X4!



Side stuff, not related to the past games, but would be nice to have:

6) Missile lock-on - it would be nice to have some kind of lock-on logic, where you have to keep target in front of you for several seconds to achive lock on.
Ever since X-BTF all missiles are target > fire > and forget
While this might be viable approach for year 3'000 technology...it's kinda boring. Lock ons would add more variety to the missiles. Not to mention there could be special upgrade that temporary jam the missile lock. Not to mention "Stealth ships" would be a thing (you would not be able to achive lock only, so you would have to use fire and forget heat seeking missile).

7) Additional missile defence forms (and used by AI) - in addition to simple shoot down the missile the mentioned lock-on jammers, "radar stealth", flares (e.g. like old missile defence mosquitos).

Skeeter
Posts: 3675
Joined: Thu, 9. Jan 03, 19:47
x3

Post by Skeeter » Mon, 18. Jun 18, 18:42

I think all you will get in a reply is, we are trying to improve it in x4 but users don't understand how complex ai is.

My take on it is they might just lack the skill and creativity to change if the same ai guys that work there are the same ones for all X games, could need fresh blood that's upto date on ai learning techniques. No offence to egosoft they just use what they can and do their best and try learn new stuff between games.

Either way imo we won't see too much of a change from say X rebirth, maybe better here and there but I'm guessing the ai is just carried over from past games and updated a bit in places instead of totally fresh ai scripting techniques. As they say themselves alot, they are a small company with limited man power and funds.

Again I'm totally not dissing egosoft just being realistic i think. I'm sure they try to do as much as they can.
[ external image ]
7600x cpu 5.4ghz 32gb DDR5 5600mhz 6700XT 32" 1440p mon

CBJ
EGOSOFT
EGOSOFT
Posts: 51974
Joined: Tue, 29. Apr 03, 00:56
x4

Post by CBJ » Mon, 18. Jun 18, 19:19

mr.WHO wrote:1) - 3) and 5)
I'll leave someone with more detailed knowledge of the AI to deal with this, but I will say that while some of the things you say about the AI are definitely true, I'm fairly sure some of them were at least partly addressed in updates to XR.
mr.WHO wrote:4)
This is an interesting one, and there has definitely been some mis-reporting of problems with this over the years. As far back in the history of the X games as I can remember, it was impossible for missiles to actually collide with the ships that launched them, but people persistently reported that they thought it was happening. In every case I am aware of, this turned out to be a case of the missile actually being blown up by something else (normally incoming fire from enemies) while within damage range of the launching ship. While clearly not what the ship firing the missile wants, it is both realistic and intended behaviour, and not something I'd expect to be "fixed".
mr.WHO wrote:6) and 7)
Yes, more feature variety such as missile lock-on and countermeasures are something we are working on. :)
Skeeter wrote:stuff
Disclaimers notwithstanding, your comments are somewhat offensive, and in some cases just plain wrong. A whole range of people have worked on the AI over the years, and while it's true that between some games there were only incremental changes, the reasons for that have normally had nothing to do with lack of creativity. As you know, with XR we essentially started from scratch, with a new engine and new scripting system. We weren't able to take full advantage of that in that first iteration, but hopefully with X4 we'll be able to make bigger strides forwards.

Skeeter
Posts: 3675
Joined: Thu, 9. Jan 03, 19:47
x3

Post by Skeeter » Mon, 18. Jun 18, 19:27

Sorry if it was read like that to you, of course I assumed alot but figured it might be close. Yeah I can be a bit blunt sometimes I blame the internet for that writing on forums all these years, sorry. Of course I respect egosoft even if it seems I don't at times. Wouldn't be here since 99 if I didn't.
[ external image ]
7600x cpu 5.4ghz 32gb DDR5 5600mhz 6700XT 32" 1440p mon

User avatar
mr.WHO
Posts: 8577
Joined: Thu, 12. Oct 06, 17:19
x4

Post by mr.WHO » Mon, 18. Jun 18, 19:43

Hey CBJ, regarding point 4:
- I never noticed NPC ship coliding with it's own missile.
- it is very possible that in some cases NPC are killed by their own missile shot down by incoming fire - this is one of the point why I never use missiles on my NPC ship.
- However I think that there was also one more case - NPC fighters shoot down it's own missile with it's own lasers during the combat.

Whichever is the case I still thing that the best solution would be remove explosion dammage from missiles that got shot down.

CBJ
EGOSOFT
EGOSOFT
Posts: 51974
Joined: Tue, 29. Apr 03, 00:56
x4

Post by CBJ » Mon, 18. Jun 18, 20:12

Skeeter wrote:Sorry if it was read like that to you, of course I assumed alot but figured it might be close. Yeah I can be a bit blunt sometimes I blame the internet for that writing on forums all these years, sorry. Of course I respect egosoft even if it seems I don't at times. Wouldn't be here since 99 if I didn't.
Oh, I know. In fact if you weren't critical in one of your posts, I'd be worried and would feel compelled to check that someone hadn't hacked your account. ;)

Skeeter
Posts: 3675
Joined: Thu, 9. Jan 03, 19:47
x3

Post by Skeeter » Mon, 18. Jun 18, 22:21

Lol cbj.

I think I only do it to nudge you guys on to do even better, when x4 comes out we'll see if it worked lol.

Regarding broadside I dunno if u ever played homeworld 2 but there's the hiigaren destroyer and the way it fights sideways with its firepower is just mint. Love to see something like that in a X game. Especially how it tries to keep a gap between it and it's attacking ship to make sure it's long range wins out.

Regarding point 6, the lock on is a good idea but can be a frustrating mechanic, I'm not sure which game it was I played that had it, might be elite d, if so trying to keep it in ur sights for a few seconds can be maddening if the flight controls are difficult like in a sim rather than arcade. Tho I think it might do ok in X games as it's more on the side or arcade than sim. I wonder if a sweet spot range indicator could be useful, like a ideal distance and perhaps a clear shot indicator to help bring missiles to more effective. Say it goes off when Ur scanner detects a clean shot with nothing in-between Ur shot to muck it up and delivers max damage based on distance i.e short range Vs long range missiles, u get a damage bonus if u time it right maybe I dunno. Just a spitball idea tbh.

Also
We weren't able to take full advantage of that in that first iteration, but hopefully with X4 we'll be able to make bigger strides forwards.
. I'm liking what you said there, I'm looking forward to see how it works out. :)
[ external image ]
7600x cpu 5.4ghz 32gb DDR5 5600mhz 6700XT 32" 1440p mon

j.harshaw
EGOSOFT
EGOSOFT
Posts: 1877
Joined: Mon, 23. Nov 15, 18:02

Post by j.harshaw » Mon, 18. Jun 18, 23:28

Regarding 1 and 2: they can be written as different scripts, increasing the number of attack scripts from 3 to 9, but the scripts would largely contain identical logic which would needlessly increase maintenance time thus reducing development time which, time per project being finite, would result in less game which no one wants (least of all, me; i want to play this game!). Luckily, separate scripts are unnecessary in this case since the relevant differences between a long-ranged forward-oriented platform, and a turret-based side- (or top-, or bottom-) firing bruiser are distance and orientation.

The premise is that a reasonably smart captain would want to defeat an enemy while sustaining as little damage as possible. So first impulse is to maintain maximum distance and orient your heaviest guns on the enemy. But if you try to keep to the very edge of your range, you'd spend more time manoeuvering than delivering fire, so you try to keep your target a bit inside your engagement envelope. Say, 7-9km assuming, for simplicity's sake, a maximum range of 10km. You'd also orient your forward-mounted guns towards the enemy since that's where your heaviest weight of fire is coming from. Adrian, who worked on these scripts before i took them up, also added some logic to determine if a ship has forward-mounted weapons to switch to more specific logic for good measure, as well as an excellent framework in the capship movement script for flexible logic switching. Added some fudge for less-than-stellar captains who might wander in a bit too close than is healthy.

3. Squadrons have several modes of attack. Simplest is the fighter wing which flies in formation and tries to concentrate fire of the whole wing. That wing can break off into individual fighters enabling them to either engage multiple targets, engage the same target from different directions, or engage different subsystems on the same target. Subordinates of capital ships do normally only engage targets if their squadron is attacked unless their squadron commander is actively looking for a fight. In that case, subordinates signal their squadron if a hostile target is spotted, and some parts of the squadron peel off to engage. Escorts of civilian ships also attack hostile targets on sight. Carriers normally prefer to have fighters not on active patrol docked for mobility, but will deploy those fighters if actively attacking. Carriers also scramble all fighters if the carrier itself comes under attack.

Speaking of modes of attack, attacking ships (or wings, or squadrons, or fleets) could also attack capital ships to disable, only destroying critical subsystems while trying to minimize damage to the hull itself.

Anyway, yeah, that's already in. Seems to be working ok so far.

By the way, about
mr.WHO wrote:IMO The Balor from X-Rebith would be OK (long range missile platform) if not terrible AI. COnsidering if there would X3-like be anti-missile logic then Balor salvo (4x missile) could be increase in size (in X-Rebirth, due to fact that only player was actively capable of missile defence the 4x salvo was ok).
Some similar logic should already be in place in XR 4.30. If it's not working properly, especially if anyone spots a case where the AI is misbehaving in a reproducible case, i would be keen to know. Can't promise a fix for XR anytime soon since we're all on X4 at the moment, but it might impact development of the new logic in place for X4.

Fedora01
Posts: 52
Joined: Thu, 29. Jun 17, 22:43
x4

Post by Fedora01 » Mon, 18. Jun 18, 23:36

Skeeter wrote: Regarding point 6, the lock on is a good idea but can be a frustrating mechanic, I'm not sure which game it was I played that had it, might be elite d, if so trying to keep it in ur sights for a few seconds can be maddening if the flight controls are difficult like in a sim rather than arcade. Tho I think it might do ok in X games as it's more on the side or arcade than sim. I wonder if a sweet spot range indicator could be useful, like a ideal distance and perhaps a clear shot indicator to help bring missiles to more effective. Say it goes off when Ur scanner detects a clean shot with nothing in-between Ur shot to muck it up and delivers max damage based on distance i.e short range Vs long range missiles, u get a damage bonus if u time it right maybe I dunno. Just a spitball idea tbh.
If I could add to this, also various lock-on/guidance methods, ranging from basic point and shoot, TOW missiles, or even smart missiles that have basic avoidance capabilities.
In space no-one can hear you scream unless you're transmitting on the right radio frequency.

It was about this time I realized I might have too many tabs open.

User avatar
sd_jasper
Posts: 348
Joined: Mon, 25. Jan 16, 00:44
x4

Post by sd_jasper » Tue, 19. Jun 18, 15:26

j.harshaw wrote:The premise is that a reasonably smart captain would want to defeat an enemy while sustaining as little damage as possible. So first impulse is to maintain maximum distance and orient your heaviest guns on the enemy. But if you try to keep to the very edge of your range, you'd spend more time manoeuvering than delivering fire, so you try to keep your target a bit inside your engagement envelope. Say, 7-9km assuming, for simplicity's sake, a maximum range of 10km. You'd also orient your forward-mounted guns towards the enemy since that's where your heaviest weight of fire is coming from. Adrian, who worked on these scripts before i took them up, also added some logic to determine if a ship has forward-mounted weapons to switch to more specific logic for good measure, as well as an excellent framework in the capship movement script for flexible logic switching. Added some fudge for less-than-stellar captains who might wander in a bit too close than is healthy.
This brings up something that I've often considered a flaw in space combat (in books, movies, games). Why are the long range weapons alway pointed forward? If the goal is to maintain distance, then it makes more sense to put your long range weapons on the side (like sailing ships use to). This give you the ability to close (move forward), turn and circle you target while firing, then turn toward or away to try and maintain distance.

With forward mounted weapons, you have a lot less options, where you basically have to close, STOP, and begin firing. You may even have to start reverse engines. This works fine if the target is fleeing, but if they also have their strongest weapons on the front, they are likely to turn to face you and then both ships end up closing.

Have y'all tried out ship designs with side mounted missiles/long range weapons? Can the current combat scripts deal with this?

Falcrack
Posts: 4998
Joined: Wed, 29. Jul 09, 00:46
x4

Post by Falcrack » Tue, 19. Jun 18, 15:37

CBJ wrote: This is an interesting one, and there has definitely been some mis-reporting of problems with this over the years. As far back in the history of the X games as I can remember, it was impossible for missiles to actually collide with the ships that launched them, but people persistently reported that they thought it was happening. In every case I am aware of, this turned out to be a case of the missile actually being blown up by something else (normally incoming fire from enemies) while within damage range of the launching ship. While clearly not what the ship firing the missile wants, it is both realistic and intended behaviour, and not something I'd expect to be "fixed".
While missiles can be blown up, consider what happens when a nuclear missile is intercepted. Will it result in the full nuclear detonation? No, because the full explosion will only occur with an extremely precise set of triggering mechanisms. Which will not happen when some hostile interceptor violently collides with it. It will simply fall apart when intercepted, not give the big nuclear "boom". It's a bit different for a simple chemical warhead, but those also would have a lot less "boom" anyways.

Perhaps the same could happen with missiles in X4? If they are intercepted by another missile or laser shot, they do not explode with their full yield, thus the chance for the firing ship to be blown up by its own missile shortly after launch would be minimal. I think that would actually be more realistic, not less.

User avatar
mr.WHO
Posts: 8577
Joined: Thu, 12. Oct 06, 17:19
x4

Post by mr.WHO » Tue, 19. Jun 18, 17:10

j.harshaw wrote:Regarding 1 and 2: they can be written as different scripts, increasing the number of attack scripts from 3 to 9, but the scripts would largely contain identical logic which would needlessly increase maintenance time thus reducing development time which,.....

By the way, about
mr.WHO wrote:IMO The Balor from X-Rebith would be OK (long range missile platform) if not terrible AI. COnsidering if there would X3-like be anti-missile logic then Balor salvo (4x missile) could be increase in size (in X-Rebirth, due to fact that only player was actively capable of missile defence the 4x salvo was ok).
Some similar logic should already be in place in XR 4.30. If it's not working properly, especially if anyone spots a case where the AI is misbehaving in a reproducible case, i would be keen to know. Can't promise a fix for XR anytime soon since we're all on X4 at the moment, but it might impact development of the new logic in place for X4.
Thanks for detailed explenation. I admit I haven't played X-Rebirth in 4.30, but I'm now more calm about X4. This, plus new map RTS command mode will make X4 something I always wanted since X2.

Anyway I'm looking forward to tomorrow live stream :)

Mightysword
Posts: 4350
Joined: Wed, 10. Mar 04, 05:11
x3tc

Post by Mightysword » Tue, 19. Jun 18, 18:27

sd_jasper wrote: This brings up something that I've often considered a flaw in space combat (in books, movies, games). Why are the long range weapons alway pointed forward? If the goal is to maintain distance, then it makes more sense to put your long range weapons on the side
You'll love the ship in the Warhammer 40k universe then, they're designed like that. There is this game Battlefleet Gothic: Armada if you want to check it out. :)
This is an interesting one, and there has definitely been some mis-reporting of problems with this over the years. As far back in the history of the X games as I can remember, it was impossible for missiles to actually collide with the ships that launched them, but people persistently reported that they thought it was happening. In every case I am aware of, this turned out to be a case of the missile actually being blown up by something else (normally incoming fire from enemies) while within damage range of the launching ship. While clearly not what the ship firing the missile wants, it is both realistic and intended behaviour, and not something I'd expect to be "fixed".
Which kinda bring in another point: why is it so prevalent in X game? As note it has been something since X2. I played just about every other space games, most allow missile interceptions, yet X game is the only game I can remember that has this particular ... feature (in case you don't consider it's an issue). Even if it's a misconception, something must have happen frequently enough to build up that misconception. I notice X is very generous in term how it determines a missile is hit. In other games you have to try pretty hard to shoot down a missile yourself, which IMO make sense. In X it feels more like as soon as someone or something sneeze in its proximity, it'll detonate. :wink:

j.harshaw
EGOSOFT
EGOSOFT
Posts: 1877
Joined: Mon, 23. Nov 15, 18:02

Post by j.harshaw » Tue, 19. Jun 18, 18:46

sd_jasper wrote:Why are the long range weapons always pointed forward?
In the fiction i've encountered, the reason usually given, if one is given at all, is usually structural: the railgun, or ginormous plasma accelerator, or particle projector, or bank of lasers, or whatever would need either significant support as provided by the ship's frame or some long element that would have to traverse the spine of the ship. Since this is (often not-so-hardcore) science fiction, though, that's often a plausible excuse for some other reason, often visual, even if the visuals are imagined (which, in my experience, can be more vivid than visuals on a screen). i think the artistic reason is clarity of intent: you see a big thing clearly pointed towards another, often big, thing with big glowing objects flying from big thing A to big thing B and it's easy to communicate what's happening at a glance even if it's all just happening in the background. i don't know if we're going with that reason in-fiction in X4, though.

From a gameplay perspective, you'll want to see where you're flying and see what you're shooting at at the same time.

Technically, long-ranged side- (or top-, or bottom-, or rear-) mounted weapons are doable.
Spoiler
Show
i vaguely remember being pummeled by a Xenon I in XR that was clearly not pointed at me, and was pleasantly surprised to find out that it has side-mounted torpedo launchers.
And long-ranged turrets are technically completely unproblematic, er, within limits. (Ships can't shoot what they can't see, so radar range provides a limit. Then there're the limits of a sector which is the largest contiguous space in the game.) And the AI as it stands should be able to deal with any combination of these, although have to admit that i haven't tested with long-ranged side-mounted weapons since i don't currently have the assets to play, ahem, test with. Don't recall plans for these for X4 at the moment, though.

User avatar
mr.WHO
Posts: 8577
Joined: Thu, 12. Oct 06, 17:19
x4

Post by mr.WHO » Tue, 19. Jun 18, 19:14

One more thing I notice playing Star Wars mod for AP.

If I recall it correctly there is hardcoded max range limit to which AI (turrets/NPCs) will engage other target.
Even if weapon has longer range than this limit the AI will not shoot.
I figured it out when I tried to test two Super Star Destroyer attack eachother in Star Wars mod - they do not shoot, just dance around eachother.

Is this has is a thing in X-Rebirth and X4?
Or does the weapon range define the AI engagement range (to resonable/usable limit - I do not expect ships to be able to shoot eachother from one side o the star system to another)?

CBJ
EGOSOFT
EGOSOFT
Posts: 51974
Joined: Tue, 29. Apr 03, 00:56
x4

Post by CBJ » Tue, 19. Jun 18, 19:54

mr.WHO wrote:Is this has is a thing in X-Rebirth and X4?
Or does the weapon range define the AI engagement range (to resonable/usable limit
This was already answered.
j.harshaw wrote:Ships can't shoot what they can't see, so radar range provides a limit.

A5PECT
Posts: 6154
Joined: Sun, 3. Sep 06, 02:31
x4

Post by A5PECT » Tue, 19. Jun 18, 20:30

So is the limit "sight", or does the radar range of the firing ship determine maximum firing range?

Can Ship A fire on a target outside of its own radar range if it's visible on Ship B's radar? i.e. Ship B is "spotting" for Ship A.
Admitting you have a problem is the first step in figuring out how to make it worse.

User avatar
mr.WHO
Posts: 8577
Joined: Thu, 12. Oct 06, 17:19
x4

Post by mr.WHO » Tue, 19. Jun 18, 21:25

A5PECT wrote: Can Ship A fire on a target outside of its own radar range if it's visible on Ship B's radar? i.e. Ship B is "spotting" for Ship A.
That would be crazy interesting. I can already see some kind of mod for the "cruise missile/death star laset" ship that sits at very far range and you have to provide radar spotter for it to work.

ZaphodBeeblebrox
Posts: 1826
Joined: Mon, 10. Apr 06, 20:35
x4

Post by ZaphodBeeblebrox » Wed, 20. Jun 18, 07:58

What about ship patrols?
What options for fleets will we have?
Will we be able to have fleets patrol several zones?
It was a woman who drove me to drink... you know I never went back and thanked her.

Don't try to outweird me, three-eyes. I get stranger things than you free with my breakfast cereal.

ajime
Posts: 337
Joined: Mon, 15. May 17, 09:00
x4

Post by ajime » Wed, 20. Jun 18, 08:22

ZaphodBeeblebrox wrote:What about ship patrols?
What options for fleets will we have?
Will we be able to have fleets patrol several zones?
Single zone patrol itself was kinda slow response to threats within the core zone itself especially if the patrol ship was at the edge of the zone. Let alone several zones in XR. Maybe it responds to line of sight of the patrolling ship only.

Post Reply

Return to “X4: Foundations”