Navigation

    TripleA Logo

    TripleA Forum

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

    maxBuiltPerPlayer error resets Purchase UI (was How to limit the number of units purchased)

    Feature Requests & Ideas
    4
    13
    1130
    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
      butterw last edited by butterw

      I am looking for a solution to limit the number of units which can be purchased.

      Ex: Japanese player can only build a maximum of 1 carrier per turn and has a piece limit of 6 armor.
      https://axisandallies.fandom.com/wiki/Piece_Limits

      1. Is there a way to display the summary of a players unit count per unit type ?

      2. The maxBuiltPerPlayer unitType option can be used to implement piece limits:

      • However unlike when you don't have enough PUs, maxBuiltPerPlayer isn't directly applied to the purchase interface. You only get an error message (informing about the current limit) after the purchasing is complete, and the purchase interface is then reset to 0, which isn't user friendly.
      • I suppose it would be possible to implement this with a system of unit tokens (as a ressource) but it would be rather complicated
      <attachment name="unitAttachment" attachTo="artillery" javaClass="games.strategy.triplea.attachments.UnitAttachment" type="unitType">
                  <option name="maxBuiltPerPlayer" value="15"/>
                  <option name="placementLimit" value="owned" count="10"/>
      </attachment> 
      
      1. Would it be possible to implement a maxBuiltPerPlayerPerTurn unitType option which could be applied to the Purchasing interface ?

      2. A placementLimit can be used to avoid huge stacks, but it doesn't prevent from purchasing the units (you just can't place them).

      TheDog RogerCooper B 3 Replies Last reply Reply Quote 2
      • TheDog
        TheDog @butterw last edited by

        @butterw

        #4. For avoiding huge stacks Im a big fan of upkeep/maintenance using

        		<option name="createsResourcesList" value="-1:PUs"/>
        

        for each unit.

        TorpedoA 1 Reply Last reply Reply Quote 2
        • TorpedoA
          TorpedoA @TheDog last edited by

          @thedog Not only to avoid huge stacks. The whole game is much more open. In the sense that if you loose a big army, you free up alot of PUs per turn.
          Because without upkeep, one big battle loss or win, is too cruicial. I had alot of those situations in the far past, where i did still play without upkeep vs AI on NWO maps, and if you loose that one battle where the most hp/units clashed, if i then lost this, i just started a new game. There was often no chance coming back.
          With upkeep now, i have no huge stacks and every battle is just a battle and not the war that you can loose.
          Furthermore, the gap between cost per hp is much more dimished, the longer the game goes.

          Never again without upkeep.

          1 Reply Last reply Reply Quote 2
          • RogerCooper
            RogerCooper @butterw last edited by

            @butterw You could create a specialized factory type, with a capacity of 1 that can only build carriers and don't let regular factories build carriers.

            B 1 Reply Last reply Reply Quote 1
            • B
              butterw @RogerCooper last edited by butterw

              @rogercooper
              Sounds correct: a custom Factory can be used.
              The extra complexity is maybe not warranted in this example, given the high cost of purchasing an aircraft carrier.

              My main issue is that maxBuiltPerPlayer piece limits aren't applied in the Purchase interface (the purchase is reset if you have gone beyond the limit) and there doesn't seem to be any way to get info on the current number of pieces used.
              By contrast, when you buy more units than you can place you get the following warning after the purchase (the purchase info is not reset):

              End Purchase:
              You have purchased 13 units, and can only place 8 of them. Continue with Purchase ?
              
              RogerCooper 1 Reply Last reply Reply Quote 3
              • RogerCooper
                RogerCooper @butterw last edited by

                @butterw I agree that a better interface would be good, but build limits work and are even supported by the AI. The original 1981 edition of A&A limited players to the counter mix.

                1 Reply Last reply Reply Quote 1
                • B
                  butterw @butterw last edited by

                  @butterw said in How to limit the number of units purchased in a turn ?:

                  1. Is there a way to display the summary of a players unit count per unit type ?

                  Per player Unit type count history is available in the export game stats csv file. This info doesn't seem to be available anywhere else.

                  1 Reply Last reply Reply Quote 0
                  • B
                    butterw last edited by butterw

                    A fix to the User Interface for purchases with maxBuiltPerPlayer limits is needed

                    Issue:

                    • Attempting to buy above the maxBuiltPerPlayer piece-limits, results in an error and a complete reset of the planned purchases: you have to start over which is very frustrating.
                    • This is made worse by the fact that the current number of piece is not known beforehand by the player (the only way to know is by getting the error).
                    • At the end of the game it is expected multiple limits (ex: infantry because it is cheapest unit, armour because the japanese piece limit is low, fighters) will be hit every turn. This will result in a purchase reset for each limit.
                    • Currently the player has to test each limit, get errors and remember the values to know what he can actually purchase for the turn.

                    Current Code:
                    PurchaseDelegate.java "May only build "

                    ui/PurchasePanel.java

                    Suggested Fix:

                    • Planned purchase should not be completely reset if a limit is hit.
                    • The error message should provide status on all the player's maxBuiltPerPlayer limits.
                    • Instead of a final error it should be a warning tested each time the Purchase interface is validated with Done (like when you attempt to purchase beyond production capacity).

                    **EDIT: ** As suggested by @TheDog displaying the max which can be purchased for each unit type in the purchase interface might be an easier/better fix
                    ex: Infantry (7)

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

                      @butterw
                      Another suggestion, show how many can be bought, as in the image below;

                      8542b084-51a9-45fc-a0d1-f886ca186d71-image.png

                      So a maximum of 2 Wizards and 3 Sorcerers can be can be purchased, the rest are unlimited, to the PU available.
                      If the red numbers were 0 then, 0 can be purchased.

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

                        @thedog Why not show the total number of pieces you already have of each type regardless of the maxBuilt property? That can be useful for planning purposes.

                        B 1 Reply Last reply Reply Quote 1
                        • B
                          butterw @RogerCooper last edited by

                          https://github.com/triplea-game/triplea/issues/9231

                          Using the max button would be the best way to prevent going above maxBuiltPerPlayer-currentlyBuilt.
                          To display the players currentlyBuilt units the produce tooltip or an extra value could be could be added to the unit name or info label.

                          TheDog-GH created this issue in triplea-game/triplea

                          closed Feature Request: to help players on the purchase screen with maxBuiltPerPlayer errors #9231

                          B 1 Reply Last reply Reply Quote 2
                          • B
                            butterw @butterw last edited by butterw

                            The unit count gets redone everytime the production panel is opened (in fact it gets redone twice, probably because of the tabs), but otherwise my mod seems to be working ok.

                            I'm struggling to find a word to describe the maxBuiltPerPlayer-unitCount value in the UI.
                            I've used "Left" or "Available", but maybe "to piece-Limit" or just "limit" would be preferable (producing beyond the piece-limit isn't allowed) ?

                            EDIT:
                            I would also like to feature the Production Capacity (ex: 13 units), I've modified the bottom label to display:
                            0/13 total units purchased.

                            1 Reply Last reply Reply Quote 0
                            • B
                              butterw last edited by butterw

                              The improved Production Panel is available in my test build v3.5.1-bu:
                              https://forums.triplea-game.org/post/50714

                              see also: https://github.com/triplea-game/triplea/issues/9231

                              TheDog-GH created this issue in triplea-game/triplea

                              closed Feature Request: to help players on the purchase screen with maxBuiltPerPlayer errors #9231

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