AI improvement megathread

In this megathread, I will be breaking down how machine learning works, as that is how the AI system alledgedly works, as well as break down what the AI needs in-game, right now, in order to perform better.

Machine learning is a system where there is a bunch of inputs, in this case being things like location and state (owned, neutral, owned by enemy) of capture point, line of sight, distance and location of enemies, etc.

It then uses modifiers to narrow all those inputs into a couple of sub-states. These sub-states can be abstract so can not really be given a comparison or example.

After that, more modifiers will use those sub-ststes to select a single output state: moving to cap, shooting an enemy, or idle. (there will be more states, but I’ll skip those to keep things simple)

Machine learning is the art of assigning random values to all modifiers, then taking the top few with the highest score, then taking those as base values for a new generation. Those will have slight variants in their modifiers, and this is repeated until you got something that can obtain a high score.

Sadly, a few modifiers seem to be missing or very out of whack, which create some issues:

Player line of sight and position modifiers too weak: AI soldiers still often bump into the player or stand in front of them. Putting greater importance at avoiding those values would help.

Range-dependant aggro gain: AI soldiers gain aggro too slowly at short distance, but too fast at long range. Giving diffrent modifiers for diffrent ranges (which could also be modifiers) would help. In addition to this, adding a narrow cone that acts as eyesight of the soldier, which grants high aggro to any soldier in it and in line of sight, could help making the bots be more responsive to what they are looking at.

Partial-opacity sight: AI soldiers commonly ignore bushes when shooting and even buildings, occasionally. Wood log buildings are also known for getting shot through, making this worse. Having an aggro modifier based on any opaque object in between the target and the soldier, like bushes, could help here.

Grenade distance and remaining fuse time, as well as cover rating for current position vs grenade position: AI soldiers are a bit too aggressive when throwing back grenades. They run out in the open and get shot. They also attempt to throw pre-cooked grenades, which is very abusable for experienced players, as they can use a partial cook to lure out AI and have it explode in their hands. Exposing these values to the machine learning algorithm would help.

Engineers are uncapable of finishing buildings on their own: Adding a variable that checks for nearby unfinished buildings set up by the owning player would fix this.

AI prefer secondary slot over primary slot and don’t use automatic weapons in full auto. Giving them diffrent firing patterns depending on weapon type could fix this:
Bolt action / semi: as is. Shotgun: high priority for seeking cover after firing. SMG: fire bursts. LMG: only fire when crouched or prone, in bursts.

AI can’t use stationary weapons when ordered to use them. Giving them the ability to fire them, depending on the aforementioned weapon firing behaviours, alongside targeting angle limits.

AI stops when running under fire while owning player is also running. Instead a strafing state should be implemented, which they enter when the owning player runs and they are under fire / have aggro. When strafing, they will slightly change directions every few meters to make them harder to hit. There is a modifier for walking distance and one for angle change required.

AI soldiers ignore player stance, which they should match, where possible. With stance I mean running, walking, crouching, or going prone. These should have high weight priority towards which stance the AI soldier uses.

AI soldiers are unable to climb ladders, which they desperately need to be able to do.

AI soldiers often ignore destroyed obstacles and treat them as intact, walking around them.
If anyone has any more suggestions, please let me know!
I will try to write it up in a more technical format, for the developers.

8 Likes

AI doesn’t seem to pay attention to the player’s stance. If the player is laying down or crawling, the bots should be laying down or crawling, unless they’re sprinting to catch up.
As of right now it’s futile to keep a low profile as a squad because the AI doesn’t even try to stay down.

The monastery seems to have its own special bit of AI pathing jank, though there are no other comparable buildings that share this issue as far as I know.
AI in the monastery can get confused as to which floor the player is on, and follow the player around from the floor/s above or below them when the layout of the building means they’re very far from the player in a practical sense.

That’s acceptable in a small house, but not on those ramparts.

2 Likes

Bots also aggro too accurately on incoming fire at long range.

I can fire 1 shot over the heads of a squad and all of the bots will instantly spin around and zero in on my position in no time at all.

2 Likes

I’m getting real tired of that. Of course we all want the AI to be smarter and react to situations accordingly, but having AI just one-tap you from 200m away is ridiculous.

1 Like

AI does not face enemy and will commonly look at a wall or door then in enemy direction. Ai will run around like a bunch of 5 year olds. Ai makes no use of any equipment other then rifle. Ai does nothing in a tank,when it could shoot mg or main cannon. Ai will not take notice of enemy spot markings.

1 Like

It would be nice to have order like “use grenades” etc. But it’s not AI related.

Simply put the AI needs major revamp…

1 Like

The core functionality is there, just some weights need adjusting so they’re not simultaneously terminators at long range and useless at short range.

Also if you order them to attack a tank, they’re surprisingly competent at timing demo charge throws.

2 Likes

On the other hand, AI equipped with a scope should be able to snipe at long distances. Of course, that is the only acceptable type of weapon to do so and it shouldn´t ignore trees, bushes etc. This was issue most particularly seen in Normandy (chateu control point where AI managed to snipe windows from spawn through all obstacles)

3 Likes

Carried over from another thread:
If I could add only 2 orders to AI, it would be “get down” and “keep moving”

“Get down” would cause the AI to all go prone until you tell them to follow, or until you get far enough away.

“Keep moving” would stop the AI from aggroing for 10 seconds or until the player in charge of them fires.

1 Like