Should the sneak attack of FirstStrike unit battle steps change during the round?
-
During a battle, the presence of destroyers affects when a firstStrike unit gets a sneak attack.
For example, a game has "Defending Subs Sneak Attack" and there is a firstStrike unit attacking another firstStrike unit. If there is a destroyer on defense, then the defending firstStrike gets a sneak attack before the attacker. If the destroyer is on offense, then the attacker gets the sneak attack. But if the destroyer isn't there, then both the attacker and defender can fire at each other.
My question is what to do if the destroyer is there at the start of the round but then gets killed during the AA phase? Imagine there is a unit that has an aaAttack and can hit a destroyer. It gets a lucky hit and the destroyer is sunk (since units hit by aa fire are removed from the battle after the aa phase).
Should the firstStrike units change their sneak attacks? If destroyer was a defender, should the defender firstStrike lose its sneak attack against the attacker firstStrike? And vice versa if the destroyer was an attacker?
Right now, the code sets the sneak attack of the firstStrike units at the beginning of the round. But that could be just because aa units originally couldn't hit destroyers. I don't think this scenario is possible in any of the classic rules.
The main reason I'm asking this is because I realized that the way I was refactoring the sub steps would cause the sneak attack of a FirstStrike unit to change in the middle of the round. And as I thought about the consequences, I wondered if this change is actually a good change.
Also, if the sneak attack can change, then the UI might have a problem. This is because the list of steps shown in the UI is set at the beginning of the round. If the destroyer does die during the aa phase, the list of steps may need to change.
Thoughts?
(Also, I'm not exactly sure if this should be asked in this forum or in github)
-
@Trevan What actually is a firstStrike unit? Is "firstStrike" synonymous to "surprise strike"? And is "sneak attack" used synoymously to "surprise strike", too?
Just trying to understand how the terms match the core game rules...And in that context an AA-gun would be totally different from a submarine, IMHO, ... so how is all of this meant to be?
Maybe it is all developer's talk, so beyond my sphere from some point on. But your posting reads as if core game rules might be concerned. If not... I'll be quiet immediately.
-
@Trevan said in Should the sneak attack of FirstStrike unit battle steps change during the round?:
...> (Also, I'm not exactly sure if this should be asked in this forum or in github)
Yea nobody else probably does either : )
For simplicity I wouldn't have it change. Just consider the DD already doing it's part in the first strike process before it gets slayed.
I see your point. You have a unit that targets the DD with AA so the DD can't negate the sub if it dies. If it doesn't negate it's abilities then why have it tho is the problem. I guess you'd just have to test it and see how confusing it is to use.
-
Thinking about this some more, my understanding is it goes AA attack, isDestroyer kicks in and then sub first strike. So is Destroyer is determined by the presence of the DD which is there before the AA unit attacks it and if it kills it, you then need to skip past it and go to the sub first strike.
Idk the difficulties in coding something like that but don't see an issue with it behaving that way. As far as Panther's concern, I'd think it would only impact a "mod" of the core rules, e.g. no AA unit then it wouldn't affect anything.
-
@Panther What I believe @Trevan is asking is whether or not the AA fire is more of a "first strike" than the surprise strike.
In practice, think about you have a house rules modified game in which you add a "minefield", or whatever, unit that is exactly the same as an AA gun, except that it is a sea unit and targets all sea units (instead of all air units). Would the "minefield" resolve its fire and remove casualties before, at the same moment or after the "submarine" make their strikes?
@Trevan Let me know if I understood you correctly. I think I understand exactly what you mean, but you are not being very clear. For example, here:
For example, a game has "Defending Subs Sneak Attack" and there is a firstStrike unit attacking another firstStrike unit. If there is a destroyer on defense, then the defending firstStrike gets a sneak attack before the attacker. If the destroyer is on offense, then the attacker gets the sneak attack. But if the destroyer isn't there, then both the attacker and defender can fire at each other.
Instead of "then both the attacker and defender can fire at each other", I assume you mean "then both the attacker and defender can strike first" ("first strike" is "surprise strike" @Panther). Side note, you are clearly referring to v3 and later rules destroyers only, not v1 or v2 ones.
-
I don't think core rules will be affected, though I'm not exactly sure what you mean by "core rules" I don't think AA guns are ever in the same battle with Subs in the core rules.
I'll try and explain what I'm talking about better.
In a battle round, there are 4 main firing phases in the code: AA, navalBombardment, firstStrike, regular. Any unit with
isAA
,attackAA
,offensiveAttackAA
, etc properties will be able to fire during the AA phase. Units withcanBombard
property will be able to fire during the navalBombardment phase. Units withisFirstStrike
property will be able to fire during the firstStrike phase (originally these were only subs but now any unit can have this property). The rest of the units fire during the regular phase (this does include units that fired during the AA phase if they also have regularattack
/defense
properties).Units that were hit in each phase are removed after the phase and can not fire back, unless certain options are enabled or certain situations are present. For the AA phase, I don't see any option that disables that ability. All units hit during the AA phase are removed from battle after the phase. In the navalBombardment phase, hit units can fire back if "Naval Bombard Casualties Return Fire" is true. In the firstStrike phase, it depends on whether a unit with
isDestroyer
is present.So, if you have a battle with units with AA abilities, any unit that is hit by them is removed from the battle immediately after the AA phase. These units do not get to fire back. Even if they are
isFirstStrike
units. And since these units don't get to fire back, my question is: "Should they also still affect the firstStrike phase?" -
@Cernel said in Should the sneak attack of FirstStrike unit battle steps change during the round?:
@Panther What I believe @Trevan is asking is whether or not the AA fire is more of a "first strike" than the surprise strike.
In practice, think about you have a house rules modified game in which you add a "minefield", or whatever, unit that is exactly the same as an AA gun, except that it is a sea unit and targets all sea units (instead of all air units). Would the "minefield" resolve its fire and remove casualties before, at the same moment or after the "submarine" make their strikes?
In the current engine, units hit by AA fire are removed from the battle before
isFirstStrike
(aka subs) can fire. So the "minefield" will have removed the "submarine" before it gets to fire.@Trevan Let me know if I understood you correctly. I think I understand exactly what you mean, but you are not being very clear. For example, here:
For example, a game has "Defending Subs Sneak Attack" and there is a firstStrike unit attacking another firstStrike unit. If there is a destroyer on defense, then the defending firstStrike gets a sneak attack before the attacker. If the destroyer is on offense, then the attacker gets the sneak attack. But if the destroyer isn't there, then both the attacker and defender can fire at each other.
Instead of "then both the attacker and defender can fire at each other", I assume you mean "then both the attacker and defender can strike first" ("first strike" is "surprise strike" @Panther). Side note, you are clearly referring to v3 and later rules destroyers only, not v1 or v2 ones.
I have no idea if I'm referring to v3, v2, or v1 destroyers since I don't know what that exactly means. I'm just referring to how the code treats the destroyers.
As for the battle, "then both the attacker and defender can fire at each other" means that neither gets a sneak attack on each other. The attacker can fire and hit the defender, but the defender can fire back. The presence of an
isDestroyer
on either side changes that. If it is on the offense, then if the attackerisFirstStrike
hits the defenderisFirstStrike
, it is removed from battle and can't fire back and vice versa. When I say "sneak attack", I'm talking about the ability to hit the target and not allow them to fire back. -
@beelee said in Should the sneak attack of FirstStrike unit battle steps change during the round?:
Thinking about this some more, my understanding is it goes AA attack, isDestroyer kicks in and then sub first strike. So is Destroyer is determined by the presence of the DD which is there before the AA unit attacks it and if it kills it, you then need to skip past it and go to the sub first strike.
Idk the difficulties in coding something like that but don't see an issue with it behaving that way. As far as Panther's concern, I'd think it would only impact a "mod" of the core rules, e.g. no AA unit then it wouldn't affect anything.
My current refactoring of
MustFightBattle
will, by default, act in the new way. So unless I make changes to how I'm doing things, the engine will pick up this new battle mechanism. The reason is that I'm checking for the presence of theisDestroyer
unit during the actual firstStrike phase. So if theisDestroyer
unit has been killed in the aa phase, then it won't be visible during the firstStrike phase. The current code in the engine does all of these checks at the start of the round. -
@Trevan said in Should the sneak attack of FirstStrike unit battle steps change during the round?:
Units that were hit in each phase are removed after the phase and can not fire back, unless certain options are enabled or certain situations are present. For the AA phase, I don't see any option that disables that ability. All units hit during the AA phase are removed from battle after the phase. In the navalBombardment phase, hit units can fire back if "Naval Bombard Casualties Return Fire" is true. In the firstStrike phase, it depends on whether a unit with
isDestroyer
is present.Regarding
firstStrike
, this is true for v2 rules submarines, but not for v3 rules ones. V3 rules ones would simply fire in the normal phase, if a destroyer is present on the opposite side.I'm talking about the "intended" rules, not the current TripleA program behaviour, whatever that is.
-
@Cernel What I described is how the code works. It is true for both v2 and v3 submarines. I think what you are describing is whether the attacked units can fire back. And yes, if a destroyer is present, then the units hit by the
isFirstStrike
units can fire back. If a destroyer isn't present, then the units are immediately removed. -
@Trevan said in Should the sneak attack of FirstStrike unit battle steps change during the round?:
@Cernel said in Should the sneak attack of FirstStrike unit battle steps change during the round?:
@Panther What I believe @Trevan is asking is whether or not the AA fire is more of a "first strike" than the surprise strike.
In practice, think about you have a house rules modified game in which you add a "minefield", or whatever, unit that is exactly the same as an AA gun, except that it is a sea unit and targets all sea units (instead of all air units). Would the "minefield" resolve its fire and remove casualties before, at the same moment or after the "submarine" make their strikes?
In the current engine, units hit by AA fire are removed from the battle before
isFirstStrike
(aka subs) can fire. So the "minefield" will have removed the "submarine" before it gets to fire.@Trevan Let me know if I understood you correctly. I think I understand exactly what you mean, but you are not being very clear. For example, here:
For example, a game has "Defending Subs Sneak Attack" and there is a firstStrike unit attacking another firstStrike unit. If there is a destroyer on defense, then the defending firstStrike gets a sneak attack before the attacker. If the destroyer is on offense, then the attacker gets the sneak attack. But if the destroyer isn't there, then both the attacker and defender can fire at each other.
Instead of "then both the attacker and defender can fire at each other", I assume you mean "then both the attacker and defender can strike first" ("first strike" is "surprise strike" @Panther). Side note, you are clearly referring to v3 and later rules destroyers only, not v1 or v2 ones.
I have no idea if I'm referring to v3, v2, or v1 destroyers since I don't know what that exactly means. I'm just referring to how the code treats the destroyers.
As for the battle, "then both the attacker and defender can fire at each other" means that neither gets a sneak attack on each other. The attacker can fire and hit the defender, but the defender can fire back.
Then, you are wrong. If there are no destroyers at all in the battle, both under v2 and v3+ rules (v1 doesn't matter here, as only offensive submarines can), all submarines offensively and defensively "sneak attack" on each other. This too implies that the defender can fire back, but the reason is because the defender is "sneak attacking" too, not because "neither gets a sneak attack". Under v2 rules, the fact that all submarines offensively and defensively "sneak attack" is actually true also in any case of destroyer presence, as the destroyer has the function of delaying "sneak attack" casualties removal.
To be clear, I understand that you are substantially understanding the matter correctly, but you are explaining it wrongly, especially in the moment you say "neither gets a sneak attack on each other", because you don't get a sneak attack on something specifically. I believe you should have said something like "neither is able to cause any removal of sneak attack able units before they can fire too", instead.
-
@Trevan said in Should the sneak attack of FirstStrike unit battle steps change during the round?:
@Cernel What I described is how the code works. It is true for both v2 and v3 submarines. I think what you are describing is whether the attacked units can fire back. And yes, if a destroyer is present, then the units hit by the
isFirstStrike
units can fire back. If a destroyer isn't present, then the units are immediately removed.I was saying how I understand the code should work. Simply put, v2 destroyers are like enabling the fire back property for naval bombardment, in that the step remains there, with all its units partaking, but the casualties stay in the battle until they can fire back. V3 destroyers, instead, move all opposing units out of the step, to fire in the normal attack/defence ones. I hope now it's all clear.
-
@Trevan said in Should the sneak attack of FirstStrike unit battle steps change during the round?:
Units that were hit in each phase are removed after the phase and can not fire back, unless certain options are enabled or certain situations are present.
By the way, this is wrong for naval bombardment. Naval bombardment casualties should always be able to fire back normally, unless a property is enabled (true) to make them unable to. This in accordance with TripleA being as default set on v1 rules (only v2 has the no-fire back behaviour for naval bombardment casualties).
Still talking about the correct "intended" rules, not the TripleA program (wrong) behaviour.
-
@Cernel said in Should the sneak attack of FirstStrike unit battle steps change during the round?:
Then, you are wrong. If there are no destroyers at all in the battle, both under v2 and v3+ rules (v1 doesn't matter here, as only offensive submarines can), all submarines offensively and defensively "sneak attack" on each other. This too implies that the defender can fire back, but the reason is because the defender is "sneak attacking" too, not because "neither gets a sneak attack". Under v2 rules, the fact that all submarines offensively and defensively "sneak attack" is actually true also in any case of destroyer presence, as the destroyer has the function of delaying "sneak attack" casualties removal.
To be clear, I understand that you are substantially understanding the matter correctly, but you are explaining it wrongly, especially in the moment you say "neither gets a sneak attack on each other", because you don't get a sneak attack on something specifically. I believe you should have said something like "neither is able to cause any removal of sneak attack able units before they can fire too", instead.
Yes, it is most likely I'm using the wrong terminology. I don't know the terminology that is commonly used in the triplea community. I'm picking it up based on the code which I've learned doesn't use the correct terminology either.
For me, "sneak attack" means that the unit can't fire back. It doesn't mean what order it occurs. I would actually say that AA units and NavalBombardment also have "sneak attack" when their targets can't fire back.
-
@Trevan said in Should the sneak attack of FirstStrike unit battle steps change during the round?:
For me, "sneak attack" means that the unit can't fire back. It doesn't mean what order it occurs. I would actually say that AA units and NavalBombardment also have "sneak attack" when their targets can't fire back.
@Trevan Calling it "sneak attack" (which is indeed in accordance with the rather spurious TripleA terminology) has also the issue that people might understand you are referring only to "attacking" submarines, not both attacking and defending ones. I guess this terminology is a relic from the times when TripleA was a highly hardcoded program to play only Classic (in which submarines are "sneaky" only on the offensive). Maybe it's better we rather stick with "first strike" instead, that has at least the benefit of being neutrally worded with respect to attack and defence.
It's not a problem for me. I'm just saying others might think you are referring to "attacking" submarines only, though.
Side note, I dislike the attack/defence dichotomy, and would like it being changed to a correct offence/defence one, instead. Of course, this is off topic.
-
@Trevan said in Should the sneak attack of FirstStrike unit battle steps change during the round?:
... And since these units don't get to fire back, my question is: "Should they also still affect the firstStrike phase?"
So if the AA shot kills the DD the DD can't shoot back but it still prevents the sub's "First Strike" ? If so, imo it shouldn't be able to. If the AA unit kills the isDestroyer unit then the isDestoyer should have no impact.
-
So, back to the original question.
I'd like to make this change in the logic since it is easier for me to code. I also think it makes sense. But the battle UI dialog (the one that you see during the actual battle) will be problematic. It currently figures out the list of steps at the beginning of the round. With this change, the list of steps can change (an example would be the "first strike casualty selection" step would originally not be there but if the destroyer dies, it will need to be there).
Here's what the UI shows when a destroyer is present:
Here's what the UI shows when a destroyer is not present:
So, imagine there is an AA phase in that first screen. The AA fires and hits the destroyer. At that point, the list of phases needs to be updated to look like the second screen.
Is it ok to either show all the possible steps? Or should the list of phases change after the AA phase is over?
-
@Trevan said in Should the sneak attack of FirstStrike unit battle steps change during the round?:
So, back to the original question.
I'd like to make this change in the logic since it is easier for me to code. I also think it makes sense. But the battle UI dialog (the one that you see during the actual battle) will be problematic. It currently figures out the list of steps at the beginning of the round. With this change, the list of steps can change (an example would be the "first strike casualty selection" step would originally not be there but if the destroyer dies, it will need to be there).
Here's what the UI shows when a destroyer is present:
Here's what the UI shows when a destroyer is not present:
So, imagine there is an AA phase in that first screen. The AA fires and hits the destroyer. At that point, the list of phases needs to be updated to look like the second screen.
Is it ok to either show all the possible steps? Or should the list of phases change after the AA phase is over?
If you mean that this is a situation in which only the Germans have submarines while only the British may have destroyers, what is being depicted here is nothing correct, in the first place. It looks to me like a wrong mixing up of v2 and v3~5 rules. It is clearly v3~5 rules in the moment I see the submarines can "withdraw" (I assume that means submerge...) before anything else listed. However, then I see that, in what I understand is the case with British destroyers present (the first one), the Germans "first strike units" still fire during what I assume is substantially the opening fire step, while the casualties are removed in the normal step for it (instead of immediately after the opening fire), which is according to v2 rules, but contrary to v3~5 rules. If this would be actually v3~5 rules, that "Germans first strike units fire" step should not be there, either (or, more exactly, should be there with no submarines firing during it), the submarines firing in the normal attack step, instead (except still rolling separately from the rest of units if not sharing the same possible targets).
As always, I defer to @Panther to correct me if I'm saying anything wrong.
-
@Cernel said in Should the sneak attack of FirstStrike unit battle steps change during the round?:
If you mean that this is a situation in which only the Germans have submarines while only the British may have destroyers, what is being depicted here is nothing correct, in the first place. It looks to me like a wrong mixing up of v2 and v3~5 rules. It is clearly v3~5 rules in the moment I see the submarines can "withdraw" (I assume that means submerge...) before anything else listed. However, then I see that, in what I understand is the case with British destroyers present (the first one), the Germans "first strike units" still fire during what I assume is substantially the opening fire step, while the casualties are removed in the normal step for it (instead of immediately after the opening fire), which is according to v2 rules, but contrary to v3~5 rules. If this would be actually v3~5 rules, that "Germans first strike units fire" step should not be there, either (or, more exactly, should be there with no submarines firing during it), the submarines firing in the normal attack step, instead (except still rolling separately from the rest of units if not sharing the same possible targets).
As always, I defer to @Panther to correct me if I'm saying anything wrong.
I don't understand what you said. That is an actual screen shot from TripleA 2.1 using WW2 Global 2nd. There are no custom modifications to it. The top screen shot is from two German subs attacking the British fleet (battleship, cruise, and destroyer) off the eastern coast of Scotland. The bottom screen shot is from two German subs attacking the British/French fleet (battleship and two cruisers) in the English Channel.
Also, I'm not sure how that helps in answering my question. Should the screen be updated dynamically after the AA phase (which isn't shown in the images, so you'll just have to imagine it) to look like the bottom image, or should the phases in the bottom image be always visible since they may or may not occur depending on the results of the AA phase.
-
@Trevan
The screen should reflect the battle that occurs after AA fire has been resolved.
The rules clearly state that AA fire is executed before the first round of combat (of the General Combat seqence).
Submarines fire either during step 2 (no enemy destroyer present) and/or step 4-5 (enemy destroyer present) of the General Combat sequence.