Heroes of Might and Magic Community
visiting hero! Register | Today's Posts | Games | Search! | FAQ/Rules | AvatarList | MemberList | Profile


Age of Heroes Headlines:  
5 Oct 2016: Heroes VII development comes to an end.. - read more
6 Aug 2016: Troubled Heroes VII Expansion Release - read more
26 Apr 2016: Heroes VII XPack - Trial by Fire - Coming out in June! - read more
17 Apr 2016: Global Alternative Creatures MOD for H7 after 1.8 Patch! - read more
7 Mar 2016: Romero launches a Piano Sonata Album Kickstarter! - read more
19 Feb 2016: Heroes 5.5 RC6, Heroes VII patch 1.7 are out! - read more
13 Jan 2016: Horn of the Abyss 1.4 Available for Download! - read more
17 Dec 2015: Heroes 5.5 update, 1.6 out for H7 - read more
23 Nov 2015: H7 1.4 & 1.5 patches Released - read more
31 Oct 2015: First H7 patches are out, End of DoC development - read more
5 Oct 2016: Heroes VII development comes to an end.. - read more
[X] Remove Ads
LOGIN:     Username:     Password:         [ Register ]
HOMM1: info forum | HOMM2: info forum | HOMM3: info mods forum | HOMM4: info CTG forum | HOMM5: info mods forum | MMH6: wiki forum | MMH7: wiki forum
Heroes Community > Library of Enlightenment > Thread: [HoMM II] Do dwarves & battle dwarves resist creatures' abilities?
Thread: [HoMM II] Do dwarves & battle dwarves resist creatures' abilities?
Ritzilopochtli
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.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
LordCameron
LordCameron


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

I always assumed the Unicorns were gouging out eyes, not being magical.
____________
What are Homm Songs based on?

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
AlexSpl
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.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Ritzilopochtli
Ritzilopochtli

Tavern Dweller
posted May 31, 2025 01:07 PM
Edited by Ritzilopochtli at 13:08, 31 May 2025.

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.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
AlexSpl
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].

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Ritzilopochtli
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.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
AlexSpl
AlexSpl


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

IDA Free + sergroj's IDA database

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
AlexSpl
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.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Jump To: « Prev Thread . . . Next Thread »
Post New Poll    Post New Topic    Post New Reply

Page compiled in 0.0632 seconds