AI-Uveso (v112) - AI mod for FAForever

Hello There!
I've been testing other AIs for a while.
M27AI is the most impressive when it comes to eco management and great placement of structures but it lacks naval logic.
There are a few things that you could implement to improve the Uveso AI.

  1. Always placing a t3 shield that covers a t3 arty and a group of t3 engies supporting it.
    It's a great defensive thing that M27AI does and it makes any AI extremely hard to crush in arty wars.
  2. I've noticed that Uveso likes to use gunships while M27AI is more bomber focused.
    Spamming t1 bombers to counter incomming land experimentals would be a great thing.
    Also using t2 and strategic bombers to kill unprotected mexes would make games more challenging.

Since the no rush for game enders option Uveso struggles to pump all of his available eco into units. It's always overflowing alot, not making a good use of mass untill it can start making experimentals, arties and nukes. I would suggest improving its behaviour before the game ender timer, making it swarm players with everything it has (t3 land, air, navy).

I've also noticed a strange behavoiur with walls. It feels like the AI doesn't know how to counter it and gets stuck. The AI is piling lots of units outside of the walls and doesn't attack it or change path to overcome the obstacle. Unfortunately i don't have a specific replay that i can post to show the problem... it's something that I forgot to mention when I gave my feedback the first time. To fix this I would suggest simply making the AI treat walls like a standard enemy with low priority. Simply getting rid of it by attacking may work well.

I also have a suggestion regarding no rush for game ender option.
Could you split the option into 4 categories?
One for land and air experimentals, second specifficaly for nukes and nuke subs, third for t3 static arty and last for the t4 game enders.
It may get rid of the eco problem that i've mentioned before, because if we let the AI to make the land and air experimentals earlier, before other game enders, it would pump mass into them.
It also would make the game more fun for the players if we can decide about the flow of the game. For example if the AI can start making land and air experimentals min 20, we know what to expect and it's possible to get prepared, then the next phase would be nukes by min 25, then static arties after 30 and t4 game enders late in the game 35~40 min.

I'm looking forward for the future improvements! 🙂

Hey radde!

Thanks for the good feedback. Is always a pleasure to read it.

I have alrady an update for the AI since end of may.
Sadly i suffer from long covid since may (need to sleeping all the day)
So all the time I'm awake I spend doing my job

nevertheless i will try to bring the update as soon as possible
(need to write the patchlog and remove some debug lines)

Talking about feedbacks, the shipyards of your AI already are built more spaced between them.

Update 17.Jul.2022(v101)

  • New: pressing [ALT]+[a] (Toggles opponent AI) suspends all AI functions (also sets all units to hold fire).
  • New: AI is now aware of allies capturing friendly structures and will report abuse when this happens
  • New: added function to shorten a path when units are stopped on a path and try to continue the path to the previous destination
  • New: MoveToLocationInclTransport is now using the path from the target function instead of creating its own
  • New: naval units now return to the closest naval base not to the base where they where build
  • New: naval units that have no special target will now attack all units (on water)
  • New: UEF satellite now has its own targeting priorities and attack function.
  • Fix: disabled the function TransferUnfinishedUnitsAfterDeath again. Crashed the game too often.
  • Fix: fixed bug in aibuildstructures.lua with restricted units
  • Fix: unit count buildcondition "NavalBaseWithLeastUnits" no longer takes MAIN base into account
  • Fix: fixed bug in platoon.lua that caused some functions to lose target
  • Fix: ACU sniper platoon now works with gunship, bomber and fighterbomber
  • Fix: Fatboy and other long range experimentals will now fight at their optimal weaponrange
  • Fix: fixed several issues where buildings are build to close to each other
  • Fix: switched some variables inside target function from global to local
  • Fix: added extra T2 Energy builder to prevent energy stall with Black Ops upgradeable hydrocarbon power plants
  • Fix: removed the old BaseTargetManagerThread and replaced it with a new target manager
  • Fix: naval factory builders will now check for at least 20% water on the map
  • Fix: naval factories will now be build with a bit more space between each other
  • Fix: fixed bug in UnitCountBuildConditions.lua that broke the naval unit build
  • Fix: added assister for building UEF satellite structure
  • Fix: base panic builder no longer only spam T1 units
  • Fix: removed unessisary overload with aiBrain table for some forked functions in ExecuteAIPlan
  • Opt: pathing will now get enemy threat from the new heatmap data
  • Opt: engineer will continue to cap mass spots even on energy/mass stall
  • Opt: increased buildrate for T3/T4 artillery and UEF satellite
  • Opt: changed artillery and nuke behavior and target priorities
  • Opt: increased number of nuke/nuke defense ratio from 0.80 to 1.00
  • Opt: added an early air factory and transporter for water maps
  • Opt: changed targets for air experimentals
  • Opt: optimized Base Ranger, moved locals to function start
  • Opt: optimized Eco Manager, moved locals to function start
  • Opt: assister that help building a paragon will now be paused on low energy
  • Opt: expansions are now also building missile defense systems (anti nuke)
  • Opt: AI Rush: increased build priority for T3 engineers
  • Opt: AI Rush: added builder to create more energy structures
  • Opt: AI Rush: now aggressively eco up
  • Opt: AI Rush: will no longer pause factories with unit production due energy/mass stall
  • Opt: target function: added more search range rings, caching already checked targets
  • Opt: target function: increased targeting speed by rearranging search parameters
  • Opt: target function: new system to determine platoon and enemy strength
  • Opt: optimized placing of local variables for performance
  • Opt: removed reclaim cleaner function. (was removing wrecks/reclaim after 15 minutes)
  • Opt: CanPathNavalBaseToNavalTargets is now using CanGraphAreaTo instead of pathing
  • DEV: endless game option does no longer use the splitscreen. It's now zooming out to see the full map
  • DEV: removed function to debug threat inside waypoint markers. AI has now a new threat system.
  • DEV: Log and debug print will now show gametime, Lua file and line number in game.log

Update 21.Jul.2022(v102)

  • Opt: rebuild nuke function to sync targets with artillery and satellite.
  • Opt: added better calculation for nuke missile flight time (lead target)
  • Opt: increased calculation speed for target manager
  • DEV: added function to convert gameTimeSeconds to hour:minute:second (FormatGameTimeSeconds(GTS))
  • DEV: removed hook for BrainConditionsMonitor
  • DEV: temporarily disabled unit uea0203 - UEF T2 Air Gunship. (could cause game freeze)

Update 31.Jul.2022(v103)

  • Fix: unit no longer ignore walls. (they will destroy walls now)
  • Fix: nuke distance to target was calculated by platoon center position, not launcher position.
  • Fix: artillery targets were accidentally sorted by satellite sort function
  • Opt: nuke "Jericho attack" now uses all launchers for an attack (was only 1 launcher per target)
  • DEV: removed platoon function "IsTargetNukeProtected", it's now calculated from the targetmanager.
  • DEV: PLatoonNameDebug does no longer start the LocationRangeManager for other AIs

v104 (01.Aug.2022)

  • Fix: naval expansion builder checks now for map water ration > 20%
  • Fix: unreachable mass spots will now be blacklisted in AIExecuteBuildStructure()
  • Fix: abuse report for reclaiming ally buildings is now restricted to AI-Uveso only.
  • Fix: in some cases waypoints were created when a map has DoNotAllowMarkerGenerator = true
  • Opt: moved AI debug options to the end of the lobby option list
  • Opt: Rush sub AI: decreased mass extractor upgrades by 5%
  • Opt: Rush sub AI: AI will no longer pause factory upgrades on low energy/mass
  • DEV: IsNavalExpansionsAllowed() now checks for water ratio and expansion count
  • DEV: EngineerMoveWithSafePath() now only call for transport if transporter actual exist

Update 06.Sep.2022(v105)

  • Fix: updated AI Fn OnDefeat() to match latest FAF version
  • Opt: decreased energy need for 9 unit SACU teleport platoon from 120000 to 90000
  • DEV: Fn GetDangerZoneRadii() will use ScenarioInfo.size in case playableArea is not present

Update 05.Oct.2022(v107)

  • New: completely new marker generator - every movement layer is now created independently
  • New: added movement layer for hover units (was using amphibious layer before).
  • Del: removed lobby option for AI waypoint genertor. (it's now always on)
  • Fix: fixed a bug that could cause the nuke function to error out after a launcher died
  • Opt: minor improvement in EconomyBuildConditions calculation speed
  • Opt: removes special pathing for engineers (pathing without heuristic search)
  • Opt: check for mass spots are now based on playerarea instead of map size
  • DEV: Fn OnDefeat() now first checks for the existence of a manager before trying to delete it
  • DEV: changed check for defeat to aiBrain.Status ~= "Defeat"
  • DEV: pathing debug will now display expansions first (from game second 5 to 10)

The new marker generator is ported from the Sanctuary-RTS game i am working on.
With the kind permission and support of Enhearten Media

I'm having an issue since yesterday's update where the AI is not building mass extractors, or acting properly in general. Tried both an AIx adaptive and AIx overwhelm, on two maps with markers that worked before. Also with and without mods. Any ideas?

@gheed It needs a quick hotfix, I'm sure Uveso will upload once he's available.

@gheed said in AI-Uveso (v107) - AI mod for FAForever:

I'm having an issue since yesterday's update where the AI is not building mass extractors, or acting properly in general. Tried both an AIx adaptive and AIx overwhelm, on two maps with markers that worked before. Also with and without mods. Any ideas?

I was using code that is only available at the FAF Develop game.
So if you start the FAF develop game version then it would work.

Will be fixed today.

Thanks for reporting it!

Update 07.Oct.2022(v108)

  • Fix: fixed a bug in EconomyBuildConditions. (Mod was build for FAF develop version)
  • Fix: fixed pathing to evade cliffs / hills or cluttered areas.
  • Fix: sub AI Experimentals was not building defense tanks if enemy is close to base
  • Opt: refactored marker generator.
  • Opt: pathing debug view is now using the internal markers, not the FAF PathGraphs
  • DEV: added 3rd impassability value for markers that are neighbors to already flaged markers
  • DEV: new commands for marker generator: GetLandExpansions(), GetNavalExpansions()

Hi There,
Thanks for the great MOD it given me a some great games. i am unfortunatly seem to be find some issue of late:

  1. The AI not build SMD before (well stop building it before it is finished)
  2. Not knowning how to use transports (it used to really surprize me)
  3. Doesn't know how to get to Mex requiring transport (it used too)
  4. I have had a AI lanch a nuke at itself when a support com tele into its base.
  5. Gunship after Gunship passed the 40mins mark (seems to run out of ideas)
    This is the only MOD i use so i don't think i have meesed it up, please feel free to say if i need somthing else to ensure the AI return to its once great self.
    Thank you.


Thank you for your feedback!

  1. When the Ai starts to build something and stopped it later, then this is mostly because of low eco
    i will take a look at the ecomanager and check if the issue is caused there.

  2. Right. My AI is using the original transport function. Its mostly wasting transports by flying into SAMs
    This needs some rework of the transport function in general.

  3. not knowing how to reach a mex on a hill or island is caused by not having a transport ready.
    The engineer will ignore the missing transport and try to get the mex on its own until a transport is available.
    Can also be caused by a missing waypoint marker that needed to be present near the Mex.

  4. That should not happen. The Nuke Target function looks for friendly buildings and shouldn't
    fire at more than 3 own Tech2/3 buildings.

  5. Well thats right. I only play the game with mods, so the AI is using those gunshipts to destroy experimental shields.
    I have to change that anyway because eg. Seraphim has no T3 gunships.

I highly recommend testing other AIs we have for Supom like RNGAI or M27AI.
They are not focussed on turtle play and are much more challenging.

Again thanks for your feedback, i have written everything down to my ToDo list and will check it!

Has anyone noticed that the civilians won't attack the Uveso AI? I think this is new behavior though I don't know what may have caused it.

I have seen this but I never correlated it to Uveso being present or not. There's nothing in his code that plays with civilians.
When I saw it happen I saw that the PD's attacked one player but not another. I'll have to try it with a few variations of different AI and see if having Uveso enabled makes it happen or not.

@swaaye said in AI-Uveso (v108) - AI mod for FAForever:

Has anyone noticed that the civilians won't attack the Uveso AI? I think this is new behavior though I don't know what may have caused it.

No, i did not noticed this, and there is no code/function for civilians in the AI-uveso mod.
We will take a look at it. Thanks for reporting!

On some naval maps the AI just builds T1 subs until it hits unit cap. This is especially true if there's a section of water where the subs are trapped. Is there any way to avoid this? In this game 30% of unit cap is taken by T1 subs at 25 minutes:

Also, does disabling nukes prevent the AI from working properly? I posted a year or so back and you fixed it. Recently it seems like disabling nukes makes the AI stop building most experimentals. UEF seems most affected by this change. Aeon plays normally with nukes off.


Thank you for your report again!

I'm very busy at the moment but I've put it on my todo list.

not sure why so many subs are build, normaly the builder should not overbuild.
I guess i forgot to add a buildcondition to check for enemies.

And yes, the AI needs to have nuke/antinuke to continue with higher tier units like experimentals.
I will have a look at it and see if i can use a different build logic without nukes.