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

    Fast Battle Calculator

    Scheduled Pinned Locked Moved Development
    44 Posts 7 Posters 14.0k 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.
    • C Offline
      Cernel Moderators Lobby Moderators @RaiNova
      last edited by

      @rainova said in Fast Battle Calculator:

      @Cernel Look's like my battle calculator will be able to handle 99.99% of all BC270 battles (probably everything with armies smaller than 256 units on one side 😁).

      Please be sure to clarify whether you are talking about "270BC" or about "270BC Wars": they are very different games. In "270BC" is not rare to have a side having over 200 units in a battle, whereas in "270BC Wars" that is almost impossible (because stacks are much smaller in "270BC Wars", compared to "270BC").

      I'll keep the functional discussion in this forum and leave github for technical issues (like naming classes).

      Seems a good way to go.

      Here are some questions:

      I suggest keeping the current battle-calculator beside this new one

      Is this in order to be able to validate the new calculator's results or would you like to choose to get some randomness in your results when you feel like it? The latter makes no sense to me.

      Even if you would cover everything, I'm not sure there may be problems now, and I think there is at least a chance something in the future may be not supported properly or at all.
      Moreover, I think it is better that any developer adding a new feature which may impact on the battle-calculator is not demanded to update the battle-calculator too.

      Besides, are you excluding that (at least for low enough run-counts) the current battle calculator may be faster than the new one in some cases?

      (The new calculator will probably not cover every battle, so as a backup for such battles, the current calculator will remain.)

      Maybe hiding the current if the program detects that every battle is fully covered for the currently selected game may be good, but I would also add an option in Engine Preferences for having it always.

      I am starting to work on the BC270 artillery.

      Unfortunately, the "270BC Wars" artillery has the issue that it gets taken as casualty or removed too soon, because the autoselector doesn't see it (so an offence/defence 0/0 unit with some powerful AA ability is just seen as powerless). Reliable results can only be obtained using "Order of Losses".

      Could you (or anybody else) point me to a precise description of all the relevant attributes resp. write/publish something?

      Are you aware that the main official TripleA documentation on game file coding is
      https://github.com/triplea-maps/the_pact_of_steel/blob/master/map/games/pact_of_steel_2.xml
      ?

      I found nothing about offensiveAttackAAmaxDieSides for example.

      Read
      https://github.com/triplea-maps/the_pact_of_steel/blob/be0efc7042287dd24a2bbb57e5bc01f4fe4fe5d7/map/games/pact_of_steel_2.xml#L1933
      and
      https://github.com/triplea-maps/the_pact_of_steel/blob/be0efc7042287dd24a2bbb57e5bc01f4fe4fe5d7/map/games/pact_of_steel_2.xml#L1930

      I have difficulties working it out from the code, because of the heavy use of Lombok (and because I was really a C++ programmer back then (i.e. at the turn of the millenia) and now I a much more comfortable with Kotlin than with Java). Given the success of TripleA and the power of all those attributes, the docu deserves an upgrade anyway IMHO.

      I'm not sure what "docu" you are referring to.

      In 270BC_Wars.xml you define an option AttackAA. Shouldn't it be attackAA?

      All occurrences of "AttackAA" and "AttackAAmaxDieSides" should be, respectively, "attackAA" and "attackAAmaxDieSides".
      However, I'm not aware such wrong casing has any actual negative consequences. Has it?
      Unfortunately, I don't believe TripleA offers anything to check for such cases, so I think that they are widespread across games.

      1 Reply Last reply Reply Quote 0
      • R Offline
        RaiNova
        last edited by

        @cernel said in Fast Battle Calculator:

        Please be sure to clarify whether you are talking about "270BC" or about "270BC Wars": they are very different games.

        I meant "270BC Wars".

        In "270BC" is not rare to have a side having over 200 units in a battle, whereas in "270BC Wars" that is almost impossible (because stacks are much smaller in "270BC Wars", compared to "270BC").

        If I run "270BC" with Hard AI for all players: Do I get to realistic scenarios?

        C 1 Reply Last reply Reply Quote 0
        • R Offline
          RaiNova
          last edited by

          @cernel said in Fast Battle Calculator:

          Unfortunately, the "270BC Wars" artillery has the issue that it gets taken as casualty or removed too soon, because the autoselector doesn't see it (so an offence/defence 0/0 unit with some powerful AA ability is just seen as powerless). Reliable results can only be obtained using "Order of Losses".

          This also means that the AI removes its artillery units too early. How would you like to express in the xml file where in the order of losses the respective artillery types belong?

          C 1 Reply Last reply Reply Quote 0
          • R Offline
            RaiNova
            last edited by RaiNova

            @cernel said in Fast Battle Calculator:

            I'm not sure what "docu" you are referring to.

            Looks like the main docu is pact_of_steel_2.xml, thanks for pointing that out to me ( @beelee thanks to you, too 🙂).
            I've also found something on https://axisandallies.fandom.com/ .

            I'd prefer an md file in the docs folder of the triplea github repository. Is there anybody else with that demand?

            1 Reply Last reply Reply Quote 1
            • R Offline
              RaiNova
              last edited by

              @cernel said in Fast Battle Calculator:

              However, I'm not aware such wrong casing has any actual negative consequences. Has it?

              It hasn't. I was just picky, because I am uncertain.

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

                @rainova said in Fast Battle Calculator:

                If I run "270BC" with Hard AI for all players: Do I get to realistic scenarios?

                It has been a long time since I did that, but I'm pretty sure Hard AI is going to play the game very differently from any good player.

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

                  @rainova said in Fast Battle Calculator:

                  This also means that the AI removes its artillery units too early. How would you like to express in the xml file where in the order of losses the respective artillery types belong?

                  I'm not sure what you are asking. Do you mean giving the game-maker a way to determine what the autoselection is going to be, like making a list of units from the first to the last one to autoselect? I don't think that would belong to the game file (as long as the player is not forced to go by the autoselection), as such file is about defining the rules of the game. Moreover, a static listing per game would not cover the case of units changing values during the course of the game (usually because of technology).

                  Are you thinking about something like
                  https://forums.triplea-game.org/topic/1580/support-priority-definition
                  but for the autoselector?

                  C 1 Reply Last reply Reply Quote 0
                  • B Online
                    beelee
                    last edited by

                    @RaiNova this may prove easier to navigate. Basically same as POS2 I believe

                    http://www.starlords3k.com/XOB.html

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

                      @cernel said in Fast Battle Calculator:

                      @rainova said in Fast Battle Calculator:

                      This also means that the AI removes its artillery units too early. How would you like to express in the xml file where in the order of losses the respective artillery types belong?

                      I'm not sure what you are asking. Do you mean giving the game-maker a way to determine what the autoselection is going to be, like making a list of units from the first to the last one to autoselect? I don't think that would belong to the game file (as long as the player is not forced to go by the autoselection), as such file is about defining the rules of the game. Moreover, a static listing per game would not cover the case of units changing values during the course of the game (usually because of technology).

                      Are you thinking about something like
                      https://forums.triplea-game.org/topic/1580/support-priority-definition
                      but for the autoselector?

                      Ideally, in my opinion, the auto-selector should present a selection that, for the whole combat, dynamically assures the average TUV swing is going to be as favourable as possible to the side under the assumption that the other side has the same dynamic selection. Even for simple games, this may be tricky when it comes to decide whether or not to take bombers before something else in defence (for example, taking defending bombers before fighters surely improves the defender's winning probabilities but it may or may not improve its TUV swing). Even better, you should have an option to, instead, select as to maximize your winning probabilities (which is often what you want when you are defending a capital).

                      To keep it simpler, you may go with just maximizing the winning probabilities, as I surmise that would be much easier to code (hoping users won't missclick defending bombers out too often).

                      Of course, I realize this will most likely never be, at least not with full coverage, especially for something as complex as the AA (targeted) fire.

                      As far as the AA (targeted) fire of "270BC Wars" goes (which is called "artillery" in that game, but that's just a customized naming which has nothing to do with what "artillery" usually is in other TripleA games), that is actually relatively simple: it works exactly like the "first strike" ability of submarines, but with the added properties of never hitting "wall" units and always "one-shotting" multiple hit-points units (namely, "fort" and "warelephant").

                      1 Reply Last reply Reply Quote 0
                      • R Offline
                        RaiNova
                        last edited by

                        To keep it simpler, you may go with just maximizing the winning probabilities

                        That‘s pretty much how it works today, and I can build the new battle calulator on top of that quite well. It however means that BC270 wars artillery is killed first since it has no fighting power after the first strike.

                        TheDogT C 2 Replies Last reply Reply Quote 0
                        • TheDogT Offline
                          TheDog @RaiNova
                          last edited by

                          @rainova
                          Im not well versed in the use of the Battle Calculator, but does it automatically take into account the rounds a battle take as defined in xml ?
                          eg.
                          land 3 rounds
                          sea 2 rounds
                          air 1 round

                          https://forums.triplea-game.org/tags/thedog
                          https://forums.triplea-game.org/topic/3741/curated-best-top-maps-triplea-guides

                          R 1 Reply Last reply Reply Quote 1
                          • C Offline
                            Cernel Moderators Lobby Moderators @RaiNova
                            last edited by

                            @rainova said in Fast Battle Calculator:

                            To keep it simpler, you may go with just maximizing the winning probabilities

                            That‘s pretty much how it works today, and I can build the new battle calulator on top of that quite well. It however means that BC270 wars artillery is killed first since it has no fighting power after the first strike.

                            It attacks every round.

                            R 1 Reply Last reply Reply Quote 0
                            • R Offline
                              RaiNova @TheDog
                              last edited by

                              @thedog After a bit of debugging and testing, I believe that the battle calculator ignores the Air/Land/Sea Battle Rounds settings. Both when called from the BattleCalculatorDialog and when used by the AI. I'd consider this a bug. The PR regarding my battle calculator will be quite big. From experience with my first TripleA PR, I'd like to keep it as small as possible. So I'd like not to fix this bug within the current PR.

                              TheDogT 1 Reply Last reply Reply Quote 1
                              • R Offline
                                RaiNova @Cernel
                                last edited by

                                @cernel Is attacks every round

                                The battle dialog shows the artillery left of the column "1", i.e. it has no hit power.
                                208aab24-1086-4109-ae5d-cfa6e1d06be9-image.png

                                R C 2 Replies Last reply Reply Quote 0
                                • R Offline
                                  RaiNova @RaiNova
                                  last edited by

                                  What is an air battle?
                                  Is every battle that starts out with only air units involved an air battle?
                                  Also if there is infrastructure in the battle location?
                                  Is a battle with only air units and aircraft carriers also an air battle?
                                  Is a ballte with only aircraft carriers also an air battle?
                                  Is a battle with only air units and defending aircraft carriers also an air battle?

                                  B 1 Reply Last reply Reply Quote 0
                                  • TheDogT Offline
                                    TheDog @RaiNova
                                    last edited by

                                    @rainova said in Fast Battle Calculator:

                                    @thedog After a bit of debugging and testing, I believe that the battle calculator ignores the Air/Land/Sea Battle Rounds settings. Both when called from the BattleCalculatorDialog and when used by the AI. I'd consider this a bug. The PR regarding my battle calculator will be quite big. From experience with my first TripleA PR, I'd like to keep it as small as possible. So I'd like not to fix this bug within the current PR.

                                    As mentioned I dont use it much, but thanks for the heads up!

                                    Personally I view the above Battle Rounds as very low priority.

                                    https://forums.triplea-game.org/tags/thedog
                                    https://forums.triplea-game.org/topic/3741/curated-best-top-maps-triplea-guides

                                    R 1 Reply Last reply Reply Quote 0
                                    • B Online
                                      beelee @RaiNova
                                      last edited by

                                      @rainova said in Fast Battle Calculator:

                                      What is an air battle?

                                      Air Battle is for airUnits and takes place before regular combat. You can set how many rounds you want the airBattle to last in map options and whether the attacker or defender can retreat. You can also set it so the air battle happens before strategic bombing raids

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

                                        @rainova said in Fast Battle Calculator:

                                        @cernel Is attacks every round

                                        The battle dialog shows the artillery left of the column "1", i.e. it has no hit power.
                                        208aab24-1086-4109-ae5d-cfa6e1d06be9-image.png

                                        As I've already pointed out, those are offence/defence 0/0 units with special AA (targeted) fire abilities.

                                        1 Reply Last reply Reply Quote 0
                                        • R Offline
                                          RaiNova @TheDog
                                          last edited by

                                          @thedog Just to maximise information about the game: The battle calculator does take into account the Air/Land/Sea Battle Rounds settings.

                                          1 Reply Last reply Reply Quote 1
                                          • aardvarkpepperA Offline
                                            aardvarkpepper @RaiNova
                                            last edited by

                                            @rainova

                                            Normal approximation to the binomial, to speed battle calculator for large battles? Does that suit?

                                            Since I don't know much math or programming I'm just taking a shot.

                                            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
                                            • 3
                                            • 2 / 3
                                            • First post
                                              Last post
                                            Copyright © 2016-2018 TripleA-Devs | Powered by NodeBB Forums