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 Offline
      Cernel Moderators @luhhlz
      last edited by Cernel

      @luhhlz I'll add a thing I said a while ago; the AI also undervalues double hitpoints units a lot, when deciding purchases. Even in my 270BC Cernel Variant/270BC 40% it almost never buys warelephant units, that about everyone with which I played agree are super good, especially when placements limits matter (like final build up before a major attack or menace of).

      No idea what the AI is doing with battleships purchases in WAW (?), but I believe all players agree battleships in WAW are one of the best units, especially for Americans.

      Captain CrunchC 1 Reply Last reply Reply Quote 0
      • Captain CrunchC Offline
        Captain Crunch Banned @Cernel
        last edited by Captain Crunch

        @Cernel I'm no AI expert for sure but have battled many forms of it in games and after reading your post it reminded me of the AI choosing more Artillery than my regular human opponents do when making our general purchases which was usually buying the cheaper Infantry ... was a discussion I had with Redrum one time and he may have changed the algorithm (settings) on those Unit Purchases but I'm pretty sure you are talking about a settings tweak and I wonder what Redrum thinks to see if he needs to change something!

        Interesting though

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

          @luhhlz Good feedback. One thing I'll add is if you have any save games that show really poor AI behavior in these situations those are always super helpful as I can then test and make adjustments based on them. I'll try to provide some thoughts around each of your points:

          1. So valuing attacking damaged BBs should mostly be captured in the TUV calculations. If you have some save games where the AI passes up attacking damaged BBs where it clearly should I'd be interested in taking a look at them. But I haven't really seen this issue much.

          2. Yeah, this one is a tough one. The AI essentially tries to hold out as long as possible for capitals and factories but if it becomes absolutely overwhelming odds then it'll retreat. I think there could be more improvements here but its not the straightforward and usually this isn't losing the AI the game. There is also a lot of subjective opinion on this as different players have different thoughts on when to retreat vs making last stands in places.

          3. Given the complexity and the number of different rules/maps, machine learning is probably impossible given where it is at today. We also don't have nearly enough data and would need a tremendous amount of processing power. Even if you just focused on say revised, it would still be very very difficult and maybe impossible at this point let alone the larger and more complex maps.

          4. This one isn't easy. The AI tries to use cheaper units for trading territories and tries to spread out its planes across them. It generally tries to avoid exposing more expensive units but doesn't always succeed. If you have some good save games showing absolutely terrible trades that its making, I'd be interested in taking a look to see how it can be improved. I think sometimes it just needs to choose to trade less territories if it doesn't have the cheap units and planes.

          5. Purchasing is really hard. Mostly because every map has a different unit set, there are different game situations, and many different factories. The funny part is even good players often disagree on it for most maps. My gut says if you showed that ratio to expert WaW/NWO/TRS players, many of them would tell you its crap and give a completely different ratio. Also the ratio varies a lot when you consider USA vs Germany vs Russia which each are in a very different situation. Generally the AI prefers cheap units until its factories are far from the front then tries higher movement options. In some part because the AI isn't a good at protecting its high cost units and maximizing their impact. I'd actually like to completely rewrite the purchase logic as while it works ok-ish on most maps, I think needs to really overhauled to make much improvement on how it is now.

          6. A/B. The AI should be willing to march towards the opponents capital/factory if it has the numbers. The problem I usually see is it spreads itself too thin and attacks too many places rather than focusing its stack. It tends towards quantity of attacks rather than quality. This could definitely be improved.
            C. Transporting units is probably the weakest part of the AI and also maybe the hardest to do well. Balancing number of transports with available units and coordinating fleets to protect them to actually get to their target is... well... really difficult. I do agree that the AI tends to over buy transports but because it also doesn't use them as efficiently as humans do it does tend to need more. Because of this the AI tends to play land powers much more effectively then naval powers. In NWO, it plays germany/russia somewhat reasonably compared to USA/UK which end up just being all over the place as it tries to coordinate transports, fleets, and air power into something that useful. The other challenges besides transporting just being hard is that there are a lot of different transport rules across maps. If you try playing 270BC vs Global vs WaW, they all do transports a bit differently and the AI has to try to understand each of them.

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

          B L 2 Replies Last reply Reply Quote 3
          • B Offline
            beelee @redrum
            last edited by

            @redrum wow Good Action Here !

            Was really hoping #3 was gonna happen, but at least I'll sleep better : )

            1 Reply Last reply Reply Quote 0
            • Q Offline
              Quorthon4
              last edited by Quorthon4

              Some thoughts about "strafing".

              I don't know what's already in the AI and what you already have planned, but not implemented yet. Here is some feedback based on my observations of Hard AI in the latest stabile TripleA version (1.9.0.0.13066).

              I'd like to think for AIplayer1 to make a strafing attack (negative TUV attack) to set up a follow-up attack from AIplayer2, there are a few things that the AI could improve on to evaluate if it's a good idea or not. The easiest to implement, I figure would be simulating "total TUV" for all attacks. So, the odds calculator for the AI needs to run the first attack TUV and immediately the 2nd attack TUV (starting with units remaining after 1st attack) and add the TUVs together and then repeat for however many simulations runs the AI uses for it to be statistically significant. The average TUV swing can then be compared with what you'd get if ONLY AIplayer2 attacks. If the total TUV swing is not improved by AIplayer1's potential strafing attack, then the AI should consider not making that strafing attack.

              So essentially what I'm saying is there should be an odds calculator that can consider several attacks in succession (or at the very least 2 attacks). I imagine if a bit more generalized this could also be used to consider potential counter-attacks by enemies or even combinations of strafing attacks, friendly follow-up attacks and enemy counter-attacks, but obviously it gets more complicated the more attacks are involved as you for every attack need to predict if that player chooses to either not attack at all or commit some troops elsewhere, or if their troops will even be there come their turn, which might not be easy to determine by just looking at battles in 1 territory.

              Captain CrunchC redrumR 2 Replies Last reply Reply Quote 0
              • Captain CrunchC Offline
                Captain Crunch Banned @Quorthon4
                last edited by Captain Crunch

                @Quorthon4 I do not know the technicalities of what you posted but I do want to re-mention something I've said a bunch of times about a "learning AI" which for me was simply adding a saved "WinnersCapturedTerritories" file to be used by the AI every game for direction of focus which would ofcourse improve the AI as more and more games are played. This could even be "machine learning" which as I described is not too complicated and not require that much more resources other than a saved file and some memory space ... so as pertaining to your post ... I think giving the AI direction and goals in its movements would improve the AI more than just letting it decide by TUV what move to make next!

                This thread is about improving the AI and I've yet to see anyone give a better suggestion than mine but let's wait for the devs response to see if your idea or mine are in the future for this AI!

                ubernautU 1 Reply Last reply Reply Quote 1
                • ubernautU Offline
                  ubernaut Moderators @Captain Crunch
                  last edited by

                  @Captain-Crunch first i heard about that idea but i was a little late to the new forum party, anyway, i like it!

                  "You should never have told me horses sleep standing up, it gave me a mental block." - Mister Ed

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

                    @Quorthon4 Good thoughts. The AI does some limiting strafing already and essentially follows a process similar to what you describe. It primarily just looks to use it on high value territories like capitals and factories. If you test revised or v3 and give USA and UK large forces next to Germany's capital where neither is large enough to capture by themselves but if they both attack then they can, you should see the AI strafe to capture it.

                    There are a few challenges with expanding its usage:

                    1. Its slow as you are running multiple BC runs for a single battle so using it across all potential battles could slow the AI considerably especially on large maps.
                    2. Adding when to retreat into it so that the AI would say just use Player1 to attack for a 1 round to weaken it then have Player2 attack to capture it instead of Player1 attacking til all their units are dead. This quickly multiplies the number of potential scenarios to calculate and complicates which is ideal.
                    3. Strafing has different uses in dice vs LL. In LL, you can guarantee a certain number of hits and always know you can retreat where this isn't the case for dice. This often becomes the case when you have a large unit stack then your opponent but are defending your capital so need to leave most of your units there so you just attack for a round or 2 to inflict casualties then retreat back.

                    If you have any save games showing scenarios that the AI could greatly benefit from strafing please upload them here so I can take a look.

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

                    ubernautU Q 2 Replies Last reply Reply Quote 2
                    • ubernautU Offline
                      ubernaut Moderators @redrum
                      last edited by

                      @redrum @Quorthon4 i've seen AI strafe, does it well in 1914 domination map in fact, particularly in the eastern front where Germany and Austria basically need to team up to overpower Russia unless either ignores their western fronts.

                      "You should never have told me horses sleep standing up, it gave me a mental block." - Mister Ed

                      1 Reply Last reply Reply Quote 2
                      • Q Offline
                        Quorthon4 @redrum
                        last edited by Quorthon4

                        @redrum I have a saved game where AI uses strafing in a situation where it's highly questionable. Especially look at Austria turn 5 and Ottomans turn 5 (both attacking Warsaw). The intent is clearly to weaken Warsaw for Germany's turn 6. Germany probably should attack Warsaw on its turn 6, but ends up not doing it, I'm not entirely sure why, but I'm guessing for some reason the AI thinks moving troops towards Greece should be a higher priority than attacking Warsaw.
                        great_war-allies.tsvg

                        Speed is surely a priority for AI and I get the part of it quickly multiplying and you probably have to put limits to how complicated things the AI is allowed to consider. You might have to cut some corners, but I figure there's certainly room for improvement without slowing the AI down significantly.

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

                          @Quorthon4 That mostly just looks like bad luck as between Austria and Ottomans they should have killed on average at least 5 more units than they did. And then Germany would have had a strong attack opportunity.

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

                          Q 1 Reply Last reply Reply Quote 2
                          • Q Offline
                            Quorthon4 @redrum
                            last edited by Quorthon4

                            @redrum Ok, so here are numbers I get with combat simulator (2000 simulation count):
                            Austria expected TUV swing: -49.62
                            Ottomans expected TUV swing: -17.22
                            on average both attacks should kill roughly 10 russian infantry

                            German potential attack without the strafing attacks above expected TUV swing: -26.54
                            German potential attack with 10 less russian infantry to defend: 32.3
                            Total benefit from strafing attacks: -49.62 - 17.22 + (32.3 - (-26.54)) = -8 TUV swing

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

                              @Quorthon4 Right but then Germany on average would get something like ~30 TUV swing and gain the factory. And ideally, you don't need to Ottoman attack. So its really -50TUV for Austria for 30 TUV for Germany plus they gain the factory.

                              I think its pretty close with average rolls. I don't think its a terrible gamble on strafing.

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

                              Q 1 Reply Last reply Reply Quote 1
                              • Q Offline
                                Quorthon4 @redrum
                                last edited by Quorthon4

                                @redrum fair enough, there's also strafing attacks against same area round 8

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

                                  @Quorthon4 Yeah, looks reasonable as again Austria gets poor luck though Germany is still able to at least take the factory.

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

                                  Q 1 Reply Last reply Reply Quote 0
                                  • Q Offline
                                    Quorthon4 @redrum
                                    last edited by

                                    @redrum assuming you value the factory that high, then yes. but I don't think it's worth ~ -27 TUV turn 5 or -60 TUV turn 8 to take the factory.

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

                                      @Quorthon4 Yeah, maybe the AI overvalues the factory a bit. Though the turn 8 would be -60 then +30 so only -30 total on average to take the factory.

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

                                      Q 1 Reply Last reply Reply Quote 0
                                      • Q Offline
                                        Quorthon4 @redrum
                                        last edited by

                                        @redrum yeah, sorry, it's like you said closer to -30. Then you probably should compare that to the other attacks that wasn't made that could have potentially had positive TUV.

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

                                          @Quorthon4 Yeah, these are both close calls on whether its worth it especially when you look at potentially what they could have gained otherwise. But I don't think either of them is terrible either. There is a pretty significant amount of randomness as well in the AI where they might choose other options if you replay the same game on those turns.

                                          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
                                          • L Offline
                                            luhhlz @redrum
                                            last edited by

                                            @redrum Thanks for the response, I overwrite save games as I play them, but I'll start trying to keep track of examples.

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