<< Back to Programming Forum   Search

Posts 1 - 9 of 9   
Damage to Special Units: 2026-01-02 05:14:48


krinid 
Level 64
Report
Looking for opinions on using cards and other abilities to damage Special Units (SUs).

A number of players have asked to make things like Bombs, Nukes, Tornados, Earthquakes, Pestilence, Wildfire (etc) actually damage SUs. Is this a good idea?

And if your answer is Yes, I'm looking for ideas on _how_ such abilities should damage SUs. Also note that there are 2 types of SUs:
- "1-shot SUs" (which I'll refer to as SU1 hereafter): they don't take damage, they don't have health, they are either killed or continue to live on; eg: these are Commanders, Tanks, etc. This isn't "health", internally the API causes it "damage to kill" so I'll use that term when talking about it.
- "SUs with health" (which I'll refer to as SU2 hereafter): they take damage, they have health which decreases when attacked and when it goes to 0, they die; eg: Behemoths, Castles, I.S. pack SUs

Some examples to consider:
- Example 1: Regular bombs do 50% damage. For SU1, technically this means it can never reach the required damage to kill, thus can never kill it nor damage it. For SU2, would it just reduce 50% of the remaining health of the SU?
- Example 2: Bomb+ v2 bombs (same as Nukes, Wildfire, etc) do host configurable % damage & fixed damage. So potentially some % damage + fixed damage could sum to or beyond the damage to kill amount of an SU1 and thus kill it. But if the sum is less than the SU's damage to kill amount, should it just stay alive with no damage done?
- Example 3: Tornados, Pestilence, Earthquakes (etc) do host configurable fixed damage, so presumably if that damage is less than an SU1's HP
- Example 4: How about structures like Forts? For sake of simplicity, assume Fizzer Forts (ie: either 'Forts' mod or 'Fort Card' mod). If a Bomb, Tornado, Nuke, Pestilence, etc, hits a territory with a fort, should the Fort be considered 'hit' and removed? Should a Fort ever take damage from anything other than an attack?

Other things I'm looking for opinions on if changes were to be made to some mods/cards/abilities:
- Should the regular cards/abilities be changed?
- Should they be changed to it affects SUs as a base rule? Or be configurable by host? PS: it's possible to implement this so it doesn't affect any games in progress, and would only change behaviour for new games created since the mod was changed (so at least ongoing games don't get a radical shift in how they play out)
- Should the regular cards/abilities be left alone and new cards/abilities that specifically target SUs be created? eg: a "Special Bomb" that targets all SUs on a single territory, or a "Special Nuke" that spreads from a specific territory but only affects SUs and doesn't damage armies.

Any other ideas?
Damage to Special Units: 2026-01-02 11:24:42


JK_3 
Level 64
Report
I see 2 possible options to handle this.

Option 1:
• The 1 shot SUs shouldn't be damaged, because if something like a bomb card (which rounds up for damage done) would hit, then they would instantly be killed. Unless you have a special bomb card that does 100% damage, tho that sounds like an annoying edge case to deal with.
• The SUs with health can have their health reduced, killing them if they reach 0 hp.

Option 2:
• The SUs power/health is added to the normal armies, which gives you a "real" army count of the territory, and the math is done on that number.
• Kill armies/SUs on the territory in CombatOrder until at least that many armies is killed.
• If the last unit to get damaged is a 1 shot SU, their health rounds back up to full (in other words, they cant get partial damage so they get no damage)

With structures, it gets more complicated because they don't have an health that is known to other mods. So probably best to ignore those and limit it to units only.

I think option 1 might be easier to implement, but option 2 might be more in line with how taking damage on Warzone works.
Damage to Special Units: 2026-01-02 11:29:59


JK_3 
Level 64
Report
Should the regular cards/abilities be changed?

Yes, I think a normal bomb or a normal blockade should use the SU health too if this gets implemented. Having some cards work on SUs and some don't sounds confusing.

Should they be changed to it affects SUs as a base rule? Or be configurable by host? PS: it's possible to implement this so it doesn't affect any games in progress, and would only change behaviour for new games created since the mod was changed (so at least ongoing games don't get a radical shift in how they play out)

I think this should be a setting because some templates have probably been designed with the concept of SUs not taking any damage from cards in mind.

Should the regular cards/abilities be left alone and new cards/abilities that specifically target SUs be created? eg: a "Special Bomb" that targets all SUs on a single territory, or a "Special Nuke" that spreads from a specific territory but only affects SUs and doesn't damage armies.

This might be the best way to communicate this change to players, but it would also mean duplicate cards of everything and that allows someone to use the wrong Nuke card. And adding more cards also increase complexity of big modded games even further, which is also something I'm not a fan of.
Damage to Special Units: 2026-01-03 16:58:52


krinid 
Level 64
Report
I think you're right that having normal card attacks (bombs & nukes) and separate Special card attacks would be confusing; attacks that target SUs should be some kind of special ability of its own, not a clone of an existing one that changes scope from armies to SUs

1 player recommended that for Nuke for example, if it's set to kill 50%, that it would kill 50% of all SUs on the territory as well, which I don't think is a good idea (for a variety of reasons), so not doing it that way

Dealing with the DamageToKill (1 Shot) SUs is the issue tho; I like your option 2, that's an interesting way of dealing with it, and largely be a factor of its combat order. It might get hard to predict/understand how for example in 2 different scenarios the SU would die vs live, eg:
(A) 50% Nuke on terr with 0 armies + 1 SU -- DamageToKill & combat order values don't matter, SU always lives
(B) 50% Nuke on terr with 10 armies + 1 SU w/10 DamageToKill, combat order -1 (before armies) -- Nuke does 10 damage, SU gets hit before armies and eats 10 damage and thus dies; so oddly adding armies to the terr to defend causes the SU to die; but I suppose this is an odd edge case not likely to happen outside of Behemoths (the only SU at this point in time that I'm aware of that gets hit before armies)

So should regular cards just automatically damage SUs or should it host configurable? This is a easy/consistent vs flexible/need to check settings for each game. I suppose the answer is host configurable by set good defaults (which should probably be to permit damage to SUs)

For structures, I'm thinking purely of Forts at this point since their scope is clear; for example, should they stop a territory from going neutral? It would stop a regular attack but not a bomb/nuke/pesti/etc
Damage to Special Units: 2026-01-04 10:44:30


Just_A_Dutchman_ 
Level 61
Report
Option 2 is my personal favorite. I already have made attempts in the past of simulating a Warzone attack, with the goal to easily compute "attacks" with different kill rates, something that can be extended to other damaging events.

I'm sure that if we put some effort into it, we can create some kind of library file that contains all necessary functionality for mods to compute damage done to an armies object. The upside of all mods using the same file to compute damage done to an armies object is that at least those mods have the same functionality, but ofc you still have the downsides of the dependency
Damage to Special Units: 2026-01-04 14:24:12


krinid 
Level 64
Report
I already have the routine to simulate the attack and apply the result

Created it for LMM & Airstrike

So would easy enough to do, would just need to add that code and integrate it everywhere required

Just weighing options before doing it so we don’t end up with something that wasn’t well thought through, making it difficult for players to use and/or predict/understand results; it’d be terrible if it’s so hard to follow the mechanics so that it ends up being a total black box situation, surprising players with SU deaths/damage or lack thereof

Even DamageToKill SUs with high combat orders could still die in cases where:
- kill rate is 100%
- fixed damage to apply meets or exceeds DamageToKill value
Damage to Special Units: 2026-01-04 15:11:34


TBest 
Level 60
Report
For bomb cards, it would be nice if the game did it native to be honest. Or have like a built in thing. I mean if you look at

https://www.warzone.com/wiki/Mod_API_Reference:CustomSpecialUnit

there is CanBeAirliftedToSelf , CanBeGiftedWithGiftCard etc.

If you had a CanTakeDamageFromCards I think it would fit in. The exact implementation is not too important, my point is more that I don't think every mod should implement code for this, feels more natural if the game would handle the logic. And we just did " damage to territory ", letting warzone itself worry about combat order etc.


( And if the card or structure has health, then it should use health imo. Also structures with health seems like a nice feature request )
Damage to Special Units: 2026-01-04 19:22:54


Just_A_Dutchman_ 
Level 61
Report
I agree with JK on the cards, to keep the same functionality across all mods the best solution is for Warzone to handle the cards like bombs and blockades
Damage to Special Units: 2026-01-04 20:43:11


krinid 
Level 64
Report
I agree, it'd be great to have this as core functionality

But ... we'll have to add it to the list of Nice to Haves like non-standard/custom anytime/anywhere to anywhere attacks leveraging the native WZ engine, paintable arrows on the map (like an airlift), etc - no telling if/when any of these will be implemented

Actually even to leverage native WZ functionality of SUs taking damage from cards, the non-standard/custom attack feature would also have to be implemented, or at least some API to apply damage to a territory. Currently we're manually modifying army/SU counts on terrs entirely outside of WZ attacks, so even if the SU had the "take damage from cards" feature implemented, it wouldn't do anything b/c (regular) Bombs are the only card that does damage via regular WZ engine, and all other cards would still not be reflected

Also, is it _just_ damage from cards we're talking about here? The ones I've mentioned here (Bomb+, Nukes, Tornados, Earthquakes, Pestilence, Wildfire, etc) happen to be cards ... but there is non-card damage that gets applied, eg: Dragon Breath damage - it happens during a regular attack handled by WZ engine, but then adds a new order to apply the DB damage. That application of damage would need to be applied via some API call for a native SU feature to be able to take damage for it w/o a mod having to code it
Posts 1 - 9 of 9