TripleA Logo TripleA Forum
    • TripleA Website
    • Categories
    • Recent
    • Popular
    • Users
    • Groups
    • Tags
    • Register
    • Login

    Improving AI

    Scheduled Pinned Locked Moved Player Help
    48 Posts 7 Posters 18.0k Views 7 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.
    • HeppsH Offline
      Hepps Moderators @alkexr
      last edited by Hepps

      @alkexr Then I shall. Lest I make a greater fool of myself more than my assumptions already have.

      "A joyous heart sours with the burden of expectation"
      Hepster

      1 Reply Last reply Reply Quote 0
      • LaFayetteL Offline
        LaFayette Admin
        last edited by

        Let's get back on topic.

        @Schulz AI development is one of the major features of TripleA and is a priority. Unfortunately it does take a ton of time and labor to do most anything in the code base, it's old and a bit hacky.

        I would recommend if there are specific situations where the AI could make a better decision, posting a game save and describing what the AI did and could have done for a better decision could be very useful. Specific spot examples like that we can probably look at specific parts of the code and perhaps improve them..

        In theory as well the code architecture tries to support "plug-and-play" AI modules. Namely you can create your own AI and drop it in. It's not done as cleanly as it could be, requires a good bit of programming knowledge, and kinda is a big effort code-wise. Perhaps it's best for now to collaborate to improve the "pro AI".

        @alkexr RE: machine learning, the AI could play itself and generate a dataset that way. Unfortunately short term that is not very feasible as the code is in a messy state which makes big changes or additions prohibitive.

        alkexrA 1 Reply Last reply Reply Quote 3
        • alkexrA Offline
          alkexr @LaFayette
          last edited by

          @LaFayette said in Improving AI:

          RE: machine learning, the AI could play itself and generate a dataset that way. Unfortunately short term that is not very feasible as the code is in a messy state which makes big changes or additions prohibitive.

          That sort of learning requires even more data, doesn't it? Like tens of thousands, at the very least? I've thought of this idea, but AI self play can take 10-20 minutes on larger maps each turn. Games can last as long as half a day. Even with multiple people running it on their PCs day and night, it seems like way too much time even for a single map. It might be worth trying for the smallest maps, but relying on it - no.

          The better option might be "machine teaching", of some sort. A human would be much better at guessing the correct territory values (or any other parameter), and adjusting after playing games against it and seeing it in action.

          "For the world is changing: I feel it in the water, I feel it in the earth, and I smell it in the air."

          1 Reply Last reply Reply Quote 0
          • redrumR Offline
            redrum Admin
            last edited by

            Wow... quite a thread.

            So I'll add my thoughts around a few of the topics here. Is it in theory possible to create some form of simulation/machine learning/learning AI based on trying to generate lots of played games and having it improve based on patterns of those games? Yes.

            Now is it feasible to do that with any reasonable amount of resources/time that would actually produce a useful result for a complex TripleA map? Personally, I don't believe that it is at this point.

            Breaking that down a bit further, if you say took just 1 TripleA map say revised, removed 95% of the starting units, reduced overall territory production values to 20%, changed all sea territories to land, removed all sea units, and removed all air units then created a base AI that understands the rules then optimized the performance of that AI then acquired significant compute power and data storage then you could probably create a some type of machine learning AI and if anyone really was serious about doing it that is essentially where I would recommend starting with a very stripped down version of a single map to at least prove they can do it with that and see how long it would take.

            Even if you achieve an expert level AI on that stripped down map, being able to then do it for Global or Total World War or Civil War would be orders of magnitude more difficult and require a lot more time and resources.

            So IMO, that mostly leaves us with trying to make some form of weighted and limited simulation AI which is what we have as a base today. If done right, this could be improved to beat 99% of players and run within a reasonable amount of time. There is already a list of items that could be improved/added and mostly we'd need more people to post examples of where the AI makes poor decisions.

            I would love to focus more on improving the AI and that was what originally brought me to developing TripleA as the previous AI was... well... terrible. Ideally I'd really like to just develop the AI and create some maps but given that we only have a few developers working on TripleA in their spare time, I end up working on a lot of other things around the engine and bugs.

            TripleA Developer with a Passion for AI: https://forums.triplea-game.org/topic/105/ai-development-discussion-and-feedback

            1 Reply Last reply Reply Quote 5
            • RogerCooperR Offline
              RogerCooper
              last edited by

              Given the complexity of creating an AI for a game like TripleA, the current hard AI performs quite well, especially on a tactical level. I often play 1 country and let the AI take the rest. This generally makes for challenging and entertaining games.

              What I would like to see is the ability of scenario designers to give objectives and directives to the base AI. This should be doable without undue effort.

              For example, I am reworking the Axis & Allies: D-Day game in TripleA. I found that making the game's 3 objective cities German 'capitals', the AI played significantly better.

              redrumR SchulzS 2 Replies Last reply Reply Quote 3
              • redrumR Offline
                redrum Admin @RogerCooper
                last edited by

                @RogerCooper Agree. Per map configuration, is definitely on the list of things to add. The AI also needs to be able to better handle various capital rules and victory cities.

                TripleA Developer with a Passion for AI: https://forums.triplea-game.org/topic/105/ai-development-discussion-and-feedback

                RogerCooperR 1 Reply Last reply Reply Quote 1
                • RogerCooperR Offline
                  RogerCooper @redrum
                  last edited by

                  @redrum said in Improving AI:

                  @RogerCooper Agree. Per map configuration, is definitely on the list of things to add. The AI also needs to be able to better handle various capital rules and victory cities.

                  The AI handles capitals pretty well, responding strongly the threats against them and making some strategic effort in the direction of the capital. Something as simple as a settable VictoryCity bonus for AI computations of territory value would improve play. A little more complex would be the ability designate a territory as a "StrategicObjective", which the AI would try to attack or defend as if it were a capital.

                  redrumR 1 Reply Last reply Reply Quote 0
                  • SchulzS Offline
                    Schulz @RogerCooper
                    last edited by

                    @RogerCooper

                    Roughly how much bid do you give to AI?

                    RogerCooperR 1 Reply Last reply Reply Quote 0
                    • redrumR Offline
                      redrum Admin @RogerCooper
                      last edited by

                      @RogerCooper Sorry I meant difference capital rules. The AI treats all its capitals as must hold or it can't produce units and loses all its PUs. But some games have capitals where losing them doesn't actually impact anything. But yeah, right now the AI essentially looks to primarily defend and try to capture capitals and factories. Having a way to designate other important territories for it to focus on would be useful.

                      @Schulz In my experience, it varies significantly across maps and just how strong of a player you are. You can also instead of a bid or in addition to give the AI bonus flat or % income.

                      TripleA Developer with a Passion for AI: https://forums.triplea-game.org/topic/105/ai-development-discussion-and-feedback

                      1 Reply Last reply Reply Quote 1
                      • RogerCooperR Offline
                        RogerCooper @Schulz
                        last edited by

                        @Schulz I usually don't give the AI a bid, unless the scenario is unbalanced. I take only 1 country, leaving me with AI allies as well as AI foes. We don't want to really lose to the AI.

                        1 Reply Last reply Reply Quote 1

                        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
                        • 3
                        • 1 / 3
                        • First post
                          Last post
                        Copyright © 2016-2018 TripleA-Devs | Powered by NodeBB Forums