Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.6: When opening battle calc on own territory on own turn, your country is selected as both attacker and defender. #12688

Open
asvitkine opened this issue Jul 4, 2024 · 7 comments
Assignees
Labels
Problem A problem, bug, defect - something to fix

Comments

@asvitkine
Copy link
Contributor

2.6: When opening battle calc on own territory on own turn, your country is selected as both attacker and defender.

See discussion here:
https://forums.triplea-game.org/topic/2999/2-6-release-getting-close-need-volunteers-to-help-beta-test-2-6/190?page=10

Although one could argue this "could" be helpful if you want to simulate an attack with the units of that territory, that functionality already exists via "swap sides" button.

Where it's not helpful, is when the units can debuff opposing units, so the stats shown (I guess just "power"?) are not accurate. In 2.5, it would default to an arbitrary hostile player.

@asvitkine asvitkine added the Problem A problem, bug, defect - something to fix label Jul 4, 2024
@Cernelius
Copy link
Contributor

I found this weird too, and I agree that clicking the "Swap Sides" button is generally faster.

Was this (having such units on both attack and defence instead of only defence like in 2.5) an intended change?

@Cernelius
Copy link
Contributor

In 2.5, it would default to an arbitrary hostile player.

I would rather leave it empty unless something better than a "first in some list" way of determining it is devised.

@asvitkine
Copy link
Contributor Author

I found this weird too, and I agree that clicking the "Swap Sides" button is generally faster.

Was this (having such units on both attack and defence instead of only defence like in 2.5) an intended change?

I don't think it was intended, I think that case wasn't considered and was a side effect of the overall changes to this logic.

@DanVanAtta
Copy link
Member

I don't think it was intended, I think that case wasn't considered and was a side effect of the overall changes to this logic.

Agree. I think an invariant is that the same side should never be chosen as both defender and attacker (unless somehow there is a map with exactly one faction, which is hard to imagine).

Adding recent comments from me on forum. Overall I think the algorithm should be roughly as follows (to my knowledge, this is pretty close to how it works now, these scenarios assume no battle calc window is open):

"ctrl+a" -> units owned by the current player from the given territory are selected as attackers. If no units are owned by the current player, then whomever owns the most units in the territory is chosen as the attacker. If the territory is empty, then the attacker is selected to be the territory owner (which could be "the neutral" player).

"ctrl+d" -> similar to 'ctrl+a' but operates with defense & ignores the current player (current player should be selected as the attacker)

"ctrl+b" -> same as "ctrl+a"

@frigoref
Copy link
Member

@DanVanAtta Isn't this issue about not being able to identify the pair Attacker x Defender and what should happen when this pair is not been able to clearly be determined?
From the posts above I still don't understand what the expected behavior of the game is supposed to be in this case.

@DanVanAtta
Copy link
Member

@frigoref - this is the issue:

2.6: When opening battle calc on own territory on own turn, your country is selected as both attacker and defender.

That should never be the case. Current player should always be the attacker. The logic for choosing the defender is somewhat involved, but if there are no defenders present - then whomever is at war and has the next turn is probably the best choice for defender.
For example, in WaW, ctrl+b clicking a german territory while it is Germany's turn should default to "russia" as the defender.

@frigoref
Copy link
Member

frigoref commented Aug 4, 2024

@Cernelius, @asvitkine, @DanVanAtta
Should be solved with PR 12816 - battleCalculator #1 (fix issue 12688 battle calc attacker/defender determination)
Could someone confirm and close this issue if all is fixed as expected?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Problem A problem, bug, defect - something to fix
Projects
Status: Back Log: Fix Sooner
Development

No branches or pull requests

4 participants