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

    AI never buys resources?

    Scheduled Pinned Locked Moved Maps & Mods
    12 Posts 4 Posters 3.0k Views 4 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.
    • B Offline
      beelee @ComR
      last edited by

      @comr HiComR You could try asking @redrum . He codes the AI. You could also ask @Frostion I think this is his map. I don't quit remember though

      C 1 Reply Last reply Reply Quote 0
      • C Offline
        ComR @beelee
        last edited by

        @beelee Hi,

        Thank you for the tips. I prefer not to PM anyone, but I wrote also on AI thread. I will take a look at source code, maybe I could be useful one day?

        ComR

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

          @comr heh heh always can use a coder The @ thingy will notify them and they'll probably reply sooner or later. Probably sooner : )

          C 1 Reply Last reply Reply Quote 0
          • C Offline
            ComR @beelee
            last edited by

            @beelee Oh, ok, thank you. Stupid me! :)))) Now I understand... 😉

            1 Reply Last reply Reply Quote 0
            • FrostionF Offline
              Frostion Admin
              last edited by Frostion

              Yes, right now the AI cant/won't buy resources. Hopefully this will be possible in the future.

              A trick I think might work (if you want AI to buy resources now) is to make some resource-generating land units that must be purchased with PUs/Gold and placed by a factory. Example; a land unit called "Wood" that is purchased and placed at a town, and by/before player end turn it generates 10 Wood for the player. After the same player end turn, all of the same player's Wood/Food/Metal land units are removed from the map.

              The technology development in Age of Tribes works like this.

              But we must note that the AI, if it purchases like this is doing it in a mindless manner. It is totally random and it has no intention of buying resources. On the positive side, if the AI has a ton of PUs that it can't use because of a lack of other purchase resources, then I guess any random purchase is better than AI having unspent resources in the bank.

              Map maker of: Star Wars: Galactic War + Star Wars: Tatooine War + Caribbean Trade War + Dragon War + Age of Tribes + Star Trek: Dilithium War + Iron War + Iron War: Europe + Warcraft: War Heroes

              C 1 Reply Last reply Reply Quote 1
              • C Offline
                ComR @Frostion
                last edited by

                @frostion Fantastic! Thank you... I will try the Age of Tribes.

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

                  Yeah, the AI will not currently buy resources as it doesn't understand the value of anything but PUs when purchasing. Only way to make the AI purchase something is have resource generating units that have low PU cost and high attack/defense/movement/hitpoints. You could then consider using triggers to remove the units or remove their combat stats. This is pretty much a hack though and at some point the AI purchase logic will be rewritten to better handle non-PU resources.

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

                  C 1 Reply Last reply Reply Quote 0
                  • C Offline
                    ComR @redrum
                    last edited by

                    @redrum Ok, so, I understand that people who originally wrote TripleA source code are not here anymore and we have no idea how to change engine without harming whole work of many others?

                    BTW. Thank you for the tip, I will try to use it! And yes, random buy would be better than holding all that money... But... I still have no idea how to force AI to buy random stuff or any - just because AI have too much money...

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

                      @comr Well the original developers have moved on but there are about 4 of us developers that are making changes to the engine. Here is a list of things that have been added/improved recently: https://forums.triplea-game.org/topic/182/guidelines-and-feature-request-list. You can also view all the changes in the github repo PRs/commits: https://github.com/triplea-game/triplea

                      The AI will always try to spend all of its PUs if there are available units to buy. If those units require other resources and it can't afford them then currently there isn't anything it can do. You'd need to provide some unit that it will buy that then generates other resources or is triggered for resources or provide some weaker PU-only units that the AI can spend extra PUs it has on.

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

                      C 1 Reply Last reply Reply Quote 0
                      • C Offline
                        ComR @redrum
                        last edited by

                        @redrum Thank you, I saw these, but it's looong list and it's new every few days for now - good, it seem alive! 😉 But, I missed a lot in the middle - this is my problem. Regarding AI, I have few simple ideas, I wrote it, but... deleted it all before posting, because I do not know how AI work exactly, so I would like to read source code (or pseudo code - if algorithms are written that way?). I have some simple ideas, but I'm not sure if it would be so simple to implement.

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

                          @comr Best thing is to play some of the new/complex maps and read the POS2 XML to understand what is available today: https://github.com/triplea-maps/the_pact_of_steel/blob/master/map/games/pact_of_steel_2.xml

                          The AI overview and backlog of improvements are here: https://forums.triplea-game.org/topic/105/ai-development-discussion-and-feedback. I wrote all of the Fast/Hard AI so know all of the algorithms/code for it. It was primarily written to play the standard A&A maps (classic, revised, v3, global, etc) so it performs reasonably well on maps that primarily use similar rules. But if you try to have the AI play Total World War or Civil War, it plays very poorly and doesn't understand many of the features used in those games. Suggestions and contributions are always welcome and you can find the AI code here: https://github.com/triplea-game/triplea/tree/master/game-core/src/main/java/games/strategy/triplea/ai

                          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 3

                          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