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

    AI Development Discussion and Feedback

    Scheduled Pinned Locked Moved AI
    316 Posts 32 Posters 431.5k Views 30 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.
    • C Online
      Cernel Moderators @Captain Crunch
      last edited by

      @captain-crunch Yah, if an AI thing for tuning the algorithm values per game (not per map) would be eventually made, I think there should be a way to determine what gets accepted, in case anybody wants to submit one for any not actively owned maps (of course, maps with an active owner, the owner decides).
      Maybe running AI vs AI somewhat officially monitored battles, in case, like, several people offer an AI configuration for WW2 Classic or whatever (you also have to consider that proposals might be worse than default, so some reasonably quick way to test would be in order, unless restricting the feature to actively owned maps only).

      1 Reply Last reply Reply Quote 3
      • Z Offline
        zlefin Moderators @redrum
        last edited by

        @redrum
        but that error didn' toccur when I was trying to load a save game; it was starting a new game.
        I opened that copy of triplea (which is on a separate installation as to not interfere), did select map for another map to make sure it clears it. did select map again to select bigworld2 BOP, set Russia to Hard AI; and click play to start the game. then it generates that error within a second or so. and it still consistently does that if I repeat the process using the 9687 installation.

        maybe it's a side effect of it being a different installation?

        1 Reply Last reply Reply Quote 0
        • Z Offline
          zlefin Moderators
          last edited by

          were there any known bugs in the ai's calculations in 7621?

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

            @zlefin Not that I can think of. If there were any they were very minor.

            I'm guessing your error on the pre-release has nothing to do with the AI though. You can probably start the game up with all human and see the same error.

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

            Z 1 Reply Last reply Reply Quote 0
            • Z Offline
              zlefin Moderators @redrum
              last edited by

              @redrum
              if I start with all human I don' tget any errors; and can go through russia's first turn without any issues. so whatever it is, it's affected by me setting russia to ai.

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

                @zlefin Try doing "Show History". I think that is what is triggering the error.

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

                Z 1 Reply Last reply Reply Quote 0
                • Z Offline
                  zlefin Moderators @redrum
                  last edited by zlefin

                  @redrum
                  yep; that did it. doing show history even in an all human game caused the nullpointerexception.

                  back to dealing with the ai stuff! so when it's at: "Check if we should try to hold attack territories"
                  where does it derive the "enemyattackers" value from? what assumptions does it make when it does that derivation?
                  oh and I note there's two different times it does that check; one early on, and one somewhat later on with what looks like a smaller list of targets, which looks like a list culled down to the best targets.

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

                    @zlefin Weird. I think you have some kind of messed up install. I'd recommend wiping all your TripleA installs and map directories then reinstalling at some point.

                    For enemyAttackers, it tries to calculate how many units each of its enemies could potentially attack the given territory with and then selects the group of enemy units that it believes has the most "power" which it then considers the the max enemy attackers that it could face in a counter attack. It tends to be extra conservative around this if there are potential can openers.

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

                    Z 1 Reply Last reply Reply Quote 1
                    • Z Offline
                      zlefin Moderators @redrum
                      last edited by

                      @redrum
                      some of the numbers i've seen for the enemyattackers value look like it's underestimating the size of the counterattack. in particular it looks like it's not counting counterattackers who would come from another territory it's considering attacking.
                      I've a save I could put up to better show the point; or I could just copy part of the logs and explain the situation, whihc would be best?

                      redrumR HeppsH 2 Replies Last reply Reply Quote 1
                      • redrumR Offline
                        redrum Admin @zlefin
                        last edited by

                        @zlefin Correct, it tries to ignore enemy counter attackers from territories that it is planning to attack since it assumes those units will die. My guess is there are some cases that it must decide not to attack one of those territories and isn't taking the additional enemy counterattack units into account. Save games are definitely better especially right before it makes the moves and if it makes those moves almost everytime.

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

                        Z 1 Reply Last reply Reply Quote 1
                        • HeppsH Offline
                          Hepps Moderators @zlefin
                          last edited by

                          @zlefin Nice to see another contributor.... thanks for jumping in @zlefin.

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

                          1 Reply Last reply Reply Quote 2
                          • Z Offline
                            zlefin Moderators @redrum
                            last edited by

                            @redrum

                            ok, hopefully that uploads right. it's right before germany's turn which is set to be hard ai. made in 7621
                            0_1520785568570_AIgermancountermoves.tsvg

                            while the ai's moves are reasonable; i'm just trying to understand how it's gettin some of its numbers here; like in the first section of its can it hold the territories checks I see this: (using finer logging setting)

                            Western Russia, value=51.35751298216039, averageAttackFromValue=20.57303311797783, MyAttackers=14, RemainingUnits=9
                            Western Russia, CanHold=true, MyDefenders=9, EnemyAttackers=1, win%=0.0, EnemyTUVSwing=-10.09375, hasLandUnitRemaining=false
                            SZ 10 North Sea, value=15.82651924854822, averageAttackFromValue=6.364376154510273, MyAttackers=16, RemainingUnits=8
                            SZ 10 North Sea, CanHold=true, MyDefenders=8, EnemyAttackers=12, win%=30.434782608695656, EnemyTUVSwing=-1.4891304347826022, hasLandUnitRemaining=false
                            Northern Russia, value=57.61767455300545, averageAttackFromValue=21.22610523348412, MyAttackers=9, RemainingUnits=4
                            Northern Russia, CanHold=true, MyDefenders=4, EnemyAttackers=1, win%=0.0, EnemyTUVSwing=-10.03125, hasLandUnitRemaining=false

                            but western and northern russia are both next to moscow, which is/will be intact and has a bunch of units. a bit above that in the logs there was
                            Removing territory that we can't successfully attack: Moscow, maxWin%=0.0, maxAttackers=2
                            so it should know that moscow will be intact and its troops available for counters.

                            other oddities are
                            Leningrad, value=30.751588092760592, averageAttackFromValue=21.22610523348412, MyAttackers=15, RemainingUnits=3
                            Leningrad, CanHold=true, MyDefenders=3, EnemyAttackers=1, win%=0.0, EnemyTUVSwing=-9.25, hasLandUnitRemaining=false
                            where, again at the least the air attackers from moscow are missing; as it has 4 air that would be in range to counterattack if the ai took leningrad.

                            and
                            Finland, value=16.73492259416393, averageAttackFromValue=6.142684580406411, MyAttackers=14, RemainingUnits=7
                            Finland, CanHold=true, MyDefenders=7, EnemyAttackers=3, win%=0.0, EnemyTUVSwing=-26.875, hasLandUnitRemaining=false
                            where I don't see which 3 attackers it could possibly be coming up with; as it's clearly using some air, but not all of the air if it's takin gfrom russia, or maybe it's takin from britain and ignoring the russian counterattack, I don't know. but if the ai did a 14 attackers on attack on finland then it wouldn't have taken leningrad, which would leave the leningrad stack available to counter. It makes me wonder more generally what the logs would show if I setup a scenario wherein province A has 8 units, and is adjacent to provinces B/C, which are hostile, and each have 6 units (let's say all units have att/def 2 and i'ts LL, and all other units are too far away to be relevant). in such a scenario it would be capable of taking either province reliably, but not both, and would not be able to hold onto either of them. maybe later i'll setup a test for that.

                            when it does the second round of its Check if it can hold territories checks, using the smaller list of targets it's selected, it's showin those same numbers again. I just don' tsee how it getting those values for EnemyAttackers in those cases.

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

                              @zlefin I think you've found a bug 🙂

                              I did some quick debugging and saw the following:

                              Germany Attack Options After Removing Can't Attack Territories:
                              [Southern Russia, Western Russia, SZ 10 North Sea, Northern Russia, SZ 16 North Atlantic, SZ 18 West Atlantic, Sweden, SZ 4 Denmark Straight, SZ 9 North Atlantic, SZ 13 Gulf of St Lawrence, SZ 7 Barents Sea, Leningrad, Switzerland, Spain, SZ 23 West Mediterranean, SZ 2 Labrador Sea, SZ 37 Caribbean Sea, Finland, SZ 17 English Channel]

                              Enemy Counter Attacks on Western Russia: [bomber owned by British]

                              I think what is happening is the British counter attack is overriding the Russian counter attack that is why you see the 1 unit instead of this:
                              [armour owned by Russians, armour owned by Russians, armour owned by Russians, infantry owned by Russians, infantry owned by Russians, infantry owned by Russians, infantry owned by Russians, armour owned by Russians, armour owned by Russians, tactical_bomber owned by Russians, bomber owned by Russians, fighter owned by Russians, tactical_bomber owned by Russians, fighter owned by Russians]

                              Enemy Turn Order was one of the last things I added to the AI which I think caused a bug. Here was the PR: https://github.com/triplea-game/triplea/pull/282

                              I'll need to look more into this but its probably either a bug in this method or the data being passed into it:
                              https://github.com/triplea-game/triplea/blob/master/game-core/src/main/java/games/strategy/triplea/ai/pro/data/ProTerritoryManager.java#L440

                              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 2
                              • Z Offline
                                zlefin Moderators
                                last edited by

                                Ok;
                                looking at another case to understand stuff generally, using finest logs (same savegame), I think I figured out wha'ts going on in this one and it's fine; it adjusted the enemy attackers up because it removed an unprofitable attack on caucasus from it's possible attacks stream, thus meaning those 3 inf can join in a counterattack on southern russia, right?:

                                in the section:
                                Determine units to attack each territory with
                                Territory=Southern Russia, CanHold=false, MyDefenders=2, EnemyAttackers=22, win%=100.0, EnemyTUVSwing=3.9375, hasLandUnitRemaining=true
                                territory=Southern Russia, win%=100.0, TUVSwing=4.34375, hasRemainingLandUnit=true, attackValue=5.71875, territoryValue=4.0, allUnitsCanAttackOtherTerritory=true with attackers=[infantry owned by Germans, infantry owned by Germans, infantry owned by Germans, tactical_bomber owned by Germans]

                                which shows the 22 enemy counterattackers; but earlier in the phase
                                Check if we should try to hold attack territories
                                Southern Russia, value=61.00113178010893, averageAttackFromValue=20.92354576175239, MyAttackers=16, RemainingUnits=10
                                Southern Russia, CanHold=false, MyDefenders=10, EnemyAttackers=19, win%=100.0, EnemyTUVSwing=23.534090909090907, hasLandUnitRemaining=true

                                with a lower number of enemy attackers;

                                unrelated question: how does the ai decide whether or not to submerge submarines?

                                redrumR 2 Replies Last reply Reply Quote 0
                                • redrumR Offline
                                  redrum Admin @zlefin
                                  last edited by redrum

                                  @zlefin Correct, at a high level it first goes through an iteration of determining which territories to attack then updates enemy counter attacks based on that reduced list of territories then decides which units to actually use for each attack (and potentially removes some more attacks).

                                  If I recall correctly, submerge is treated essentially just like any other retreat where it tries to determine if it has positive TUV for the remaining battle and if not then submerge.

                                  Oh and I just ran a quick test to validate my theory by removing the UK bomber which then gives these results:

                                  Germany Attack Options After Removing Can't Attack Territories:
                                  [Southern Russia, Western Russia, SZ 10 North Sea, Northern Russia, SZ 16 North Atlantic, SZ 18 West Atlantic, Sweden, SZ 4 Denmark Straight, SZ 9 North Atlantic, SZ 13 Gulf of St Lawrence, SZ 7 Barents Sea, Leningrad, Switzerland, Spain, Caucasus, SZ 23 West Mediterranean, SZ 2 Labrador Sea, SZ 37 Caribbean Sea, Finland, SZ 17 English Channel]

                                  Enemy Counter Attacks on Western Russia: [armour owned by Russians, armour owned by Russians, armour owned by Russians, infantry owned by Russians, infantry owned by Russians, infantry owned by Russians, infantry owned by Russians, tactical_bomber owned by Russians, bomber owned by Russians, fighter owned by Russians, tactical_bomber owned by Russians, fighter owned by Russians]

                                  German attacks after removing the UK bomber:
                                  0_1520798479041_797fcfb8-27a6-4eb2-83fc-9af44a09ed80-image.png

                                  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 0
                                  • redrumR Offline
                                    redrum Admin @zlefin
                                    last edited by redrum

                                    @zlefin I looked at the code and I think after the enemy turn order changes I mentioned above, the territoriesToCheck needs to be set to ensure the potential territories to attack are all checked for all enemies. I did some testing and updating that seemed to fix the max enemy attackers issue and not cause any side effects. Here is the PR: https://github.com/triplea-game/triplea/pull/3271

                                    This can be tested with the latest pre-release: https://github.com/triplea-game/triplea/releases/tag/1.9.0.0.9743

                                    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
                                    • C Offline
                                      Cody Young
                                      last edited by Cody Young

                                      I don't know that anyone cares about what I have to say and I hope I am posting this in the right place, but for the first time since I discovered Triple A I find it utterly unenjoyable. Entirely due to the AI.

                                      I have been playing for many years, ever since I found it on Sourceforge, but only single player. My preference is toward World at War (or before that, New World Order), though I think I have tried pretty much every map which has been offered. Some are better than others. Ironically, the best single player experience for me currently has been Greyhawk, which I have absolutely no interest in, but which is immensely fun to play and very well balanced while still retaining its challenge.

                                      The AI has always been progressively improving. I remember when Moore N Able Russia was all bombers and infantry, or the US would just conscript fleets of Patrol Boats to swarm the Atlantic. They were things which were effective, sometimes brutally so, though really quite silly . .But currently, World of War as it exists now is just. . .Well its a nightmare..

                                      Hard AI doesn't, as near as I can tell, carry any additional strategic sophistication, but rather just gives more favorable rolls (even with low luck set, and I do hate low luck since that favors the AI calculations). France, rather than folding in six months, cannot be taken before turn four (I used to be able to take it in two), and if the AI is in charge of Germany (even on Hard) sometimes it won't fall at all.The Dutch and Australians can practically take out Japan's naval forces all by themselves, with only token assistance from the British and none at all from the Americans. In fact, if America does nothing, the Axis powers are defeated entirely within about twenty turns. There is never, and I mean absolutely never, a point at which Britain appears distressed, let alone pressed anywhere on the globe. Japan used to be poised for a Pearl Harbor strike even if it was somewhat out of sync with the setting, but now that is virtually impossible. Even if one commits everything within reach, it is a failure more often than not, and even when it is successful the next turn sees every ship destroyed. It is little wonder why the AI will not do it on their own, and really, an early Pearl Harbor strike is no more anomalous than the US conquering South America, so why not allow what is a trademark moment in the war.

                                      I like a challenge. it is the reason I usually play the Axis, but this goes beyond merely being disadvantaged. I have played games in the past as Finland or China where through patience and careful planning I could tip the scales of victory for my side, but it was always a struggle. That fine balance is no longer present in the game. I don't know why, and wish I could offer something more helpful that these feeble observations, but I sorely miss the game I used to love so I am just offering you what I have.

                                      Also, a personal annoyance I have always harbored but never felt particularly inclined to mention (though I may as well while I am here). . .I absolutely loathe how AI allies will sweep in and steal territories I have just barely lost (or just opened up access to through a pressed engagement) before I have a chance to (re)claim them. Seeing checkerboard islands of other nations in the heart of my territory bugs the, uh daylights, out of me. I realize they are opportunistic and tactically make some sense, but that frequent siphoning of IP is like death by a thousand cuts since their 'help" is otherwise pretty nonexistent. I will have Italy, Romania and Finland spilling through breaches I open, to claim territories they can't hold, while the British cross up through Turkey without any concern whatsoever from them. Ideally, Romania and Italy should be concentrating wholly upon Africa and the Middle East, leaving Russia to Germany. Italy can barely make headway in Africa as it is and has absolutely no chance of holding it against the Americans, its even worse when they seem to ignore the continent completely.

                                      Anyway, this sounds like a lot of griping, mostly because it is, but for many years I have been a loyal if silent fan and I really do appreciate all the work you guys have put into this and hope to see good things going forward. The way I figure it though, you can't fix problems you don't know about.

                                      C 1 Reply Last reply Reply Quote 0
                                      • C Online
                                        Cernel Moderators @Cody Young
                                        last edited by

                                        @cody-young I've never played World At War, but, aside from the AI, Yamamoto can attack 91, on round 1, with 5 Submarine, 1 Destroyer, 4 Fighter, 1 Bomber.
                                        With Low Luck, taking Destroyer first, then Submarine, then Fighter, this is, on average, 1 Bomber, 4 Fighter and 0.67 Submarine surviving.
                                        If you take Fighter before Submarine, you would have 1 Bomber, 5 Submarine and 0.33 Fighter surviving; tho you don't want to do that (just saying it gives you some more safety, if rolls are bad).
                                        Then, you can have the Fighters land on carriers in 96 (easily safe) or 104 (can be made safe with some effort).
                                        Just remember to have 1 land unit where the bomber is going to land (Kwajalein or Jaluit).

                                        C 1 Reply Last reply Reply Quote 0
                                        • C Offline
                                          Cody Young @Cernel
                                          last edited by

                                          @cernel I didn't say it was impossible, but anything which survives that strike is annihilated the next turn by outlying American ships and aircraft. The AI won't even attempt a Pearl Harbor strike, and I really do think that is telling.

                                          C 1 Reply Last reply Reply Quote 0
                                          • C Online
                                            Cernel Moderators @Cody Young
                                            last edited by

                                            @cody-young Yeah, you can't sit in Pearl Harbor. Anything that attacks it and stays there is due to be destroyed (so, try to save air units). Still, not doing that attack is a really bad choice, and the AI has a big problem, if does it anything less than 100% times.

                                            C 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
                                            • 7
                                            • 8
                                            • 9
                                            • 10
                                            • 11
                                            • 15
                                            • 16
                                            • 9 / 16
                                            • First post
                                              Last post
                                            Copyright © 2016-2018 TripleA-Devs | Powered by NodeBB Forums