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: 8572
Joined: Thu, 12. Oct 06, 17:19
x4

Post by mr.WHO » Sat, 23. Jun 18, 22:06

@j.harshaw: Thanks for your detailed explenation and hard work. So far I'm very impressed by how much effort you put into this system.

I'm sure there will be a lot of bugs and strange behaviours, but well, this wouldn't be an X-game without it.

I'm too old to be overhyped easily, but I must admit my hype metter nudged a bit for the first time since several years.

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

Post by j.harshaw » Sat, 23. Jun 18, 22:17

Thank us when you get the game and are happy with it! And even then, i can't take much credit because a lot of this stuff relies on backend work that's been in development for quite a bit of time before i even joined the team. That said, most of the AI is my baby. She's a good baby, most of the time.

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

Post by Skeeter » Sat, 23. Jun 18, 23:06

What's the chance we might get formations in that's kinda like from homeworld 1 game. Bandbox say 12 fighters on map click or press key for X formation and they stay in said formation fly in formation fight and shoot in formation etc. Since alot of people want fleets and war in this it seems a good idea to add fleet formations by now for a X game.
[ external image ]
7600x cpu 5.4ghz 32gb DDR5 5600mhz 6700XT 32" 1440p mon

Snafu_X3
Posts: 4472
Joined: Wed, 28. Jan 09, 15:14
x3tc

Post by Snafu_X3 » Mon, 25. Jun 18, 05:58

Hmm.. sounds like hostiles calling in reinforcements from nearby may be implemented.. ;)
Wiki X:R 1st Tit capping
Wiki X3:TC vanilla: Guide to generic missions, Guide to finding & capping Aran
Never played AP; all X3 advice is based on vanilla+bonus pack TC or before: AP has not changed much WRT general advice.

I know how to spell teladiuminumiumium, I just don't know when to stop!

Dom (Wiki Moderator) 8-) DxDiag

Alan Phipps
Moderator (English)
Moderator (English)
Posts: 30425
Joined: Fri, 16. Apr 04, 19:21
x4

Post by Alan Phipps » Mon, 25. Jun 18, 10:58

… and that means the possibility of the player using decoy attacks to shift away patrols and defences from a zone of interest.
A dog has a master; a cat has domestic staff.

Scoob
Posts: 10040
Joined: Thu, 27. Feb 03, 22:28
x4

Post by Scoob » Mon, 25. Jun 18, 16:21

j.harshaw wrote:Thank us when you get the game and are happy with it! And even then, i can't take much credit because a lot of this stuff relies on backend work that's been in development for quite a bit of time before i even joined the team. That said, most of the AI is my baby. She's a good baby, most of the time.
Thanks for your input to this thread, it's appreciated by all who are reading it I've no doubt.

Going back a while, to the original X3 Reunion, I recall there was a mod called "Fight Command Mk3" I think it was that *vastly* enhanced the AI. I think it even had a degree of skill progression.

With this AI mod, Fighters (it was mainly aimed at fighters IIRC) were a LOT more spatially aware, with ships using strafing manoeuvres to avoid incoming fire - I was dead cool seeing fighters dodge PPC fire from a capital ship - as well as do 180 degree turns, take out missiles targetting them, before flying on their way. Sadly, this mod appeared to die with Reunion, never making it to TC or AP to my knowledge.

I wonder if AI abilities like this could potentially be in X4 as it TOTALLY changed the fighter / large ship interaction dynamic. I must admit, while they could be quite effective, I largely ignored Fighters in Rebirth - they were just fodder most of the time as they never seemed to *effectively* avoid fire. This wasn't helped by the anti-fighter weapons on Capitals of course. Indeed the only way Fighters were really effective - other than in overwhelming numbers - was when they used missiles, due to there being no effective missile defence.

For me, while I'll love being able to personally pilot most ships once more, the fact that ships are smart enough to look after themselves is a massive part of the game. Also, I need to be able to order my ships to not be suicidal and retreat if they're out classed - if configured / ordered to do so. The classic M5 having a go at an M2 still amuses me - I'm replying Albion Prelude currently - but it does sometimes become frustrating to see such less than smart behaviour, irrespective of which side of the fight I might be on.

So, ships of all sizes being aware of their environment, their own capabilities as well as that of any threat is key - especially as the game is simulating a pilot in all ships now. AGI (aka Xenon) ships might have a different approach, happily sending fodder against a foe just to wear them down. Having a marked difference in behaviour that way would enhance the game a great deal I think.

Anyway, enough rambling from me...for now :)

Scoob.

Snafu_X3
Posts: 4472
Joined: Wed, 28. Jan 09, 15:14
x3tc

Post by Snafu_X3 » Wed, 4. Jul 18, 01:53

Alan Phipps wrote:… and that means the possibility of the player using decoy attacks to shift away patrols and defences from a zone of interest.
Assuming you're replying to my post (& that it's implemented both ways), IMO that makes things /more/ interesting tactically & strategically, leading to great gameplay.

Bring it on! :)
Wiki X:R 1st Tit capping
Wiki X3:TC vanilla: Guide to generic missions, Guide to finding & capping Aran
Never played AP; all X3 advice is based on vanilla+bonus pack TC or before: AP has not changed much WRT general advice.

I know how to spell teladiuminumiumium, I just don't know when to stop!

Dom (Wiki Moderator) 8-) DxDiag

User avatar
Sandalpocalypse
Posts: 4447
Joined: Tue, 2. Dec 03, 22:28
x4

Post by Sandalpocalypse » Mon, 9. Jul 18, 21:44

a big problem with the modded fighting scripts in the x3 engine was always scaleability. they were expensive on CPU. The same usually applied to the advanced turret scripts. In practice they seemed to be player use only.
One trick that i play around with in testing is to tell the commander to wait for much longer than you need them to (say, 24 hours), then cancel the Wait order once everyone is assembled, so everyone moves to attack in a single mass. The timeout is important because a Wait order without a timeout is interpreted as "wait indefinitely" and there's a piece of logic that says that an infinite order followed by another order has to be completed as soon as possible because, if it goes on indefinitely, the next order will never start. Alternatively, they could be told to move to a point and wait indefinitely, then manually given an attack order when you're satisfied that it is time.
I believe the ye olde Rainbox Six games used a clever bit of UI wherein you tied your orders to Go Codes. So you'd issue move orders for your various teams to stack up at doors, then tied to Breach order to Go Code Alpha.
After the player sent the "GO ALPHA" message the AIs would follow their next group of commands until they hit their next Go Code gate. But that was a game oriented around planning as much if not more than first person action.
Also playing around with a piece of logic where, if you order a squadron to directly attack a target, they all move together until they get close enough for the normal attack logic to kick in. Testing so far looks like it simply takes too long, is too fragile, and is needlessly restrictive though so might scrap it. We'll see.

edit: Problem with all this is that it's complex enough that the fact that you can do this isn't easy to communicate to the player. Working on that bit. Ideally, you won't feel like you have to, but you can if you want to.
would love to have something of that nature, since it could make for organized attacks by an AI as well!

I love it when the AI can function in a more organized hierarchy like that, it really brings depth to fighting in a game.
Irrational factors are clearly at work.

Warnoise
Posts: 674
Joined: Mon, 7. Mar 16, 23:47

Post by Warnoise » Fri, 13. Jul 18, 03:43

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, 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.
Ok after reading this post. I am 100% going to pre-order X4

Scoob
Posts: 10040
Joined: Thu, 27. Feb 03, 22:28
x4

Post by Scoob » Fri, 13. Jul 18, 13:14

Sandalpocalypse wrote:a big problem with the modded fighting scripts in the x3 engine was always scaleability. they were expensive on CPU. The same usually applied to the advanced turret scripts. In practice they seemed to be player use only.
With Multi-threading being a core part of the game engine now, I'd hope the game would be able to cope a lot better with such things.

Considering X3 was single threaded, but effectively used two Core - one for the game one for DX - being able to spread over four cores, which is the minimum now realistically, is going to make a huge difference.

My only concern is how Rebirth still choked massively when modded, yet CPU utilisation would drop as performance dropped, despite being multi-threaded. I really hope X4 scales well and can use proportionally more CPU resources as the number of scripts - both vanilla through updates as well as modded - increases.

With Six and Eight Cores becoming more normal, I really hope that X4 can thrive and scale well as stuff is added.

Scoob.

Slashman
Posts: 2515
Joined: Tue, 12. Oct 10, 03:31
x4

Post by Slashman » Fri, 13. Jul 18, 17:35

Scoob wrote:
Sandalpocalypse wrote:a big problem with the modded fighting scripts in the x3 engine was always scaleability. they were expensive on CPU. The same usually applied to the advanced turret scripts. In practice they seemed to be player use only.
With Multi-threading being a core part of the game engine now, I'd hope the game would be able to cope a lot better with such things.

Considering X3 was single threaded, but effectively used two Core - one for the game one for DX - being able to spread over four cores, which is the minimum now realistically, is going to make a huge difference.

My only concern is how Rebirth still choked massively when modded, yet CPU utilisation would drop as performance dropped, despite being multi-threaded. I really hope X4 scales well and can use proportionally more CPU resources as the number of scripts - both vanilla through updates as well as modded - increases.

With Six and Eight Cores becoming more normal, I really hope that X4 can thrive and scale well as stuff is added.

Scoob.
Just keep in mind not to overestimate the impact of multi-threading. It is not a magical mcguffin.
If you want a different perspective, stand on your head.

Post Reply

Return to “X4: Foundations”