Anti Magic / Anti Fire- question
Moderator: Ameena
Forum rules
Please read the Forum rules and policies before posting. You may
to help finance the hosting costs of this forum.
Please read the Forum rules and policies before posting. You may

Anti Magic / Anti Fire- question
Maybe this was already discussed here on this forum ... but there is one thing I don't quite understand - the way Anti-Magic and Anti-Fire statistics work.
One of my heroes has an AntiMagic value exceeding 100 (with the proper necklace). He surpasses my other heroes by approximately 35-40 points. Still I couldn't notice an effect (less damage when attacked by magic or something like that). The damage seems to be distributed virtually equally among the party members.
So what does AntiMagic really do? Has it got any effect at all?
And does AntiFire reduce the chance of getting a wound after a fireball attack as stated in the manual?
One of my heroes has an AntiMagic value exceeding 100 (with the proper necklace). He surpasses my other heroes by approximately 35-40 points. Still I couldn't notice an effect (less damage when attacked by magic or something like that). The damage seems to be distributed virtually equally among the party members.
So what does AntiMagic really do? Has it got any effect at all?
And does AntiFire reduce the chance of getting a wound after a fireball attack as stated in the manual?
Anti-magic does provide a reduction against magical attacks, but really that is mostly lightning bolts, which do smaller damage anyway, so the reduction will be less noticeable
Anti-fire is the big defense, as indeed it does reduce your damage by things like fireball
As with all the DM mechanics, it's subtle unless you artificially create champions with high/low values to see the difference.
For example, a champion with 255 dexterity becomes a god of not being hit even against animated armours, whereas your fighter with even 100 dexterity should by no means stop wearing armour
It is the same with armour and the physical shield, you can tell over time in combat with say golems that these items are protecting you, but on a blow by blow basis the spread of possible damage might disguise their effectiveness
Anti-fire is the big defense, as indeed it does reduce your damage by things like fireball
As with all the DM mechanics, it's subtle unless you artificially create champions with high/low values to see the difference.
For example, a champion with 255 dexterity becomes a god of not being hit even against animated armours, whereas your fighter with even 100 dexterity should by no means stop wearing armour
It is the same with armour and the physical shield, you can tell over time in combat with say golems that these items are protecting you, but on a blow by blow basis the spread of possible damage might disguise their effectiveness
- Sophia
- Concise and Honest
- Posts: 4306
- Joined: Thu Sep 12, 2002 9:50 pm
- Location: Nowhere in particular
- Contact:
Anti-magic protects you against attacks like the vexirk melee attack, anti-fire protects you against the black flame.
Anti-magic and anti-fire should theoretically have protected you against fireballs/magic attacks, but a bug in the DM engine (at least the version used in CSBwin) makes them almost worthless for this purpose. If you're using RTC or DSB, this has been "fixed" and a high anti-fire character will take significantly less damage from a fireball. Otherwise, cast some fireshields!
Anti-magic and anti-fire should theoretically have protected you against fireballs/magic attacks, but a bug in the DM engine (at least the version used in CSBwin) makes them almost worthless for this purpose. If you're using RTC or DSB, this has been "fixed" and a high anti-fire character will take significantly less damage from a fireball. Otherwise, cast some fireshields!
- Sophia
- Concise and Honest
- Posts: 4306
- Joined: Thu Sep 12, 2002 9:50 pm
- Location: Nowhere in particular
- Contact:
The offending lines are here: (in function TAG016426)
This function is called when taking damage from a fireball or other magic (with anti-magic or anti-fire as the attrNum); as you can see, the value is divided by 256 before it's used. The comments suggest some disbelief on Paul's part as well... 
Fireshielding is handled separately. Here we see the call to the function above, with stat 6 (anti-fire) as the parameter, and then fireshielding applied separately.:
Code: Select all
w_10 = pChar->Attributes[attrNum].Current();
D7W = sw(170 - w_10/256); //They stored a word and fetch a byte!
//Appears it was purposeful!

Fireshielding is handled separately. Here we see the call to the function above, with stat 6 (anti-fire) as the parameter, and then fireshielding applied separately.:
Code: Select all
D7W = TAG016426(pcA3, 6, D7W);
D7W = sw(D7W - d.FireShield);
- Paul Stevens
- CSBwin Guru
- Posts: 4322
- Joined: Sun Apr 08, 2001 6:00 pm
- Location: Madison, Wisconsin, USA
Well, if it was a bug.. it disturbes the whole system of attributes, therefore the game balance and the balance of the character`s power: a bug, that make anti-fire useless- which lowers dramatically the real value of some characters: every character has more of one attribute in cost of the others. much more usefull here, like dexterity or strenght. Do you think it was intensional? Rather not. Even the greatests (FLT team) mistakes sometimes.. 

Spoiler
(\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/)
Spoiler
(@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@)
Spoiler
(>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<)
Test executable sounds like a good idea
I really wonder how different it would be without division by 256.
But I would also like to know, what is the difference between
Spellshield(rare, only item based) and a Shieldspell?(light blue and dark blue shield respectively)
Can anyone shed some mon oh ir ra on this, please?
I really wonder how different it would be without division by 256.
But I would also like to know, what is the difference between
Spellshield(rare, only item based) and a Shieldspell?(light blue and dark blue shield respectively)
Can anyone shed some mon oh ir ra on this, please?
Bugfix would be perfect
Thanks for the explanations and the exact code for it
Gorgeous!!
There we have it, expressed mathematically that it is really quite a useless stats.
With hordes of vexirks dwelling everywhere and tons of black flames throughout the levels it might have proved a little useful but this way ...
And I perfectly agree - some characters lose their individual strengths, especially Nabi with the double 55 or Gothmog (who is still a good char even without AM/AF).
And to be honest, it bugs me a bit if I know that there are stats (and therefore necklaces too) which are really useless.
I would gladly playtest a version in which this is corrected to see how the game feels playing like then.
Now only strong health (and of course the FulBroNetas) are an insurance against Ful Irs.

Gorgeous!!
There we have it, expressed mathematically that it is really quite a useless stats.
With hordes of vexirks dwelling everywhere and tons of black flames throughout the levels it might have proved a little useful but this way ...
And I perfectly agree - some characters lose their individual strengths, especially Nabi with the double 55 or Gothmog (who is still a good char even without AM/AF).
And to be honest, it bugs me a bit if I know that there are stats (and therefore necklaces too) which are really useless.
I would gladly playtest a version in which this is corrected to see how the game feels playing like then.
Now only strong health (and of course the FulBroNetas) are an insurance against Ful Irs.
- Paul Stevens
- CSBwin Guru
- Posts: 4322
- Joined: Sun Apr 08, 2001 6:00 pm
- Location: Madison, Wisconsin, USA
There is a test version at:
http://dianneandpaul.net/CSBwin/CSBwinTestAntiFire.exe
Let us see if there is consensus as to whether
this should become permanent. I suppose it could
be a designer option. Pretty soon the entire
program will become a collection of designer
options!
http://dianneandpaul.net/CSBwin/CSBwinTestAntiFire.exe
Let us see if there is consensus as to whether
this should become permanent. I suppose it could
be a designer option. Pretty soon the entire
program will become a collection of designer
options!

hmm.. I think it should be an exception - something, that was definitely a nasty bug and was repaired.
Spoiler
(\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/)
Spoiler
(@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@)
Spoiler
(>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<)
- Paul Stevens
- CSBwin Guru
- Posts: 4322
- Joined: Sun Apr 08, 2001 6:00 pm
- Location: Madison, Wisconsin, USA
hmmm! I am not sure about it.
I think it makes fireballs too wimpy. even 30 A-fire gives too much protection
Adamo, sorry!
I did not understand your post. So I don't know
what your message was meant to tell/ how you voted!?
You get an idea how much damage fireballs do to monsters, probably, but I am honestly used to the way it was.
With
tweaking of custom dungeons, I would like it rather the old way.
how did you fix it? substituted w_10/256 with w_10?
compromise: how about w_10/128? or w_10/64 or w_10/192 or
w_10/224?
increased Anti Fire makes it harder to fireball-kill your party (which I don't like somehow.)
Furthermore I think the old way is ok, since fireshields do providea decent protection after all - once you can cast them (excluding conflux, but that is a totally different matter and here you go:
I would vote to leave it the old way and custom dungeon designers have the means to tweak Anti fire how they feel fit)
Speedruns don't get obsolete and well, you get the idea...
I am open for discussion. My point of view is - they (FTL) - did this on purpose, most likely as an ad hoc decision, but nevertheless..
edit: still there remains the thing with the useless stats...
I think it makes fireballs too wimpy. even 30 A-fire gives too much protection
Adamo, sorry!
I did not understand your post. So I don't know
what your message was meant to tell/ how you voted!?
You get an idea how much damage fireballs do to monsters, probably, but I am honestly used to the way it was.
With
tweaking of custom dungeons, I would like it rather the old way.
how did you fix it? substituted w_10/256 with w_10?
compromise: how about w_10/128? or w_10/64 or w_10/192 or
w_10/224?
increased Anti Fire makes it harder to fireball-kill your party (which I don't like somehow.)
Furthermore I think the old way is ok, since fireshields do providea decent protection after all - once you can cast them (excluding conflux, but that is a totally different matter and here you go:
I would vote to leave it the old way and custom dungeon designers have the means to tweak Anti fire how they feel fit)
Speedruns don't get obsolete and well, you get the idea...
I am open for discussion. My point of view is - they (FTL) - did this on purpose, most likely as an ad hoc decision, but nevertheless..
edit: still there remains the thing with the useless stats...

- Sophia
- Concise and Honest
- Posts: 4306
- Joined: Thu Sep 12, 2002 9:50 pm
- Location: Nowhere in particular
- Contact:
I do agree, there's a certain sentimentality to it. For DSB, I tried to compromise and keep the feel of DM's deadly fire and yet still have anti-fire matter.zoom wrote:how did you fix it? substituted w_10/256 with w_10?
compromise: how about w_10/128? or w_10/64 or w_10/192 or w_10/224?
increased Anti Fire makes it harder to fireball-kill your party (which I don't like somehow.)
I did two things:


It's distinctly "unofficial" but it seems to work...

- Paul Stevens
- CSBwin Guru
- Posts: 4322
- Joined: Sun Apr 08, 2001 6:00 pm
- Location: Madison, Wisconsin, USA
I wonder what happened here.
Conjecture:
It was originally 170-w10; but
that was too much. You don't
suppose that they did a binary
patch to change it to a byte
rather than a word? That would
not have required access to the
source or to the (probably) very
complicated build process. A simple
one bit change in the binary.
From the beginning, I have been
surprised to find this snippet of
code. It was out-of-character and
not a straight-forward thing to
produce in a higher-level language.
or something like that.
Conjecture:
It was originally 170-w10; but
that was too much. You don't
suppose that they did a binary
patch to change it to a byte
rather than a word? That would
not have required access to the
source or to the (probably) very
complicated build process. A simple
one bit change in the binary.
From the beginning, I have been
surprised to find this snippet of
code. It was out-of-character and
not a straight-forward thing to
produce in a higher-level language.
Code: Select all
*(unsigned char *)(&w10)
Sounds ok, sophia.
maxed out fireshields will not make you immune bcs of 20% minimum damage?
.............................................................................
switched values accidentially?
"D7W = sw(256 - w_10/170)"
anyway, probably bit can help with his what a fun thread?????
edit:
ah, forget that I asked about the different shieldings:
\I remember now... nevermind!

maxed out fireshields will not make you immune bcs of 20% minimum damage?
.............................................................................
switched values accidentially?

anyway, probably bit can help with his what a fun thread?????

edit:
ah, forget that I asked about the different shieldings:
\I remember now... nevermind!


- Sophia
- Concise and Honest
- Posts: 4306
- Joined: Thu Sep 12, 2002 9:50 pm
- Location: Nowhere in particular
- Contact:
The problem with this idea is that, why didn't they just change the 170 then?Paul Stevens wrote:It was originally 170-w10; but
that was too much. You don't
suppose that they did a binary
patch
No, this is all done before fireshields. It's just to keep the "feel" of DM's deadly fireballs intact, and actually ensures you need fireshields-- anti-fire can't completely mitigate the damage done by a fireball.zoom wrote:maxed out fireshields will not make you immune bcs of 20% minimum damage?
- Paul Stevens
- CSBwin Guru
- Posts: 4322
- Joined: Sun Apr 08, 2001 6:00 pm
- Location: Madison, Wisconsin, USA
Because they thought "/256" was better?Sophia wrote:why didn't they just change the 170 then
Because they thought "/256" was more clever?
Actually, a close examination of the original
binary code reveals that it was done in
the source code, quite deliberately. The
way they did it took two additional instructions.
Well -- it was only a conjecture

knows? Only The Shadow knows.
Hmmm - I will explain why I think that there is nothing with 256 at all...zoom wrote:...
anyway, probably bit can help with his what a fun thread?????
I think ... it's a bug!
(I'll write it like my code is done, should be easy to read)
The sequence is:
lea(someadress,A0); // A0 gets an adress to an array
add_w(D0,A0); // D0 finishes the adress
move_b(ind(A0),D0); // one byte is picked to D0
move_w(D0,local(0xa)); // and a word gets poked...
Short explanation for non-68000-assembler-people:
In the beginning of a routine, a memory-area usable for
temporary variables is created by the 'link'-command.
That one gets later released by the 'unlk'-command before
the end of the routine. Now, here the size created is hex 0xa,
so decimal 10 (bytes).
If you imagine a graph, with memory adress 0 far left, and the
y-axis is the end of that memory, those ten bytes are
directly left of it (and local(0xa) is first one of them).
Because of the endianess, the high byte of D0 will be placed
into that cell, and the low byte (yes, that single one they
picked from the array before) is right of it - at local(0x9),
and ...lost! They simply get the wrong byte.
The read operation later
move_b(local(0xa),D3)
picks the wrong one, division of 256 will not make it better,
it is that what was left in D0 before, and that is the higher part
of that array-offset used in the pointer-addition of D0 before!
Voila!
I'd had to study Paul's implementation, maybe he uses w10
a way so that the byteshift (the division by 256) makes sense.
Also - of those ten bytes preserved for locals, only those two
are used, so - something uncleaned was done here anyways.
My vote goes for a patch!
That routine is same for DM and CSB.
so the max value of each attribute is 255? I know it is like that now in CSBwin (max possible value increased from 170 to 255 by Paul), but I thought originally it was 170, don`t remember why...
BTW. training which skill increases luck, when you get another level? was that ninja or priest skill?
BTW. training which skill increases luck, when you get another level? was that ninja or priest skill?
Spoiler
(\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/)
Spoiler
(@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@)
Spoiler
(>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<)
Well, what now?
Is there a way of looking into DM2 and see how there the thing with Anti fire is set up?
off topic:!!!!!!!
@Adamo, I believe there's a useless priest skill which is
coin flipping; it is useless because flip coin does not give
you any experience for that or the main skill Priest, so
you cannot advance levels by this action!
Never heard about a skill that increases luck, if so, it should
be this priest skill (number 13 probably, not sure)
I think you cannot have more than 170 in any stat??
strangely, my mind plays tricks most likely, but I "remember" that in the amiga version , it was 230??
Is there a way of looking into DM2 and see how there the thing with Anti fire is set up?
off topic:!!!!!!!
@Adamo, I believe there's a useless priest skill which is
coin flipping; it is useless because flip coin does not give
you any experience for that or the main skill Priest, so
you cannot advance levels by this action!
Never heard about a skill that increases luck, if so, it should
be this priest skill (number 13 probably, not sure)
I think you cannot have more than 170 in any stat??
strangely, my mind plays tricks most likely, but I "remember" that in the amiga version , it was 230??
My highest Strength was Hissssa,who went through
DM and CSB and cheated at conversion with a mace of order,
I think to get the stat increase permanently and ended up
with a figure of 96. Could have made 2 ninja levels and one fighter level, probably 1 more each, because I never reached archmaster
and don't know if it comes after mon master or whether mon master actually is archmaster
anyway, not possible to reach 170 Strength, no no! Best Attribute would probably be Anti Magic to reach highest amounts...
DM and CSB and cheated at conversion with a mace of order,
I think to get the stat increase permanently and ended up
with a figure of 96. Could have made 2 ninja levels and one fighter level, probably 1 more each, because I never reached archmaster
and don't know if it comes after mon master or whether mon master actually is archmaster

anyway, not possible to reach 170 Strength, no no! Best Attribute would probably be Anti Magic to reach highest amounts...