TripleA Logo TripleA Forum
    • TripleA Website
    • Recent
    • Popular
    • Register
    • Login

    Creating a (hopefully) competitive bot using Claude Code.

    Scheduled Pinned Locked Moved AI
    29 Posts 7 Posters 132 Views 6 Watching
    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.
    • B
      beelee @husky81
      last edited by

      @husky81

      Can you combine scripted responses while adding some van dam uniqueness ?

      It'd be a projrect. Start with the optimal 3-5 moves and there counters and then do the same from there. Can see that exploding quite quickly 🙂

      But instead of just choose between these 3 and 5 choices add some claudeness to it as well.

      Idk I have basically zero knowledge of how hard this is but it seems pretty hard 🙂

      Keep it up though, we want you to succeed 🙂

      TheDogT H 2 Replies Last reply
      Reply Quote 0
      • TheDogT
        TheDog @beelee
        last edited by

        @husky81 said

        I am currently trying to build a proper logic for purchase and non combat move.

        Have you/ClaudeBot seen TripleA AI logs?
        In game
        Debug> HardAI> Show Logs
        Enable AI Logging =TICK
        Log Depth=Finest
        Log History To=99

        AFAIK this is only in memory and not a file.

        It shows amongst other things how it categorizes its purchases and how it values the purchase of units and places them where needed.

        https://forums.triplea-game.org/tags/thedog
        https://forums.triplea-game.org/topic/3741/curated-best-top-maps-triplea-guides

        H 1 Reply Last reply
        Reply Quote 1
        • H
          husky81 @TheDog
          last edited by

          @TheDog said:

          ow Logs
          Enable AI Logging =TICK

          No, but this is useful information. Am I right to think that this is more about seeing the current hard AI's reasoning? Currently i am attempting to solve the problems on my own (With Opus), I've told it explicitly not to look into the current ai's reasoning because I don't want to reverse engineer that ai at this point in the project.

          Of course at some point in the future I could change my philosophy, especially if I either hit a brick wall and run out of ideas to improve my bot, or if i can finally beat triple A's bot, I would be more interested in mining the existing ai for ideas at that point. If there's another reason to look at the ai logs that I'm missing, let me know.

          1 Reply Last reply
          Reply Quote 0
          • H
            husky81 @beelee
            last edited by

            @beelee said:

            s and there counters and then do the same from there. Can see that exploding quite quickly

            But instead of just choose between these 3 and 5 ch

            I can see the interest in making it do some weird plays, like going for fancy VC play, or doing different versions of KJF. I would definetly be interested in doing that. but currently I'm at the stage of trying to get it to stop doing ridiculous and stupid things like buying all infantry and turtling in moscow, or throwing it's Luftwaffe away trying to kill a naval stack that doesn't even had a single tt under it.

            I'm very much at the walk before you can fly stage.

            TheDogT 1 Reply Last reply
            Reply Quote 1
            • TheDogT
              TheDog @husky81
              last edited by

              @husky81
              Does the Claude bot have some simple stacking rules like the following?
              Infantry > Artillery
              Infantry > Armor
              Destroyer > Cruisier
              Destroyer > Battleship
              Destroyer > Carrier
              Destroyer = Transport
              As this determines what to buy/place and then move.

              If attacking it should have Armor in the stack
              If attacking 66%+ chance of success, otherwise don't attack.

              Also if Defending 50%+ chance of success, otherwise retreat

              Just so you know , this is not a clone of what the TripleA AI does. It just me putting stuff on the page, for a starting point.

              https://forums.triplea-game.org/tags/thedog
              https://forums.triplea-game.org/topic/3741/curated-best-top-maps-triplea-guides

              TheDogT H 2 Replies Last reply
              Reply Quote 3
              • TheDogT
                TheDog @TheDog
                last edited by

                The above is only for that map.
                It should be based on the units xml contents, not their unit names.

                So like
                Infantry 1-2-1, 3pu as cheapest land unit
                Artillery 2-2-1 with artillery" value="true as support/mixed unit
                Armour 3-3-1 with Blitz, so an Attack/mixed Unit
                Destroyer 2-2-2 8pu as cheap surface sea unit

                https://forums.triplea-game.org/tags/thedog
                https://forums.triplea-game.org/topic/3741/curated-best-top-maps-triplea-guides

                1 Reply Last reply
                Reply Quote 2
                • H
                  husky81 @TheDog
                  last edited by

                  @TheDog Currently it a values units by TUV (so cost), but also by "combat power" which is pips + 2.6* hit points, so an infantry is worth 2+2.6=4.6 in a defensive stack, 1 +2.6=3.6 in an attacking stack.

                  BB's are 4+2*2.6=9.2. This formula was arrived upon by simulating thousands of medium sized (6-12) unit per side land battles, and fitting the value of m in the equation pips + m * hitpoints that best predicted the favorite in the most circumstances. The simulation said that m was pretty flat between 2 and 4, so you could multiply hit points by anything from 2 to 4, then add pips to get a units approximate combat power when in a medium sized stack. (according to Claude)

                  the attack threshold is 70% to win I believe. Eventually, I want to have this become adjustable by the current board state. Every turn there is a function that the bot runs to test which side is winning, %to win estimate. (currently this function is not great since my training games only involve weak players). but my idea is that the bot will look for trends in the % to win, and if it notices that it's trending downward, or is really low, the bot will lower it's % to win threshold for attacks, choosing the most impactful ones.

                  So if I can ever get it to work right, it will 1-2 yolo on berlin or Karelia if it thinks it's getting close to the point of no return.

                  TheDogT 1 Reply Last reply
                  Reply Quote 0
                  • TheDogT
                    TheDog @husky81
                    last edited by

                    @husky81
                    What do think of having temporary hard ratios for Land, Sea, Air for each nation?
                    Losses are replaced in these ratios.
                    For example
                    Germany Land:80%, Sea:0% Air:20%
                    Russia Land:80%, Sea:0% Air:20%
                    Italy Land:50%, Sea:30% Air:20%
                    You get the idea.

                    This is to see if you can beat your current scores, as maybe your bots focus is too wide?

                    Ideally these ratios should be dynamic, perhaps based on the nearest VC objectives.

                    https://forums.triplea-game.org/tags/thedog
                    https://forums.triplea-game.org/topic/3741/curated-best-top-maps-triplea-guides

                    H 1 Reply Last reply
                    Reply Quote 1
                    • H
                      husky81 @TheDog
                      last edited by

                      @TheDog said:

                      n these ratios.
                      For example
                      Germany Land:80%, Sea:0% Air:20%
                      Russia Land:80%, Sea:0% Air:20%
                      Italy Land:50%, Sea:30% Air:20%
                      You get the idea.

                      This is to see if you can b

                      I am not completely opposed to this, but currently the buys don't see to be the problem so much. I think the main issue is having it not leave exposed forces that then get cleaned up cheaply. so the biggest gap is on move planning.

                      I suppose hard coding objectives could get there, like Japan Maximize pressure on india round 3, Germany take West Russia Round 4. but I would like to not do that if it can be avoided.

                      TheDogT 1 Reply Last reply
                      Reply Quote 2
                      • TheDogT
                        TheDog @husky81
                        last edited by

                        @husky81 said

                        like buying all infantry and turtling in moscow,

                        As Moscow (A capital and VC) has been secured, its 'objective' value should be reduced(halved) , so that the bot AI gives priorities to adjacent TT to secure it even further so it cannot be directly threatened.

                        the attack threshold is 70% to win I believe

                        Maybe I'm too aggressive/optimistic, I would reduce this to 66% to see if this is affecting the win ratio.
                        In the past, this is one of the TripleA improvements I have asked for. In simple terms Germany/Japan is more aggressive than USA/Britain, so a map maker could pick a nations Aggression level to simulate this.

                        https://forums.triplea-game.org/tags/thedog
                        https://forums.triplea-game.org/topic/3741/curated-best-top-maps-triplea-guides

                        B 1 Reply Last reply
                        Reply Quote 3
                        • B
                          beelee @TheDog
                          last edited by

                          @TheDog said:

                          o a map maker could pick a nations Aggression level to simulate this.

                          rightarm.png

                          H 1 Reply Last reply
                          Reply Quote 2
                          • H
                            husky81 @beelee
                            last edited by

                            @beelee Yes, Ideally it will be customizable, but all current bots that I am aware of are pretty stupid, mine included.
                            The developers of tripleA did a great job coding a bot that can play reasonable games (better than mine) without benefit of AI tools, and one that can work on a wide variety of maps. Impressive.

                            But let's face it, at the end of the day, the bot plays some stupid moves. My goal is first to make it play less stupid. At some point it will have tunable agression.

                            If I ever distribute it, I could look into having some settings that users could control. As is, there are lots of settings in the code that Claude tries to optimize, so I think it would be easy ish to make some of them user facing in a public version.

                            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
                            • 1
                            • 2
                            • 2 / 2
                            • First post
                              Last post
                            Powered by NodeBB Forums