FAForever Forums
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Login
    The current pre-release of the client ("pioneer" in the version) is only compatible to itself. So you can only play with other testers. Please be aware!

    DualGap AI – role-based skirmish AI for Dual Gap Adaptive v14 (6v6)

    Scheduled Pinned Locked Moved Modding & Tools
    skirmishaidualgapmodbots
    7 Posts 3 Posters 78 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.
    • J Offline
      jaxxtrend
      last edited by jaxxtrend

      Hi everyone!

      Why I made this: it's often hard to get a good full lobby together, but I still want to practice and train my skills on big team maps. On top of that, I was curious to see how far I could get building an AI together with Claude Opus — the whole mod was developed with Claude Opus as a coding partner.

      So here is DualGap AI, an AI mod built specifically for Dual Gap Adaptive v14 (6v6). This is the first test version, so expect rough edges. Instead of every bot playing the same generic game, each bot reads its spawn and plays the role that spot is meant for:

      Role Spawns (per team) What it does
      GROUND 2 front spawns Holds its own half of the land mid, fortifies the map's defensive point, builds a proxy base with T2 shields + T2 artillery at T2
      NAVAL coast spawn Builds yards early, fights for the water and the underwater mexes
      AIR 2 rear spawns Mass air factories, patrols along the front, strikes enemy eco and game enders
      ECO rear spawn Fast mex upgrades + RAS, then picks a random game ender (T3 arty, nuke, T4 arty or T4 air)

      Video of the first test match: https://youtu.be/36RrrPkwhb8

      Highlights

      • Scripted opening build order (ACU, first factory and the first 10 engineers follow a fixed order), then priority-based tasks
      • Own mexes only: every bot builds its base mexes plus its own zone; when a player dies, the two nearest allies split his mexes
      • Reclaim crews for trees, rocks and wrecks, a hydro crew with storages
      • Scouting with a shared team memory: bots only react to what the team has actually seen
      • Responses to scouting: anti-nuke (one per group of 3 spawns, placed so it covers all three bases), heavy shields against scouted artillery, bombers go for scouted game enders
      • Experimentals on role triggers: AIR after ~50 T3 fighters, GROUND/NAVAL after pushing their lane or when an enemy T4 is spotted
      • Army in formation: units mass behind their wall and leave as a wave; fleets fall back from a clearly stronger fleet; fighters patrol along the front and step back from enemy AA
      • ACU logic: overcharge, retreat to max depth in the rear at the end of the T2 phase, stays on land if the threat is torpedo bombers, helps the navy from underwater

      Install

      1. Download the repo: https://github.com/jaxxtrend/faf-dualgap-ai
      2. Copy mods/DualGapAI to Documents\My Games\Gas Powered Games\Supreme Commander Forged Alliance\mods\ (the folder must be named exactly DualGapAI)
      3. In the lobby enable DualGap AI and fill the slots with AI: DualGap or AIx: DualGap

      Build orders and production tables are plain Lua data in DualGapBuildOrders.lua, coordinates and thresholds in DualGapConfig.lua, so it's easy to tweak.

      Limitations

      • First test version: only a few test games so far.
      • Tuned for Dual Gap Adaptive v14 only. On other maps every bot falls back to the GROUND role.
      • Thresholds (wave sizes, AA reaction, push detection) are first guesses and need more games.

      Feedback, replays and bug reports are very welcome, here or as GitHub issues. Thanks!

      1 Reply Last reply Reply Quote 2
      • NuggetsN Online
        Nuggets FAF Association Board
        last edited by

        What would happen if one bot dies? Does another take over its role? Can they adapt?

        1 Reply Last reply Reply Quote 0
        • J Offline
          jaxxtrend
          last edited by jaxxtrend

          Currently they can't adapt, its only one evening work. But it is a good point i will update it later

          1 Reply Last reply Reply Quote 0
          • D Offline
            Defiant
            last edited by

            Do you plan to make it available via FAF mods?

            J 2 Replies Last reply Reply Quote 0
            • J Offline
              jaxxtrend @Defiant
              last edited by

              @Defiant Yes i will

              1 Reply Last reply Reply Quote 1
              • J Offline
                jaxxtrend @Defiant
                last edited by

                @Defiant I have already uploaded it to the FAF

                1 Reply Last reply Reply Quote 1
                • J Offline
                  jaxxtrend
                  last edited by

                  DualGap AI v2 — role-based team AI for Dual Gap Adaptive (6v6)

                  Version 2 is now in the mod vault. Enable DualGap AI in the mod manager, then pick AI: DualGap (beta) (or AIx: DualGap (beta)) in the lobby.

                  Each bot reads its spawn and plays a role: GROUND, NAVAL, AIR or ECO. The goal is bots that feel like a team of players, not a pile of skirmish AIs. The normal AI plays with fog of war: it only reacts to what it has seen or has on radar.

                  What's new in v2

                  Team play

                  • Roles adapt: when a player dies, the ally who takes over its mexes also takes over its job (game enders, base AA, navy...). Losing your ECO doesn't end your late game.
                  • Allies call for help when their base is attacked; land, navy and bombers answer.
                  • AIR builds the anti-air for its whole group. The group anti-nuke is started by whoever has the most resources, and the others help build it.

                  Game enders

                  • ECO picks a random plan, the way players do: usually one nuke first, then artillery or a T4. Four nukes is a rare option.
                  • If the air T4s get shot down, the plan moves on to nukes and artillery instead of rebuilding them forever.
                  • Nuke salvos are sized to beat the anti-nukes the bot knows about.

                  Air

                  • Bomber packs go for the enemy ACU first, then game enders, then the anti-nuke (if we have a nuke), then T3 power. No more bombing mexes.
                  • A big bomber stack goes in as one mass attack under fighter cover. When the target dies, bombers switch to a commander or game ender nearby instead of flying home over it.
                  • Air T4 operations: the Czar or Ahwassa flies around the map edges with fighters and bombers at its pace, going for the enemy ECO commander.
                  • Every free fighter goes after an enemy air T4 in our half. Fighters sweep the enemy front when they clearly outnumber its air.
                  • Scouts only after minute 10, sent in packs of 5–10.

                  Land and navy

                  • Land waves push through the mid to the enemy bases and don't turn back for stray targets. Stuck formations get moving again.
                  • Fleets regroup until they are clearly stronger before going back in. NAVAL sends destroyers to help ground at the mid.
                  • Land experimentals are built in front of the base, so they can walk out.

                  Commanders

                  • Hidden ACUs stay in their own base's water, under the team's anti-nuke and fleet.
                  • They spread out only when an enemy nuke has actually been launched and no loaded anti-nuke covers them. The bot uses the public "strategic launch detected" announcement, not the target.
                  • Base ACUs step out of the dense base on a nuke launch, and take cover under T3 AA and shields when an enemy air T4 comes in.

                  Economy and base

                  • Player-like base layout: first factory against the hydro, power in tight adjacency blocks, mass storage crosses around mexes and fabricators in their corners.
                  • Base mexes go T2, get their storages, then T3.
                  • Income gets spent: more factories as income grows, and idle engineers assist production.

                  Feedback

                  Replays and logs are very welcome, especially games where the bots did something dumb. The bots log what they decide, so a game log usually shows why.

                  Source: https://github.com/jaxxtrend/faf-dualgap-ai

                  1 Reply Last reply Reply Quote 0

                  Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                  Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                  With your input, this post could be even better 💗

                  Register Login
                  • First post
                    Last post