Unless I'm missing some weird rule this is a bug.
The game does not ask for retreat during a standard straight up naval battle. It just finishes the battle for you.
I have encountered this bug multiple times on multiple maps.
Savefile is during battle. When I play it, game doesn't ask for retreat.
TripleA: 1.8.0.5
AI-prerelease: 14-07-2015
I'm able to reproduce, taking a look..
Here is the block of code where the problem is (games.strategy.triplea.delegate.BattleTracker):
The instance object is the battle delegate that has our battle information it is empty initially, then by the end at "loadState" it is loaded with data that is incorrect. Specifically the combat logic says to show retreat if there is a territory to retreat to. Incorrectly SZ7 is a list off territories where a battle has occurred. That list is coming from the game save data, so the real question is perhaps why was it saved incorrectly.
@ZjelcoP
It seems like you had the game saved at the right time, how did you go about recreating this? Do you have a save from the combat move phase?
Last edit: triplelafayette 2015-07-29
Hey,
I did not recreate this battle, it just occurred during a game against AI as it has done before. I then decided to post it as a bug and therefore made the save during battle.
What I recall about those instances was that it always was a Naval battle. I believe it also always included multiple units and a mix of sea and air units attacking.
Combat-save is an autosave
CombatMove i made from history
All show the same bug to me.
Last edit: ZjelcoP 2015-08-01
More mentioning of the issue on TripleA.org since new release.
Thinking back it might have started since i started using the prerelaese jars which I'v been doing for a long time.
Now that this jar is common in 1_8_0_7 more people run in to the issue.
here's a couple saves from A&A org
here's the other
The bug actually is triggered during the combat move phase. If you could, could you attach a save game from the prior move phase, preferably at the end of combat? If not, NBD, but would be of some help
Seems like pretty much all naval only battles have this issue. You can easily reproduce it on revised turn 1 by just attacking the UK battleship with the german battleship.
not sure if this is what you're looking for. It goes two RDs
So the issue is in MustFightBattle.getAttackerRetreatTerritories(). This is returning 0 possible retreat territories for naval battles so the retreat option isn't presented. Just need to figure out why.
This code is removing the possible retreat territory:
// the air unit may have come from a conquered or enemy territory, don't allow retreating
final Match<Territory> conqueuredOrEnemy = new CompositeMatchOr<Territory>(
Matches.isTerritoryEnemyAndNotUnownedWaterOrImpassibleOrRestricted(m_attacker, m_data),
new CompositeMatchAnd<Territory>(
// Matches.TerritoryIsLand,
Matches.TerritoryIsWater, Matches.territoryWasFoughOver(m_battleTracker)));
possible.removeAll(Match.getMatches(possible, conqueuredOrEnemy));
@veqryn - It appears to have to do with the BattleTracker changes that you committed then reverted for this patch: https://sourceforge.net/p/triplea/patches/105/
These commits:
https://github.com/triplea-game/triplea/commit/1d18e9d86339683426088063e29cf8ea5204b6e0
https://github.com/triplea-game/triplea/commit/2c11ce8a2f48662ff0ec1f0705c784c97e1e331f
@redrum fixed in version 1.8.0.9
This has been fixed. Closing it.