New Fleet AI Design

The place to discuss scripting and game modifications for X4: Foundations.

Moderators: Moderators for English X Forum, Scripting / Modding Moderators

FanUS
Posts: 69
Joined: Mon, 13. Mar 23, 03:48
x4

New Fleet AI Design

Post by FanUS »

X4 Fleet AI
Current problems:
Current design, ships operate disorganized and does not move with cohesion. The whole system is too complex and a lot of redundancy that are not needed. Nobody likes stupid.

New design:
We use real life military engagement rules. Concept is simple, wingmen, escorts first and foremost behavior script is form up and maintain formation, nothing else.

S, M, L, XL ships no carriers:
Get rid of attack with commander, defend commander, intercept for commander, or follow commander all this is redundant overly complex. Replace with single join fleet menu option. A fleet should be able to perform these basic tasks without player micromanagement.

Default behavior script for fleet subordinates is maintain formation and nothing else:
• Acquire commander position
• Acquire fleet formation type
• Acquire formation position
• Move to formation position
• Match speed with lead ship and headings
• Maintain formation position by adjusting speed heading as needed
• When commander engage travel drive, adjust heading and engage travel drive
When there are no orders from command ship or player, this is what the ship in a fleet performs. Get rid of travel drive charge time. Or fleet would have to engage the drive at the same time to eliminate stupid ship lagging for 30 seconds. Recommend reduce travel drive charge to few seconds. Ship can’t travel when under attack anyways. Therefore, long charge time is frankly idiotic to make ship sit for 30 seconds. This is what I mean like real life military. Wingmen does nothing but maintain formation until command is given.

Fleet commander:
Fleet commander’s job is to oversee the well being of the fleet. It’s the job of the commander to issue orders.
When told to attack all in range, defend position:
• Monitor scanner enemy list
• Issue targets and attack target orders to subordinates
• Monitor subordinates shield and health
• Keep self at safer distance as in not aggressive
• Cancel attack order to a subordinate if subordinate shield is gone and or health is certain threshold. This makes the subordinate return to execute keep formation as soft retreat to commander side. This allows commander to cover fire for damaged subordinate ship. Reissue attack order to subordinate when subordinate shield is full.
When subordinates receive attack target, it moves keep formation script to next in the list and execute attack target script first. This act as break formation and engage. When target is destroyed or no longer possible to attack, out of scanner range, drop attack order and return to formation script. This makes it so subordinates do not chase targets.

Command ship attack order types:
Commander should determine appropriate order to give to subordinates. This replace the intercept, attack, defend, or bombard.
• Attack subsystems if destroyer target
• Disable engine if destroyer target
• General attack to destroy if S, M target
• Bombard if ship is equipped with torpedo or very long-range weapons

Join fleet replaces follow commander since maintain formation is following commander. Remove ship from fleet if you no longer want it to follow.
Commander issuing different type of orders is automating attack, defend, intercept or bombard. Therefore, all those scripts are redundant.
When commander is hold position idle, and subordinate is attacked or fleet is attacked, commander enter combat AI start issuing orders like above. Self defense and keeping well being of the fleet.
• Command ship attack station:
• Acquire station position, size
• Determine subordinate weapon range
• Determine attack positions around the station
• Issue move to attack position to each subordinate as appropriate based on their weapon range
• Monitor subordinate shield and health
• Cancel move to attack position order makes subordinate return to formation as soft retreat
• Reissue move to attack position when subordinate shield is full
• Commander should keep max distance and not being aggressive
This way, it should automate bombard, or attack at max range depends on weapons available on the subordinates. There is no need for all these cumbersome individual script of bombard for commander or attack for commander. The commander should be the one determining which script to give to subordinate.
• For pilot skill you might do things like low skill only issue general attack and doesn’t know how to issue attack sub system.
• Higher skill knows how to match ship types against enemy targets and such. IE, M against S target, L against M target XL against L target. Basically a target priority.

Test and make adjustment.
Carrier is entirely something else for another time.
User avatar
Axeface
Posts: 3029
Joined: Fri, 18. Nov 05, 00:41
x4

Re: New Fleet AI Design

Post by Axeface »

I like the ideas here, and you are correct that there is a lot of redundant orders. Its certainly a step in the right direction to think about it like this. And 100% agree that a fleet should be able to make decision by itself, one of the first things I noticed in 2018 when this game came out was how we had to set turret priority for our ships and that it stuck... I was a bit shocked by that one and still am really.
FanUS
Posts: 69
Joined: Mon, 13. Mar 23, 03:48
x4

Re: New Fleet AI Design

Post by FanUS »

Axeface wrote: Sun, 23. Apr 23, 16:33 I like the ideas here, and you are correct that there is a lot of redundant orders. Its certainly a step in the right direction to think about it like this. And 100% agree that a fleet should be able to make decision by itself, one of the first things I noticed in 2018 when this game came out was how we had to set turret priority for our ships and that it stuck... I was a bit shocked by that one and still am really.
This shouldn't be so difficult. Even if this was an old system running scripted behaviors and maybe execution of the program is slower but there seems to be no logics put in place how a fleet should behave. We're not even talking anything advanced. Just basic fly the ship properly and maintain formation is lacking. There are also fundamental mechanics that's making the situation worst such as overly sluggish maneuverability for large ships it takes them forever to change heading and move. To call it a fleet is a joke in current build. At best, it's a bunch of armature gangs and a gang leader that's running around in disarray.

Return to “X4: Foundations - Scripts and Modding”