AI Development Guide and M27AI v74 Devlog

@teralitha Thanks, I'll have that bug fixed for the next version - looks like it is mistakenly treating all allied naval units as being M27 naval units

Seems to be a problem overcharging. Not sure if its because of your mod or not. But its the only mod Im using so a good chance.

Problem is I cant do overcharges. The button is never highlighted no matter how much energy I have stored.

If you disable M27 and e.g. just play against normal AI can you overcharge? I dont have any issue myself (playing with M27) and I don't recall putting in any code to disable overcharge, so it may be an issue with the base game (especially as you mentioned in the other thread you aren't able to target individual units with T3 arti so sounds like a few strange UI related behaviours).

Yeah could be an issue with FAF. In vanilla I can overcharge. On a different note, with M27, something that is a bit annoying is when I build an T3 arty, AI will send over engineers to help me build it sometimes, and thats ok, but the problem is when they also start building their own T3 Pgens next to it. Im not sure if that matters whether or not an allied PGEN will give the connection boost to the arty or not, but I dont think its intended.

Another little issue Im seeing on occasion, the AI will send out a cluster of T3 engineers toward the enemy bases that behave as though they are combat units on the offensive, and they just die.
https://i.imgur.com/qBuXOVK.jpg

@teralitha Re the T3 arti PGens this sounds like an indirect effect of it's backup logic for finding somewhere valid to build (where it takes the last location that something was successfully built as a start point when searching for build locations, coupled with its logic for building power normally where it tries to build power adjacent to units that benefit from the adjacency). I'll see if I can adjust the adjacency logic to only factor in units owned by the AI since adjacency doesnt benefit allies.

Re the engineers I'd need a replay to see why they're doing that/if it's intentional, e.g. they may all be on reclaim duty, or trying to build something (that's ended up with a really far away location due to not finding somewhere nearer the base) etc.

https://replay.faforever.com/18009052

Keep an eye on Gray, they are one of the biggest cuprits that send out all the engineers groups Also, I looked at every AI, and they at any given time will have anywhere from 50-90 T3 engineers each. That seems very excessive to me. They never ever have enough mass to warrant having so many engineers.

Check this out - https://i.imgur.com/JwDscQD.jpg

Is there an arbitrary limit placed on the m27 AI on how many nuke launchers if can build? Just wondering because in my current game I built 4 nuke lanchers, but for some reason only 1 will allow me to build nukes, the rest I have built cant. Not sure if its because of the mod but Im thinking it is.

@teralitha No limit. I've also seen the same M27 AI build (and use) multiple nuke launchers. Sounds like another UI issue, but I've not had anyone else say it happens with M27. See if you can reproduce without M27 (e.g. just enable cheats and spawn in 4 nukes both with and without m27), and if it's the same without M27 ask for help in the technical support section on discord and/or on the forums.

@maudlin27 , great job with this AI. I like to make 1v1 style maps and when I play test I throw in an AI opponent. I've only used it a few times so far but it acts the more like a human opponent than any other AI I've tried. It even chased my com down with T1 arty after a battle had left it <1000hp and got the kill as I was trying to get under water

I used to use Sorian AIx adaptive with 1.7 or 1.8x but M27x absolutely destroyed me with those settings. It bombed all of my engineers within a few minutes.

Anyway, great job. I won't be going back to Sorian AI.

@maudlin27 Okay so I tested it and its fine. I think what happened is I reached unit cap.

Just a suggestion, what if instead of a one size fits all AI, you make a couple different AI for different roles. Like one that focuses on navy, one that focuses on air etc. Trying to make one AI do it all could be difficult to balance perfectly. Depending on map positions, I would want certain AI to perform focused roles, and that is what is missing from alot of modded AI's i see out there, with the exception of sorian which does make several role focused AI. (That arent as good as they could be)

@teralitha If you try playing against 4 M27 on a map like setons you should notice each AI perform a different role. I did contemplate different player selectable roles for the AI at one point but decided I'd rather focus on having the AI decide what role to try and do based on the map/scenario (it also makes it easier to maintain if I'm just dealing with one AI rather than different variants, and helps make the AI a bit more varied/less predictable when playing in different map/game setups).

FYI re your previous replay with grey sending engineers out it was due to a bug with M27's pathfinding for that map, it'll be fixed in the next version (although I expect the AI will still built lots of engineers)

@stlng Thanks for the feedback, glad you're enjoying it! If you see it do anything stupid feel free to send me a replay

Latest changes (v53 summary)

  • New unit unlocked - shield boats! Related logic for Aeon and Seraphim added to use mobile shields like shield boats.
  • 10 Bugfixes, including pathing bug on Battle Swamp map and stopping M27 from controlling non-M27 teammate's naval units
  • 10 Adjustments to navy, mostly relating to decisions on whether to attack and with what units
  • 6 other changes, including adjusting threat calculations so shielded undefended bases emit less threat, and making it less likely for T1 PGens to be gifted to a non-M27 teammate

Acknowledgements:

  • Teralitha – Replay highlighting bug with teammate’s navy, along with other more general feedback
  • Fearghal – Highlighting M27 breaking on maps with underwater start positions.

Im still seeing the AI take control of my naval units, but its not all the time now. They are occasionally grabbing a few of my ships to move in their naval groups.

@teralitha Thanks, spotted the issue in the code so hopefully will be fixed properly in the next version

I am still unable to use overcharge while using this AI in my game.

EDIT, correction, it is working, however, Im not getting any audible notification that its available like you normally do. At least, not at first. It starts giving audio and visual que's after you fire it a few times. However, Im not sure if this is caused by M27..

Sounds like it's probably an unrelated sound issue. One thing I found helped when I had separate sound issues (where a range of different sound effects including ACU being under attack stopped working consistently) was doing a restart of my computer (restart rather than shutdown), but if that doesnt help I'd see if anyone can help you in the technical support area

v54 summary of changes
Small update mainly to fix the bug with M27 taking control of non-M27 allied naval units

  • 3 bugfixes, including bug with initial land factory build location and controlling non-M27 naval units
  • 2 Misc changes (reducing the amount of AA structures that get built, and no longer targeting underwater mexes with TML)
  • Temporary eco strategy - very niche strategy that will be most relevant probably in AI vs AI games - M27 will eco temporarily even if it lacks map control if it has a firebase protecting most of its units and its core mexes are behind the opponent's

Acknowledgements:

  • Relent0r - screenshot highlighting the factory build location issue was a more widespread isuse than I'd thought
  • Teralitha - Confirming the naval control bug was still present in many cases

Feedback: AI defending against yotha(seraphim chicken experimental) I watched as a single yotha casually strolled through 2 of my allied M27 team mates wiping them out entirely with barely a scatch. One of the defending AI had a sizable group of T3 tanks that they brought to deal with the chicken. Only they didnt. They would approach the chicken at the very edge of the chickens range, and never even try to get in range of their own weapons. They kept retreating out of their weapon range and all got destroyed while doing no damage whatsover to the chicken. My 2 AI teammates were doing better than me in this battle. I had been nuked and was struggling to make any progress. When i saw the chicken coming, and I saw my teammate with a group of 20-30 T3 tanks along with some turrets in the base, I figured they could handle it no prob. But not so. The above happened and the chicken wiped them out easily then moved on to wipe my next teammate in the same fashion.

My assumption here is that the AI are programmed to be a bit too cowardly. Maybe in general, or maybe when on defense. they should have had little trouble dealing with the chicken. Its rather strange how the AI behaves when its my team vs their team.

For example, if I send a monkeylord to an enemy base, the AI will respond by quickly making a huge swarm of t1 bombers. The AI on my team didnt do that. Maybe the AI responds differently to different threats? I dunno. But I have seen the AI on my team get wiped out by a single monkeylord before too. The more I play with this AI the more It seems like the AI on my team plays dumb while the enemy plays smart. I had one team mate that far exceeded me in eco and everything, I thought for sure we were gonna win. But when I look at their base... no artillery... no nukes... no experimentals.. Yet the enemy team will be droppin nukes and marching experimentals, dropping arty on all of us.

As I said, its feels like when the AI is on my team, they dont play very smart or do much, but the enemy AI always seems to be geniuses and gets way ahead of my team on everything. I will say this, my team loses alot. I have won sometimes, but its hard, usually because my team never does very well compared to the enemy team. Its as like, if I dont carry my team, Im pretty much guaranteed to lose with this AI on my team. It gets a little frustrating.

I also want to mention, of all the games ive been playing with M27, I dont believe Ive ever seen them build a GC before. I see monkeylords often, chickens less often. Dont think ive ever seen a crab either. Or a czar. I did once see asswasher. Nukes are pretty uncommon as well. I am seeing the AI build multiple nuke defenses, which is quite inefficient. Thats alot of their mass being wasted.

Anyway, to sum up

  1. AI plays too cowardly with ground units, and as a result gets decimated without doing much. If I had to guess, Id say the AI treats all T3 ground units as a spiderbot regardless of their actual weapon ranges, and as a result, will get killed by units that outrange them without actually closing the distance and engaging.
  2. Builds too many nuke defenses, essentially wasting a ton of mass.

I have always been playing with random factions, but Im gonna be testing with all one faction vs all one faction to see how the AI handles such matchups. And really to see what they build compared to others.

@teralitha Thanks for the feedback, in terms of your points:
-Experimental defence - Ive recently finished drafting specific logic for this in my current WIP version which sounds like it should address your main concern here, although monkeylord may still cause issues if the AI doesnt have omni up by that stage
-t3 units not engaging experimental - have you got a replay? Theyre not meant to engage if they think theyll lose the fight but it sounds like they might be a bit too cautious, or (if it’s their base under attack) should just try attacking anyway
-too many smd being built - I was hoping to fix this in the current WIP but a replay where I came across the issue is desynced; have you got a replay example of this? Ideally where 3+ smd are built near to each other when the enemy has just 1 nuke launcher
-No GC being built - I expect if you only play Aeon vs Aeon you’ll see some being built, Ive seen them and Czars built numerous times where the only faction on the team is Aeon
-Poor M27 teammates - one possibility is that the teammates lack air control so focus on regaining it while the opposing team has air control so focuses on other areas, which would also account for the poor response to attacking experimentals. m27 only considers friendly M27 air units when deciding if it has air control so it’d be eg 3 m27 trying to outproduce 4 m27 at air (and likely almost always being behind as a result)