• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Login
FAForever Forums
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Login

AI Development Guide and M27AI v81 Devlog

Scheduled Pinned Locked Moved AI development
219 Posts 28 Posters 61.1k Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M
    maudlin27 @tyne141
    last edited by maudlin27 27 Jun 2022, 22:06

    @tyne141 Thanks for the replays, looking into further there's a bug with my logic on 'chokepoint' games (such as 2v2 eye of the storm) - will be fixed in v41 (I'm just working through a few adjustments before I release).

    @splitice I'll have a look after the current release to see if there are any easy adjustments to help fix, but some of my logic's range is hardcoded which may cause issues if the mod is introducing very long range units. I'll double-check how it handles things when T4 arti is disabled though, as it's quite possible it is trying to build it, and when it fails due to the unit restriction it stops building any experimental, leading to poor use of resources. I'm just going through pre-release checks on my current release so it won't be until v42 for any changes re this though.

    M27AI and M28AI developer; Devlogs and more general AI development guide:
    https://forum.faforever.com/topic/2373/ai-development-guide-and-m27ai-v71-devlog
    https://forum.faforever.com/topic/5331/m28ai-devlog-v150

    1 Reply Last reply Reply Quote 0
    • S
      splitice
      last edited by 28 Jun 2022, 01:21

      @maudlin27 Iterate the blueprints on start for unit ranges perhaps? Thats how unit stats are normally changed so it makes sense to do the same on first tick.

      It didnt build zero experimentals (I saw a few galactic colossuses before taking the center) but they were limited. Towards the end of the game I would have expected to see waves of them.

      1 Reply Last reply Reply Quote 0
      • M
        maudlin27
        last edited by maudlin27 30 Jun 2022, 07:41

        v41 Update - Hives and Shield Disruptor

        • Added new unit – Shield disruptor
        • Added new unit – Hives
        • Fixed various bugs/assumptions that meant M27 wouldn’t work with the survival map Final rush pro support (in preparation for an AI monthly tourney on this map)
        • Fixed bug on some chokepoint maps (such as 2v2 Eye of the storm) with the chokepoint assignment
        • 10 Other bug fixes
        • 53 Misc changes, including various tweaks to late-game logic in high mass scenarios to try and build more land factories sooner, assist SML and SMD with fewer engineers if mass is overflowing, build more power, and adjustments to T3 arti targeting logic when the enemy has no T3 arti of their own. Also including various tweaks to the early game such as initial build order tweaks and slightly better use of early raiders so theyre less likely to die.

        Acknowledgements:

        • Tyne141 – Replays highlighting strange choice of destination for M27’s ACU when turtling
        • Zlo – suggesting I ctrl-K obsolete radar rather than reclaiming it
        • Relent0r –Querying whether M27 chooses not to upgrade mexes in range of enemy TML (prompting a tweak to incorporate such logic).
        • Ice-IX – Bug where disbanded platoons would have their displayed name change even if the config settings said to not do this.

        Benchmarking
        As it's roughly 1 year since I first started working on M27, I thought I'd benchmark how well it was performing against several of the other AI (DilliDalli and RNG, as they're the 2 AI that during testing are most likely to beat M27), in part as one of my long term goals had been to create an AI capable of beating all other AI on the <700 rank map pool a majority of the time.

        While M27 just managed to reach this goal (after numerous small tweaks to its early-game logic), it was very close on several maps so this will be highly dependent on the map pool chosen. The devlog has more details on the results, but in summary (with 4 faction mirror matchups being played against each AI, and then another 4 in the case of a tie in results):

        Maps with 100% win rate:

        • Theta passage
        • Auburn Canyon

        Maps with a clear >50% win rate:

        • Adaptive Hardshield Oasis (3 win 0 loss vs RNG, 4 win vs DilliDalli)
        • Regor VI Highlands (4 win vs DilliDalli, 3 win 1 loss vs RNG)

        Close fought maps:

        • Loki - FAF version (3 win 1 loss vs DilliDalli, 2 win 2 loss vs RNG followed by 4 win 0 loss)
        • Forbidden Pass – FAF version (7 win 1 loss vs RNG, 13 win 9 loss vs DilliDalli)
        • Point of reach (4 win vs RNG, 2 win 2 loss vs DilliDalli followed by 4 win 0 loss)

        In terms of the other map pool maps, Serenity Desert Small – FAF version currently has a bug that prevents RNG and DilliDalli working on it so the results aren't included

        M27AI and M28AI developer; Devlogs and more general AI development guide:
        https://forum.faforever.com/topic/2373/ai-development-guide-and-m27ai-v71-devlog
        https://forum.faforever.com/topic/5331/m28ai-devlog-v150

        1 Reply Last reply Reply Quote 3
        • T
          tyne141
          last edited by 4 Jul 2022, 11:57

          Great to see so many frequent updates.
          If you want some more replays, here are a few more:

          • Four-Leaf Clover: https://replay.faforever.com/17387027
            - We lost a few times because the T1 land skirmishing was quite effective but we ended up winning in this replay by turtleing and using tactical missiles
          • Flooded Strip Mine: https://replay.faforever.com/17432261
            - This was just me playing with one ally M27 and two opponents; I was mainly just practising to see if I could beat it with T3 artillery; in this particular one I mostly beat the opponent opposite me but my ally lost its side so I lost in the end
          • 3 of us losing against 3 M27s on The Ditch: https://replay.faforever.com/17401339
          • 2 of us on Fields of Isis: https://replay.faforever.com/17364957
            - We lost quite a few times before we won but we found that a firebase with tactical missiles was quite effective against the AI as it only built so many missile defenses
            Tactical missiles seem to be the biggest weakness we've found on land skirmish maps but on a map like Flooded Strip Mine that's larger the tactical missiles aren't so much of a weakness because of the range.
          M 1 Reply Last reply 4 Jul 2022, 12:35 Reply Quote 0
          • M
            maudlin27 @tyne141
            last edited by maudlin27 7 Apr 2022, 12:36 4 Jul 2022, 12:35

            @tyne141 Thanks, I’ll have a look ahead of the next release. I’m in the middle of tweaking M27’s tmd logic to handle massed tml and billy nukes so the replays highlighting tml issues are well timed!

            M27AI and M28AI developer; Devlogs and more general AI development guide:
            https://forum.faforever.com/topic/2373/ai-development-guide-and-m27ai-v71-devlog
            https://forum.faforever.com/topic/5331/m28ai-devlog-v150

            1 Reply Last reply Reply Quote 0
            • I
              IgneusTempus
              last edited by 7 Jul 2022, 03:43

              So after trying to play with M27AI on DualGap Scale Adaptive around 2 min in the entire game freezes and I have to force kill it. This is the log I got from it game_17452319.log

              M 1 Reply Last reply 8 Jul 2022, 12:48 Reply Quote 0
              • M
                maudlin27 @IgneusTempus
                last edited by 8 Jul 2022, 12:48

                @igneustempus Thanks, it looks like M27 will hard-crash on any maps that have mexes outside the playable area, I'll have it fixed for the next version

                M27AI and M28AI developer; Devlogs and more general AI development guide:
                https://forum.faforever.com/topic/2373/ai-development-guide-and-m27ai-v71-devlog
                https://forum.faforever.com/topic/5331/m28ai-devlog-v150

                1 Reply Last reply Reply Quote 0
                • M
                  maudlin27
                  last edited by maudlin27 7 Sept 2022, 08:18 9 Jul 2022, 07:43

                  v42 Update
                  This update was almost entirely about fixing issues highlighted by replays people have sent me:

                  • Various adjustments to Czar and Soul ripper logic to make them avoid large concentrations of enemy ground AA better
                  • Various adjustments to turtling logic so it's less likely to preemptively build T2 arti, large amounts of T2 PD, and/or mobile artillery
                  • Various adjustments to bomber defence logic, including expanding the cases where bombers will target enemy fixed AA buildings
                  • AiX Omni vision support - When a teammate/M27AI has map-wide omni vision then intel units shouldn't get built. If the enemy team has map-wide omni vision then stealth shouldn't be used.
                  • Multiple enemy TMLs and/or billy nukes should now be defended against
                  • Engineers should now be able to handle enemy cloaked selens blocking mexes
                  • 21 Other misc changes and 17 bug fixes, including fixing hard-crash caused by maps with mexes outside the playable area, and a bug that prevented backup logic for deciding what experimental to build from working (most relevant for unit restrictions and modded games)

                  Acknowledgements

                  • tyne141 – Replays highlighting M27’s vulnerability to massed TMLs
                  • Yung Dookie – mentioning they were practicing against M27, which meant I had a few replays I could check for flaws in M27’s approach
                  • Radde – A number of replays highlighting flaws in M27’s turtling approach
                  • Splitice – Highlighting M27’s issues with not building many experimentals (in a modded game) and units dying to long range units.
                  • IgneusTempus – Replay highlighting hard crash on dual gap

                  M27AI and M28AI developer; Devlogs and more general AI development guide:
                  https://forum.faforever.com/topic/2373/ai-development-guide-and-m27ai-v71-devlog
                  https://forum.faforever.com/topic/5331/m28ai-devlog-v150

                  1 Reply Last reply Reply Quote 0
                  • T
                    Tomma
                    last edited by 10 Jul 2022, 11:12

                    Great work! I think it can play at around 700 rating in 1v1. AI uses bombers quite well, its pain in ass to deal with them even with air control. All in all pretty solid.
                    I played some games with it, search "M27 testing" if you want to see them. What i noticed is: strange unit movement and questionable unit composition. For example it will build too many t1 maa while being at disadvantage. It will not contest huge concentations of reclaim (cadmium gree for example). It's pd logic is kinda bad too. Like it will build pds in base where it's not doing anything useful (regor highlands). Also its plateu logic working strange (on regor highlands it never dropped three mex expansions with civs but dropped 1 mex hills).
                    I think it ecoes too much maybe? On some maps it's ok but on some it snowballs quite bad.

                    Skill issue

                    M 1 Reply Last reply 10 Jul 2022, 12:23 Reply Quote 0
                    • M
                      maudlin27 @Tomma
                      last edited by 10 Jul 2022, 12:23

                      @tomma Thanks for the feedback and for labeling the replays, I'll have a look to see what adjustments can be made

                      M27AI and M28AI developer; Devlogs and more general AI development guide:
                      https://forum.faforever.com/topic/2373/ai-development-guide-and-m27ai-v71-devlog
                      https://forum.faforever.com/topic/5331/m28ai-devlog-v150

                      1 Reply Last reply Reply Quote 0
                      • maudlin27M
                        maudlin27
                        last edited by maudlin27 23 Jul 2022, 19:27

                        Various mostly unrelated changes based on replays provided:

                        • Adjustments to experimentals, including adjustments to when to build, targeting/attack logic adjustments for land experimentals, improvements to Novax target prioritisation
                        • Improved response to T2 bomber snipe attempts
                        • On chokepoint maps reclaim should be factored into the decision of where to setup the chokepoint
                        • Basic support for games where there are no enemy players (e.g. survival maps)
                        • Sniperbot attack logic rework
                        • Optimisation of the logic for calculating rally points (now takes c.10% as long)
                        • 12 Bugfixes, 38 other Misc changes

                        Acknowledgements

                        • Radde – a number of replays highlighting flaws in teamgames particularly late-game scenarios
                        • Wingflier – replay highlighting M27’s vulnerability to a Corsair snipe
                        • Relent0r – Highlighting performance concerns on Ian’s Cross, and a replay highlighting some issues on Fields of Isis 2v2
                        • Tomma – Various 1v1 replays, highlighting a couple of points that could be improved on further (e.g. bomber dodging)

                        M27AI and M28AI developer; Devlogs and more general AI development guide:
                        https://forum.faforever.com/topic/2373/ai-development-guide-and-m27ai-v71-devlog
                        https://forum.faforever.com/topic/5331/m28ai-devlog-v150

                        1 Reply Last reply Reply Quote 2
                        • A
                          art-wiedzmin
                          last edited by 24 Jul 2022, 04:38

                          Could you add support for foreign engineering units (units sharing)? Now, as far as I understand, buildings and experimental units are built сonsidering of GetFactionIndex

                          maudlin27M 1 Reply Last reply 24 Jul 2022, 06:18 Reply Quote 0
                          • maudlin27M
                            maudlin27 @art-wiedzmin
                            last edited by 24 Jul 2022, 06:18

                            @art-wiedzmin If you're talking about e.g. a Cybran teammate giving engineers to a Seraphim M27AI, and having the Seraphim M27AI build cybran experimentals, this is already supported. E.g. if you spawn in M27AI in sandbox, give it a paragon, and a bunch of T3 engineers from a different faction, it should build an experimental with that faction's engineers (so if you gave it Cybran T3 engineers and it had no other T3 engineers, I'd expect it to start on a monkeylord).

                            There are a couple of bits of logic that will be affected by the base faction (e.g. when deciding what type of experimental to build it will be assuming it has engineers of its base faction so its decision might be different to if its base faction aligned with those engineers, while some parts of the logic like building hives will also be faction index dependent) but this shouldnt prevent it from building any experimentals of the gifted faction.

                            M27AI and M28AI developer; Devlogs and more general AI development guide:
                            https://forum.faforever.com/topic/2373/ai-development-guide-and-m27ai-v71-devlog
                            https://forum.faforever.com/topic/5331/m28ai-devlog-v150

                            1 Reply Last reply Reply Quote 0
                            • maudlin27M
                              maudlin27
                              last edited by 30 Jul 2022, 11:56

                              V44 Update:
                              First part of planned improvements to teamwork (released early due to a hotfix for a rally point bug in v43):

                              • Resources should be shared amongst the team
                              • Resource producing buildings should be gifted to allies in some (rare) cases
                              • Teammates overflowing resources should impact on other M27AI's calculation of their available resources
                              • Engineers should no longer try and claim a mex that an allied M27AI is already planning on claiming
                              • Teammate's air power should be disregarded to some extent if they are far away
                              • Units should now try and retreat from T2 PD that hits them but hasn't been revealed yet.
                              • Fixed bug that would cause M27 to think there was a safe rally point near the enemy base (leading to various unintended behaviour, such as ACUs 'retreating' into a heavily fortified position)
                              • 8 misc changes and one other bugfix

                              Acknowledgements:
                              Relent0r - highlighting error message
                              Radde - replays showing strange decisions by m27 which were caused by the rally point bug

                              M27AI and M28AI developer; Devlogs and more general AI development guide:
                              https://forum.faforever.com/topic/2373/ai-development-guide-and-m27ai-v71-devlog
                              https://forum.faforever.com/topic/5331/m28ai-devlog-v150

                              1 Reply Last reply Reply Quote 4
                              • maudlin27M
                                maudlin27
                                last edited by maudlin27 8 Jul 2022, 13:14 7 Aug 2022, 13:14

                                Latest changes (v45 summary)
                                This update's main focus was on teamwork although I also got sidetracked into improving PD placement logic.

                                • M27 teams should coordinate which plateaus they will try and drop on so they dont all go to the same plateau
                                • Land scouts for mexes should be shared to avoid doubling up
                                • ACU kill targets are now coordinated even if the ACU isn't the closest one to other teammates
                                • Improvements to the decision on where to build PD on maps with cliffs near the start position where M27 isnt choosing to turtle
                                • Improvements to the strat bomber target selection to allow for a more seamless viewer-bombing experience
                                • 19 Bugfixes and 20 misc changes

                                Acknowledgements:

                                • Relent0r – Highlighting bug on Moonlight where M27 would incorrectly see there as being 1 chokepoint (when there were 2)
                                • Fearghal – Replay containing errors and crash

                                M27AI and M28AI developer; Devlogs and more general AI development guide:
                                https://forum.faforever.com/topic/2373/ai-development-guide-and-m27ai-v71-devlog
                                https://forum.faforever.com/topic/5331/m28ai-devlog-v150

                                1 Reply Last reply Reply Quote 2
                                • S
                                  savinguptobebrok
                                  last edited by savinguptobebrok 8 Jul 2022, 16:51 7 Aug 2022, 16:28

                                  Greetings
                                  I've tried playing several maps with the latest updated, however it keeps crashing around the 5 minute mark. I disabled all other mods , it still crashed , changed maps still crashed. If you need more infomation let me know. I've not familiar with how feedback is given here.
                                  I did see someone else managed to upload their game log, how IDK.

                                  maudlin27M 1 Reply Last reply 7 Aug 2022, 17:02 Reply Quote 0
                                  • maudlin27M
                                    maudlin27 @savinguptobebrok
                                    last edited by 7 Aug 2022, 17:02

                                    @savinguptobebrok Could you give me a couple of the replay IDs where the crash happens? (the earlier on the crash happens the better)

                                    M27AI and M28AI developer; Devlogs and more general AI development guide:
                                    https://forum.faforever.com/topic/2373/ai-development-guide-and-m27ai-v71-devlog
                                    https://forum.faforever.com/topic/5331/m28ai-devlog-v150

                                    1 Reply Last reply Reply Quote 0
                                    • S
                                      savinguptobebrok
                                      last edited by savinguptobebrok 8 Jul 2022, 18:27 7 Aug 2022, 18:26

                                      Here is the one with no mods (Uveso & m27 only)

                                      https://replay.faforever.com/17705860

                                      If you want the game log or crash log let me know.

                                      1 Reply Last reply Reply Quote 0
                                      • maudlin27M
                                        maudlin27
                                        last edited by 7 Aug 2022, 18:45

                                        Thanks, looking into it further for some reason v45 was only compatible with the FAF develop version of FAF (hence why my pre-release testing didnt pick up any issues as it was all using FAF develop). I've uploaded v46 that reverts it back to v44, and will either upload a new version if I figure out the cause of the incompatibility, or wait for the current FAF develop changes to be incorporated.

                                        M27AI and M28AI developer; Devlogs and more general AI development guide:
                                        https://forum.faforever.com/topic/2373/ai-development-guide-and-m27ai-v71-devlog
                                        https://forum.faforever.com/topic/5331/m28ai-devlog-v150

                                        1 Reply Last reply Reply Quote 0
                                        • maudlin27M
                                          maudlin27
                                          last edited by maudlin27 13 Aug 2022, 08:19

                                          Latest changes (v47 summary)
                                          The main focus of this update was on optimisation. Special thanks to Softles who wrote some work scheduler code that I was able to use to try and spread out some of my function calls to improve performance.

                                          • Fixed the bug from v45 that would cause every game on FAF standard (not FAF develop) to crash when an M27 bomber fired.
                                          • Added in logic for doing a simple profiling of AI performance which can be run by any AI (even if no M27AI is in the game) - for use in place of a normal AI tourney
                                          • Incorporating Softles' workflow scheduler to the majority of M27's loops
                                          • Further optimisation of functions relating to recording the units in a platoon and calculating the threat of enemies
                                          • Reduction in the amount of error messages displayed
                                          • 3 other bugfixes and 3 other misc adjustments

                                          Overall based on my '4v4 UEF Africa for 10m' benchmark, v47 is approximately 8.5% faster than v46.

                                          Acknowledgements:

                                          • Softles for providing work scheduling code
                                          • Savinguptobebrok and Fearghal – highlighting crashes caused by M27 (in every game)
                                          • Relent0r – Highlighting an issue where the ACU can build T1 power when in a vulnerable position (no change was made as it’d be too much effort for a niche scenario – essentially if all our power is destroyed, and we lack intel, then the ACU thinks there are no nearby mobile enemies and tries to build a pgen, but by that stage it will have lost anyway)

                                          M27AI and M28AI developer; Devlogs and more general AI development guide:
                                          https://forum.faforever.com/topic/2373/ai-development-guide-and-m27ai-v71-devlog
                                          https://forum.faforever.com/topic/5331/m28ai-devlog-v150

                                          1 Reply Last reply Reply Quote 2
                                          • First post
                                            Last post