Target priority for AI

I noticed that all the AI on the map focuses on attacking me all the time(especially with experimental and nukes) even if there is another opponent near them. It's annoying because my friend never gets nuked or attacked by experimental.

Is there a way to make the AI attack his nearest target?

Helllo Ropi,

depends on what AI you are using.

The default AI is fist attacking the player that is on top of the usertable.
(The player who is on top of the list inside the lobby (Slot 1))

After some minutes the AI is attacking the base with the highest threat.

The PickEnemyLogic function logic is simple,
First its making a table with all bases and threat.
Then its calculationg the distance * threat to get the best target
In case the AI is playing with another AI it will just attack the same Enemy than the other AI.

In case you are playing FAF you can install my AI:
https://forum.faforever.com/topic/350/ai-uveso-v88-ai-mod-for-faforever
(FAF is able to load AI mods like any other mod, no .SCD patch needed)

My AI will attack mostly the closest enemy.

Thank you. So far I like it. I hope in the future it goes from "mostly the closest enemy" to always attack the closest enemy. The only exception when someone builds a game ender.

Well, mostly means exactly that.

My AI will always attack the closest enemy units first.
Except the targetmanager has a high priority target like nuke, paragon or incoming experimental.

There are also 2 different attack vectors for AIR experimentals.
The 1st also attacks the closest enemy, the second tries to fly in the middle of the enemy base.

Have also in mind there are different AIs with different tactics.
Did you test Relentors RNGAI or the Swarm AI from Azrael ?

You can join us on Discord (link at bottom of my AI post) for more information.