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

    AI Territory valuation visibility?

    Scheduled Pinned Locked Moved AI
    19 Posts 7 Posters 5.6k 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.
    • T Offline
      Trevan @TheDog
      last edited by

      @TheDog said in AI Territory valuation visibility?:

      Yes please display the weighting, but I think they are already displayed, but in a hard to understand format, does the bigger the number mean more attention/weight is required?

      Where are the weights displayed?

      @beelee said in AI Territory valuation visibility?:

      @Trevan isn't this how it's kinda setup right now ?

      My first comment is basically the current setup. But I'm not aware of seeing the weights in the UI so my proposal was to make them visible.

      My second comment (Collaborative Diffusion) isn't what the current engine uses. The current engine is closer to an A* pathfinder.

      B 1 Reply Last reply Reply Quote 0
      • B Offline
        beelee @Trevan
        last edited by

        @Trevan so would this be map specific then ? One could tell the AI to defend this territory more than that one. Have it target these units more than others type thing ?

        Or it would be the current one size fits all and you have to figure out how to make your map so it will react the way you want it ?

        Either way, any improvement, even if just more information on the current process, would be a plus I would think.

        T 1 Reply Last reply Reply Quote 0
        • T Offline
          Trevan @beelee
          last edited by

          @beelee The initial idea for making the valuation visible wouldn't really change the AI that much. It would just make it "easier" for players to figure out what it is thinking.

          The idea for the diffusion could be map specific. The map maker could mark certain territories with a high value. But I would hope the diffusion to be able to find most of "good" territories automatically.

          1 Reply Last reply Reply Quote 1
          • TheDogT Online
            TheDog
            last edited by TheDog

            @Trevan In the AI logs search for this heading

            Prioritizing territories to try to defend

            The AI log then lists the territories in the format below.

            Removing territory=Semigallia, value=52.85, CanHold=true, isLandAndCanOnlyBeAttackedByAir=false, isNotFactoryAndShouldHold=false, canAlreadyBeHeld=true, isNotFactoryAndHasNoEnemyNeighbors=false, isNotFactoryAndOnlyAmphib=false, tuvSwing=-1.0, hasRemainingLandUnit=false, maxEnemyUnits=0

            Above the value=52.85 I think is what you are after, this appears to be the weighting of the territory.

            It would be good to rename the "value=" above to TerritoryWeight= or similar.

            If you then search for that value in the AI logs you will find it is reused many times.

            Also I think the above value is what I was talking about here;
            https://forums.triplea-game.org/topic/2489/ai-and-over-stacking-of-defensive-units-on-capitals

            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 1
            • TheDogT Online
              TheDog
              last edited by

              @Trevan
              below is a link to one of my Settler maps, it has been customised for you,  I'm hoping it will give you a test AI map for over the winter break and will do the following things;

              • More often than not it will have a stack of units piled up in a factory/town/city territory, usually in/near Russia.
              • Gives economic victory in about 10 minutes
              • Plays 2v2 on Hard AI
              • Not World War 2
              • Of note, there is no victoryCity as it is a random start map.

              https://drive.google.com/drive/folders/18pc1M1-oqyHGgbmYU6R6F0MkLAaAmpXi?usp=sharing

              Open folder "For Trevan only
              Download it
              Select Settlers: Trevan Age of Tribes
              Load it and press Play

              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 0
              • TheDogT Online
                TheDog
                last edited by

                You are probably doing this anyway but just in case, is it worth coding your calculations as positive integers?
                Then we humans can easily read the values, as floating point with leading zeros is harder.
                The AI will probably execute faster with whole numbers.

                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 0
                • T Offline
                  Trevan
                  last edited by

                  Yeah, I'll be using longs as much as possible. I'd actually like to be able to show the valuation on the map itself, using something like a heatmap. I think that would be easier to understand vs having to look at a chart of numbers/territories.

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

                    Ambitious! I hope you can get it to work, you might have to put it on a white background as some maps are quite dark.

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

                      @Trevan Unless I'm misunderstanding you, the current Hard/Fast AI pretty much does exactly what you describe for determining territory value during non-combat move. It values things like factories/capitals/number of nearby territories and then diffuses this value to nearby territories so that units essentially move towards higher value territories. This could be improved to consider additional values like canals, objectives, etc.

                      https://github.com/triplea-game/triplea/blob/master/game-core/src/main/java/games/strategy/triplea/ai/pro/util/ProTerritoryValueUtils.java#L52

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

                      T 1 Reply Last reply Reply Quote 0
                      • T Offline
                        Trevan @redrum
                        last edited by

                        @redrum yes, the existing AI does calculate value and diffuse it. But it doesn't appear to do the entire map. It looks like it grabs a list of territories and then grabs neighbors of those territories and then calculates the values.

                        My idea is also to not do battle simulations but instead try and incorporate that in the diffusion. That is one of the big unknowns on what I'm trying.

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

                          @Trevan Not sure what you mean. If I recall it first finds all the "objective territories" which right now is capitals and factories then loops through all territories to find the distance each territory is from each objective and assigns value based on distance from each one. It also adds in some value based on territory production values that are nearby (within a few hexes).

                          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
                          • T Offline
                            Trevan
                            last edited by

                            Screen Shot 2020-12-17 at 9.07.58 PM.png

                            Here's an initial attempt to showing the values of the territories as a heatmap. This is World at War. It is from Russia's point of view. The bluer the territory is, the better it is. So most of the Russian territories are very red since the units shouldn't stay there.

                            M 1 Reply Last reply Reply Quote 1
                            • M Offline
                              Myrd @Trevan
                              last edited by

                              @trevan I'm curious whether the code for the above coloring was ever landed and if so, how to enable it?

                              LaFayetteL 1 Reply Last reply Reply Quote 0
                              • LaFayetteL Online
                                LaFayette Admin @Myrd
                                last edited by

                                @myrd I think it did and is part of the 'flow' AI. I don't recall if we've removed the flow AI at this point or not. So it may still be there. It would have been part of the AI debug menu to turn it on, check engine settings for "enable beta features". You'll also need to download the latest 2.6 engine as well, I'm pretty sure this was all well after the 2.5 release.

                                M 1 Reply Last reply Reply Quote 0
                                • M Offline
                                  Myrd @LaFayette
                                  last edited by

                                  @lafayette Ah, I see it. I guess I was expecting to be available for the Hard AI, since the Flow AI doesn't do anything on some maps.

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