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

    Artillery that fires at Aircraft

    Scheduled Pinned Locked Moved Map Making
    17 Posts 5 Posters 4.3k Views 5 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.
    • RogerCooperR Offline
      RogerCooper
      last edited by

      I am trying to create a unit that is artillery but can also fire at 1 against 1 aircraft. I tried this:

      <attachment name="unitAttachment" attachTo="artillery" javaClass="games.strategy.triplea.attachments.UnitAttachment" type="unitType">
        <option name="movement" value="1"/>
        <option name="attack" value="2"/>
        <option name="defense" value="2"/>
        <option name="artillery" value="true"/>
        <option name="attackAA" value="1"/>
      </attachment>
      

      But no AA fire takes place.

      I looked at the Global game where aaGun is defined as this

      <attachment name="unitAttachment" attachTo="aaGun" javaClass="games.strategy.triplea.attachments.UnitAttachment" type="unitType">
        <option name="isAAforCombatOnly" value="true"/>
        <option name="isRocket" value="true"/>
        <option name="canNotMoveDuringCombatMove" value="true"/>
        <option name="isInfrastructure" value="true"/>
        <option name="canBeDamaged" value="false"/>
        <option name="movement" value="1"/>
        <option name="transportCost" value="3"/>
        <option name="canBeGivenByTerritoryTo" value="British"/>
      </attachment>
      

      And I am bit mystified. Where does is designate the the AA fires at 1, against up to 3 units and can be taken as a hit? How can I create a dual use unit?

      HeppsH redrumR 2 Replies Last reply Reply Quote 0
      • HeppsH Offline
        Hepps Moderators @RogerCooper
        last edited by

        @RogerCooper Your AA attack needs a list of targets.

        "A joyous heart sours with the burden of expectation"
        Hepster

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

          @RogerCooper I believe attackAA defaults to 1 if any of the isAAXXX options are set to true.

          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
          • RogerCooperR Offline
            RogerCooper @Hepps
            last edited by

            @Hepps said in Artillery that fires at Aircraft:

            @RogerCooper Your AA attack needs a list of targets.

            It does not work even with a target list.<option name="targetsAA" value="fighter:bomber"/>

            It should not be necessary, according to the object browser, "This option is not required, defaults to 'all isAir units' if not set."

            HeppsH 1 Reply Last reply Reply Quote 0
            • HeppsH Offline
              Hepps Moderators @RogerCooper
              last edited by

              @RogerCooper You also need the typeAA defined

              "A joyous heart sours with the burden of expectation"
              Hepster

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

                Also, there is one setting defining defensive AA shot strength and another defining AA shot strength when your unit is joining in on an attack.
                So if your tests are with the unit attacking, then you might not have any shots?

                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

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

                  Actually, most likely you are missing <option name="isAAforCombatOnly" value="true"/> (assuming you want the attack during combat not fly over or SBR). Essentially you need to let the engine know when you want the AA gun to be able to fire (combat vs fly over vs SBR).

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

                  RogerCooperR 1 Reply Last reply Reply Quote 3
                  • RogerCooperR Offline
                    RogerCooper @redrum
                    last edited by

                    @redrum said in Artillery that fires at Aircraft:

                    <option name="isAAforCombatOnly" value="true"/>

                    That worked.

                    1 Reply Last reply Reply Quote 1
                    • RogerCooperR Offline
                      RogerCooper
                      last edited by

                      I have made some progress here but I am not getting the behavior I want.

                      <attachment name="unitAttachment" attachTo="artillery" javaClass="games.strategy.triplea.attachments.UnitAttachment" type="unitType">
                        <option name="movement" value="1"/>
                        <option name="attack" value="2"/>
                        <option name="defense" value="2"/>
                        <option name="artillery" value="true"/>
                        <option name="attackAA" value="1"/>
                        <option name="targetsAA" value="fighter:bomber"/>
                        <option name="isAAforCombatOnly" value="true"/>
                      </attachment>
                      <attachment name="unitAttachment" attachTo="fighter" javaClass="games.strategy.triplea.attachments.UnitAttachment" type="unitType">
                        <option name="movement" value="20"/>
                        <option name="isAir" value="true"/>
                        <option name="defense" value="0"/>
                        <option name="offensiveAttackAA" value="1"/>
                        <option name="offensiveAttackAAmaxDieSides" value="12"/>
                        <option name="targetsAA" value="infantry:artillery:armour_ge"/>
                        <option name="isAAforCombatOnly" value="true"/>
                      </attachment>
                      

                      I would like artillery to be limited to 1 shot regardless of how many aircraft there are. Is this possible? In the Global game, AA is limited to 3 shots each, but I don't see how that is achieved.

                      On the other hand, I would like each fighter to shoot at every possible target. Instead, it seems that the maximum number of shots is the number of enemy targets. Can this be changed?

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

                        @RogerCooper To limit the number of AA atttacks to 1, you need to set maxAAattacks to 1:

                        maxAAattacks				values: sets how many times this unit may fire its AA guns. Defaults to -1, which means infinite. If not infinite, then aa guns can stack.
                        		
                        

                        To be able to have more shots than number of targets you need to set mayOverStackAA to true:

                        mayOverStackAA				values: sets if this unit may fire aa more times than there are aircraft (default = false).
                        		
                        

                        I'm not sure whether having infinite target AA and using mayOverStackAA work together. You'll need to test that.

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

                        RogerCooperR 1 Reply Last reply Reply Quote 3
                        • RogerCooperR Offline
                          RogerCooper @redrum
                          last edited by

                          @redrum said in Artillery that fires at Aircraft:
                          The artillery is working. However I have some issues with the fighter. Using the following code

                            <option name="mayOverStackAA" value="true"/>
                            <option name="maxAAattacks" value="8"/>
                          

                          With 2 fighters, 16 rolls are made regardless of enemy units.

                          With just maxAAttacks, 1 roll is made per enemy unit
                          With just mayOverStackAA, 1 roll is made per enemy unit

                          It seems that mayOverStackAA is not working correctly. If maxAAattacks is infinite, the overstack is ignored, if maxAAattacks is finite, the maximum number of rolls always applies regardless of the number enemy units.

                          One could reasonably differ on how maxAAttacks & maxOverstackAA should interact. If you wanted to use them to indicate a cavalry charge, it would reasonable to always give it maximum effect. However, for most purposes it would make sense to limit the number to the number of AA attackers * the number of targets.

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

                            @RogerCooper Correct. That is currently how those 2 parameters are intended to work. If you use them together then the AA units essentially always use all of their maxAAattacks regardless if there is 1 or 100 enemy targets (that's essentially what mayOverStackAA controls whether number of enemy units restricts number of shots). If maxAAattacks is infinite then mayOverStackAA doesn't really make sense since you would then have infinite attacks but you can always just set maxAAattacks to like 999 if you really want it to essentially auto kill any units it can target.

                            Limiting to the number of targets happens when you set mayOverStackAA to false.

                            Reading between the lines, I'm guessing what you are trying to get at is this scenario for your fighters. So using your fighter attachment, let's say you have 2 fighters and 3 enemy targets then you want to have 6 AA rolls instead of 16 AA rolls (with mayOverStackAA=true) or 3 AA rolls (with mayOverStackAA=false). Essentially a kind of in between behavior of mayOverStackAA where they can stack but only up to the number of targets. Maybe called something like mayStackAAButNotOverStack 🙂

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

                            RogerCooperR 1 Reply Last reply Reply Quote 1
                            • RogerCooperR Offline
                              RogerCooper @redrum
                              last edited by

                              @redrum Too bad, that I can achieve the desired effect of stacking up aircraft for more firepower. I will compensate by making aircraft more effective overall. Thanks for the help.

                              1 Reply Last reply Reply Quote 0
                              • ZjelcopZ Offline
                                Zjelcop Moderators
                                last edited by

                                I'd love to see the map when it's done. Had a lot of fun trying to implement all the weird rules though it resulted in hardly a playable map. Should be a lot more possible at this point!

                                RogerCooperR 1 Reply Last reply Reply Quote 0
                                • RogerCooperR Offline
                                  RogerCooper @Zjelcop
                                  last edited by

                                  @Zjelcop It is almost done. However, although I was able to get aircraft-only attacks to work, the AI did not handle it properly, so I implemented more conventional aircraft rules. Similarly, I dropped the stacking limits because they confused the AI.Dual-role artillery works.

                                  1 Reply Last reply Reply Quote 0
                                  • ZjelcopZ Offline
                                    Zjelcop Moderators
                                    last edited by

                                    Yeah, getting those rules implemented is one thing, getting the AI to play with that properly makes it even harder.

                                    RogerCooperR 1 Reply Last reply Reply Quote 0
                                    • RogerCooperR Offline
                                      RogerCooper @Zjelcop
                                      last edited by

                                      @Zjelcop I made the objective cities German capitals, which focused the AI on taking and defending them.

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