AI Bid Rules
-
So I'm going to rewrite the AI bid logic and wanted to get input on what rules the AI should follow.
Here is what I was thinking is probably the most standard bid rules:
- Limit one bid unit in a territory or sea zone (until set in all territories then 2 in all, then 3, etc)
- The nation placing a unit in a territory or sea zone must have started with a unit in said territory or sea zone prior to placing the bid
Questions:
- Should you be able to place units in owned territories with no starting units?
- Should the AI have to place at least 1 unit in sea territories as well or just 1 in all land before being able to set a second unit in a territory?
-
@redrum Before thinking about how the AI does its bidding, do you have any ideas if to maybe add a property for having / not having the common 1 unit per territory limit? I would not enforce it, without a property for setting it, because some may want not to have this limit, when bidding.
It could be a boolean property, but maybe a numeral one, where 0 would mean infinite (the current behaviour) and maybe -1 would mean that the limit is equal to the production value of the territory (thus, you would be able to place no units in normal sea zones).
I don't think that having such property would be very important, and I'm not requesting it, nor I've any ideas to use it, nor I think it is a problem at all to just let people limiting themselves (as they do now), but it would be better to decide on that (eventually deciding that such a property is not wanted), before thinking about any AI behaviours.
A main problem with adding such a property, assuming that the default would be the common limit of 1 per territory, is that it would break all maps supposed to have the bid working otherwise, thus needing adding the property to all of them (they are surely only a few, but the biggest issue would be spotting them all, or the risk is to break some maps, without noticing).
I can tell you Domination, Domination 1901 and the various Feudal Japan need not to have the 1 per territory limit; there may be a few more games, tho.Should you be able to place units in owned territories with no starting units?
Yes, the only common limit not already enforced is the max 1 per territory; placing in owned land territories only if having units in them is not a common limit (I don't think any ladders or ToC ever imposed such a limit, and I'm not aware of users following such a limit, but I cannot be sure). Maybe you are thinking to other non-TripleA communities that commonly follow such a bid limit?
But I've never played ladder, which is where the rules for bidding (commonly used outside ladder too) are made. Can anyone confirm that you never need any existing units there, to place any bid in land territories, but you just need to be the territory owner? I believe a unit is necessary only for placing in sea zones, never in land territories.
Also, when we lost the ladder, we also lost the main (or only?) official reference about how normal TripleA bidding works. Not sure where new players now are supposed to look at, if they want to learn how to bid properly.
-
@redrum said in AI Bid Rules:
The nation placing a unit in a territory or sea zone must have started with a unit in said territory or sea zone prior to placing the bid
As far as I know, this limit exists (or, since the ladder is gone, should I say existed?) only for sea zones, not for land territories, where you just need to be the owner.
-
But, if it would be a vote, I would be favourable at rewriting the rules, stating that you need to be the owner of the territory/zone or having a unit in the territory/zone (or both). This should keep the same actual behaviour in all games in which only land territories can be owned and you don't start with units in territories owned by someone else, while avoiding the confusion of having different rules for land territories and sea zones.
In the past, such a decision (for Ladder and Lobby, at least) would have been up to Bung only; not sure about now.
-
Anyway, I think it would be better if the standard bidding rules are the ones used commonly in ToC (the Ladder would be the main reference, but it's gone). Myself, I think it would make sense if you always need to have units, but this should surely be allowed not to be, with a property, or some games would be broken.
So, currently, I would talk with @bayder and @Deltium, for the bidding rules that they intend to use in the Revised ToC, before changing or clarifying any bidding rules.
Also, I'm not even sure of what I said, especially referring to the Revised ladder; so better you wait for someone to confirm or call me wrong.I know, this is a tad off topic, since this should be about AI behaviour.
-
I've extracted the bidding rules from the broken "WarClub" (the true one...) Ladder:
Here are the ones of Revised:
The following will be used in the matches:
Axis & Allies 4ed Standard Rules and/or Low Luck rules. (These
options are selected in the My Profile link in the flyout menu for each ladder.)
The current stable version, as of the above date, of TripleA is v1.0.0.3 .
The Axis bid is set to 9 IPCs. These IPCs may be spent on units to be placed on the board prior to game start. The IPC may be
split between Germany and Japan in any way. The only restrictions are
that no more than one unit may be placed per territory and
units must be placed in a territory controlled by or containing units of the same nation. Placement of naval units in empty sea zones or
placement of German units with Japanese units (and vice
versa) is not allowed. Unspent IPC's from the bid can be divided up
between Germany and Japan for spending in future turns as the Axis
player desires.Here are the ones of Anniversary:
The following will be used in the matches:
Axis & Allies Anniversary Edition (AA50) Standard Rules and/or Low Luck rules. (These
options are selected in the My Ladder Profile link).
Players must currently play with National Objectives on.
The current stable version, as of the above date, of TripleA is v1.2.5.4 .
_
For 1941 with regular luck (Dice), the Allies bid is set to 8 IPCs.
For 1941 with LowLuck (LL), the Allies bid is set to 13 IPCs()
For 1942 with regular luck (Dice), the Allies bid is set to 9 IPCs.
For 1942 with LowLuck (LL), the Allies bid is set to 9 IPCs
_
() No bomber purchases are allowed for this game and bid combination
These IPCs may be spent on units to be placed on the board prior to game start. The IPC may be split the allies in any way. The first restriction is that no more than one unit may be placed per territory. Naval units must go into a sea zone with existing Naval units of the same nation. Placement of naval units in empty sea zones or placement of, for example, British units with American units (and vice versa) is not allowed. Similiarly, ground/air units must be placed in the territories controlled by the same nation. However, ground units may be placed in territories that have no existing ground/air units.
Unspent IPC's from the bid can be divided up between the Allies for spending in future turns as the Allied player desires(I've added the underscores because this forum, apparently, refuses to allow empty lines in quotes, or I cannot figure how that works; let me know, in case)
So, aside from the no-bomber-bid special rule (in there just due to the peculiarities of the setup), it looks like we have two different sets of rules, in the specific case:
Revised:
units must be placed in a territory controlled by or containing units of the same nation.Anniversary:
Naval units must go into a sea zone with existing Naval units of the same nation.
Similarly, ground/air units must be placed in the territories controlled by the same nation. However, ground units may be placed in territories that have no existing ground/air units.You can notice that, at least in the Revised ones, the meaning of "territory" is either "land territory" or "sea zone", alike (land territories and sea zones are both "territories", looks like).
So, it looks like Revised has 1 single rule for all, while Anniversary has different rules for Land Territories and Sea Zones.
Also, what I was proposing as my preference is just exactly the Revised Ladder rule!
Personally, I'm with the Revised guys here, and would prefer a general rule, rather than different rules for land and sea, like in Anniversary, which is just confusing, but I see that if you generally apply the Revised rule, then in Anniversary you would be able to place a Germans unit in Italian Libya, since there are Germans units at start game, there, which I would be totally fine with, and it is not an issue at all, since the bid goes to Allies (not to Axis).
Looks like the Anniversary rules are not justified, in their confusingly dealing with land and sea differently, since the only changes I can see, in applying the above straight Revised rule would be:- In 1941 and 1942 you would be also able to place Germans units in Italian Libya.
- In 1942 only you would be also able to place Americans units in British United Kingdom.
None of the above looks anywhere important to me, so I've no clue why the Anniversary guys decided to make different rules for land and sea, instead of just copying the homogenous Revised ones.
Am I overlooking something?
My suggestion is to just adopt the Revised Ladder rules in the engine, but reworded this way:units must be placed in land territories controlled by the same owner or in any land territories and sea zones containing units of the same owner.
Using just this rule would also allow you to place units in a land territory that you don't own, if you have units in it, but not placing units in a sea zone you own, without units in them (usually, convoy zones), that strict Revised rules would allow, instead (of course, not relevant for Revised, as you don't start with any units in allied land territories, there, nor you have any convoy zones, or somesuch), assuming that a "sea zone" is a "territory" (if we don't, then we would not be able to place ships).
Tho, this would also allow you, for example, in a British territory with Americans units in it, to place both 1 British unit and 1 Americans unit, in the same, during the respective bid placement phases, which I think it would be fine.If you want, you can also add a property (off as default) for always just requiring having units (thus disabling placing in empty land territories), as it seems you were thinking to; it makes sense, I like the idea and no harm done, as long as it is optional and not default.
-
@Cernel ii moved the full links to the tournament section a few months ago
https://forums.triplea-game.org/topic/78/current-ladder-rules-v3-41-42-aa-50-anniversary
https://forums.triplea-game.org/topic/79/current-ladder-rules-revised-v2
-
@Cernel "units must be placed in land territories controlled by the same owner or in any land territories and sea zones containing units of the same owner." I think this is the way I'm going to go with it as its straightforward and simple.
That along with "Limit one bid unit in a territory or sea zone (until set in all territories then 2 in all, then 3, etc)" so that units have to be spread around evenly.
Here is the PR for the initial rewrite of the bid AI: https://github.com/triplea-game/triplea/pull/1763
Once that is merged, folks can start testing it out!
-
@redrum the bid rules were originally designed for a balanced map vs humans. AI has its own set of rules to be determined by u - main point is if it makes ai harder do what needs to be done. Great job btw. A neat ffa vs ai as minors (zods creation) coming soon for u 2 examine.
-
@redrum said in AI Bid Rules:
@Cernel "units must be placed in land territories controlled by the same owner or in any land territories and sea zones containing units of the same owner." I think this is the way I'm going to go with it as its straightforward and simple.
Right. That is also how the engine currently mostly appears to handle it.
However, I still believe we should ponder the matter some more, and possibly reach a better defined consensus, on the bid placement basics for humans, before adventuring into tailoring anything for the AI.
I'm also curious if, besides the limited and inhomogeneous Ladder rules and the Wiki (that can't be considered an official reference), there is any place at all where all the bid placement rules, or at least the ones enforced by the engine, are recorded, or have they just been partially enforced in the engine without any documentation at all? If not so, where is the engine-related documentation? Definitely, they are not fully enforced; so, the engine behaviour still appears partially, albeit mostly, defined, and to some significant extent left to interpretation, if we don't have any clarifications anywhere, integrating it.
I can't see any bid rules in the "TripleA_RuleBook", and I don't think I would want to have any there, as bidding is not really a rule, but more like an informal agreement, albeit mostly standardised by the engine, around the common abits, or so at least it appears to be. Moreover, the matter does not appear defined enough (and likely can't really be so) to make it into the rulebook.
Indeed, this distinction between land / air units and sea units appears limited to the Anniversary ladder, not figuring in other ladders or in the engine behaviour.
For example, if you start "World War II v3 1942" and bid any land / air units for Americans, you will be able to place them in any Americans territory plus United Kingdom, due to the presence of an Americans bomber in the British owned United Kingdom.
This also means that, if you are following a limit of 1 per player, you would be able to place a total of 2 units in United Kingdom, 1 British and 1 Americans.
However, the peculiar rules of the Anniversary ladder would forbid you to place any Americans units in United Kingdom (as well as any Germans units in Libya), as only naval units allows you to place other units in the same zone, according to how the Anniversary rules are worded.
Also, based on my definition only, quoted above, you could argue that if Americans have 1 battleship in a Sea Zone, you should be allowed to place 1 fighter or 1 infantry in that sea zone, because you already have 1 unit in it and are placing some units.
Of course, it seems obvious that we don't want to put air or land units on the sea, with bid, in conditions in which they would just crash or drown!
However, if we would merely clarify that all units "can be placed only in territories / zones they can legally end movement into", as it would seem the most obvious way to go, then we open up the problem that the current engine behaviour doesn't allow you to place 1 infantry in a sea zone with 1 empty transport in it (something that one would argue should be possible, under my simplified formulation, as well as under the Revised ladder rules for bidding).
So, then, the question would be: do you want to rework the bid placement phase so to allow for placing land units into transports, with bid (as per what that definition appears to allow), also taking into account that you would need to code it as to allow you to decide exactly what transports you are putting each unit into?
This is up to you, and I'm not sure on this matter, but I tend to believe better not, and rather keeping the current behaviour of never being able to place land units in sea zones, no matter what, but this would require a coherent rewording of the rule, that cannot merely rely upon telling to follow the basic rules.
A similar matter would be placing fighters (read: whatever air able to land on some ships) in sea zones with carriers in them. The engine behaviour is that you can place fighters in sea zones with any units of yours in them (for example, in "World War II v3 1942" the engine allows you to place fighters in 53 Sea Zone, due to the presence of a carrier (with only 1 fighter on it), but, if you read the Anniversary rules, it is never possible to place air units on the sea, not even on an empty carrier of yours, as no mention at all is made for placing air units on sea zones, but only and specifically for naval units.
However, here the current engine behaviour is not actually sensible, as it allows you placing fighters where you have carriers, but with no regards to the actual transport limits.
For example, you can see that, in "World War II v3 1942", the engine allows you to place infinite fighters in 53 Sea Zone, no matter the carrier capacity, and would allow you to do so even if the carrier would start with a full load of 2 fighters on it!
Thus, it appears that the engine, currently, allows you placing fighters just in case any owned or allied carrier is present, with no regard whatsoever to the actual capacity limits, not even if all carriers are already fully loaded. This cannot be an intended behaviour, but just an unrefined one, and it looks like a patch to hint at allowing fighters only with carriers, while still letting the players to limit themselves to the available carrier capacity.
Also, the current engine will allow you to place, for example, Americans fighters in a sea zone with only 1 Americans battleship and 1 British carrier or even in a sea zone with only 1 British carrier with 1 Americans fighter already on it.
More in general, if you have only a fighter in a sea zone, over an allied carrier, this allows you to place air and sea units in that sea zone, as you meet the requirement of having a unit of yours in it.
We should thus decide if we want to allow bidded fighters to be placeable on allied carriers, as long as they share the sea zone with an owned unit, which may as well be an owned fighter, already on the allied carrier, or a submarine, or even a land unit onto whatever transport.
I'm personally favourable to this behaviour, as it meets the requirement of any units of yours being present, as well as the requirement of your fighters being able to land (as long as enough disposable capacity on the allied carrier).
A more tricky matter, already mentioned, is the case in which, in the starting setup, we have land units already loaded onto allied transports.
For example, you may start with a sea zone having only 1 British carrier and 1 British transport with 1 Americans infantry in it. Should you be able to bid an Americans fighter, in that sea zone, on the British carrier, just because there is an Americans infantry onto a British transport, already? The engine allows you to do so.
I'm fine with this awkward case, as well, since the Americans infantry covers the need of the same owner presence and the British carrier covers the need of the landing ability.
A final disputable item would be the bid behaviour of transport cost 0 air units, if they are supposed to be like seaplanes, but I would leave this matter totally out, as I don't believe that currently such kind of units can be considered really supported.
A final touch we overlooked so far, is that the engine doesn't allow you to place in sea zones containing enemy units; this appears to be a sea-only additional limit, as you can, instead, always place in land territories, as long as you have units in there or have the ownership of them, no matter if contested by enemy units.
So, here we are obliged to make a special exception for sea zones only, specifying that they have to be friendly too, unless you want to modify the engine to extend this limit to land territories too, or removing it from applying to sea zones, either.
I don't really get why sea zones have to be friendly, while land territories can be hostile, when you place the bid, and would prefer the same rule for both, but this would require an engine change; so, up to you.
So, to be correct the most, if I'm not missing anything, the rule can be clarified as:"during bid placement, units must be placed in land territories controlled by the same owner or in any land territories and friendly sea zones containing any units of the same owner, but air units can be placed in sea zones only if they can land there, and land units cannot be placed in sea zones"
The above rule appears to be fully supported by the engine (I've also verified that owning sea zones, usually convoy zones, does not allow placement without owned units in there), with the only exception that the limit for placing fighters on carriers is not fully supported: as long as there is a carrier in a sea zone (also allied, as long as any other unit of yours is also already in there), you are allowed to place infinite fighters, no matter the actual free capacity.
I believe it would be nice to have an official clear set of bid rules being fully supported, aside only from the 1 unit per territory limit, thus it would be good if a developer would close up the matter and enforce this last remaining unsupported limit, by limiting placement of fighters to the disposable capacity (owned plus allied), on the sea zone.
For example, in "World War II v3 1942", you should be able to place 1 fighter in 53 Sea Zone, but no more than 1 (as said, the engine currently allows you infinite).Conclusively, if you decide to adopt the above definition for bid placement rules, I believe it should be documented somewhere, and I don't mean the Ladder, that should be something separate from the engine, having enforced bid placement restrictions, already. I'm actually not sure where, but what I'm saying is pasting the above definition somewhere it would make sense for it to record the main supposed bid behaviour partially (mostly) supported by the engine, instead of letting such behaviour just talk for itself.
If you agree with the above considerations and if I'm not overlooking anything major, my suggestion is opening a GitHub issue for:- Implementing the fighter on carrier limit as per actual capacity (currently just allowing infinite with any carrier).
- Adding the above definition somewhere feasible for the users to read it, instead of having to experiment with the engine, to get an idea bout how bid placement works (maybe in the in-game Help menu).
Do you (and anyone) agree?
I really believe documenting both the current engine behaviour and the still unsupported, yet somewhat implicit, elements of it is important, also in case anything would happen to change, and we would have no way to guess if the behaviour that we happen to have, at any point, is what we actually want or wanted to.
This would leave the 1 per territory limit as the only not mandatory and not enforced main limit of what we can see as a commonly shared set of bid placement rules (if ever enforced, I definitely believe a property for allowing at least infinite should be made available). -
@redrum said in AI Bid Rules:
@Cernel "units must be placed in land territories controlled by the same owner or in any land territories and sea zones containing units of the same owner." I think this is the way I'm going to go with it as its straightforward and simple.
That along with "Limit one bid unit in a territory or sea zone (until set in all territories then 2 in all, then 3, etc)" so that units have to be spread around evenly.
Here is the PR for the initial rewrite of the bid AI: https://github.com/triplea-game/triplea/pull/1763
Once that is merged, folks can start testing it out!
While I strongly believe we should reach a consensus on the general default bidding rules, hopefully all supported, and fully document it, before even starting thinking at what the AI should, then, do, since you are already pushing it (I disagree), my main considerations are:
- I'm guessing that placing till filling then doubling up, etc., might be a reasonable compromise, in absence of a proper way of having the AI know if it is playing something in which it can or cannot place more than 1 per territory, but I'm not a fan of it.
- At the current state, I suggest the AI never purchasing units exceeding the 1 per territory placement, comprising what the AI might already have (thus, placing more than 1 per territory would be restricted only to cases of the AI having those exceeding units to place, never buying them itself (the bid income can be saved, anyways, and the AI should think about doing so, if the alternative would be making bad purchases / placements)).
- Lacking a property to enforce a per territory limit, I would have the AI always following the common limit of 1 per territory (even wasting units it can't place, in case), but having an AI properties in the maps for the mapmaker to tell the AI how much it is allowed to place per territory, during bid, much in the same way as it would tell the human players, by having it explained in Notes, instead (in this case, the AI should place at full effect, also possibly placing all the bid in 1 single territory, if so specified in the map).
-
I've made some more testing, and it looks like the bid placement of fighters over carriers is not a case of partial enforcement, but an actual bug (I guess, bad coding).
There is an actual enforcement of fighters on carrier limits, related to carrier capacity, during bid placement, but it appears not working correctly, allowing always placing up to the total carrier capacity, regardless how much of it is already used. This implies that you can place infinite fighters, in multiple steps. For example, if you have 2 carriers in a sea zone, you can place infinite fighters in them, as long as you keep placing 4 or less at the same time, in multiple steps.
To test this bug, you can buy 1 carrier and 4 fighters with bid, in whatever basic maps.
Then, you place the carrier, during bid placement, in a sea zone without any carriers (you need other units of yours in there, of course).
Then, you try to place the 4 fighters all at once. You won't be able to, and the game will tell you "Not enough new carriers to land all the fighters".
Then, instead, place only 2 fighters (the correct max number you can place). This will work fine.
But, then, you will be able to place the 2 remaining additional fighters in that sea zone, disregarding having enough carriers, thus making the above limit practically pointless, as you can go around it, by doing the air placement in multiple steps, as long as each time you don't exceed the total capacity in that sea zone (for example, if you place 1 then 3 fighters, on the carrier you previously placed on the same bid phase, the engine will disallow the second action).
I believe the bug is two-fold:- When you place fighters in a sea zone where you have available carrier capacity, the "max" button works like "all", making you trying to place all your fighters, instead of the correct max.
Solution: Have the max button selecting the correct "max" number of units you can place, instead of "all"; otherwise, the button should be reworded from "max" to "all", with the current behaviour.
For example, if you buy 2 carriers and 10 fighters with bid, and place the 2 carriers somewhere there are no other carriers, then click to place the fighters and click on max, it should set the number at "4", not "10"; otherwise it should read "all", not "max".
2) When you place fighters in a sea zone where you have carriers, the number of fighters you can place depends only on the total carrier capacity (owned plus allied), not the available one.Solution: If you place fighters in a sea zone where you have not enough available carrier capacity for anything you have to place, you should, either, not get prompted to place what you can (like when you try to place in a sea zone with no carriers), or being unable to do so, after trying to place an illegal number. If you have more fighters than you can place, you should be limited to the current max, one way or the other.
Other than this, there is also an incorrect wording of the fail notification, as it seems it always reads "Not enough new carriers to land all the fighters" despite that fact that, since in the starting setup there may be carriers already, the carriers we are trying to place fighters on are not necessarily all new.
Solution: Change the warning from "Not enough new carriers to land all the fighters" to "Not enough carriers to land all the fighters".
For example, if you bid 3 Americans fighters in "World War II v3 1942" and try to place them all, in one step, in 53 Sea Zone, it will say "Not enough new carriers to land all the fighters", while the only carrier is the one of the starting setup, thus surely not "new" (and it works fine if you place only 1 fighter, in there).
I'm guessing this strange warning might be a hint of an intention of limiting fighter placement on the sea only to "new" carriers, placed on the same bid phase. For example, there might have been the intention to allow placing 1 carrier with 2 fighters on it, with bid, but not to allow placing fighters upon existing carriers, instead. However, while this would explain why the warning talks only of new carriers, I doubt this is the matter, and I would not make a specific rule forbidding bidding additional fighters for existing carriers that are not using their full capacity.Thus, as said, the actually enforced bid placement of fighters on carriers appears to bug off in any case in which any fighters are already present, allowing infinite, while working correctly if you start with no carrier, except that you can still place infinite, by doing it in two steps.
Regarding the AI, it is to be taken into account that, even if debugged, the current procedure is a two steps one, thus the AI, for deciding to use the bid to place a carrier with some fighters on it, should see that has to be done in two steps, first placing the carrier, then placing the fighters. Of course, this is relevant mainly in case the common 1 per territory limit does not apply, but, even so, if in a same sea zone there is a multi-player allied force with no carriers, you could first place a carrier with one player and, then, a fighter with another one (this should be a legal move, I assume, and the AI may want to do it, if it appears to be a good way to make some sea zones safer).
-
@Cernel I believe that bug around air units on carriers has nothing to do with bid phase and actually exists in regular place phase. The engine currently doesn't do a good job validating air units placement regarding carrierCapacity as you place units. It does make sure to validate this at the end of the place phase and prompt the user though.
-
@redrum an Ultimate talibush pant ffa moded by zod
0_1496103257161_Zods ai Nightmare rnd 9.tsvgWe are minors vs the world