Menu

#1118 No Retreat possible during Naval Battle

v1.0 (example)
closed-fixed
redrum
None
5
2015-09-10
2015-07-28
ZjelcoP
No

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

1 Attachments

Discussion

  •  triplelafayette

    triplelafayette - 2015-07-28

    I'm able to reproduce, taking a look..

     
  •  triplelafayette

    triplelafayette - 2015-07-29

    Here is the block of code where the problem is (games.strategy.triplea.delegate.BattleTracker):

                        IDelegate instance;
                        try
                        {
                                instance = (IDelegate) Class.forName(className).newInstance();
                                instance.initialize(name, displayName);
                                data.getDelegateList().addDelegate(instance);
                        } catch (final Exception e)
                        {
                                e.printStackTrace();
                                throw new IOException(e.getMessage());
                        }
                        final String next = (String) input.readObject();
                        if (next.equals(DELEGATE_DATA_NEXT))
                        {
                                instance.loadState((Serializable) input.readObject());
                        }
    

    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
  • ZjelcoP

    ZjelcoP - 2015-08-01

    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
  • ZjelcoP

    ZjelcoP - 2015-08-27

    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.

     
  • joe  mack

    joe mack - 2015-08-27

    here's a couple saves from A&A org

     
  • joe  mack

    joe mack - 2015-08-27

    here's the other

     
  •  triplelafayette

    triplelafayette - 2015-08-27

    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

     
  • redrum

    redrum - 2015-08-28

    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.

     
  • joe  mack

    joe mack - 2015-08-28

    not sure if this is what you're looking for. It goes two RDs

     
  • redrum

    redrum - 2015-08-28

    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.

     
  • redrum

    redrum - 2015-08-28

    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));

     
  •  triplelafayette

    triplelafayette - 2015-09-10

    @redrum fixed in version 1.8.0.9

     
  • redrum

    redrum - 2015-09-10
    • status: open --> closed-fixed
    • assigned_to: redrum
     
  • redrum

    redrum - 2015-09-10

    This has been fixed. Closing it.

     

Log in to post a comment.