Remove spell resistance of level difference

Post Reply
User avatar
Weasel
Posts: 9
Joined: Sat Feb 10, 2018 11:57 pm

Remove spell resistance of level difference

Post by Weasel » Sun Feb 25, 2018 2:33 pm

Confusing title, but basically, you know how a high level unit (10-15 levels above) tends to resist most spells of a lower level unit? That's because of the level difference between the two, mostly. Not the actual resistances, not the spell's level (unless it's a special spell that depends on level of target, such as Charm or Pestilence etc).

So, I'd like to remove this stupid mechanic in a mod, since it makes no sense. A low level damage spell, for example, already does bad damage to a high level unit because it's lower damage. There's no reason for it to be completely useless. This is a problem mainly because the avatar is way too strong at lv50. Any magical enemy unit of lv35-40 will be completely useless against the avatar, which is boring (there's no reason to use resistance-enhancing buffs either).

I can't just bump the level of the enemies up to lv50, because while it fixes the "permanently resist everything" on the avatar in respect to the enemies' spells, the player's magical units will be completely useless now. For example Dark Elf Sorcerers (which are lv35 at most) will be completely useless since their Pain will be resisted 90% of the time by the lv50 enemy, which is downright retarded.

I'd like to keep the enemies at lv35 so they're not too overpowered for the player's units, but this resist bullshit is getting on my nerves. I could bump the player units' levels (maybe in GameData.cff) and then all enemies, but that may wreck the balance or something, would be my last resort. I want to make challenging freegame maps where you actually have to build an army instead of just rush with avatar (and heroes) because the enemy has plenty of army himself. No point if avatar is just immune to all magical enemy units though.


So, anyone knows where I have to look to change this behavior? Make it so that only resistances affect the spell resist mechanic, not the level. It doesn't matter if lv1 vs lv50 face off, the latter won't be immune to the former's spells (unless its resistances are really high, which is ok). Of course a lv1 spell will barely dent a lv50 but that's normal and ok, nothing to do with resistances, just low damage (as expected).

Maybe somewhere in GameData a field for spells and how much the level difference affects them? (I already tried all the "known" fields in the first table, no effect unfortunately). Maybe a lua script or something... I don't know where though.

Probably wishful thinking. Sorry for the long post/rant. but hopefully you get what I mean. Cheers.

User avatar
mordo
Site Admin
Posts: 251
Joined: Sun Nov 13, 2011 3:15 pm

Re: Remove spell resistance of level difference

Post by mordo » Sun Feb 25, 2018 10:10 pm

i dont know but i also wanted to tweak it and could never find out how.

i think ice is a bit of abnormal in that its the only magic that works against many levels above,
another thing to investigate is death spell, because it fizzle so often,
it should display some variable that is different from ice i would think,
but i could never find out all the things that goes into fizzle factor
Der Hölle Rache kocht in meinem Herzen

User avatar
Weasel
Posts: 9
Joined: Sat Feb 10, 2018 11:57 pm

Re: Remove spell resistance of level difference

Post by Weasel » Mon Feb 26, 2018 1:56 pm

Yeah, now that you mention it, some spells have higher chance to hit in respect to level differences than others (good mention about ice). Even Pain seems to hit more than Death (which fizzles almost all the damn time if level difference is more than 10 or so) and they're both BM damage spells.

I'm guessing this kind of thing is probably encoded somewhere in the actual spell "type" not the spell individually. The first table doesn't leave much for unknown parameters, only the last 4 bytes, one of which seems to always be set to 100 (64 00 in hex), I tried to modify it but it did nothing.

I mean, where exactly are the spell's parameters "read"? Are they implemented in the .exe itself? Does the .exe even store the spell type IDs in there, hardcoded? (to know what spell is what) (when I mean spell types, I mean the spells in the second table "spell UI" here: Spell UI, while the actual spells (for each level etc) are in the first table, in GameData.cff -- the first table doesn't have this info for sure because I tried everything there)

I've been trying to look for a lua script but all I could find were some things related to spell graphical effects and such.

leszekd25
Posts: 5
Joined: Wed Feb 15, 2017 9:54 pm

Re: Remove spell resistance of level difference

Post by leszekd25 » Thu Mar 01, 2018 11:57 pm

Behavior of spells is most certainly hardcoded. This includes appearance, targetting types and resistance calculation. Of those three, resistance calculation probably can't be modified by any means.

Some spells have additional resistance conditions. For example, Pestilence, Hypnotize, dominate spells have a maximum unit level - no unit with a level higher than this can be affected by the spell (lvl 46 for Pestilence lvl 20, lvl 46 for Hypnotize lvl 20, lvl 39 for Dominate lvl 20). This condition can be easily modified by manipulating parameters in Gamedata.cff spell description.

User avatar
mordo
Site Admin
Posts: 251
Joined: Sun Nov 13, 2011 3:15 pm

Re: Remove spell resistance of level difference

Post by mordo » Fri Mar 02, 2018 7:24 am

pestilence/hypno/clay work up to and including lv 45,
dominate work up to and including lv 42 assuming a minimum of 140 charisma
(points + gear combined)
Der Hölle Rache kocht in meinem Herzen

User avatar
Weasel
Posts: 9
Joined: Sat Feb 10, 2018 11:57 pm

Re: Remove spell resistance of level difference

Post by Weasel » Fri Mar 02, 2018 5:12 pm

leszekd25 wrote:Behavior of spells is most certainly hardcoded. This includes appearance, targetting types and resistance calculation. Of those three, resistance calculation probably can't be modified by any means.
Bummer. I was worried about that, but how come some stuff never get resisted (the black tower with extinct for example)? Is that a special spell or maybe just a parameter, is what I'm wondering.

Do you guys know what "Spell Line" is? I mean, sql_spellline.lua and constants in the .exe like "kGdMaxSpellLineMagicBase" or "kGdSpellLinePainChained" etc. I'm not asking about those constants themselves , I'm asking what the hell "Spell Line" even is, lol (i.e. what are they about).

I mean, I don't even know what sql_spellline.lua is for, I tried to change some stuff there and it had no effect whatsoever (not even on the UI)??

User avatar
mordo
Site Admin
Posts: 251
Joined: Sun Nov 13, 2011 3:15 pm

Re: Remove spell resistance of level difference

Post by mordo » Fri Mar 02, 2018 5:23 pm

extinct works vs health points, black towers works vs anything below 10.000 HP,
but not above
the total immune to magic thing is 1000 resist vs the various magic,
so extinct isnt black magic with regards to resist, its health points that set resist
Der Hölle Rache kocht in meinem Herzen

User avatar
Weasel
Posts: 9
Joined: Sat Feb 10, 2018 11:57 pm

Re: Remove spell resistance of level difference

Post by Weasel » Sat Mar 03, 2018 1:43 pm

But Extinct can still be resisted like a normal spell, even if its damage is higher than the target's remaining HP. Of course, if it happens to hit, then the target(s) will die, but it can still be resisted "normally". I think it's the case with all of the "special" spells like Pestilence with a level limit, as well. It's just that the level (or HP) limit is an extra resistance check that other spells don't have. I never seen the Black Tower get resisted though. Maybe I didn't test enough.

(and only the level difference resistance check is what I want to get rid of -- normal fizzle due to magic resist stats are ok)

User avatar
mordo
Site Admin
Posts: 251
Joined: Sun Nov 13, 2011 3:15 pm

Re: Remove spell resistance of level difference

Post by mordo » Sat Mar 03, 2018 5:38 pm

as far as i know, extinct could be resisted in original launch version with enough BM resist,
but on v1.54, i have never seen it resisted.

you can test vs death tower if you equip with 'fist of reaperman' and then various gear
to put you just above 10.000 HP, or just below
death tower uses extinct spell, just its lv 101 or so, perhaps similar to rohens lv 101 ice spell

the things i wanted to mod was reduced fizzle for death and make ice resist more potent
vs ice magic. the thing i could do was reduce spell casting time for death spell to standard speed,
its in the main mod
Der Hölle Rache kocht in meinem Herzen

Post Reply