AI Development Guide and M27AI v74 Devlog
-
Smaller update fixing a few bugs and adding in mass fabs:
- Unlocked ability to build T2 mass fabs (I've not checked how it handles reaching the unit cap though, here's hoping it doesn't ctrl-K them!)
6 bugfixes, including
- Bug resulting from the latest FAF patch that caused the Ythotha death ball/energy signature to be controlled by the AI (at the same time I've improved M27's response speed to the death ball from before)
- Shield boats should no longer remain at the naval factory if they had lost shield at any point in the past
- The Bjarg map should now be playable by M27 in the bottom-right start position (previously it would break)
14 Misc changes, including: - MML should be far less likely to walk into range of T2 PD
- Added new 'experimental prioritisation' builder logic for late-game (where land factories are less likely to build units to conserve mass for experimentals)
- Slight improvements to M27's response when an enemy tries to get a firebase near M27's base
- Slight reduction in the bomber defence range to make them less likely to suicide into enemy air
Note that updates may be smaller and/or less frequent for a bit as I mull over creating an entirely new AI, and/or testing out changes in a basic alternative AI that might then be incorporated into M27 at some future point.
Acknowledgements
- Jip โ Highlighting error on the Bjarg map where if M27 started in the bottom right position it wouldnโt work
- Azraeelian Angel - A number of team game replays
- Radde - Several teamgame replays
-
Latest changes (v65 summary)
Smaller update - I'm experimenting with smaller ad hoc updates with reduced testing for fixing issues highlighted in replays (since I'm not planning any big future changes to M27 for the time being as I'm experimenting with a separate AI to try out alternative land based logic)11 bugfixes, including:
- Incorrectly calculating Seraphim SACU range as their TML range (leading to strange actions from land units)
- Skirmisher platoons (e.g. sniperbots) should be less likely to suicide (by being more likely to attack move and less likely to try and move close to a target)
- Experimental shots such as ythotha shots will now be considered for dodging
10 Misc changes, including:
- Adjustments to skirmisher logic, including making them run further from T2 arti, and splitting up skirmishers that are far apart into separate platoons
- Increased the value of SMD and Nukes as targets
- Made larger units more likely to try and dodge shots (e.g. summits should try and dodge Aeon battleships, Galactic (colossii?) should try and dodge Ythothas)
Acknowledgements
- Radde for providing an entertaining team game replay against M27 (that also highlighted some of the bugs fixed in this release).
-
Latest changes (v66 summary)
- Refinements to the logic for experimentals to dodge shots (and more generally) so they're hopefully less likely to turn around in a full circle doing no damage while being attacked
- 7 tweaks to T3 arti targeting logic, none of which are major but which for example now assign a value to heavily shielded units (previously none was given), firing infront of mobile units, reducing the value of targets that we have fired a huge number of shots at without killing, and factoring in how long it will take for the T3 arti to turn towards the target
- 15 other misc changes or bugfixes, a number of which relate to decisions on when units should retreat (e.g. MML running from ravagers, skirmishers running from PD, GC/Monkey/Ythotha being more likely to run from a fatboy based on how close it is)
Acknowledgements:
- Radde - several teamgame replays on both land and naval maps
- Jip and Magge for highlighting a missing units error message that appeared a lot, and also Jip for helping me figure out how to determine which direction a T3 artillery is aiming at.
-
Stop making it better. It's getting too hard to beat. I'm kidding. Your work is appreciated.
-
@stlng At some point! Each update lately I think just after uploading 'right, now I can take a break and focus on writing a new approach to handling land units', then I see a replay where M27 does some stupid or incorrect things and figure I'll just put through one more update to fix it!
-
Anyone else having trouble opening the devlog google doc? The first page loads a preview but nothing else appears. Says "couldn't preview file - there was a problem loading more pages."
-
Same issue - @maudlin27 maybe the file is too big?
-
@sioloc I've split it out into several documents to reduce the size slightly, let me know if you still have issues accessing.
-
Thank you so much for your work. I'm one of those players who really loves playing against AIs, but I hate AI that is too easy or cheats. It seems to me like you've made the best vanilla (well, vanilla-ish since it's on FaF) AI. It's currently kicking my ass. I'd really love it if you would continue working on it to make it even tougher, and also resistant to all sorts of cheesy tactics used by humans to beat it quickly. I also really like how it's not specialized for a single type of terrain and it can play navy as well. Anyway, just wanted to voice my appreciation.
-
Just came here to say thanks @maudlin27, this is really appreciated. Uveso was kinda challenging when using x1.5 multipliers, M27 is even better without even any multiplier. Can't wait for M28.
-
Latest changes (v67 summary)
No significant changes in this update, just a number of small tweaks and fixes.13 bugfixes, including:
- Certain SACUs being considered to have 0 threat
- Improved build order on some maps that resulted in a power stall due to power and hydrocarbons being built at the same time
25 misc changes, including:
- Mobile shield and stealth sharing (so cybrans can share the joy when they have non-cybran teammates)
- Novax targeting adjustments to prioritise lower health instead of higher health units of the same type
- Slight increase in navy aggressiveness (including a workaround for humans who would constantly dodge aeon destroyer shots with frigates when massively outnumbered)
- Improved nomads compatibility by building T2 support factories and getting the gun upgrade
- Increased likelihood of UEF and Seraphim building game-enders in team-game maps
Acknowledgements
- Relent0r โ highlighting an issue with M27โs build order on theta passage, and with M27โs ACU getting stuck on Air Wars
- Radde โ Numerous replays
- SniperbotMeta (now Flordia Man) โ Feedback on issues M27 has with nomads
- Jip โ Highlighting how using ForkedThreat on a function that returns a value will cause a โYield()โ error message
-
V68 summary of changes:
Various small improvements to tml and tmd logic:- tmd can now be built on plateaus
- predictive logic added to estimate if a tml shot will hit the cliff to help with target prioritisation
- tml are less likely to be paused when stalling
14 other misc changes, including making unupgraded acu scared of all pd and improving plateau expansion speed
16 bugfixes, including:
- t1 pd shouldnt be ignored by the threat response logic
- pre-emptive fix for upcoming faf develop changes to veterancy
- fixed various niche scenarios causing errors and reduced some of the error messages sent to the log
Acknowledgements:
- Fearghal โ Bug where M27 ignored civilian T1 PD
- Relent0r โ highlighting a dangerous upgrade decision by M27
- Sprouto - sharing thoughts on TML missile trajectory that led me to trying to come up with the predictive missile logic
-
v69 Summary of changes
Mini update with 7 bugfixes and 12 misc changes, including:- Fixed an issue that could cause a major slowdown when M27 was power stalling late game
- Better plateau selection in team games (previously sometimes two M27 would each go for the plateau furthest from them but closest to the other M27)
- Improved SMD/anti-SML logic to handle large enemy AiX modifiers, large enemy nuke numbers, and attempts to edge-nuke M27's ACU
- Adjustments to naval kiting logic so they take longer to turn around (and therefore less likely to abort a firing sequence after a single shot)
Acknowledgements:
- Fearghal - Highlighting a significant slowdown in an M27 game that led me to discovering the flaw in M27โs power stall logic.
- Thacon - Replay highlighting poor plateau selection by M27 on the same team
-
-
-
Hi @maudlin27, I've just been reading your development notes and really appreciate how thoroughly you've documented everything. As a programmer myself it's really interesting to see what you learned along the journey I'm also enjoying your M28 blog - looking forward to seeing how that goes!
BTW, I'm still having issues opening the devlog (https://docs.google.com/document/d/1uQlEoN-kti7G2MnhwD60uaaHwVevPNYH/edit?usp=sharing&ouid=100973959280546778272&rtpof=true&sd=true) - maybe that's also grown too big for google drive to show?
-
@Sioloc Just keep the document tab open - It takes several minutes until the doc gets rendered, after that you can/need to download it and open it on your machine. Google Docs can not load more pages than the first one, for whatever reason. They really do not like the .docx format.
-
V70 summary of changes:
Update based primarily on issues spotted from the first weekend of the Rainbow Cup tournament:- Fixed a bug that caused MAA to stay way too far back from the ACU when there were nearby enemy tanks (i.e. the MAA would run away from the tanks even if they were needed to protect the ACU from gunships/bombers)
- Significantly improved the speed at which the AI will try and get T2 PD if the enemy gets a guncom and attacks its base
- Added new capture logic to capture certain civilian units on the map (e.g. titans on big bang dry) - while this ended up much more work than expected, fortunately the map was picked by the players and featured in the RC finals, meaning I got to see the results of the capture logic feature and have a noticeable impact on the game
- 6 other bugfixes, and 12 misc changes, mostly relating to ground based anti-air logic, and being a bit more cautious with bombers (including an issue that would cause bombers to be overbuilt, which would then trigger backup logic to make use of the bombers on high risk targets due to there being so many of them, leading the AI to just waste/donate mass).
Acknowledgements:
- Fearghal - For funding and hosting the Rainbow Cup tournament, which provided valuable replays on AI performance as well as being very entertaining to see AIs pitted against the top FAF players, and having their profile raised.
-
@maudlin27 - I just thought I'd post about a bit of a vulnerability I noticed fairly frequently. I was just playing round with some AI vs AI out of curiosity; mainly because we've been getting a lot of enjoyment out of M27 and I was just curious to see whether any other AIs could be nearly as challenging.
I saw that in the recent AI vs AI tournaments that DilliDalli was one of the few that seemed to win relatively frequently. I tested it on 4 vs 4 Setons a couple of time with 4 x DilliDalli VS 4 x M27 (URLS:
https://replay.faforever.com/19777194 & https://replay.faforever.com/19776810 ) and the front most M27 ai-player twice in a row left its commander unnecessarily far forward where it got easily killed by moderately large swarms of T1 units. In one of the games the commander even managed to complete a T2 engineering upgrade but then it didn't move back far enough to build a T2 point defense despite there being plenty of land support available; it could've easily moved back a bit and built a T2 point defense but seemed to just wander fairly aimlessly amongst the incoming T1 tanks for long enough to get killed. I know that this is quite an isolated and specific scenario because DilliDalli seems to always T1 land rush and on Setons the front most player is instantly swamped by 4 teams worth of T1 land units, but it just didn't seem to adapt to a new strategy when it was clearly out numbered.I should add that in both games I tested under those conditions that M27 still won because the remaining 3 teams had vastly superior economies after a few minutes, but it just seemed to me that the front player could've easily kept its commander alive if it'd just backed back a bit and defended its commander. M27 seems to build pretty good firebases slightly forward on Setons and if it builds those it's pretty hard to beat; however, when it seems to be prevented from doing that, its front playing commander seems pretty vulnerable. Recently with human players vs M27 I've also found that if you prevent M27 from getting the front fire base it often won't build too much defense back further which makes its front bases fairly vulnerable.
-
@tyne141 Thanks for flagging, at the moment I think this will be in the 'too much hard work to try and improve further' category - what's meant to happen is on maps like that it tries to setup a firebase, and only gives up on trying to establish a firebase if it thinks it is about to lose its ACU (but with adjusted thresholds as it is mostly a 'firebase or die' approach), at which point it defaults to the default (non-firebase approach) M27 logic.
I'll make a note to check vs 4 DD to make sure it's working as intended at some point but it sounds likely it is from your post - the main threshold I used was if it could get T2 PD up before a likely guncom got in range, but if 4 enemy players are going mass T1 spam then it's likely there's not much 1 M27 would be able to do to hold them off with its current approach, while the way the firebase logic works is the location is decided at the start of the game (with a bit of leeway to allow for it to be situated slightly closer to base than planned), so trying to adjust on the fly to move to a fallback position would be too much work.
Another issue on setons is having it build the firebase too far back potentially means forfeiting all the mid reclaim which could lose the game.
-
Hello Maudlin, I had a game with a buddy, which ended up crashing to a game speed of -17 after the M27 was destroyed. Here is the log excerpt.Gamelog M27.txt
-
you may find an error that explains the gamespeed. Nevertheless, again a big compliment to your two AI's. They're a lot of fun