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

Prevent senseless BattleTable display and fix right-click issues #7003

Merged
merged 4 commits into from
Jun 2, 2022

Conversation

SomeTroglodyte
Copy link
Collaborator

Select a city, then select a city from another nation. You get the BattleTable "what-if I could bombard that city". Even if half the world away. Pretty senseless. I thought - OK, try to limit, but don't just prevent display if no attack possible. Maybe display if the battle could conceivably happen next turn. This is only on approximation so far, but it already feels better.

Thing is, getMaxMovement returns 1 for air units. No relation to reality. But, with this code, I could "compare strengths" with a Bomber and a City one tile outside its range, but not one two tiles too far. Should I fix this in the original Unit getMaxMovement code, or in the ICombatant proxy I added because it makes sense and things easier, or correct in the threatRange calculation? Once that is done, should I "predict" increased range ("could happen next turn") for: -Operational Range promotion? -Relocation to another City? Simplify potential relocation as a guesstimate by not checking cities one could relocate to but simply doubling range?

The right-click issues part - after a RC move currently TileInfoTable is wrong, and after a RC attack the unit info too. Or - select an Artillery, then a city on another continent 30 tiles away. You get the BattleTable. Now RC-move it one tile - the BattleTable is still there. With the above fix this could look even more ridiculous, with the BT appearing after a RC move because the selectedTile still remembered an ages old selection... I think these lines a left click would do but were missing in RC should do it. Please comment if anybody knows counter arguments.

@Azzurite
Copy link
Collaborator

How about just preventing it city-to-city? I've so far liked to be able to see how my unit X would handle a fight with enemy unit Y halfway across the map even though I only see them by some boat scouting their stuff.

@SomeTroglodyte
Copy link
Collaborator Author

That was one vote, accepted. Other votes?

@yairm210
Copy link
Owner

yairm210 commented Jun 1, 2022

Agree, cities can never bombard cities, but other combat is potentially viable so it's good data

@SomeTroglodyte SomeTroglodyte marked this pull request as draft June 1, 2022 15:38
@SomeTroglodyte
Copy link
Collaborator Author

Two votes it is. Mine only counts half - the other aspects are more important. Will need "a minute" to simplify this.

@SomeTroglodyte SomeTroglodyte marked this pull request as ready for review June 2, 2022 01:33
@SomeTroglodyte
Copy link
Collaborator Author

BattleTable reduction down to only city-city prevented. I didn't complicate it by checking whether a mod might have made cities bombarding each other possible, though. Think that would be prudent?

The other part - no outdated info or disappearing units after right-click - is worth it alone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants