|
Thread: [HoMM II] Do dwarves & battle dwarves resist creatures' abilities? | |
|
Ritzilopochtli

 
Tavern Dweller
|
posted May 09, 2025 05:12 PM |
|
|
[HoMM II] Do dwarves & battle dwarves resist creatures' abilities?
Lately I'm researching a lot of how HoMM 2 works, and I've noticed that you never actually see a message saying (battle) dwarves resisted a spell cast by a creature attack (like the unicorn's blind, cyclops' paralysis etc). But surely they must, right?
Since both of these abilities (attack spell and spell resistance) are RNG-based, I've assumed that the game somehow accounts for the dwarves' resistance when throwing dice on whether the attack spell will trigger. I roughly estimated that if the supposed chance to cast curse is 30%, then the dwarves' 25% resistance would decrease it to ~22%. So I decided to test it.
As attackers I used royal mummies since they get the highest odds to cast a spell with an attack - 30% curse. I ran two combats: against veteran pikemen (no resistance; sort of a control group), and then against battle dwarves (25% resistance). Both combats had 20 rounds, 5 stacks of attackers and defenders on both sides, so 100 attack instances in total. To speed things up after each round I cast mass dispel.
The actual numbers of rounds in the combat against dwarves was >20 since occasionally they resisted mass dispel. When this occurred, I skipped entire rounds, and waited until it naturally wore off or mass dispel proc'ed. For the summary I only counted the rounds with actual attacks.
Results are below. As you can see, veteran pikemen scored 25% curses out of 100 attacks, and battle dwarves did even more - 29%. To say the least, I didn't manage to find a meaningful effect of dwarves' resistance on blocking spells cast by creatures' attacks.
Interesting to know if someone has some theories on this question.
|
|
LordCameron

 
   
Famous Hero
Veteran of the Succession Wars
|
posted May 09, 2025 08:39 PM |
|
|
|
AlexSpl

   
    
Responsible
Supreme Hero
|
posted May 23, 2025 09:28 PM |
|
|
There is a research of the same question for HoMM 1. There dwarves have two types of resistances. Cannot say if HoMM 2 changed the rules though.
|
|
Ritzilopochtli

 
Tavern Dweller
|
posted May 31, 2025 01:07 PM |
|
|
AlexSpl said: There is a research of the same question for HoMM 1. There dwarves have two types of resistances.
Found it.
https://handbookhmm.ru/interesnyie-faktyi.html#more-3315
>Chance to resist an area-of-effect spell is equal to 25%. Other negative spells have a 20% chance to fail
By the way, did you discover this by chance or did you disassemble the code?
AlexSpl said: Cannot say if HoMM 2 changed the rules though.
If it worked on abilities it would show in a meaningful way over the distance of 100 rolls. I think it is safe to *presume* dwarf resistance doesn't work on creature abilities unless proven otherwise.
|
|
AlexSpl

   
    
Responsible
Supreme Hero
|
posted June 01, 2025 07:36 AM |
|
Edited by AlexSpl at 07:44, 01 Jun 2025.
|
Quote: By the way, did you discover this by chance or did you disassemble the code?
The latter.
Quote: If it worked on abilities it would show in a meaningful way over the distance of 100 rolls. I think it is safe to *presume* dwarf resistance doesn't work on creature abilities unless proven otherwise.
As in HoMM I* and II we have predefined randomness, you have to test all claims about random events on multiple setups.
*) Actually it sometimes can be predefined based on your previous actions in the game.
For example,
Test #1. 1 Royal Mummy vs 5 Battle Dwarves.
Test #2. (1 + 1) Royal Mummies vs (5 + 5) Battle Dwarves.
Test #3. (2 + 3) Royal Mummies vs (10 + 8 + 7) Battle Dwarves.
And so on.
I haven't checked the code for creatures' resistances in HoMM 2, so I cannot say if they resist an ability.
In HoMM 1 you can use the 'Battle Supervisor' tool of LMOracle to see when Dwarves resist a spell and when they resist an ability. The tool marks the first case as [M], the second case as [A].
|
|
Ritzilopochtli

 
Tavern Dweller
|
posted June 01, 2025 10:19 AM |
|
|
AlexSpl said:
Quote: By the way, did you discover this by chance or did you disassemble the code?
The latter.
Could you recommend a tool for this?
AlexSpl said: In HoMM 1 you can use the 'Battle Supervisor' tool of LMOracle to see when Dwarves resist a spell and when they resist an ability. The tool marks the first case as [M], the second case as [A].
I'll check it out, thanks.
|
|
AlexSpl

   
    
Responsible
Supreme Hero
|
posted June 01, 2025 10:29 AM |
|
|
|
AlexSpl

   
    
Responsible
Supreme Hero
|
posted June 01, 2025 06:52 PM |
|
Edited by AlexSpl at 19:59, 01 Jun 2025.
|
Well, just checked and Dwarves and Battle Dwarves do resist an ability with 24/99 ~ 24.2% chance. Btw, Mummies and Royal Mummies cast Curse with slightly lower chances - 19% and 29% accordingly. So, in your case with Royal Mummies vs dwarves it's only 7% chance to trigger dwarves' resistance.
As for a spell itself (Curse in your case), I haven't checked yet if another roll happens when Curse is really being applied to creatures. If dwarves didn't resist an ability on ability check they probably can try to resist it yet another time when magic is being applied (needs confirmation through roll checks; though in HoMM I it's the case).
* * *
Likely, in HoMM 2 there is no second check if creatures apply magic.
combatManager::CastSpell(gpCombatManager, v48->spellEnemyCreatureAbilityIsCasting, v48->occupiedHex, 1, -1);
See that 1? It's a4 argument, a flag that is set when creature's ability is triggered.
Then we see -
if ( a4 || !v34 || army::SpellCastWorks(v34, a2) )
So, I expect there is no second check if spell cast works, as a4 is set to 1, therefore, army::SpellCastWorks() doesn't invoke.
|
|
|