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.32k stars 393 forks source link

Incorrect handling of AA-fire and/or AA-fire casualty selection #4133

Open panther2 opened 5 years ago

panther2 commented 5 years ago

Engine version

irrelevant

Map name

wwIIv1, v2, v3, v3, v4, v5 , wwII"any" (1940)

Can you describe how to trigger the error? (eg: what sequence of actions will recreate it?)

Simply create situations that lead to AA-fire and resulting casualty selection with more than one plane of every type involved.

In brief this is what is incorrect:

v1:

v2:

v3:

v4:

v5:

wwII_"any" (1940)

Instead of this error, what should have happened?

In general (v1-v4) AA guns should fire against group of units if possible (e.g. against fighters as a group, against bombers as a group...). The attacker should be able to select casualties among those groups. In v5 and 1940-games the attacker should be able to choose the casualties totally free (as long as no special rules apply).

In v2 (likely v1, too) all movement has to be plotted out before any AA fire is resolved. Also we have AA-fire during CM, Combat and NCM phases in OOB-rules while in LHTR AA-fire takes place only during Combat.

Any additional information that may help

The background, rules and clarifications are elaborated on in detail here: https://forums.triplea-game.org/topic/989/open-aa-revised-bug-aa-fire-casualty-selection-issues

Regarding the somehow systematic "take-out error", see especially https://forums.triplea-game.org/post/26839

(Don't be irritated by the tile of that thread, actually this is far from being minor ;-) )

This issue serves more or less as an initial collection of bugs. I am happy to provide more detailled information in separate issues of course, in case someone is willing to fix them.

DanVanAtta commented 5 years ago

@panther2 Good list, perhaps let's start from the top and see how well we do working down?

To begin:

v2:

  • incorrect timing of AA fire (different rules for OOB and LHTR apply, but both versions are affected)

Can you note when the AA gun is currently firing and when it should fire?

  • AA gun does not fire against groups of air units (if possible)

Would you mind attaching a save game that has this scenario?

  • attacker cannot choose casualties

Similar, could you attach a second save game that has this scenario and note what conditions were important to create. In other words, how did you know to create that save game where attacker would not be able to choose casualties?


I'm hoping with the saves and extra info, this will become pretty easy for one of the team to tackle. That would knock out at least the v2 issues.

panther2 commented 5 years ago

@DanVanAtta Thank you for your interest!

v2

Can you note when the AA gun is currently firing and when it should fire?

The way TripleA Revised OOB fly-over AA-fire is coded at the moment gives the player the opportunity to ignore the principle of "all combat movement takes place at the same time" allowing to discard and/or change whatever movement plans depending on the result of AA fire. Currently the AA gun fires at the very moment any plane enters any territory.

Instead, the AA gun(s) should fire after all movement has been completed. AA-fire follows movement-plotting. Then it is resolved territory by territory and group by group. So the engine should keep track of the routes.

In OOB AA-fire can occur during CM (at the end of that phase), during Combat (as retreating planes and planes involved in combats land at the end of that phase (and not during NCM as TripleA handles this) and NCM (when only units that did not move in the combat move phase or participate in combat during that turn should land).

In TripleA Revised LHTR the engine incorrectly handles fly-over AA during CM as it does in OOB. Actually in LHTR AA-fire only takes place during Combat. So the engine should keep track of the routes and resolve AA-fire territory by territory and group by group, then.

The current concept blocks attackers from allocating groups of planes deriving from different territories. You should be able to create bunches of bombers and bunches of fighters originating from different territories to fly over/attack in an enemy territory. In this case the AA gun(s) should roll against a group of fighters and a group of bombers separately. The attacker should be able to select casualties from within these groups. This would enable the attacker to choose planes with the lowest remaining movement points.

I hope I have covered all aspects. I will add things that I might have missed for now.

Would you mind attaching a save game that has this scenario? Similar, could you attach a second save game that has this scenario ...

It appears to be impossible to create savegames for a concept the engine does not follow at the moment. So I have created two savegames that enable you to reproduce the issues, one for OOB, one for LHTR. Just toy around with Germany after loading the games. Try to attack from different territories, try to create groups of planes deriving from different territories. When attacking with bombers and fighters at the same time from only one territory the engine rolls AA fire against all planes without seperating types of units. The concept of casualty selection is not obvious here.

savedGames.zip

Sidenote: Maybe it is advisable to keep the current behaviour as option/sort of "house-rule", as many players are used to it and have played with it for years.

PS When it comes to selecting casualties from within groups it appears to be reasonable to implement a sort of "autoselection". As the player would always choose to lose the plane with the least remaining movement points, this might be handled automatically by the engine, if wanted, IMHO.

simon33-2 commented 5 years ago

The way TripleA Revised OOB fly-over AA-fire is coded at the moment gives the player the opportunity to ignore the principle of "all combat movement takes place at the same time" allowing to discard and/or change whatever movement plans depending on the result of AA fire. Currently the AA gun fires at the very moment any plane enters any territory.

Instead, the AA gun(s) should fire after all movement has been completed. AA-fire follows movement-plotting. Then it is resolved territory by territory and group by group. So the engine should keep track of the routes.

Classic is identical, except that the attacker gets to choose between fighters and bombers if there is a hit and both units are targetted by the AA gun. Not 100% sure what @panther2 means by "group by group". I see what he means by territory by territory though - if 2 AA Guns are overflown and the first one scores a hit, the second one doesn't get that roll. In theory it is possible to have 2 fighters overfly territory A then B, while a bomber will go from B to A. Not sure if there is a way of handling that one.

limo49 commented 5 years ago

@panther2

  • attacker cannot choose casualties

@DanVanAtta PS When it comes to selecting casualties from within groups it appears to be reasonable to implement a sort of "autoselection". As the player would always choose to lose the plane with the least remaining movement points, this might be handled automatically by the engine, if wanted, IMHO.

Same problem here: 5 bombers (4 with 3 remaining movement points and 1 with 1 mp) attacked a factory and 2 were shot down. The engine saved the 2 with 3 mp and the one with 1 mp without asking anything.

panther2 commented 5 years ago

I have updated the issue to reflect new insights and links.

Cernelius commented 5 years ago

Instead, the AA gun(s) should fire after all movement has been completed. AA-fire follows movement-plotting. Then it is resolved territory by territory and group by group. So the engine should keep track of the routes.

Albeit this would add an element of inconsistency with Non Combat Movement, it may be better having the Combat Movement flyover attacks firing before the Conduct Combat phase (instead of after Combat Movement itself), so that having Combat Movement before Purchase won't allow you to decide your purchase after having seen AA hits (as switching those phases is usually made for easy of play, not with the aim of changing the rules).

Cernelius commented 5 years ago

Of course, the above would imply changing the current behaviour for v2 games having Combat Movement before Purchase, possibly updating the notes of at least NWO, tRS and WaW.

panther2 commented 5 years ago

@Cernelius

Instead, the AA gun(s) should fire after all movement has been completed. AA-fire follows movement-plotting. Then it is resolved territory by territory and group by group. So the engine should keep track of the routes.

Albeit this would add an element of inconsistency with Non Combat Movement, it may be better having the Combat Movement flyover attacks firing before the Conduct Combat phase (instead of after Combat Movement itself), so that having Combat Movement before Purchase won't allow you to decide your purchase after having seen AA hits (as switching those phases is usually made for easy of play, not with the aim of changing the rules).

To represent Combat Movement before Purchase games I think the rules would be matched if there was an "AA-fire phase" at the very beginning of the Conduct Combat Phase (representing the Combat Move AA-fire), instead at the end of the Combat Movement Phase.

Cernelius commented 4 years ago

Thinking more upon it, my suggestion would be having this "AA flyover step" appening default right after Combat Movement and Non Combat Movement (if the ruleset is v2), but having a step option for setting it as always true or false after any movement and purchase phases, so that if you are making a v2 map with combat movement before purchase, but don't want to change the rules here, you can set it as false for combat movement and true for purchase, resolving the fly overs after purchase.

DanVanAtta commented 4 years ago

I added the 'needs clarification' label to this. I'm afraid in its current state it is not going to be picked up. It would be ideal to have one problem described per issue. It seems like we'll have at least one fix per version. When we submit a PR referencing a bug number, the bug is auto-closed; it's preferable and partly built in then that one issue corresponds to one problem and one fix. Beyond that, I think we need solid scenarios to be described with the actual and expected outcomes.

For example "AA gun does not fire against groups of air units (if possible)", how can that be recreated? What scenarios are actually possible? What constitutes a group of air units, are mixed air units okay or just more than one?

A second example, AA guns not firing when appropriate is one problem, casualties not being selected appropriately is actually another problem.

@panther2 would you have the patience and capacity to break this issue up and clarify the scenarios that would need to be fixed?

I believe we have 3 separate problems described in this ticket:

panther2 commented 4 years ago

@DanVanAtta I'll happily put this onto my to-do list. Unfortunately, I cannot do this on short notice.

trevan commented 3 years ago

I'm willing to work on the issues here. I just did a rework on AA (in normal battles) and their firing groups. I haven't done anything with flyovers. I'm not exactly sure what needs to be done, though.

panther2 commented 3 years ago

Sorry for the unintentional "Close".

Sounds great, @trevan .

I will be back to you within the next days, as my time is a little restricted these days.

Cernelius commented 3 years ago

I don't believe it would be opportune starting much without having first fully clarified the v1 behaviour. That should be the default behaviour, upon which you would build up the rest.

trevan commented 3 years ago

@panther2 , can you explain what you mean by "AA gun does not fire against groups of air units (if possible)"? I looked through the rules of v2 and I don't see where it mentions splitting up the air units by groups. What behavior would you expect to see in the game?

Also, is the "attacker cannot choose casualties" issue fixed? I played world war II classic and added an German AA gun to East Europe and 6 Russian bombers and fighters to Karelia S.S.R. I then moved the 6 bombers and fighters to Germany. The East Europe AA gun got a chance to fire and it hit 2 planes. I was given a casualty selection dialog to pick which two planes I wanted to loose. Then in Germany, the AA gun hit 1 plane and I was asked to pick the casualty. I'm attaching the saved game right before moving the bombers and fighters. If you open the saved game, then move the bombers and fighters to Germany, you should see the behavior I'm seeing. classic_aa_casualties_selection.zip

panther2 commented 3 years ago

@trevan

what you mean by "AA gun does not fire against groups of air units (if possible)"

In the applicable rulesets the AA-gun should fire separately against

The attacker should be free to chooses casualties from within each group, then.

Also, is the "attacker cannot choose casualties" issue fixed?

I don't know, unfortunately. v1 has never been investigated concerning all these issues. There has been so many code work since this issue has been raised (Oct. 2018) and deeply analyzed (except for v1) that it is hard for me to tell whether this issue has been affected or not.

Please don't trust the rulebook behind v2 too much, as this one has experienced the most clarifications and corrections of all.

I don't know whether you took the time to go through the above mentioned forum topics:

"The background, rules and clarifications are elaborated on in detail here: https://forums.triplea-game.org/topic/989/open-aa-revised-bug-aa-fire-casualty-selection-issues

Regarding the somehow systematic "take-out error", see especially https://forums.triplea-game.org/post/26839"

These should give you a good overview about how things are (at least were at this time) and how they should be, including clarifications.

I am sorry that I still don't have the time to deeply re-analyze all of this right now.

trevan commented 3 years ago

@trevan

what you mean by "AA gun does not fire against groups of air units (if possible)"

In the applicable rulesets the AA-gun should fire separately against

* a group of fighters

* a group of bombers

* a group of bombers carrying paratroopers

The attacker should be free to chooses casualties from within each group, then.

But what does that mean? How would the UI change to make it feel like the engine is doing that?

Also, is the "attacker cannot choose casualties" issue fixed?

I don't know, unfortunately. v1 has never been investigated concerning all these issues. There has been so many code work since this issue has been raised (Oct. 2018) and deeply analyzed (except for v1) that it is hard for me to tell whether this issue has been affected or not.

Please don't trust the rulebook behind v2 too much, as this one has experienced the most clarifications and corrections of all.

I don't know whether you took the time to go through the above mentioned forum topics:

"The background, rules and clarifications are elaborated on in detail here: https://forums.triplea-game.org/topic/989/open-aa-revised-bug-aa-fire-casualty-selection-issues

Regarding the somehow systematic "take-out error", see especially https://forums.triplea-game.org/post/26839"

These should give you a good overview about how things are (at least were at this time) and how they should be, including clarifications.

I am sorry that I still don't have the time to deeply re-analyze all of this right now.

I read through those forums. It seems like the issue for "attacker cannot choose casualties" isn't that the attacker cannot choose casualties, it is that the engine doesn't allow choosing casualties based on movement amount. Is that correct?

And this isn't AA specific since you can't do that for non AA casualties. So, should the UI group the possible casualties by available movement in addition to its current groupings (unit type, damage, owner, etc)?

Cernelius commented 3 years ago

Obviously, this should be seen in a whole TripleA perspective. Like whether or not different owners for the same units type should create distinctive grouping and, likely, having one group of bombers carrying units for every different type and number of them. @panther2 is most likely skipping them because they don't matter for the basic games (in the first example, AA fire is only defensive, so you never have eligible units belonging to more than one power, and, in the second example, there is only one type of units (infantry) that can be carried in no more than one per bomber), but all such items need to be decided, as well. I'm just pointing out that the list that @panther2 gave is for the basic games, but it is not enough for TripleA.

I still believe that we should really be sure about what is the intended v1 behaviour, first thing first. It doesn't seem to me anyone is really sure about it (I'm certainly not).

It is particularly strange to see a property called Choose AA Casualties, since I'm pretty sure in v1 you can indeed choose AA casualties. So, since v1 is the default, I would not expect to see a property for what should be the default.

So, even if the current v1 behaviour would be correct (and I'm not saying it is nor it is not), if it requires the Choose AA Casualties to be true, then I would say it would be still not correct, as v1 should be correct as default, not requiring a property to be true. This would be not the only case in which the default behaviour is not v1 compliant.

Cernelius commented 3 years ago

Also, I think that a purely random system for casualties selection may be valuable (meaning you cannot even choose to take a unit with different movement left than an other same one). Since, problems aside, this is how, at least under some property or properties, the v3 rules games appear to be working, I would keep this behaviour as a possibility for custom mapmaking.

Personally, if I cannot decide whether to take out a fighter or a bomber, I cannot see why I can decide to take out one fighter instead of another one.

Cernelius commented 3 years ago

And this isn't AA specific since you can't do that for non AA casualties. So, should the UI group the possible casualties by available movement in addition to its current groupings (unit type, damage, owner, etc)?

Please wait for @panther2, or someone the like, to confirm what I'm saying, but I believe that the equivalence (in that the fix is generally needed, and not AA specific, if this is what you mean) is true for the AA fire of v1 and the normal combat one of v5+/1940.II. For everything else, beside maybe the non-1940 Europe and Pacific, the matter is that you first divide both the eligible casualties and the dice to roll in groups, then roll the dice and assign the hits within each group separately.

trevan commented 3 years ago

@Cernelius , thanks for that information. It's good information but I don't see how that answers my questions with more clarity.

stale[bot] commented 3 years ago

I noticed there has not been much activity on this issue. Please check this issue and close it if it no longer applies. Otherwise to help move this issue move forward, please add a comment summarizing any further actions that need to be taken in order to resolve this issue.

panther2 commented 3 years ago

Still important.