AI Development Guide and M27AI v74 Devlog
-
@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
- 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.
- 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) -
When it comes to air control, I usually dont focus on making air units myself, but instead I send out SACU's to my allies to build SAMS and Shields around their bases since they dont do much of that themselves. M27 tends to focus only on offence. But I only do this if I am able. In games where I cant support them in time they will tend to die a slow death from air attacks or novax picking on their shields. They would do much better if they would build more shields and sams since M27 heavily builds air. I hardly ever need to build anything to defend against a ground assault. I usually get away with building one experimental and just have it at the front line with some sams and some other static defenses. Even if my base is in the front, my main worry is defending against a ground experimental, nukes and t3 artillery. I never get assaulted by waves of ground units with M27. But perhaps that is just reactionary. its usually waves of engineers trying to steal all the mass points.
-
Unfortunately, my recent game where I saw multiple smd, the replay didnt record the latter part of the game where this was happening. The replay ends halfway into the match. If I find a replay where it happens Ill post one later. Also, the AI is still transferring control of Pgens over to me. This is kind of an issue because whatever gets transferred, either to me or another AI, which is usually T1 or T2 Pgen, never gets reclaimed. They usually reclaim lesser PGens later on, but they wont do it for ones that are transferred, whcih then clutters up their base. It might be better if the AI never transferred any structures at all. Resources are generally shared anyway, so its not necessary. Ive watched the AI transfer power over to me (The resource, not the structures) SO them gifting Pgens really is not necessary at all.
-
Just as an aside Maudlin. You can leverage the brain:TakeResource and brain:GiveResource as well to transfer energy directly should you want to implement more restrictive pgen gifting but still want to be able to quickly help allies if they have crashed power. I do it on mine though I don't play with AI on my team so never really done much validation on it.
-
Here is a new replay where the AI is seen having built 2 SMD nearly next to each other, both of which have nothing loaded, and that AI got destroyed by a nuke... https://replay.faforever.com/18075538
I only saw what was current on my team while playing. The dark red colored AI in the south is the one in question. Others may also have built multiple smd but I didnt watch the replay.
-
@teralitha Thanks, I'll have a look to figure it out (from an initial glance it looks likely to be an overlap between my firebase SMD logic and my main base logic but I'll test to confirm).
Re the T1 power gifting they're meant to transfer back to the original owner who then reclaims them once all teammates have sufficient power, so if this isn't happening if you send me a replay I can see why. Broadly, if all M27 teammates have a T3 PGen (the actual threshold is earlier than this) and the M27 gifted the PGens also has surplus energy (of 100 per second) then they should be gifted back.
Meanwhile they should only gift T1 PGens to a non-M27 teammate if that player has less than 10% energy stored (as well as less than 750 energy income per second)
Re its attacks I did see one (ai vs ai) game recently where 3 ythotha got sent to attack an enemy base at the same time but it's more likely to attack with 1-2 experimentals, while waves of units are more likely at lower tech levels (but if you're turtling up then it's far less likely)
@relentless Already implemented :), I like to share PGens as well since a lot of my build conditions are based on the AI's gross and net energy so giving the T1 PGens over makes those more reliable/accurate than estimating the overflow available to it.
-
Well, if it is intended that they gift Pgens back, I have never see it happen. All ive seen is once they have been gifted to someone, its permanent. I think the replay I just gave you should show this. And if they are gifting them to me, I am unable to gift them back. I believe that is something you would have coded into the AI, to not allow a player to gift them anything. If I notice they have given me something, I will usually control K them. I still think you should remove PGEN gifting at all.
I watched that replay back today and I saw that the red AI actually built 3 smd's(EDIT: Actually they built 5 of them which were all destroyed by artillery and then they promptly built 3 more! After which they got hit by a nuke and died...) and they were turning them on and off repeatedly. Definitely needs a change.
-
@teralitha Found the issue with the SMD (and why I've not come across it before) - Seraphim battleships can build nukes, so the AI was (correctly) seeing them as a nuke capable unit and trying to build enough SMD to prevent being overwhelmed by nukes if they were all building them.
I'll probably tweak it for the next version so limit the amount of SMD being built where the nuke launchers are battleships.
Also not seeing any 'left over'/isolated T1 PGens on the replay (about 45m in) - the only PGens out of place are where an ally whose base (and all their power) got mostly destroyed and so was gifted the PGens
-
Yea it wasnt the best example in that replay. Ive seen it happen more prominently on different maps.
So.. my cybran submarine can build nukes too. Does the AI react to that by building more SMD? perhaps I can trick the AI into wasting more resources into SMD then by building a bunch of subs...