Battle Calculator Question/Feature?


  • Admin

    @Cernel If you have a save game reproducing the FFA error using the pre-release then I can probably take a quick look to see if I can fix it. But generally so few maps are actual FFA and so few people play them that not much attention is paid and few bugs are ever reported.

    And I don't really have a strong preference on what its called in game. It is also referred to as Odds Calculator in some places. If there is a strong consensus on what it should be named then I'm glad to update all the in-game references.


  • Moderators

    @redrum Ok, I guessed just opening Napoleonic Empires FFA, get everyone allied (possible in edit mode too), then try to open the battlecalculator was easy enough. I'll upload a savegame shortly.

    Another argument for calling stuff the correct way is that if anyone would ever develop a true Battlecalculator (something that actually calculates your odds on a probability tree), you may want to call that one as Battle/Odds Calculator, and I guess at least for a while the two utilities would coexist.


  • Moderators

    @redrum Loading this savegame (in which France is Allied with every players but Neutral):
    BugReportCernel_Napoleonic Empires FFA 8 Player_1.10_20190118_01.tsvg

    Trying to open the Battle Calculator, I get this error:

    gen 18, 2019 1:12:12 AM org.triplea.game.client.HeadedGameRunner lambda$main$0
    GRAVE: No enemies or non-allies for :PlayerId named:France
    java.lang.IllegalStateException: No enemies or non-allies for :PlayerId named:France
    	at games.strategy.triplea.odds.calculator.OddsCalculatorPanel.getEnemy(OddsCalculatorPanel.java:655)
    	at games.strategy.triplea.odds.calculator.OddsCalculatorPanel.lambda$new$0(OddsCalculatorPanel.java:348)
    	at javax.swing.JComboBox.fireActionEvent(Unknown Source)
    	at javax.swing.JComboBox.setSelectedItem(Unknown Source)
    	at games.strategy.triplea.odds.calculator.OddsCalculatorPanel.<init>(OddsCalculatorPanel.java:449)
    	at games.strategy.triplea.odds.calculator.OddsCalculatorDialog.<init>(OddsCalculatorDialog.java:67)
    	at games.strategy.triplea.odds.calculator.OddsCalculatorDialog.show(OddsCalculatorDialog.java:35)
    	at games.strategy.triplea.ui.menubar.GameMenu.lambda$new$1(GameMenu.java:75)
    	at games.strategy.ui.SwingAction$1.actionPerformed(SwingAction.java:65)
    	at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
    	at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
    	at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
    	at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
    	at javax.swing.AbstractButton.doClick(Unknown Source)
    	at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source)
    	at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(Unknown Source)
    	at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
    	at java.awt.Component.processMouseEvent(Unknown Source)
    	at javax.swing.JComponent.processMouseEvent(Unknown Source)
    	at java.awt.Component.processEvent(Unknown Source)
    	at java.awt.Container.processEvent(Unknown Source)
    	at java.awt.Component.dispatchEventImpl(Unknown Source)
    	at java.awt.Container.dispatchEventImpl(Unknown Source)
    	at java.awt.Component.dispatchEvent(Unknown Source)
    	at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
    	at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
    	at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
    	at java.awt.Container.dispatchEventImpl(Unknown Source)
    	at java.awt.Window.dispatchEventImpl(Unknown Source)
    	at java.awt.Component.dispatchEvent(Unknown Source)
    	at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
    	at java.awt.EventQueue.access$500(Unknown Source)
    	at java.awt.EventQueue$3.run(Unknown Source)
    	at java.awt.EventQueue$3.run(Unknown Source)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
    	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
    	at java.awt.EventQueue$4.run(Unknown Source)
    	at java.awt.EventQueue$4.run(Unknown Source)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
    	at java.awt.EventQueue.dispatchEvent(Unknown Source)
    	at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    	at java.awt.EventDispatchThread.run(Unknown Source)
    
    gen 18, 2019 1:12:35 AM org.triplea.game.client.HeadedGameRunner lambda$main$0
    GRAVE: null
    java.lang.NullPointerException
    	at games.strategy.triplea.odds.calculator.OddsCalculatorDialog.dispose(OddsCalculatorDialog.java:77)
    	at java.awt.Window.disposeImpl(Unknown Source)
    	at java.awt.Window$1DisposeAction.run(Unknown Source)
    	at java.awt.Window.doDispose(Unknown Source)
    	at java.awt.Window.dispose(Unknown Source)
    	at games.strategy.triplea.ui.TripleAFrame.stopGame(TripleAFrame.java:591)
    	at games.strategy.triplea.ui.display.TripleADisplay.shutDown(TripleADisplay.java:102)
    	at games.strategy.triplea.TripleA.shutDown(TripleA.java:81)
    	at games.strategy.engine.framework.ServerGame.stopGame(ServerGame.java:351)
    	at games.strategy.triplea.ui.TripleAFrame.leaveGame(TripleAFrame.java:635)
    	at games.strategy.triplea.ui.TripleAFrame$1.windowClosing(TripleAFrame.java:259)
    	at java.awt.AWTEventMulticaster.windowClosing(Unknown Source)
    	at java.awt.AWTEventMulticaster.windowClosing(Unknown Source)
    	at java.awt.AWTEventMulticaster.windowClosing(Unknown Source)
    	at java.awt.Window.processWindowEvent(Unknown Source)
    	at javax.swing.JFrame.processWindowEvent(Unknown Source)
    	at java.awt.Window.processEvent(Unknown Source)
    	at java.awt.Component.dispatchEventImpl(Unknown Source)
    	at java.awt.Container.dispatchEventImpl(Unknown Source)
    	at java.awt.Window.dispatchEventImpl(Unknown Source)
    	at java.awt.Component.dispatchEvent(Unknown Source)
    	at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
    	at java.awt.EventQueue.access$500(Unknown Source)
    	at java.awt.EventQueue$3.run(Unknown Source)
    	at java.awt.EventQueue$3.run(Unknown Source)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
    	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
    	at java.awt.EventQueue$4.run(Unknown Source)
    	at java.awt.EventQueue$4.run(Unknown Source)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
    	at java.awt.EventQueue.dispatchEvent(Unknown Source)
    	at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    	at java.awt.EventDispatchThread.run(Unknown Source)
    

    I wan to, again, point out that this problem appears to verify when a player is Allied with every other player except the null (Neutral) player. At least France should have been able to battlecalculate against Neutral. However, this is just an edge problem of a more general and more important problem: the program doesn't allow you to battlecalculate against your allies, that is a major issue for games in which you can go from Allied to War relationships (if everyone has the same units, there is the workaround of calculating against some other player you are currently not Allied with, if any).


  • Admin

    @Cernel @redrum not sure if you already have that.
    I'd like the possibility to add allied units to the defending units. Necessary for maps with tech.
    Another one would be the option to add techs in the BC. In a map like TWW you can only estimate how a certain tech changes the odds.


  • Admin

    @wirkey There is now the ability to add defenders from any territory to an open battle calc so that you can have multiple defending nations.

    Tech and damaged units are 2 things I'd like to eventually add into the BC but still aren't available at this point.


  • Admin

    The BC updates have been merged and I encourage folks to test them out the latest pre-release and give feedback here: https://github.com/triplea-game/triplea/releases/tag/1.10.13840


  • Donators

    Would be nice if the Calc button was bigger or more centered/obvious somehow.

    I keep wanting to hit close for some reason to activate it : )

    Sorry haven't checked out the new model yet. I'll give it a shot soon.

    Good work as always : )


Log in to reply