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
    10 Posts 6 Posters 62 Views 5 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.
    • wc_sumptonW Offline
      wc_sumpton
      last edited by wc_sumpton

      Hi all:

      First off I would like to thank @victoryfirst for his excellent map "Classic League". This is the mod I used here.
      I would also like to thank @thedog who as described a problem he has with "1941 Global Command Decision" for a long time.
      And also @frigoref who suggested I post here to get these rules clarified.
      I get things wrong, ask @beelee and @cernel, I get things wrong alot.
      Now for a little background.
      When the AI encounters a purchase step it simulates certain steps between the purchase and the place or and endStep. These steps include combat move, combat, non-combat move and politics. If any of these steps come before purchase or after a place or endStep are not simulated. Also steps like tech and user actions are not simulated. When the place step is encountered, the AI simulates a purchase to place phase. Purchasing one unit at a time by evaluating its needs, using the simulated information, the placing that unit in a territory that can produce that unit.
      This first figure shows a Human Germans player simulating an AI attack setup.
      Screenshot 2026-06-09 125704.png
      The Russian forces have been depleted to entice these attack movements by the AI. The Russians player purchased 1 transport that was placed in Karelia Sea Zone and 6 infantry in Russia. This will be the basic setup mostly used.
      The Germans AI will generally, in its simulated combat, take both Karelia S.S.R. and Caucasus. Because Karelia S.S.R. has a factory the Germans AI can use this territory for simulated purchase to place units. Units purchased this way but cannot be place fall to the unplaced unit's routine. Please note the bottom right of the above figure. The Germans have bought 9 infantry and 1 armour and these will all have been pre-placed in Germany. The factory, transport and 1 infantry are given to Germans via a trigger are considered unplaced units just like units bought in error as described above. Also, units given by purchaseNoPUs/"productionPerXTerritories" are considered unplaced units. A Human player will have no problems placing all 13 units. The AI will have no problems with the 10 purchase to place units as they all go to Germany as seen below in the non-highted units;
      Screenshot 2026-06-09 125203.png
      Unplaced units are broken down into 2 different categories, non-construction units and then the construction units. What must be understood here is that both groups follow the same rules for placement and since the production rule has not been changed all unplaced must be placed into territories with production or in a sea zone adjacent to a territory with production. As seen above the transport was placed in Central Mediterranean Sea Zone and an infantry in South Europe. The factory can only be placed in South Europe or Germany. Even though Karelia S.S.R. has a factory and can be used for purchasing units being conquered this turn means it cannot be considered for placement.
      That is the first rule that is different between the Human and AI player. A Human can place construction units in non-production territories. By rule the AI player cannot, all construction units must be placed into production territories.

      Cheers...

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

        Now for a change up. This setup is exactly the same as above, the only change is the following:

        <attachment foreach="$Players$" name="rulesAttachment" attachTo="@Players@" javaClass="RulesAttachment" type="player">
        	<option name="placementCapturedTerritory" value="true"/>  
        </attachment>
        

        This will allow the Human player to place units into Karelia S.S.R. as well as the Karelia Sea Zone. The factory can go into Caucasus, but non-construction units cannot.
        For the AI player this does nothing. The AI was already allowed to purchase to place in Karelia S.S.R. and these units can be placed there but by rule, unplaced units cannot, even with "placementCapturedTerritory" their placement looks the same as above. The factory unit is still not placed.
        If a bunker unit is created:

        <attachment name="unitAttachment" attachTo="bunker" javaClass="UnitAttachment" type="unitType">
        	<option name="attack" value="0"/>
        	<option name="defense" value="2"/>
        	<option name="hitPoints" value="2"/>
        	<option name="movement" value="0"/>
        	<option name="isConstruction" value="true"/>			<!-- place anywhere owned -->
        	<option name="constructionType" value="Bunker"/>
        	<option name="maxConstructionsPerTypePerTerr" value="2"/>
        	<option name="constructionsPerTerrPerTypePerTurn" value="2"/>
        	<option name="canOnlyBePlacedInTerritoryValuedAtX" value="1"/>
        	<option name="canBeDamaged" value="true"/>
        	<option name="canDieFromReachingMaxDamage" value="true"/>
        	<option name="maxDamage" value="2"/>
        </attachment>
        

        And 6 bunkers were given to Germans along with the factory, transport and infantry. The Human player can place all 6 bunkers. They could be placed 1 each in 6 different or stack 2 in 3 territories. The Human player has options the AI does not have. The AI can place 2 bunkers in South Europe and another 2 in Germany and that is all the bunkers it can place. This is by rule the AI player can only place in production territories it has owned since the start of their turn.

        Cheers...

        1 Reply Last reply Reply Quote 1
        • wc_sumptonW Offline
          wc_sumpton
          last edited by

          The next change is pictured below;
          Screenshot 2026-06-09 064442.png
          No factories at the start of the game but factories are still needed for production. So, this will change Russians purchases to a single factory and it is placed in Russia.
          The AI German player may purchase 1 or 2 factories. It is still being given a factory, transport and infantry, all of which cannot be placed this turn.
          Prior to running tests this morning, I upgraded to version 2.7.15616. When running test on an older version, the AI German player favored Germany then East Europe, Karelia S.S.R. or South Europe. Now East Europe is highly favored followed by Karelia S.S.R. or South Europe. I have not seen a purchase for place factory for Germany with this new version. I have not dug too deep into the purchasing routine as I'm just trying to figure out the rules for placement. At first, I thought the rules would be similar for the placement of units given to a player whether AI or Human controlled. The placement of these types of units have completely different rules depending on the type of player.
          If "placementCapturedTerritory" is still active and the AI purchased to place in Karelia S.S.R. or Caucasus, then that unit is placed. If not active, then those factories purchased for those locations will become held unplaceable units. Held unplaceable unit are either destroyed at the end of placement or saved over until the next turn determined by how "Unplaced units live when not placed".
          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.

          Cheers...

          ubernautU B 2 Replies Last reply Reply Quote 2
          • ubernautU Offline
            ubernaut Lobby Moderators @wc_sumpton
            last edited by

            @wc_sumpton dstfp.gif

            "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
            • B Offline
              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 0
                  • 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 0
                    • wc_sumptonW Offline
                      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 0
                      • 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.

                        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
                        Powered by NodeBB Forums