Anti Magic / Anti Fire- question

Discuss anything about the original Dungeon Master on any of the original platforms (Amiga, Atari, etc.).
This forum may contain spoilers.

Moderator: Ameena

Forum rules
Please read the Forum rules and policies before posting. You may Image to help finance the hosting costs of this forum.
Mark
Neophyte
Posts: 7
Joined: Fri Aug 01, 2008 6:12 pm

Anti Magic / Anti Fire- question

Post by Mark »

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?
User avatar
beowuuf
Archmastiff
Posts: 20686
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Post by beowuuf »

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
User avatar
Sophia
Concise and Honest
Posts: 4306
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Post by Sophia »

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!
User avatar
beowuuf
Archmastiff
Posts: 20686
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Post by beowuuf »

Ah, fireshield is a separate mechanic? Cause yeah, that does protect you. And interesting, I forgot or missed that there was a problem!
User avatar
zoom
Grand Master
Posts: 1819
Joined: Tue Sep 23, 2003 1:27 am
Location: far away but close enough

Post by zoom »

note that there are 3 shields:
theowand spell (spellshield, light blue shieldaround champion portraits)
shieldpotion/shieldspell(dark blue shield around champion portraits)
Fireshield(red around champion portraits)
User avatar
Gambit37
Should eat more pies
Posts: 13769
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Post by Gambit37 »

Sophia wrote:But a bug in the DM engine (at least the version used in CSBwin) makes them almost worthless for this purpose.
Interesting, I don't think anyone has ever noted this before. What is the bug?
User avatar
Sophia
Concise and Honest
Posts: 4306
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Post by Sophia »

The offending lines are here: (in function TAG016426)

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!
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

          D7W = TAG016426(pcA3, 6, D7W);
          D7W = sw(D7W - d.FireShield);
User avatar
Gambit37
Should eat more pies
Posts: 13769
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Post by Gambit37 »

Ah! Of course! It's all perfectly clear now ;-)
User avatar
Paul Stevens
CSBwin Guru
Posts: 4322
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Post by Paul Stevens »

Gambit wrote:It's all perfectly clear now
Sophia can explain things in such
easy-to-understand ways! Probably
a Fluid Mechanics professor.

What do folks think? Should I fix
this? I can make a test executable
if anyone would like to try it out
the other way.
User avatar
Adamo
Italodance spammer
Posts: 1534
Joined: Fri Apr 22, 2005 11:59 am
Location: Poland
Contact:

Post by Adamo »

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<)
User avatar
beowuuf
Archmastiff
Posts: 20686
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Post by beowuuf »

Actually, we should list the bugs at some point

But yes, it might be an idea to correct the problem - after all, monsters get more resistant to fireballs and magic, it might be nice for the party to be the same! Especially the back row mages and priests who tend to be your weakness by level 12
User avatar
zoom
Grand Master
Posts: 1819
Joined: Tue Sep 23, 2003 1:27 am
Location: far away but close enough

Post by zoom »

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?
Mark
Neophyte
Posts: 7
Joined: Fri Aug 01, 2008 6:12 pm

Bugfix would be perfect

Post by Mark »

Thanks for the explanations and the exact code for it :D
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.
User avatar
Paul Stevens
CSBwin Guru
Posts: 4322
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Post by Paul Stevens »

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! :(
User avatar
Adamo
Italodance spammer
Posts: 1534
Joined: Fri Apr 22, 2005 11:59 am
Location: Poland
Contact:

Post by Adamo »

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<)
User avatar
Paul Stevens
CSBwin Guru
Posts: 4322
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Post by Paul Stevens »

Adamo wrote:something, that was definitely a nasty bug and was repaired
It would seem that one vote is in. Without
any testing! :o
User avatar
zoom
Grand Master
Posts: 1819
Joined: Tue Sep 23, 2003 1:27 am
Location: far away but close enough

Post by zoom »

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... :roll:
User avatar
Sophia
Concise and Honest
Posts: 4306
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Post by Sophia »

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 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.

I did two things:
:arrow: Changed the 170 in the first formula to a 200. This means AF has to be 30 higher to get the same protection as it would in an un-"broken" DM.
:arrow: Added an extra check: fireballs will always do at least 20% of their base damage, no matter what.

It's distinctly "unofficial" but it seems to work... :)
User avatar
Paul Stevens
CSBwin Guru
Posts: 4322
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Post by Paul Stevens »

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.

Code: Select all

*(unsigned char *)(&w10)
or something like that.
User avatar
zoom
Grand Master
Posts: 1819
Joined: Tue Sep 23, 2003 1:27 am
Location: far away but close enough

Post by zoom »

Sounds ok, sophia.
maxed out fireshields will not make you immune bcs of 20% minimum damage?
.............................................................................

switched values accidentially?
:arrow: "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! :oops: :lol:
User avatar
Sophia
Concise and Honest
Posts: 4306
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Post by Sophia »

Paul Stevens wrote:It was originally 170-w10; but
that was too much. You don't
suppose that they did a binary
patch
The problem with this idea is that, why didn't they just change the 170 then?
zoom wrote:maxed out fireshields will not make you immune bcs of 20% minimum damage?
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.
User avatar
Paul Stevens
CSBwin Guru
Posts: 4322
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Post by Paul Stevens »

Sophia wrote:why didn't they just change the 170 then
Because they thought "/256" was better?
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 :!: Who
knows? Only The Shadow knows.
User avatar
Bit
Arch Master
Posts: 1064
Joined: Mon Mar 03, 2008 10:53 am
Location: Nuts trees

Post by Bit »

zoom wrote:...
anyway, probably bit can help with his what a fun thread?????
Hmmm - I will explain why I think that there is nothing with 256 at all...
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.
User avatar
Adamo
Italodance spammer
Posts: 1534
Joined: Fri Apr 22, 2005 11:59 am
Location: Poland
Contact:

Post by Adamo »

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?
Spoiler
(\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/)
Spoiler
(@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@)
Spoiler
(>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<)
User avatar
zoom
Grand Master
Posts: 1819
Joined: Tue Sep 23, 2003 1:27 am
Location: far away but close enough

Post by zoom »

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??
User avatar
beowuuf
Archmastiff
Posts: 20686
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Post by beowuuf »

That is true, the maximum you can buff a character to is 170 with potions, and you cannot get that high with level gain I don't believe

Only when hacking was it shown the stats happily supported up to 255
User avatar
zoom
Grand Master
Posts: 1819
Joined: Tue Sep 23, 2003 1:27 am
Location: far away but close enough

Post by zoom »

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...
User avatar
beowuuf
Archmastiff
Posts: 20686
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Post by beowuuf »

Archmaster comes after mon master
User avatar
zoom
Grand Master
Posts: 1819
Joined: Tue Sep 23, 2003 1:27 am
Location: far away but close enough

Post by zoom »

thanks ;)
Octopuss

Post by Octopuss »

Speaking about shields - what does the "shield" spell do? Fireshield is pretty clear... but this? I never found out.
Post Reply