TripleA Logo TripleA Forum
    • TripleA Website
    • Categories
    • Recent
    • Popular
    • Users
    • Groups
    • Tags
    • Register
    • Login

    Battle Calculator Question/Feature?

    Scheduled Pinned Locked Moved Feature Requests & Ideas
    27 Posts 7 Posters 13.1k Views 7 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • redrumR Offline
      redrum Admin @LaFayette
      last edited by

      @LaFayette Good suggestions. I'd like to move towards a single battle calc window with tabs vs multiple windows. I think that will make a lot of things easier to manage and more clear what your 'active' tab is for adding units with hotkeys while keeping other calcs around. I'm already working on making sure it "adds" and not "replaces" units and that you can change to a different allied nation as the defender and it not clear the units.

      The unit lists idea is an interesting one as well and hadn't thought that far ahead yet.

      TripleA Developer with a Passion for AI: https://forums.triplea-game.org/topic/105/ai-development-discussion-and-feedback

      1 Reply Last reply Reply Quote 1
      • redrumR Offline
        redrum Admin
        last edited by

        Initial PR for some of the changes is up: https://github.com/triplea-game/triplea/pull/4576

        TripleA Developer with a Passion for AI: https://forums.triplea-game.org/topic/105/ai-development-discussion-and-feedback

        1 Reply Last reply Reply Quote 2
        • redrumR Offline
          redrum Admin
          last edited by redrum

          Changes so far:

          • Added ability to use CTRL+A and CTRL+D to add attackers and defenders to last active battle calc window
          • Improved default player selection for attacker and defender when opening a new battle calc
          • Allow changing defending player in BC and if any of the current units are owned by the new defending player then units no longer reset
          • When switching players in BC, it only moves over the units of the new attacking player (not any allied units which can't actually attack)
          • BC considers isInfra units in unit counts and TUV (otherwise you could add combat isInfra units and it would appear they would always improve your TUV chance even if they were pretty much always being lost)
          • Can have 0 move and can't combat move units in BC attackers for maps which have limited combat rounds (this is because battles can last more than 1 round so these units can become attackers)
          • Changed action tab hotkey to 'C' and updated help menu
          • Defending units now create separate columns for each player
          • Scales appropriately based on unit list and number of defending players but also has a max window size slightly smaller than TripleA window

          TripleA Developer with a Passion for AI: https://forums.triplea-game.org/topic/105/ai-development-discussion-and-feedback

          1 Reply Last reply Reply Quote 4
          • redrumR Offline
            redrum Admin
            last edited by redrum

            Here are some examples of the updated BC.

            Global 40 Before
            0d00c57b-5678-4467-b8e0-6f35f14d9a3e-image.png

            Global 40 After
            21683464-727c-4b93-83b1-435b126963bb-image.png

            Dragon War - Using CTRL+D to Add Defenders
            f95583ac-3128-4911-8ff4-8712697e7003-image.png

            Dragon War - BC Includes IsInfra Unit Value in TUV
            0c482f88-7e57-4028-bf2e-0c3e3bd98d32-image.png

            TripleA Developer with a Passion for AI: https://forums.triplea-game.org/topic/105/ai-development-discussion-and-feedback

            1 Reply Last reply Reply Quote 2
            • FrostionF Offline
              Frostion Admin
              last edited by Frostion

              @redrum Very nice improvements. 😃 Would it not be a good idea to add some sort of information and instructions about how to use these features? I could imagine a little help button some where in the window that opened a popup with all shortcut keys and what they did. Button could be a little icon like: alt text

              Map maker of: Star Wars: Galactic War + Star Wars: Tatooine War + Caribbean Trade War + Dragon War + Age of Tribes + Star Trek: Dilithium War + Iron War + Iron War: Europe + Warcraft: War Heroes

              redrumR 1 Reply Last reply Reply Quote 1
              • redrumR Offline
                redrum Admin @Frostion
                last edited by redrum

                @Frostion Yeah, that's probably a good idea. I'd like to at least get the changes in the pre-release and have a few folks try it out then we can probably come up with some help text. I also added buttons for adding attackers/defenders in the territory tab under the battle calc one.

                TripleA Developer with a Passion for AI: https://forums.triplea-game.org/topic/105/ai-development-discussion-and-feedback

                1 Reply Last reply Reply Quote 1
                • C Offline
                  Cernel Moderators
                  last edited by

                  First advice first, I already made a number of times, is changing the name of the Battle Calculator/Odds Calculator to "Battle Simulator". It doesn't calculate your odds: it simulates battles a number of times and make statistics out of it.


                  Probably not the best place to talk about this, as this is a problem rather than a feature request (unless FFA and such are not meant to be supported, which I assume it is not the case), but there is still that long standing problem (bug?) that the battlecalculator doesn't allow you to calculate against Allies.

                  Obviously, this is tailored for all those games in which you have two sides committed against one another, that is true even in the case of diplomatically dynamic games like "WW2 Global" (where it can never happen a same other player switching from Allied to War with you, or vice versa), but it breaks down any games in which a player you are currently Allied with may be at War with you in the future, and you want to calculate now for any occurrences (the game may even allow to go directly from Allied to War, at the start of one's turn, so you would really want to calculate your defence, at least, there).

                  This is a major problem for games allowing to go Allied to War (directly or indirectly) and vice versa and having player specific frontiers, while it is mostly just an annoyance for games in which all players have the same frontier, which is actually the case for almost all such games, as you can just calculate using one of the players you are not at war with, except that, if you are allied with everyone, the Battlecalculator breaks down completely.

                  If you play "Napoleonic Empires: FFA 8 Player" and keep upgrading all relationships you can with France, getting always accepted, after the Politics of Round 3, if you try to open the Battlecalculator with France, you will get a warning:

                  "No enemies or non-allies for :Playerld named:France

                  And the following in the console:

                  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)
                  

                  With this said, I think it has been a few years since I've seen anyone playing any Napoleonic Empires FFA, and that's the most popular (and arguably best) multi-sides politic game TripleA offers. And, on top of that, if, playing a wargame, you end up allied with everyone, there must be a problem with that game, but I can say this indeed happens when you play Napoleonic Empires FFA (I remember of people complaining they were unable to use the battlecalculator, because of this, after they got allied with everyone...).

                  Aside from this, I believe the battlecalculator has a number of minor issues and marginal unsupported items. I'll see to try to recall them, if I can remember them all, and make a compilation here, if there is interest in making a general clean up for this utility.

                  1 Reply Last reply Reply Quote 1
                  • C Offline
                    Cernel Moderators
                    last edited by

                    Also, bugging myself off by trying to battlecalculate when everyone Allied crashed TripleA leaving it invisible. So I just had to open task manager to kill the process, or I couldn't delete that map's zip.

                    redrumR 1 Reply Last reply Reply Quote 0
                    • redrumR Offline
                      redrum Admin @Cernel
                      last edited by redrum

                      @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.

                      TripleA Developer with a Passion for AI: https://forums.triplea-game.org/topic/105/ai-development-discussion-and-feedback

                      C 2 Replies Last reply Reply Quote 0
                      • C Offline
                        Cernel Moderators @redrum
                        last edited by

                        @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.

                        1 Reply Last reply Reply Quote 0
                        • C Offline
                          Cernel Moderators @redrum
                          last edited by

                          @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).

                          wirkeyW 1 Reply Last reply Reply Quote 0
                          • wirkeyW Offline
                            wirkey Moderators @Cernel
                            last edited by

                            @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.

                            redrumR 1 Reply Last reply Reply Quote 0
                            • redrumR Offline
                              redrum Admin @wirkey
                              last edited by

                              @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.

                              TripleA Developer with a Passion for AI: https://forums.triplea-game.org/topic/105/ai-development-discussion-and-feedback

                              1 Reply Last reply Reply Quote 0
                              • redrumR Offline
                                redrum Admin
                                last edited by

                                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

                                TripleA Developer with a Passion for AI: https://forums.triplea-game.org/topic/105/ai-development-discussion-and-feedback

                                1 Reply Last reply Reply Quote 3
                                • B Offline
                                  beelee
                                  last edited by

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

                                  1 Reply Last reply Reply Quote 0

                                  Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                                  Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                                  With your input, this post could be even better 💗

                                  Register Login
                                  • 1
                                  • 2
                                  • 2 / 2
                                  • First post
                                    Last post
                                  Copyright © 2016-2018 TripleA-Devs | Powered by NodeBB Forums