suicide/munitions unit with support?


  • Admin

    Is there a way to have a suicide/munitions unit with a support attachment be able to give that support in the first round of combat, even when dying?

    It seems that the suicide unit dies before combat and therefore does not give support to anything …. ever.

    It could be relevant in situations where fore sample kamikaze units would give a morale boost to other units as it sacrifices itself?


  • Admin

    @Frostion I believe the only way to do it currently is use isSuicideOnHit instead of isSuicide so that the unit actually fights in round 1 so it can provide its support. For example, I'm planning to do this for a WW1 gas unit so it always gets 1 hit round 1 and dies but also provides its negative support round 1:

            <attachment foreach="$UnitPrefixes$:$UnitPlayers$" name="unitAttachment" attachTo="@UnitPrefixes@Gas" javaClass="UnitAttachment" type="unitType">
                <option name="movement" value="1"/>
                <option name="attack" value="12"/>
                <option name="defense" value="0"/>
                <option name="isSuicideOnHit" value="true"/>
            </attachment>
            <attachment foreach="$UnitPrefixes$:$UnitPlayers$" name="supportAttachment@UnitPrefixes@Gas" attachTo="@UnitPrefixes@Gas" javaClass="UnitSupportAttachment" type="unitType">
                <option name="unitType" value="$InfantryAndCavalryUnits$"/>
                <option name="faction" value="enemy"/>
                <option name="side" value="offence"/>
                <option name="dice" value="strength"/>
                <option name="bonus" value="-2"/>
                <option name="number" value="12"/>
                <option name="bonusType" value="GasBonus"/>
                <option name="players" value="@UnitPlayers@"/>
            </attachment>
    

    The limitation of this is that if you want it to always die round 1 then you have to set its attack equal to dice sides so it actually gets a hit and suicides.


  • Admin

    @redrum hmmm. I see what you mean.

    But maybe, instead, there could be made a supportAttachment called “supportsDuringSuicide” true/false? Or something. I would certainly make use of it, and you could too. 😉

    Or maybe the engine code could just be made to have this behavior be default?


  • Admin

    @Frostion Yeah, I've thought about it a little bit. I saw a couple different approaches:

    1. Add some boolean support property like “supportsDuringSuicide” which probably is the most flexible option but of course adds another field to set
    2. Tie it to the existing global property "Suicide and Munition Casualties Restricted" so that if casualties can return fire then the suicide unit should be able to provide its support as essentially that means all the first round of battle is occurring simultaneously rather than suicide units going first and removing any casualties.
    3. Make it default provide support round 1 but I hesitate to do this as it would seem kind of inconsistent with how sub/AA fire casualties usually die before the main round 1 combat so don't provide their support just like suicide units die before the main round 1 combat. Though in the end if you are adding a support attachment to a suicide unit then having it never provide its support also doesn't really make sense 🙂

  • Admin

    Yea I can see the dilemmas and complications.

    1. I am all in for that as it can be used by in many cases and maps in the future, even if it is a small niche setting. You can use it for gas, I would use it for like when hero units battle in Warcraft, they can bring “spells” that attack/defend, support and are gone after battle.

    2. I am not sure that every time "Suicide and Munition Casualties Restricted" is used to have casualties return fire, that that the intent is also to have the Suicide and Munition give its support or not during the attack. Like if the support/boost is given to a viking army by a bunch of viking berserkers charging alone across the battle field and attacking the enemy army, before the rest of the viking army even moves. The viking army would look, cheer and be boosted by seeing their berserkers commit suicide and go to Valhalla ⚔ 🍺 🍖 😃 But the enemy would not get to kill anyone but the suiciders. In the case of my use of spell-units that give support and/or attack during first round and then dissolve into thin air, it would also not be the idea that any casualties should return fire.

    3. I see how default is inconsistent with how sub/AA fire. Good point.


  • Moderators

    @Frostion Actually, time ago I wanted to have (attack 0) suicide shells receiving (not giving) support from (not suicide) artillery, so the have a decent representation of ammunition consumption, and I found out that suicide units cannot even receive support. So that's also something that could be allowed, as that would not require any map coding additions.



  • Just change the unit on taking 1 HP damage into an infrastructure that gives support, that is then removed at the end of combat / end of turn.


  • Admin

    @Cernel I totally agree, it would be nice to be able to also give support to Ammo/Munitions units if this is something that cannot be done atm.

    @alkexr Your sollution gives the munition unit a HP and seems to complex a workaround. I would like something more clean I think.

    @Everyone We need some backup here ... We need to persuade a dev to let Suicide and Munition units also be able to receive/give support! 🤘 😃


  • Moderators

    @redrum said in suicide/munitions unit with support?:

    @Frostion I believe the only way to do it currently is use isSuicideOnHit instead of isSuicide so that the unit actually fights in round 1 so it can provide its support. For example, I'm planning to do this for a WW1 gas unit so it always gets 1 hit round 1 and dies but also provides its negative support round 1:

            <attachment foreach="$UnitPrefixes$:$UnitPlayers$" name="unitAttachment" attachTo="@UnitPrefixes@Gas" javaClass="UnitAttachment" type="unitType">
                <option name="movement" value="1"/>
                <option name="attack" value="12"/>
                <option name="defense" value="0"/>
                <option name="isSuicideOnHit" value="true"/>
            </attachment>
            <attachment foreach="$UnitPrefixes$:$UnitPlayers$" name="supportAttachment@UnitPrefixes@Gas" attachTo="@UnitPrefixes@Gas" javaClass="UnitSupportAttachment" type="unitType">
                <option name="unitType" value="$InfantryAndCavalryUnits$"/>
                <option name="faction" value="enemy"/>
                <option name="side" value="offence"/>
                <option name="dice" value="strength"/>
                <option name="bonus" value="-2"/>
                <option name="number" value="12"/>
                <option name="bonusType" value="GasBonus"/>
                <option name="players" value="@UnitPlayers@"/>
            </attachment>
    

    The limitation of this is that if you want it to always die round 1 then you have to set its attack equal to dice sides so it actually gets a hit and suicides.

    Haven't tested, so I wonder if you can hack a pure support behaviour (without killing anything) by using the isSub sub-options, so to give the unit no valid targets, while automatically hitting (nothing), while re-entering the pure suicide dynamic of possibly hitting something, while always suiciding regardless, by adding an AA offensive attack on top of what I said. I believe it should work fine, and I understand this way all that @Frostion wants would be covered, albeit in a convoluted manner.

    In the past, I've considered mostly the other side of the coin, that is supporting munitions, as it has always been a major issue for me that TripleA didn't have any ammunition consumption dynamic, as that is actually maybe the most important cost of war (or at least you usually spend much more money in ammunitions, overtime, than in the guns firing those ammunitions; easily over 10 times as much). The ideal would be having a dynamic by which 1 artillery can give 1 roll to 1 otherwise useless ammunition, that suicides only upon rolling (so, for example, if you would have 1 artillery and 3 ammunitions in a battle, you would use 1 ammunition each in the first 3 rounds of combat). Other ways to represent that may be with the land transport ability, in that the ammunition could be combat moved only by the artillery, so that you need 1 artillery to send a number of suicide ammunition into combat, or, to fire from zone to zone, have 1 artillery producing 1 target unit each round, the target unit land transporting 1 ammunition into combat, then removing all target units at the start of combat (practically like the mortars of AoT, but you need to produce and stockpile the actual ammunitions; just the utility unit to fire (land transport) them into battle is given for free).

    Anyways, all solutions I could come up with are workarounds with serious limitations; so I don't believe that ammunition consumption can currently be very well represented in TripleA.


  • Moderators

    @redrum said in suicide/munitions unit with support?:

    @Frostion I believe the only way to do it currently is use isSuicideOnHit instead of isSuicide so that the unit actually fights in round 1 so it can provide its support. For example, I'm planning to do this for a WW1 gas unit so it always gets 1 hit round 1 and dies but also provides its negative support round 1:

            <attachment foreach="$UnitPrefixes$:$UnitPlayers$" name="unitAttachment" attachTo="@UnitPrefixes@Gas" javaClass="UnitAttachment" type="unitType">
                <option name="movement" value="1"/>
                <option name="attack" value="12"/>
                <option name="defense" value="0"/>
                <option name="isSuicideOnHit" value="true"/>
            </attachment>
            <attachment foreach="$UnitPrefixes$:$UnitPlayers$" name="supportAttachment@UnitPrefixes@Gas" attachTo="@UnitPrefixes@Gas" javaClass="UnitSupportAttachment" type="unitType">
                <option name="unitType" value="$InfantryAndCavalryUnits$"/>
                <option name="faction" value="enemy"/>
                <option name="side" value="offence"/>
                <option name="dice" value="strength"/>
                <option name="bonus" value="-2"/>
                <option name="number" value="12"/>
                <option name="bonusType" value="GasBonus"/>
                <option name="players" value="@UnitPlayers@"/>
            </attachment>
    

    The limitation of this is that if you want it to always die round 1 then you have to set its attack equal to dice sides so it actually gets a hit and suicides.

    By the way, I believe autohitting 1 unit is lame. While I'm not against something killing something for sure, there should always be a dynamic by which the damage may vary. For example, if something kills or damages something for sure, then it should work like roll 1d6 and kill as many units.


  • Admin

    So thinking about this a little more, I'm starting to wonder if isSuicide should be reworked now that isSub was broken into separate options. As really isSuicide is currently doing 2 separate things which is having the unit roll first (essentially isFirstStrike) and dieing after its attempted roll. We also now have isSuicideOnHit that can be used for many scenarios.

    This would also seem to align with what @Cernel mentions here: https://forums.triplea-game.org/topic/323/unit-option-which-suicides-only-when-it-registers-a-hit-mines/28. Where you have some sort of isSuicideOnRolling instead where if you want the unit to always die then it would just be set to the dice sides but you could then have 3 outcomes for suicide-like units:

    1. It hits and suicides
    2. It misses and suicides
    3. It misses and survives

    So what does all that mean in relation to suicide units giving support? It makes the whole thing a lot cleaner as you could have the suicide unit roll with the rest of the units (like isSuicideOnHit does) rather than before all units so it gives its support before dying.


  • Moderators

    @redrum It has been a while since I tested, but I believe that, for the old "isSuicide", supporting is not really a matter of when it dies. I remember I tested it and I couldn't have a "isSuicide" unit receiving (not giving) support from a normal unit, despite that, of course, the normal unit is still there when the suicidal one attacks and dies.
    I was trying to have a normal "artillery" unit giving support to an attack 0 "isSuicide" "ammunition" unit, and it didn't work, the "ammunition" not receiving support at all (I guess I could test it again).
    Yeah, I agree there is no reason why a suicide unit must also be "isFirstStrike" too, but mind you currently there is a property that determines that for suicidal units (well, it actually determines if the casualties can fire back, similarly to naval bombard).
    And, yes, with a "isSuicideOnRolling" the old "isSuicide" would become redundant, as you could set it at the dice sides, and also the new "isSuicideOnHit" would become mostly redundant, as you could set it at the same attack or defence value, except not for units both attacking and defending at different values (tho, in case of support, here you would need the support to change this value as well).


  • Moderators

    The other matter that is not covered about suicidal units is having something like a V2 or an ICBM that doesn't die or fight if the territory gets attacked. Currently the only way to do this is making the unit an infrastructure with defence 0 that doesn't suicide on defence (like done for the "gas" of Domination NML), but that comes with the limit that you can only attack with at least 1 non infrastructure unit (so that would not be acceptable for a V2, an ICBM, or any rockets, really).


  • Admin

    @Cernel I think isSuicide units are essentially handled completely separately in the engine and don't receive/give any support. But I don't believe that is the case for isSuicideOnHit which I think can receive/give support. Assuming that is the case, my thought is to essentially get rid of isSuicide and make them act like isSuicideOnHit so they can properly give/receive support.


  • Moderators

    @redrum You mean "isSuicide" would become a shortcut to generate the new option, with proper values, or updating all games having "isSuicide" (it might be feasible; I don't think there are too many).


  • Admin

    @Cernel Either way. It would depend on how many maps need updated but would probably deprecate it and just make it set the new properties to be safe.


Log in to reply