M28AI Devlog (v101)

v32 update

  • 7 changes for FA Mission 3, the most noticeable of which should involve building fewer land units and not rushing an SMD just because the enemy has a seraphim battleship
  • Improved support for low mex maps (1-2 mexes in the starting zone and none or almost none in the rest of the map) - M28 should build far fewer factories initially and focus on upgrading its mex sooner. Note that its build order is in no way optimised, and an optimised human build order will still crush it at 1.0 modifier.
  • 10 changes mostly relating to improving M28's approach once it has a paragon (making it more likely to build air factories and experimentals, fixing an issue with building a second paragon, etc.)
  • Rewrote part of the pathing logic to fix a bug (most likely on 20km+ land maps) that could cause units to move in the opposite direction to where they were meant to go
  • 4 other changes, including fixing an issue with underwater start points, and fixing a bug I realised has been present since pre-v1 that caused too many engineers to be sent to other zones (the number of engineers a zone was requesting featured double-counting in some cases)


  • Retributer - highlighting issues with M28 building too many land units on M3 of the FA campaign
  • Bart - Replay highlighting issues with paragons and wierd pathing for a GC

Hi - I have a question aswell:

My friends an I are always playing against AI and since AIx isnt a challenge anymore once you figuerd out how they work, we tried M28. We were 2 and in the end we lost vs 1 M28. Next Game we won (still 2vs1 though .. ^^) and we analyzed the replay.
Now the question: Does M28 cheat like AIx? With shorter building times and do they get somehow more ressources?
We couldnt really figure it out, because somehow M28 seems to have alot of Units and almost never Mass or Energy Problems, it never seems to get like masslocked.
We think its just because M28 is so clever with pausing/unpausing updates, unit production etc. but we are not quiet sure because i bombed almost all his mass in that one game and (M28 had 2 Massextractors left, 1 T1 and 1 T2) and was still able to produce a sufficient supply of mass and units.
Well, as you can see, we are not Pros. But your AI gave us a great fight, very good work!

@calvalon M28 doesn’t receive any resource or build power bonus unless you’re playing against the AiX version.

I’d expect it to be very rare that it runs out of energy but quite common that it has low mass (ie 0 stored mass with negative mass income).

It should pause things to avoid running out of energy or if it’s mass stall becomes too severe.

It should also reclaim regularly so that might explain it having more units than expected (you could use 4z0t’s scoreboard and analyse a replay to see how much it is reclaiming and total mass generated to see how its gaining and spending its mass)

Ah ok thanks. I did not see any AIx version, thats why I asked. The only option I could choose from was just called AI: M28 so I guess its just the normal one then.
It did all the things you said, to perfection. Thats why we wondered. ^^

Thanks for the Scoreboard recommendatoin, I was anyway looking for a thing like that.

v33 Update

  • 6 changes made from a live replay I happend to come across where 3 new players tried to fight an AiX 1.5 M28, including additional backup logic for ships whose shots are blocked by cliffs, reducing the land factories built on small (in size) plateus (such as the setons' islands), and fixing a bug with the ACU's early build order where if it had no orders it would build too much power.
  • 8 changes based on a replay from Fertgl which highlighted a flaw with M28's MAA logic - in addition to a few fixed for this (hover-MAA should now support other islands, and MAA should no longer be massively overbuilt on small island bases) the transport drop logic is improved so they'll drop to multiple locations on very large other islands (to help with this replay where the start was a tiny island but most of the map was a separate island that both players had to fight over)
  • 7 changes based on a replay I did to test low mex maps for v32, the most impactful of which is a fix to what apppears to have been a very longstanding bug preventing M28 building and using mobile shields properly. Related to this I also fixed an issue where a fatboy would build mobile shields on repeat (despite having no use for them).
  • 2 Other changes, including having short range units ignore orders to retreat for a short period of time after being given an attack order (to try and reduce instances where e.g. a GC would move into enemy megalith range, then after a while turn around and retreat, having done no damage).


  • Fertgl – replay highlighting several bugs with MAA (infinite production and not moving outside of the core base when on a small island starting position)

v34 update
21 tweaks and fixes mostly to the early game logic, including:

  • Reducing the tendency to build defensive PD in response to nearby T1 PD, particularly against civilian PD (such as on Ambush pass)
  • Made seraphim combat scouts better at avoiding enemies, and more aggressive by having them attack non-combat scouts
  • Fixed an issue with updating the last known position of visible enemies (which could cause issues for example with units not retreating properly)
  • Fixed an issue that could happen late game with engineers having their orders constantly cleared (to try and move them away from factories so the factories can build units)
  • Added a workaround for an issue where the game incorrectly indicates MML missiles are being intercepted (which would cause M28 to overbuild MML)


  • Fertgl – Replay showing issue where M28 could get engineers idling at its base doing nothing

v35 update
This update was focused on reducing many of the error messages sent to the log that have built up over time, prompted in part by one of these highlighting an error on maps with mexes close to each other such as astro craters where available mexes weren’t always correctly tracked, involving 16 different bugfixes. This included:

  • Fixing issues with tracking unbuilt mex locations (which caused mexes on maps like astro craters rich to not be rebuilt after being destroyed)
  • Added some redundancies to decisions on where to build a mex in a zone if the only unbuilt location appears unavailable (fixing an issue where there could often be a significant delay until the last unbuilt mex in a zone got built)
  • Increased the cap on how many TMD can be built in a single zone, and fixed a bug with some units not getting TMD built to protect them from TML
  • Fixed various error messages that could appear (sometimes these were for minor issues, other times there was no issue but rather a valid explanation for why the unexpected scenario had arisen), including with the initial map generation, with trying to find the closest pathable location a land unit is on, etc.
  • Stealth boats should no longer be built if there are no main targets for them


  • Fertgl - Replay on astro craters rich where M28 failed to rebuild mexes that died to TML

v36 update

  • Removed debugging code I forgot to disable on release of v35 (that changes unit names)

v37 update

  • Fixed a bug introduced in v35 with tracking how many mexes of each tech level M28 has

v38 Update
16 changes, mostly bugfixes from testing against M27 on 3 maps (interestingly M28 won 2 of the 3 games upfront, and looked likely to win the 3rd after changes in then desynced replay, so maybe it is approaching the point where it has a c.50%+ win rate against M27 on larger maps - the maps were Nilfheim, Syrtis major and Open palms):

  • Fixed a bug where I forgot to disable debugging code in v37 which filled up logs with information about how many mexes M28 had
  • Various fixes to TMD, so that TMD should no longer be over-built in response to a TML threat, mobile TML shouldn't be double-counted, and upgrading mexes should properly reflect TMD coverage
  • Novax targeting fixes that could cause it to target underwater units or error out when consdering the ACU in some cases
  • Adjustments to T2 arti and radar builders and ctrl-K logic (for radars) to e.g. T2 arti should be built faster, and with radar coverage, when facing an enemy fatboy threat
  • Improved the open palms build order to use the hydro (this switched the replay from a heavy defeat by M27 to a likely defeat of M27)


  • zhanghm18 – Screenshot showing M28 attempting to build a modded naval experimental on land

v39 Update
25 changes, the majority relating to a replay featuring modded units:

  • Transports should now consider dropping ponds that have mexes (which also helps workaround an issue with a replay I saw where the map design resulted in FAF namesh generation incorrectly thinking ponds were pathable)
  • Cheaper versions of buildings should be prioritised early game (to stop unit mods that introduce experimentals at the T1 stage tanking the economy, or for expensive hydros to be built at the start of the game)
  • Fixed a bug with land units not retreating in certain rare cases, and adjustments to ACU retreat logic. Also expanded logic for long range enemy threats so e.g. ravagers should now be taken into account to help with smaller maps where their range exceeded the size of a zone
  • Improvements to shield logic, fixing an issue where multiple shields would be built on the outskirts of the base (shielding nothing but themselves)
  • Various bugfixes and workarounds, including a workaround for a Brewlan bug that categorises torpedo bombers as transports (which causes an error when the AI tries to check if the unit has a cargo).


  • fertgl - Replay showing an issue with shields being built outside the main base on open palms

AI seems to build only engineers, shield disruptors, and MML. Has no ability to defend itself against direct fire units. Places its PD away from the only enemy approach direction so it can't shoot anything.

@trixie_lulamoon I'd need a replay ID to consider why, as the described behaviours are generally very rare (e.g. I've never seen M28 build a shield disruptor, and I'd only expect it to be building lots of MMLs if the enemy is trying to get a firebase setup near M28's base)

I just started a new match on the same map with the same settings and now they're building direct fire units no problem, so IDK what the problem was last time. Ignore for now since I can't reproduce it

@maudlin27 Loving the AI so far. Might need to be a little more aggressive, not our best game.


@ender06 said in M28AI Devlog (v39):


Thanks! I forgot to check the replay ahead of the v40 release but will make a note to review for the next release to see if it was working as intended.

v40 Release
Introduced new naval 'raiding' logic (to help with very large water maps so that full naval control isnt needed to try and attack enemy land buildings), improved t1 bomber logic, and various other changes

  • New naval bombardment logic - I expect it may need tweaking since it risks weakening M28's overall naval forces, but the idea is that on maps like Aeon M1 of the campaign and Betrayal ocean it helps by attacking islands with naval forces even if the enemy navy is too strong for a full attack
  • 6 other changes for Aeon M1, resulting in the time to complete reducing from 1hr53m to 1hr6m (actual time will vary significantly based on AI luck)
  • Support added for spaceships from the extreme wars mod
  • 10 Changes made for a replay where Sladow crushed a 1.7 AiX M28, including making it less likely that T2 upgrades will be started on air factories at higher AiX modifiers early game
  • New T1 bomber logic added to target enemy engineers and radar (similar to how M27 uses T1 bombers, although I doubt it will work as well given M27's needed a fair bit of refinement)
  • New 'engi targeting' logic for land units early game (based on a replay from Wifi_) so tanks should move closer to enemy engineers if they catch the engineer without an escort, rather than e.g. targeting t1 mexes that the engineer has built
  • 14 changes made for 'PASS but mexes are underwater' map, which is roughly 1 change for every 2 people who has downloaded the map! I'm hoping that the changes will have more general use though, including making M28 a bit more robust in unusual map scenarios (on that map there are no mexes at the start position, but a crasy number of mexes nearby in the water)


  • Sladow – Accepting a challenge to fight (and beat) M28 AiX 1.7 on Arcane, which highlighted a number of flaws with M28’s build order
  • Fertgl – highlighting how M28 wouldn’t attack civilian islands early on with navy on betrayal ocean, along with noting that M28 doesn't work on the PASS but mexes underwater map
  • zhanghm18 - noting extreme wars spaceship incompatibility
  • Wifi_ - several replays against M28 where there were more M28 than humans

I had to watch that just to witness greatness. Looks like the reissuing of commands to the acu got him killed.

@relentless I'd suggested 1.6 as the modifier I thought would beat Sladow on that map, and being a boss Sladow did 1.7 instead and crushed!

Although there were plenty of improvements from a BO perspective the ACU I didn't really change due to the likelihood of the benefits outweighing the costs in other situations - from its perspective, it had a better gun than the enemy ACU, was full health, the enemy ACU was damaged, M28's ACU was on its 'side' of the map, had friendly tanks and PD relatively nearby, the enemy only had access to T1 and no significant bomber/gunship threat, it recognised there was enough danger that it should try and run, and it picked a location that was both away from the enemy and would've ultimately brought it closer to friendly PD (although the latter is more by coincidence than by plan). I.e. one of those scenarios where a split second judgement from a human is likely to give a much better result than the AI since the issue was more having the ACU in a place where it could easily die due to being too far from potential support.

One of the changes I made though was to make tanks no longer abandon the ACU to its fate (the c.3 blazes that were nearby ran when they saw the enemy army instead of fighting to give the ACU more of a chance) but even with this change the ACU would've likely died (it ended up sub-100 health on the desynced replay).

However the BO stuff was embarassing for me with it all largely caused by the early air fac upgrade - the early upgrade meant it didn't have enough engineers (so had little power and didn't even get mexes near the base), and it quickly stalled energy and overflowed mass - I'd hoped for much better of M28 on that side of things!

v41 Update
Main new feature is laying the groundwork for M28 to take over campaign AI (i.e. allies and enemies), although this is still in the very early stages

  • 6 changes for replay 20937306, primarily relating to bugfixes/oversights, for example fixing an issue where TMD could be built far away from the intended location (and so be of no use), and where on very large starting areas the ACU would move a while before building its first land factory. Support also added for building underwater mass storage.
  • 11 misc changes and fixes, including having some MAA support a fatboy by staying under its shield to protect from air, reducing the frequency of a number of error messages that could arise with unit mods, and making M28's air force less likely to suicide into the enemy just to protect a friendly experimental
  • Introduced new option for allies and/or enemy campaign AI to make use of M28's logic for managing their units. This option can be set in the game settings on a campaign map. Note that it is in the very early stages so I expect on most campaign missions it could break the mission entirely. So far it's only been tested on SC Cybran mission 2 (although even in this case in some scenarios use of the cheat menu to ctrl-K off-map units may be necessary to progress the mission if it is stuck after a long period of time). I'll hopefully be working through other campaign missions over time to improve this option's compatibility.
  • 7 changes to campagin missions identified when testing the above, including fixing an issue where huge numbers of T1 engineers would be built by a T2 factory (if T2 engineers were restricted from being built), and fixing an issue where naval raiding units could end up idling at base.


  • Fertgyl – replay with a bug with TMD build locations, highlighting how mass storage can be built underwater (something I wasn’t aware of – it looks like it was a change introduced by FAF earlier this year), and a video showing a bad air engage by M28
  • Clyf – highlighting extracts of error messages in logs relating to unit mods
  • Zhanghm18 – replay and logs relating to issues that can arise when large numbers of unit mods are used with M28

v42 Update

Most changes related to improving M28 as a hostile AI for campaign missions.

  • UEF M1 - 4 fixes relating to error messages and the playable area
  • UEF M2 - 8 fixes, including improving compatibility if M28 is a teammate (as well as hostile AI), and an issue that prevented M28 dropping engineers by the research station to repair it
  • 4 fixes for replay 20973901 and 20969506 relating to building asfs, naval raiding, and rare cases where units could stay idle after trying to avoid a bomb


  • Fertgyl - Replay highlighting a bug where an engineer became stuck permanently after trying to dodge a bomb

v43 Update
21 fixes and adjustments based on replays, including:

  • Fixing a bug that could break M28 when trying to get units to shield
  • Fixed some issues with the teleport logic such as where the 'teleport away' order would be canceled so the ACU could try and dodge a bomb
  • Various adjustments to gunships to try and make them both less aggressive and more aggressive (hopefully in the right way - i.e. less likely to suicide into enemy asfs, but more likely to try and attack an area with weak ground based AA)
  • Various adjustments to reclaim, including fixing bugs that could lead to idle engineers, and improved tracking, along with making the ACU more likely to priotise areas with reclaim
  • Fixing some error messages relating to naval bombardment, and added in missing tracking that was meant to reduce M28's tendancy to allow mass stalling while trying to build an SMD or SML missile.


  • Azraeelian Angel – Several replays and detailed analysis – although desynced, some of the points and map specific issues led to a number of changes
  • Fearghal replay where M28 broke due to a bug with finding units to shield.
  • Zhangham log highlighting a bug with M28’s naval raiding logic
  • Fertgyl – replay highlighting idle engineers