Navigation

    TripleA Logo

    TripleA Forum

    • Register
    • Login
    • Search
    • TripleA Website
    • Categories
    • Recent
    • Popular
    • Users
    • Groups
    • Tags

    Lets help the AI purchase the unpurchaseable

    AI
    5
    15
    1370
    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.
    • TheDog
      TheDog last edited by TheDog

      I would like to collect in one place all the things the AI does not purchase or purchases badly.

      For me the AI will not Purchase the following;

      Unit---------- Atk-Def-Move  Notes
      Fort------------0---0-----0---isInfrastructure, isConstruction
      Castle----------0---0-----0---as an upgrade to a Fort
      Cruise Missile--0---0-----7---isStrategicBomber,  isFirstStrike,  isSuicide,   isKamikaze

      Please list all your AI purchase issues, even ones previously posted by others, then we can all see if it's a common or rare problem, then I will attempt to identify possible solutions to help the Devs.

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

        Possible Solution for 0 move units

        In ProPurchaseOption.java line 259+

        private double calculateLandDistanceFactor(final int enemyDistance) {
            if (movement <= 0) {
              return 0.1; // Set 0 move units to an order of magnitude less than 1 move units

        I think this calculation is forcing movement 0 units to have a value of 0.1 and I think this needs to be increased, but to what value?

        This value could be included in the new AI properties file, something like this;
        AI.PurchaseOption.ZeroMovement=0.5
        .
        .
        Possible Solution for over buying Air units on a bid or turn 1 when the AI has a lot of money and also during the game

        Either code to ignore for turn 1 or less and/or change the value 10 below to a smaller value.

        In ProPurchaseAi.java line 2154+
        if (ppo.isAir()) {
        attackEfficiency *= 10;
        }

        In ProPurchaseAi.java line 2323+
        if (ppo.isAir()) {
        efficiency *= 10;
        }

        This value could be included in the new AI properties file, something like this;
        AI.PurchaseAi.AirEfficiency=8
        .

        redrum 1 Reply Last reply Reply Quote 1
        • redrum
          redrum Admin @TheDog last edited by

          @TheDog This is done on purpose. A significant amount of either logic to value 0 move units better or a map specific AI property would need to be added. Otherwise you risk the AI buying lots of 0 move units and not understanding that they can't move anywhere.

          1 Reply Last reply Reply Quote 0
          • RogerCooper
            RogerCooper last edited by

            A common problem is buying too many air units if the AI has a large amount of money, which can happen with a starting bid. This happens in all scenarios.

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

              @RogerCooper I dont play much WWII, but I am working on an Ultra modern/SciFi map and noticed the same, that the AI buys 3 Stealth Bombers and I thought why, when it needs ground units, but as you said the AI has a lot of money.

              A possible solution has been added to post 2.

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

                @TheDog I don't think that proposed fix is sufficient. The problem is not only a bid problem, it can also happen during the game if the AI has relatively few factories. The AI does not really deal with the concept that enough is enough.

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

                  @RogerCooper You could be correct.

                  There are two parts to the proposed fix.

                  1. The bid/turn one purchases, hopefully that's now covered.
                  2. The x 10 variable, makes the probability of buying aircraft probably too high and this value should be reduced, but to what ? Hopefully having it as a mapmakers/tinkers AI property we can find out.

                  As an example, having this value as an AI variable for WWI this can set as 2 and for WWII 5, for modern warfare 8, the higher the number the more aircraft are favoured.

                  redrum 1 Reply Last reply Reply Quote 0
                  • redrum
                    redrum Admin @TheDog last edited by

                    @TheDog if you decrease that air variable then the ai is probably gonna buy even less air units then it does today which is probably gonna make it worse in most situations.

                    1 Reply Last reply Reply Quote 0
                    • F
                      ff03k64 last edited by

                      AI has issues buying other resources. Frostion's warcraft map lets you buy wood, food, etc. and the AI won't.

                      AI doesn't factor units with createsunitlist into purchases.

                      AI either doesn't make purchases of units that consume other units, or does it poorly. I can't remember which.

                      1 Reply Last reply Reply Quote 0
                      • RogerCooper
                        RogerCooper last edited by

                        It is hard to see how the AI can deal with buying resources without some specific guidance. Perhaps a supplementary AI plan file that can be read by the AI. An AI plan file could contain a series of conditions and actions that the AI would execute before doing its regular buys.

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

                          The AI would need to know the value/ratio of a resource, compared to 1 PU.
                          Resource1,fuel,0.5
                          Resource2,iron,1.25
                          Resource3,wood,2
                          etc

                          But the more resources the harder it will be for the AI to work out what is the best value per resource combo. The more resources the longer time it will take to come to a conclusion.

                          I dont think there is a quick fix for this one.

                          redrum 1 Reply Last reply Reply Quote 0
                          • redrum
                            redrum Admin @TheDog last edited by

                            @TheDog This is the design that I came up with to add valuation for non-PU resources for the AI: https://forums.triplea-game.org/topic/105/ai-development-discussion-and-feedback/192

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

                              @redrum Wow already have a design that looks like it should work, when can you start work. 😛

                              Seriously though, are you back as an observer or as a Dev?

                              Either way good to have you back!

                              Some questions
                              Would you limit the number of non-PU resources? If so, to how many? Frostions Warcraft map has 6.
                              Could it be done in two phases, the 'supply' side and then the 'demand' side or would it be better to do as one phase?
                              Would this AI project conflict with what Trevan is currently doing?

                              redrum T 2 Replies Last reply Reply Quote 0
                              • redrum
                                redrum Admin @TheDog last edited by

                                @TheDog Just a player and observer at the moment.

                                • Shouldn't need to be any limit as it would just make each resource's value "relative" to PUs
                                • Yes, it could be implemented in phases
                                • No idea as I'm not sure exactly what Trevan is planning to do
                                1 Reply Last reply Reply Quote 0
                                • T
                                  Trevan @TheDog last edited by

                                  @TheDog said in Lets help the AI purchase the unpurchaseable:

                                  Would this AI project conflict with what Trevan is currently doing?

                                  No. My AI is completely different from @redrum's. So changes to his ai wouldn't affect mine.

                                  1 Reply Last reply Reply Quote 0
                                  • 1 / 1
                                  • First post
                                    Last post
                                  Copyright © 2016-2018 TripleA-Devs | Powered by NodeBB Forums