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

    Rules interpretation for placement Human vs AI

    Scheduled Pinned Locked Moved Map Making
    26 Posts 7 Posters 1.8k Views 6 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 Online
      beelee @wc_sumpton
      last edited by

      @wc_sumpton said:

      So, the AI can purchase to place factories, but can still lose them because it can always try to purchase for captured territories even if they can't be placed there.

      Not sure what all this means. Does new code need to be written for the AI not to do this ? Or does a new map property need to be added to the xml so one can turn it off depending on what game they're playing ?

      I'm not real clear on all the different rulesets, as it's been so long since I've played anything other than G 40.

      Anyway, I won't be of any help here but Good Luck for getting it corrected 🙂 I will ping @panther for you, as he is a rules heavyweight.

      PantherP 1 Reply Last reply Reply Quote 1
      • VictoryFirstV Offline
        VictoryFirst
        last edited by VictoryFirst

        @beelee

        To sum up what WC is pointing out here - basically the AI is stupid here in that it tries to purchase units for territories it can't place in. And it is also unable to place unplaced factories because it tries to place them in territories with factories.

        This needs to be fixed on the engine level. Two fixes are needed:

        1. When making purchases, the AI simulates it turn first and then uses that information to make its purchase. However, it then correctly needs to identify that it cannot place in conquered territories because right now it thinks it can.

        2. When the AI tries to place unplaced factories, it needs to use a different set of territories than those for regular units.

        TheDogT 1 Reply Last reply Reply Quote 1
        • TheDogT Offline
          TheDog @VictoryFirst
          last edited by TheDog

          Is this what should happen?
          Components of this problem

          rulesAttachment has placementCapturedTerritory" value="true"
          This allows for the placement of units in the same turn as they were captured.

          Order of delegates in xml speak
          A&A style Purchase before Combat
          Purchase> Combat move>Combat> Non-Combar move> Place> End Turn
          or
          New style Purchase after Combat
          Combat move>Combat> Non-Combat move> Purchase> Place> End Turn

          For Purchase before Combat
          The AI tries to purchase what it thinks it needs based on its current TT and then Places them.
          If PlacementCapturedTerritory=true then it should re-evaluate its Purchases/Place based on its new TT gains, yes? (As the gains might be better, closer to the enemy etc)

          Purchase after Combat
          If PlacementCapturedTerritory=true or false
          The logic is simpler, the AI purchases what it can place, yes?

          In the above mix, if the AI have been given units/factories from isAI/xml it should test for these first and not Purchase them,

          Is the above what should happen?

          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
          • PantherP Offline
            Panther Admin Moderators Lobby Moderators @beelee
            last edited by

            @beelee said:

            I will ping @panther for you, as he is a rules heavyweight.

            I am happy to assist in case anything rules-related might be unclear.

            Don't always trust TripleA when it comes to rules questions. Know the rules before you start â€Ķ and better check what TripleA has done.

            wc_sumptonW 1 Reply Last reply Reply Quote 3
            • wc_sumptonW Online
              wc_sumpton @Panther
              last edited by

              @Panther

              Why are unplaced construction units being placed only into production territories or adjacent sea zones owned since the start of turn?
              Why when using rule "placementCapturedTerritory" are unplaced units still limited to production territories and their adjacent sea zones owned since the start of turn?
              Why when using rule "placementAnyTerritory" are unplaced units now allowed to be placed in captured territories. This is also including those sea zones adjacent to captured production territories?
              Why when using rule "placementAnySeaZone" along with "placementAnyTerritory" are sea unis still restricted to sea zones adjacent to production territories? And why is this still also including sea zones adjacent to captured production territories?
              Why are the rules so different for the AI to place unplaced units?

              Cheers...

              PantherP 1 Reply Last reply Reply Quote 1
              • PantherP Offline
                Panther Admin Moderators Lobby Moderators @wc_sumpton
                last edited by Panther

                @wc_sumpton

                Lol, I should have specified that when I talk about the rules I exclusively mean the v1-v6 rulesets.

                I can't know what the intentions or intended specific game-(house-) rules behind those "placementWhatever" rules might be, as these are usually used to override those core game-rules, as it seems.

                Don't always trust TripleA when it comes to rules questions. Know the rules before you start â€Ķ and better check what TripleA has done.

                wc_sumptonW 1 Reply Last reply Reply Quote 2
                • wc_sumptonW Online
                  wc_sumpton @Panther
                  last edited by

                  @Panther

                  So in the PoS2 it states:
                  isConstruction values: allows the unit to be placed in territories that don't contain factories.

                  But because this is not a rule, requiring the AI to place isConstruction units in territories with factories is not a bug.

                  There you have it @thedog. You can only give Human players factories with triggers but you can't give them to AI players.

                  Cheers...

                  TheDogT 1 Reply Last reply Reply Quote 2
                  • TheDogT Offline
                    TheDog @wc_sumpton
                    last edited by

                    @wc_sumpton said:

                    You can only give Human players factories with triggers but you can't give them to AI players.

                    Yes, its wrong, TripleA should allow the AI to place Factories, because the Player can.

                    @wc_sumpton
                    Is this a question because the Devs want confirmation that, the AI should be allowed to place Factories like a human player?

                    https://forums.triplea-game.org/tags/thedog
                    https://forums.triplea-game.org/topic/3741/curated-best-top-maps-triplea-guides

                    wc_sumptonW 1 Reply Last reply Reply Quote 1
                    • wc_sumptonW Online
                      wc_sumpton @TheDog
                      last edited by

                      @TheDog

                      Let me see if I can explain things better. For reference I'll be looking at the "Axis & Allies Anniversary Edition" rule book. Page 10

                      *The U.S. player places the new Chinese units at the same time that the new U.S. units are placed. They may be placed on
                      any Chinese-controlled territories, however those units cannot be placed on any territory that already contains three or
                      more units. *

                      To be rule complaint "World War II v3 1941" has:

                      <attachment name="rulesAttachment" attachTo="Chinese" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player">
                         <option name="movementRestrictionTerritories" value="Chinghai:Ningxia:Sikang:Yunnan:Hupeh:Fukien:Suiyuan:Manchuria:Kiangsu:Kwangtung"/>
                         <option name="movementRestrictionType" value="allowed"/>
                         <option name="productionPerXTerritories" value="2"/>
                         <option name="placementAnyTerritory" value="true"/>
                         <option name="placementCapturedTerritory" value="true"/>
                         <option name="placementPerTerritory" value="3"/>
                      </attachment>
                      

                      "placementAnyTerritory" allows a player to place any non-isSea unit into any land territory that was owned at the start of the players turn (Human player only not AI players). can you place in any LAND territory you owned at the beginning of the turn? (Does not include newly captured territories for Human players only.)
                      "placementCapturedTerritory" allows a Human player only, not used by the AI player to place these units because "placementAnyTerritory" assumes placement into newly captured territories as a default, to place units into newly captured territories, but still follows production rules. can you place in territory you captured this turn?
                      Even though these are handled/enforced differently they are both considered rule complaint and so it will not be changed.
                      And don't get started on "placementAnySeaZone" (For Human player only) can you place in any SEA territory beside a LAND territory you owned at the beginning of the turn? But because there is no rule for placement of sea units without production, the AI will not be changed this.
                      One would think that the same rules would apply to the placement of a purchased factory would apply to the placement of a given factory. They do not. And because there are no rules that govern the placement of a given factory do not expect this to change ant time soon.

                      Cheers...

                      1 Reply Last reply Reply Quote 2
                      • wc_sumptonW Online
                        wc_sumpton
                        last edited by wc_sumpton

                        @thedog

                        I am very sorry for my above post. I do think that you have a legitimate bug/issue. I have found the cause to your problem (review issues #14447 and #14457). While investigating this issue I uncovered other problems with how the AI handles the placement of units. To me these fixes seemed simple, so I submit a PR to make those changes. A test was created to check the output of the file I wanted to change.
                        The file passed all the tests. I took issue with the test file because it failed to test the broken functionality of file. Some changes were made to the test but none of the testing covered any of the issues which I raised. So again, I took issue with the test.
                        Now I'm being told to find the rules.
                        When a Human places an isConstruction unit, either given or purchased, there are certain rules the player follows. These are the same rules the AI player follows when placing a purchased isConstruction unit. But the rules change for the AI player when placing a given isConstruction unit. Why? So now I have to find a rule that governs the placement of a given unit because it's not the same as placing a purchased one.
                        A human player as to follow certain guidelines with respect to the use of "placementAnyTerritory", "placementAnySeaZone" or "placementCapturedTerritory" but the AI does not have to follow the same guidelines unless there is a rule?

                        Why are there different sets of rules for placement given that a player is Human vs AI?

                        Again, sorry for the rant. The fixes are easy. But without a rule they will not be made.

                        Cheers...

                        TheDogT 1 Reply Last reply Reply Quote 3
                        • TheDogT Offline
                          TheDog @wc_sumpton
                          last edited by

                          @wc_sumpton
                          Your post above lists 3 functions that the AI cannot do that a Player can, I would like to add a 4th.

                          Give the AI a Factory it will not Place it (it will place units). It will only Place a Factory that it has decided it needs, even though it might have a lot them to place.

                          Give a Human the Factory, they would place it if they thought it safe to do so.

                          The AI does not appear to check how many Factories it has already and still buys what it thinks it needs and in turn Places it and no others.

                          @wc_sumpton
                          Summarising the Chinese rules, they do appear to work for a human, I have tried them once for human play, but your saying for the AI they dont?

                          Is one of the problems placementAnyTerritory only applies to land TTs?

                          @panther
                          In World War II v3 1941 A&A game PvP, Lets look at an unlikely scenario.
                          Japan build a Factory in Manchuria, 3PU
                          Next Turn, China captures Manchuria
                          ..In that same turn, how many units can China, place in Manchuria?
                          ..Is it 2 or 3 ?
                          ..Also, in 62 Sea Zone can China Place any ships in this same captured turn?

                          Note: The above is for the boardgame.

                          @Anyone what does the TripleA game do?

                          https://forums.triplea-game.org/tags/thedog
                          https://forums.triplea-game.org/topic/3741/curated-best-top-maps-triplea-guides

                          B PantherP wc_sumptonW RogerCooperR 4 Replies Last reply Reply Quote 2
                          • B Online
                            beelee @TheDog
                            last edited by

                            @TheDog

                            Hi Dog

                            Long time since I played Anniversarry. I think China can only have 3 dudes in a TTy max. Not sure but I think the Fctry gets destroyed the way it would in G 40 as china can't use it.

                            Screenshot from 2026-06-11 02-28-55.png

                            TheDogT 1 Reply Last reply Reply Quote 2
                            • TheDogT Offline
                              TheDog @beelee
                              last edited by

                              @beelee
                              Thanks, you could be right.

                              If this is the correct WW2v3-1941balmod.xml

                              Then it is badly written there is only one generic/shared productionFrontier so China can buy a Factory, even though the A&A rules might say otherwise.

                              To quote Panther
                              Don't always trust TripleA when it comes to rules questions. Know the rules before you start â€Ķ and better check what TripleA has done.

                              Also it might explain wc_sumpton frustration as the China xml code is mimicking A&A rules only and is not intended for generic use.

                              This is all supposition , as I dont play A&A boardgames or know the rules.

                              https://forums.triplea-game.org/tags/thedog
                              https://forums.triplea-game.org/topic/3741/curated-best-top-maps-triplea-guides

                              B 1 Reply Last reply Reply Quote 2
                              • B Online
                                beelee @TheDog
                                last edited by

                                @TheDog

                                yea Idk. The balance mod is different from the OOB map. The triplea version of AA50 aka WWII v3 1941 is pretty accurate. A few things are off rules wise but it's one of the more successful triplea maps. BlackElk drawn 🙂

                                There's multiple A&A versions with different rulesets.
                                I think triplea trys to incorporate all of them but the original game the engine was designed around is different from the latest ones.

                                Why there's been so many additions. Add in multiple developers over 20 years and you get what we have now 🙂

                                At least people trying to make it better 🙂

                                TheDogT 1 Reply Last reply Reply Quote 2
                                • TheDogT Offline
                                  TheDog @beelee
                                  last edited by

                                  @beelee
                                  For reference WW2v3-1941.xml (if thats what we should be talking about) still only has one generic/shared productionFrontier so China can buy a Factory. 🙂

                                  https://forums.triplea-game.org/tags/thedog
                                  https://forums.triplea-game.org/topic/3741/curated-best-top-maps-triplea-guides

                                  B 1 Reply Last reply Reply Quote 2
                                  • B Online
                                    beelee @TheDog
                                    last edited by beelee

                                    @TheDog

                                    well actually they can't 🙂

                                    Edit
                                    At least I can't get them too 🙂

                                    WWII v3 1941 China can't Buy Fctry.tsvg

                                    1 Reply Last reply Reply Quote 3
                                    • PantherP Offline
                                      Panther Admin Moderators Lobby Moderators @TheDog
                                      last edited by Panther

                                      @panther
                                      In World War II v3 1941 A&A game PvP, Lets look at an unlikely scenario.
                                      Japan build a Factory in Manchuria, 3PU
                                      Next Turn, China captures Manchuria

                                      ..In that same turn, how many units can China, place in Manchuria?
                                      ..Is it 2 or 3 ?

                                      During the Purchase Units Phase of USA China gets one new Chinese infantry unit for every two Chinese territories that are not under Axis control (rounded down) at that time. These units will be placed during the Unit Placement Phase of USA. New units may only be placed on Chinese-controlled territories (including those captured in the current turn) that already contain less than three Chinese units (including the Flying Tigers fighter, see below). Any number of new units may be placed in such a territory, regardless of the number already there.

                                      So in your case China can place a maximum of three units there, provided it was able to generate as much before.

                                      ..Also, in 62 Sea Zone can China Place any ships in this same captured turn?

                                      China cannot use any factory. It only can generate infantry as described above. So China can't produce a ship and place it.

                                      Different from Global 1940 the factory (built by Japan) is not destroyed when China liberates that territory. It stays on the board but cannot be used by China.

                                      TripleA handles all of this correctly (IIRC).

                                      Don't always trust TripleA when it comes to rules questions. Know the rules before you start â€Ķ and better check what TripleA has done.

                                      TheDogT 1 Reply Last reply Reply Quote 4
                                      • TheDogT Offline
                                        TheDog @Panther
                                        last edited by

                                        @Panther @beelee
                                        Thanks!

                                        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 2
                                        • wc_sumptonW Online
                                          wc_sumpton @TheDog
                                          last edited by

                                          @TheDog said:

                                          Give the AI a Factory it will not Place it (it will place units). It will only Place a Factory that it has decided it needs, even though it might have a lot them to place.

                                          The AI uses the same rules for placing a purchased unit/factory that a Human player does. The rules only change when the AI attempts to place non-purchased/held/given units/factories.

                                          For S&G add the following to GCD:

                                          <!-- Player Rules -->
                                          <attachment foreach="$All-Players$" name="rulesAttachment" attachTo="@All-Players@" javaClass="RulesAttachment" type="player">
                                             <option name="placementAnyTerritory" value="true"/>
                                          </attachment>
                                          

                                          Let the AI play a few rounds, more than 2. Save the game and then reload with Human players and inspect the history. Check purchase with placement.
                                          The AI is now placing the factories!
                                          Most of the units have "requiresUnits". Even with "placementAnyTerritory", "requiresUnits" still has to be fulfilled to place units.
                                          Using "placementAnyTerritory" allows the AI player, not a Human player, to place units into newly captured territories. There are also some side effects to how the AI purchases units, it may in fact stop purchasing altogether.

                                          Cheers...

                                          TheDogT 1 Reply Last reply Reply Quote 3
                                          • TheDogT Offline
                                            TheDog @wc_sumpton
                                            last edited by

                                            @wc_sumpton
                                            To the genius that is wc_sumpton, Thank you, Thank you!
                                            Im almost excited by this revelation 🙄

                                            That "placementAnyTerritory" value="true"
                                            Should work the way it does, now the AI armed with this, will be a much tougher opponent. muhahah ðŸĪŠ

                                            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

                                            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
                                            • 1 / 2
                                            • First post
                                              Last post
                                            Powered by NodeBB Forums