triplea-game / triplea

TripleA is a turn based strategy game and board game engine, similar to Axis & Allies or Risk.
https://triplea-game.org/
GNU General Public License v3.0
1.29k stars 382 forks source link

2.6.14650 Bid ships cannot be placed in a SZ that you own with your own ships #12376

Closed TheDog-GH closed 3 months ago

TheDog-GH commented 4 months ago

Map=1941 Global Command Decision Currently there is no error message when trying to place a ship in 113 B Sea Zone near Denmark it just does not work Placing land unit works.

To reproduce it Load Map Place a Bid for Germany of say 40 Buy Infantry & Ships Try and place a Ship in 113 B Sea Zone (as it is owned and has own ships) - it fails Placing land unit works

An old map like world_war_ii_v3 bidding/placing works in 2.6 :-/ But 1941 GCD uses lots of new features and has 2 0EndTurn & 1EndTurn & isAI amongst others

Attached is a log recording the failed bid placement triplea.log

Link to the latest 1941 Global Command Decision v161 https://drive.google.com/file/d/1F0Ci5ESw21oV_Aa-dBJted0hwa7caoPQ/view?usp=sharing

For reference this forum post by wc_sumpton https://forums.triplea-game.org/topic/3326/1941-global-command-decision-official-thread/604

@asvitkine

WCSumpton commented 4 months ago

2024-3-1-1941-Global-Command-Decision.zip Save game file was created using 2.5 release. This will allow the file to be opened with both 2.5 release and 2.6+ pre-release. The save was created after Germany's Bid Purchase of 15PUs which is 1 Armor-Lgt and 1 Cruiser. Using 2.5 release both units can be place. Using 2.6+ pre-release only the Armor-Lgt can be placed. There is no error/message give when selecting an appropriate location like 113 B Sea Zone. Message are generated when selecting inappropriate locations like 113 A Sea Zone and 114 Sea Zone. triplea.log show the following:

37740 09:19:51.118 [AWT-EventQueue-0] INFO  g.s.e.m.UnifiedInvocationHandler - Blocking network operation performed from EDT
java.lang.Exception: null
    at games.strategy.engine.message.UnifiedInvocationHandler.invoke(UnifiedInvocationHandler.java:52)
    at com.sun.proxy.$Proxy22.getPlaceableUnits(Unknown Source)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at games.strategy.engine.player.PlayerBridge$GameOverInvocationHandler.invoke(PlayerBridge.java:154)
    at com.sun.proxy.$Proxy22.getPlaceableUnits(Unknown Source)
    at games.strategy.triplea.ui.PlacePanel.getUnitsToPlace(PlacePanel.java:242)
    at games.strategy.triplea.ui.PlacePanel$1.territorySelected(PlacePanel.java:58)
    at games.strategy.triplea.ui.panels.map.MapPanel.notifyTerritorySelected(MapPanel.java:501)
    at games.strategy.triplea.ui.panels.map.MapPanel$3.mouseReleased(MapPanel.java:223)
    at java.desktop/java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:298)
    at java.desktop/java.awt.Component.processMouseEvent(Component.java:6635)
    at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3342)
    at java.desktop/java.awt.Component.processEvent(Component.java:6400)
    at java.desktop/java.awt.Container.processEvent(Container.java:2263)
    at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5011)
    at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2321)
    at java.desktop/java.awt.Component.dispatchEvent(Component.java:4843)
    at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4918)
    at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4547)
    at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4488)
    at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2307)
    at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2772)
    at java.desktop/java.awt.Component.dispatchEvent(Component.java:4843)
    at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:772)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95)
    at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:745)
    at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:743)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
    at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742)
    at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

Cheers...

asvitkine commented 4 months ago

The error message in the log is unrelated.

Looks like the issue is happening because the ship requires Industry-Hvy and that doesn't exist in the sea zone being selected...

(But looks like there's an adjacent one, so I guess the expectation is the adjacent one is supposed to be counted? Does it work that way for regular placement, outside of Bid?)

asvitkine commented 4 months ago

Non-Bid placement works correctly.

Looks like the issue is that getAllProducers() from BidPlaceDelegate doesn't consider adjacent territories. I'm not sure why it worked in 2.5, I guess the code was different somehow.

TheDog-GH commented 4 months ago

@asvitkine Please reopen and take following into consideration wc_sumpton and myself think that the check in 2.6 for factories/production should be removed. see here for our conclusions and a few posts following https://forums.triplea-game.org/topic/3326/1941-global-command-decision-official-thread/614

To repeat Cernel bullet points here

asvitkine commented 4 months ago

Thanks for the feedback!

I'm not sure "place infinite per territory" makes sense since some maps have stacking limits (e.g. no more than X of a given unit in the same territory), but I agree that it doesn't make sense to limit based on factory output. I'll take a look at fixing it so bid doesn't have factory reqs.

asvitkine commented 4 months ago

Closed per the latest change, but I would appreciate if someone can do a thorough test of the different cases to make sure it's all working as expected. Thanks!

TheDog-GH commented 4 months ago

@asvitkine Still not working as 2.5, see here and following posts https://forums.triplea-game.org/topic/3326/1941-global-command-decision-official-thread/619

Has more detail https://forums.triplea-game.org/topic/3326/1941-global-command-decision-official-thread/620 https://forums.triplea-game.org/topic/3326/1941-global-command-decision-official-thread/621

Hope this helps.

This is a modified list of what Bid & Bid Placement can/should do. You can;

TheDog-GH commented 4 months ago

@asvitkine 2.6.14662 Argh, something's not right Ships & land units (not factories) work As German buy x2 of the 3 types of factory In France select Belgium 5pu, place Industry-Med Normandy 5pu, place Industry-Med (there is now no more) Orleans 3pu, Industry is now a Industry-Hvy (should not be placeable as it requires 9pu territory) Lorraine 3pu, Industry is now a Industry-Hvy (should not be placeable as it requires 9pu territory) Move to North Africa Pick a 1pu territory, place Industry-Lgt (should not be placeable as it requires 5pu territory) Pick a 1pu territory, place Industry-Lgt (should not be placeable as it requires 5pu territory)

TheDog-GH commented 4 months ago

Added a log file tried to copy the above but could follow the order of placements triplea.log

If anything can be placed in any territory then all 3 industries should be offered for the 1st placement, yes?

asvitkine commented 4 months ago

@TheDog-GH Thanks, will take a look.

asvitkine commented 4 months ago

@TheDog-GH I'm not able to repro?

Belgium 5pu, place Industry-Med

That doesn't work, I can only place Light

TheDog-GH commented 4 months ago

It appears to be random, keep going

asvitkine commented 4 months ago

Is this during bid or regular place? I can't repro during regular place at all.

TheDog-GH commented 4 months ago

Only Bid Place, I have not tested regular buy/place

asvitkine commented 4 months ago

I see.

I think it's a bit of a tricky case. Should we enforce checks for unit placement based on territory size during bid? For example, if you have a tank that would normally only be able to be built in a territory of size 5+, would it not be allowed to be placed in a territory of size 3 during Bid?

I would imagine we'd still allow that placement. So I think maybe we have to treat infrastructure units differently than regular units in this case?

How does 2.5 work?

TheDog-GH commented 4 months ago

@asvitkine 2.5 Infrastructure Bid Placement Will offer what is available, not what is possible Screenshot 2024-03-04 092059

When you try to place the Palace, the biggest, it requires a 6pu territory and a Castle it fails to place it, see below, because the territory is only 5pu. Screenshot 2024-03-04 092023

In another example placing the Palace in a 6pu territory with a Castle, the Palace is placed as an upgrade, this is correct and is the same as the main game place delegate.

Summary 2.5 Infrastructure Bid Placement works like the main game place delegate.


Modified list of what Bid & Bid Placement can/should do. You can;

WCSumpton commented 4 months ago

The "hasUnitPlacementRestrictions" override in BidPlaceDelegate should be removed, as this process removes the checks for unitPlacementRestrictions, unitPlacementOnlyAllowedIn, canOnlyBePlacedInTerritoryValuedAtX along with requiresUnits, when only requiresUnits check is causing the problem.

Maybe a better way is to add "GameStepPropertiesHelper.isBid(getData())" check in "unitWhichRequiresUnitsHasRequiredUnits" in AbstractPlaceDelegate?

Cheers...

TheDog-GH commented 4 months ago

WCSumpton has made a very point on the forums and I agree with him. I copy it here.

Should "territoryEffect" option "unitsNotAllowed" affect placement / bid placement?

Using GCD if a Base-Camp were placed in Prypriat which has a "marsh" "territoryEffect" with "unitsNotAllowed" equals "Inf-Motorized", the "Inf-Motorized" can still be placed there.

So we/I think we should obey "territoryEffect" option "unitsNotAllowed" for Bid Placement, even if 2.5 allows it.

asvitkine commented 4 months ago

Latest PR addresses the last two comments here. Can you test to see if it's all working as expected now or if there are still things not working as expected?

Cernelius commented 4 months ago

Beside the cases in which units consume other units to be placed, I strongly disagree with placement restrictions on their own having anything to do with bid placement, even in case they are absolute (max placement per turn equal to 0 for the unit in the zone) or also accounting what's already there (stacking limits).

Bid placement is just a way of adding units to a starting setup. In most games, these units, as in any normal starting setup, are implied being there because the game has been ideally played before it starts (for example, German armours being in Ukraine S.S.R. at the start of the game are representing invading German units in some history which happened before the start of the game rather than the production of Ukraine S.S.R..).

Even in the most basic games, where productions is simply related to factories, most bid placement happens in territories without factories, which necessarily implies (at least for all games in which you cannot destroy or down-grade factories) that those units got there by moving (before the start of the game in idealized rounds which are implied having happened before the actual players are taking over the game from this hypothetical previous pseudo-player).

Therefore, there are only two reasonable ways to address this:

  1. Placement is completely unlimited by placement and movement restrictions beside consumables.

OR

  1. Placement is limited by stacking-only placement or movement restrictions, whichever the less restrictive, accounting only what is possible, beside consumables.

(Non-stacking limits do not matter in any case: I can still place 1,000 units in a territory even if nothing can move into it and I can place only 1 per turn, on the assumption that, before the start of the game, there have been 1,000 turns during each of which 1 of the units was placed.)

To make an example of the second case, if we have a game which has placement stack limit A and movement stack limit B, where A and B are natural numbers, I can place as many units as the highest between A and B in a territory with a factory in it (because I can assume they were either moved there or placed there before the start of the game).


In the specific case,

battleship is marked as not placeable in "West Canada Sea Zone" on the test map. // This should be ignored for Bid purposes, like other placement restrictions.

it is correct to ignore such placement restriction as we can assume that the battleship may have moved there before the start of the game: bid placement somewhere does not imply placement in there! Of course, that would be impossible in situations like a sea zone which do not connect with other sea zones, but this is irrelevant unless we want to go as far as making the program able to understand what is actually possible based on the map design (and I think that we don't want that).

TheDog-GH commented 4 months ago

@asvitkine On 1941 GCD map Germany the Prypriat Marshes only allows infantry to enter, but currently allows Armor & Mech Infantry to be placed, which I think is wrong? Working is Base-Camp & Bunkers are not offered to be placed. Also working is I bought 22 Infantry, but only 20 are offered to be placed.

In Algiers 5pu, Industry-Lgt should be offered to be placed but it is not. Working is 2 Bunkers and Base-Camp are offered to be placed.

USA Boston-New England 7pu, with all types infrastructure bought Wrong Industry-Lgt & Industry-Med should be offered, but are not. Working 2 Bunkers offered Industry-Hvy is offered but when placed, then says Cannot place these units in Boston-New England, Industry-Hvy should not even be offered.


My list of what Bid & Bid Placement should do. You can;

asvitkine commented 4 months ago

Thanks, let me look at these.

For the Algiers case, it looks like the logic that's applying here that omits Industry-Lgt is the call to UnitStackingLimitFilter.filterUnits() from BidPlaceDelegate.getUnitsToBePlaced().

As different factory types are mutually exclusive, if you have Industry-Lgt and Industry-Med both purchased and Industry-Med gets considered first, Industry-Lgt will be filtered out.

I think there's a few different issues here:

  1. We shouldn't be filtering the list this way for the purposes of the dialog that shows units to select. I think this is something I might have fixed for the normal placement logic, but maybe the same wasn't done to the bid logic. I'll have to check.
  2. Whether bigger Industries that require a larger territory value should be allowed here at all. This is a bit tricky, since I think this restriction should actually be different between infrastructure and regular units (because as Cernelius says, for regular units, the mental model is they could have moved there on previous turns, but that wouldn't apply to factories). EDIT: Looks like this isn't actually allowed, but just gets validated after the units get selected for placement, rather than before the dialog. So not just a UI enhancement issue.
  3. That we're using the PLACEMENT_LIMIT for the stacking filter and not the MOVEMENT_LIMIT - again, with similar arguments to what Cernelius mentions.

Let me start by fixing 1. and we can see how to best handle the others. I haven't yet looked at the other cases pointed out above.

Cernelius commented 4 months ago
  1. Whether bigger Industries that require a larger territory value should be allowed here at all. This is a bit tricky, since I think this restriction should actually be different between infrastructure and regular units (because as Cernelius says, for regular units, the mental model is they could have moved there on previous turns, but that wouldn't apply to factories). EDIT: Looks like this isn't actually allowed, but just gets validated after the units get selected for placement, rather than before the dialog. So not just a UI enhancement issue.

I think here you are confusing the "infrastructure" and "immobile" concepts. Whereas in all current basic games (namely, v5, v6 and the 2nd edition of the 1940 series) the two concepts happen to be consubstantial, they were not in previous (v4 and before) basic games. Specifically, the "aAGun" is a mobile infrastructure in all basic games before v5.

Moreover, in TripleA you have fairly "classic" games, like Napoleonic Empires (developed and finalized by no less than the owner and chief developer of TripleA at the time), in which you have mobile factories ("general", in this case), that is units that are infrastructures, can place other units (like factories) and can move and be transported by sea units. 270BC is an other and more complex example (legionaires being factories for placing forts only).

Besides, even though the basic games are arguably the ultimate referring point, TripleA does not necessarily depend on those, but can refer to itself. In TripleA, being (or not being) an infrastructure has exclusively combat-related consequences, so it should simply be COMPLETELY irrelevant for any bid-related matters.

This said, if we really want to make any kind of distinction on this matter (specifically, for things like the factories of Global 1940), such distinction should be based on them having movement 0 (which is the case of other units like the bunkers of WAW and the fortresses of Napoleonic Empires, both being neither factories nor infrastructures) and certainly not on them being infrastructures, but without forgetting that, in TripleA, movement 0 units can potentially move too (by receiving movement bonus from other units or even themselves, by being transported via land, air or sea or by being moved in special movement phases like the Global paratroopers, and that the movement 0 itself is not necessarily fixed, as it can change in the course of the game because of triggers and technological development). An example of a unit that (beside being also an infrastructure) is movement 0 yet meant to be moved (by transporting it) is the "material" of Total World War.

In theory, I could have a game in which there is a unit like the "material" of TWW, but that can be produced only in territories worth 1 (or 2 or 3...) production or more, yet some of them start the game in production 0 territories on the assumption that they were moved there in the pseudo-history which is implied to have happened before the start of the game.

asvitkine commented 4 months ago

@Cernelius

Thanks, I did mean "immobile" rather than infra, but as you point out, it does seem complicated. I think theoretically the engine could still determine if a unit is truly immobile (e.g. can't be transported, can't get boosted), but it seems a lot of complexity just for the bid phase, so not sure it's worthwhile to do.

Cernelius commented 4 months ago

@asvitkine Mind you that the pseudo-history argument I made is certainly not comprehensive. It is a fact that TripleA has bidding rules which have nothing to do with it, an example being the requirement that the territory must have the same ownership as the (in-game) player (power) which is using its bid money. For example, there is no pseudo-history reason why in "World War II v3 1941" I cannot add (more) German units in Libya. In this case, most likely the reason is that the bid rules were devised for "Classic" (where you never have cases of allied presence in the starting setup and every land unit is on a same-ownership territory) and were never updated therefrom on this regard.

Even though I cannot state it for certain (and you would have to defer to the developer who coded the TripleA bid system in the first place), I feel confident assuming that the bid placement rules which the engine enforces or used to enforce (like the fact that the presence of units is necessary on sea but not on land and so on) are actually based on what was written in the old War Club: the old War Club had full information about it and now that is gone, but I don't know if someone copy-pasted it somewhere else.

Generally speaking, the problem with bidding is that (as far as I know) we don't have an actual "rulebook" about bidding rules, unlike what we do have when we deal with regular placement rules...

For example, "everyone" knows that (in most games) you can place at most 1 unit per zone with bid even though the engine does not enforce it (and it is good that it does not because this rule does not apply universally). This used to be written in the bidding rules section of the old War Club, and it is now written at least in the rules topics of the official TripleA tournaments.

An other matter may be letting the game-makers decide what can and what can not be placed with the bid. More generally, I would be in favour of atomizing the bid purchase/placement rules and make a property switch for every one of them so that every game-maker can configure the bidding rules of its game.

This (if anyone would then update the relevant games) would also allow enforcing a very old special rule of V3 bidding, that is the fact that is forbidden to buy bombers in the bid phase of at least the 1941 game of that map.

This rule has been actually lost by the elimination of the old TripleA War Club coupled with the fact that all V3 related rules (as far as I know) have not been copy-pasted into the current ladder (unless I'm over-looking something), the rules section of the current V3 ladder being simply empty.

Thus, I'm not sure I would add such a rule simply because I don't think I've any way even to demonstrate that such a rule (no placing air units with bid in v3) ever existed, but this is an example of the (former) existence of a game-specific bid rule and what may happen when a game has non-enforced rules. Moreover, I don't remember if this special bid restriction was only for the 1941 scenario or for the 1942 too, and I also don't remember whether air units were forbidden or just the bombers.


Currently, I suppose that the only TripleA official pages about bidding rules are this post for V2 https://forums.triplea-game.org/topic/542/triple-a-rules-for-revised-tournaments

Bidding rules for Revised Edition • You are bidding for the Axis, that means the player with the lowest bid is playing the Axis. • In order to determine who bids first, players shall roll a "test Marti die" to randomly select who begins bidding. For example, Player A may choose 1-3, and if the test Marti die is 1-3 then he/she begins the bidding, and if 4-6, then the opponent shall do so. Bids shall then be exchanged by email initially, and bid responses must be replied to with 24 hours. If your opponent fails to respond to the bid, please copy Deltium (5683deltium@gmail.com), and I will issue a warning. • Additional sea units may only be placed in sea zones where already units of the same power are present • Only ONE unit per territory is allowed with the bid units • Additional land units, naval units and industrial complexes can only be placed in areas belonging to the same nation as the to be placed unit, which means russian units in russian areas (red), english units in english areas (brown), american units in american areas (dark green), etc.

and this post for V3, https://forums.triplea-game.org/topic/394/triplea-rules-for-anniversary-edition-tournaments

Bidding rules for A&A Anniversary Edition

  • You are bidding on the allies, that means the player with the lowest bid is playing the allies.
  • The lower rated seed will begin the bidding. Bids shall be exchanged by email initially, and bid responses must be replied to with 24 hours. If your opponent fails to respond to the bid, please copy Deltium (5683deltium@gmail.com).
  • Additional sea units may only be placed in sea zones where already units of the same power are present
  • No additional bombers may be placed during the bidding, but fighters are OK.
  • Only ONE unit per territory is allowed with the bid units
  • Additional land units and industrial complexes can only be placed in areas belonging to the same nation as the to be placed unit, which means russian units in russian areas (red), english units in english areas (brown), american units in american areas (dark green) and chinese units in chinese areas (light green).
  • China may only place infantry units. Same rules apply to the 1942 setup.
  • Do note that kamikaze attacks are NOT allowed.

beside similar posts.

However, these rules have some issues which I've pointed out, never to receive an answer.

@Deltium said in Triple A Rules for Revised Tournaments:

• Additional land units, naval units and industrial complexes can only be placed in areas belonging to the same nation as the to be placed unit, which means russian units in russian areas (red), english units in english areas (brown), american units in american areas (dark green), etc.

Is this an error, and it should, instead, be "Additional land units, air units and industrial complexes". Also, industrial complexes (the TripleA name is actually "factory") are land units too, so this is kinda redundant (at most, I would put it between parentheses, after "land units"). Side note, I would not talk in term of colours at all.

Actually, now that I re-read it, my correction may be also wrong as it would forbid placing air units on carriers, but I don't remember if it is possible to place fighters on carriers with bid (I assume it should be allowed at least so far as it is your own carrier, but I'm not sure, and let's not forget that it is theoretically possible to have allied fighters on carriers in the starting setup (which would raise a question like "if in the starting setup there is a British carrier with an American fighter on it, can Americans place an additional fighter on the carrier with bid money?".).

You can also see that the V3 bidding rules from Deltium say that "Additional land units and industrial complexes can only be placed in areas belonging to the same nation as the to be placed unit", which is missing to mention that this rule applies to air units (like fighters) too if it is true that "No additional bombers may be placed during the bidding, but fighters are OK." but would be fine if fighters are forbidden as well (and I cannot remember whether or not this was the case).

As they are written, and beside the fact that they say that you can place fighters (if we can count "fighters are OK." as something stating that) but don't tell you anything more about it, the V3 rules of Deltium (which I've quoted) actually say that you can add a Russian fighter on an American territory (or maybe even an American carrier) during the bidding phase (which is certainly not the case, but it is what Deltium is literally saying if we assume that "fighters are OK." means that you can place fighters on the map without clarifying if we are talking of land zones, sea zones or both, thus literally meaning both).

I'm also aware that exists at least this page about TripleA bidding rules. https://en.wikibooks.org/wiki/TripleA/Advanced_Rules

Bidding If one side is considered to be disadvantaged, it can be offered a bid. A bid is represented by some PUs that a country can buy units and place them before the game begins. Some players settle two more rules for bids: only one unit per territory. And you can only place units in a territory you already have units.

Players over the lobby say the bid they need to take the disadvantaged side, and the ones with the lowest bid requirement take it.

I'm not sure how official this page may be, but I guess it is not and has been written at some point by @RogerCooper? I can however vouch that these "bidding rules" are very much incomplete based on what I still remember about the lost (I assume.) actual bid rules which were written in the old official War Club page.

Myself, I've already made an (unofficial) summary of bidding rules some time ago. https://forums.triplea-game.org/topic/785/bid-explanation-resolved/11

Bid is a special purchase phase where you use the bid property income, instead of any other resources, and it also turns such income into regular PUs, for the part you don't spend (this doesn't usually happen).

placeBid is a special placement phase where you are subjected to a series of placement limitations different from the regular phase of the same kind, namely:

  • You can place infinite per territory or sea zone
  • You can place in any territory you own (no factory or anything required)
  • You can place in any friendly sea zone with ship of the same owner already in it

On top of that, players may or may not decide to apply other restrictions, the most common being limiting 1 placement per territory or sea zone (but it can be whatever agreed or specified anywhere; for example, if you play WWIIv3 1941 ladder, at least in the old ladder, you are forbidden to buy bombers with bid (not engine enforced)).

The bid phases are also used, in a few games, as special purchase / placement delegates, not just for rebalancing (not sure if this is a good practice).

Mind you that I'm only talking about anything directly related to TripleA. There are some other places where you can find TripleA-like games or forums using the TripleA program which have their own bidding rules (for example, also requiring the presence of units in a zone for bid-placing land units in the zone).

TheDog-GH commented 4 months ago

@asvitkine Thank you for staying up late last night and working on this!

My list of what Bid & Bid Placement should do. You can;


For Germany, buying all 3 Industries and Base-Camp, place in Algiers 5pu, Placement offers all 3 Industries and Base-Camp. But canOnlyBePlacedInTerritoryValuedAtX will only allow Base-Camp & Industry-Lgt to be placed, so it should not offer Industry-Med or Industry-Hvy, yes? When trying to place Industry-Med or Industry-Hvy, it errors with Cannot place these units in Algiers, this is correct. So almost there 😃

TheDog-GH commented 4 months ago

@asvitkine Thank you for staying up late again last night and working on this!

Yay nothing bad to say, looks like Bid & Bid Placement is working, so it can be closed from my testing?

Cernelius commented 4 months ago

I definitely don't agree with this (on the assumption that this means that the unit cannot be bid-placed in a territory where it cannot be placed but to which it can be moved), regardless of this being a conservative bug-fix or a change. If the program used to work or to be supposed to work as such, I'd say it was wrong.

However, for example, if a game has a restriction by which immobile factories cannot be placed on a territory worth less than 3, I would agree that it makes no sense that the bid allows you to place them in such a territory. I would personally fix this by having an option which makes the factory unable to be (meaning unable both to be placed and to be moved) in such a territory, then this option would make sense to apply to the bid-placement too.

As I said beforehand, if you can go there by either placement or movement, you should be able to go there with bid-placement too, if you can go there by neither means, then neither with bid.

In the moment in which bid allows you to place units where there are no factories in basic games, it makes the only sense that it also ignores whatever other placement restrictions beside consumables.

The restriction that the territory must have a minimum value is logically akin to the restriction that the territory must have a factory in order to place units: it makes no sense to ignore one but take into account the other one.

My suggestion, at this point, is either

  1. having a property for switching on/off such restrictions when bid placing or
  2. making sure that such restrictions apply only to units which are immobile, cannot receive movement bonuses and cannot be transported or
  3. having a way for the game-makers to define a list of units for which placement restrictions apply to bid-placement too (default being an empty list, of course), the best being a matrix in which you have all the restrictions and all the units and can sort out which one applies and which one does not.

Unfortunately, I'm not really sure what is wanted there, but I think that what can be inferred as the original purpose of bid-placement should be maintained and harmonized to beyond-basic rules which TripleA eventually came to enforce.

TheDog-GH commented 4 months ago

@Cernelius As you would expect I don't agree.

As Bid Place units are air dropped then movement does not come into consideration.

Im hoping that A&A players are unaffected by these changes.

WCSumpton commented 4 months ago

@Cernelius You bring up a lot of good points about the "bid" process, but here we are only talking about bid placement. Who bids what, how much, and who control which factions/nations/players is handled by the players and not TripleA engine. Other rules like "No Bomber purchases", "One unit per territory/zone", "Can only be placed in territories/zones that contain another units" can be handled with triggers.

Game properties cannot be changed within the xml, so these "placement" properties should be enforced by the engine. If the map maker wants these properties "removed" during "bid" placement, then it should be up to the map maker to design conditions/triggers to remove/reinstate such restrictions.

My 2 cent..

Cheers...

Cernelius commented 4 months ago

I think the fundamental problem here may be one of nomenclature.

It is called "bid placement", so persons tend to think that it has anything to do with the regular "placement" and that what restricts placement should restrict "bid placement" too (even though removing such restrictions (and adding some other ones unrelated to the production process) was the whole point of bid-placement in the first place).

Obviously, the fact that the bid-placement focuses on the elimination of specific restrictions (chiefly, factories) is due to the fact that it was merely tailored for the basic games, so likely little-to-no thought was simply given to it once TripleA became more complex than that.

One would think that it should be clear enough that bid-placement has nothing to do with placement if you only think that bid-placement allows you to place sea units regardless of the presence of any territory of the same player.


@WCSumpton Triggering in-out restrictions during bid-placement is a hack. Definitely better having a matrix option like I've explained.

DanVanAtta commented 4 months ago

@Cernelius raises a good point, bid placement is a glorified edit placement. The restrictions on bid placement are generally arbitrary and depend on the specific game scenario. Bid placement in effect changes the starting scenario. Units placed with a bid should be considered as starting units, equal to any other unit that starts pre-placed.

WCSumpton commented 4 months ago

@DanVanAtta Good point. Should a sea unit be Bid placed into a land territory? Some restrictions have to apply. To say that a factory (0 movement production unit) restricted to a territory with a production/PUs value greater the 2, should be allowed to be placed in any territory, without restrictions because it is part of a Bid process does not seem fair. The factory could not be placed there, so it should not be Bid placed there. But the other side of the coin maybe true, maybe you want that factory to be placed there only during the bid. It is easier to enforce the rule with the game engine, and then "Hack" (as @Cernelius would say) the change only for the Bid process, then to try and do it the other way around. Remove all restrictions, and the try to "Hack" the changes you want. (We are talking about map making here, not players. If the players agree to some "off-the-wall" placement rules, then that Battleship could always be "Edit Mode" into Washington D.C.)

Cheers...

DanVanAtta commented 3 months ago

I just realized there is some greater context here & back-and-forth and some updates already made.

If the immediate problem that was reported is fixed, we should close this issue.

I appreciate the discussion and wouldn't mind continuing, but we are distracting from the immediate problem that was reported.

TheDog-GH commented 3 months ago

The discussion could continue here https://forums.triplea-game.org/topic/2998/2-6-testing-report-2-6-problems-here/209

As I have posted a summary of what the Bid & Bid Place currently does.

Its working as WCSumpton & I envisage. Bid & Bid Place now shares a lot of the same code as the main Place rules, thanks to Asvitkine late nights.

So I will close it.