DM mechanics - Azizi through the mirror of dawn

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

Re: DM mechanics - Azizi through the mirror of dawn

Post by Sophia »

Automaton wrote: Sat Jul 25, 2020 1:18 am Word64 is unused, there is a comment somewhere in Paul's CSB code that states as much.
I couldn't find this comment, but I don't think it's true, regardless.

Word64 (which I called "ddefense" in DSB) stores a modifier to your defense based on the last attack method that you used, which is then added in when a monster attacks you. Offensive methods have negative values while defensive methods have positive values: e.g., melee is -12, stab is -20, parry is +28, block is +36. This number is just linearly added to the defensive calculation so for larger values it can have a noticeable effect on your defensive ability, although the overall impact is not incredibly huge.
jayrshaw wrote: Sat Jul 25, 2020 4:41 pm Not sure if it this helps or not, but previous posters on this forum have claimed that the effectiveness of potions does not vary at all based on your characters' Healer experience/level. However, the same posters claimed that the effectiveness of missile spells (e.g., fireball, poison bolt, poison cloud, etc.) does improve as you gain Wizard experience/levels. No idea about whether or not Healer experience/levels improve the effectiveness of the Ya Ir shield spells or Ful Bro Neta fireshield spells, though.
This is all correct as far as I can tell. Potions store only the power rune of the spell used (e.g., lo, um, etc.) with the skill of the spellcaster not mattering, while the power of a magical missile is (2*Skill + 4) * (SpellPower + 2). Much like a potion, the strength of shield spells is based only on the power rune and the caster's skill is not used in the calculation.
User avatar
Paul Stevens
CSBwin Guru
Posts: 4318
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Re: DM mechanics - Azizi through the mirror of dawn

Post by Paul Stevens »

Word64 is unused, there is a comment somewhere in Paul's CSB code that states as much
Here is what I found in "my" code:

Code: Select all

  i16 word64; // In the original it appeared that this was
              // intended to hold an adjustment to damage
              // resistance.  When an attack was made by a
              // character a positive or negative value was
              // added to this word.  When the attack expired
              // (when the character's attack was no longer
              // disabled) the adjustment was subtracted.
              // Unfortuately, some attacks required no time
              // for recovery.  In such cases the adjustment
              // was made when the attack occurred but, since
              // it never timed out, the adjustment was never
              // canceled.  When a player did hundreds of these
              // attacks the adjustments added up until they
              // overflowed.  Then the value suddenly changed
              // from +32767 to -32768.  It was not too terrible
              // because the final computation was limited to
              // to the range (0, 100).  But it was noticeable
              // and probably hid smaller effects of armor, etc.
              // Since this word is used for only this one thing
              // and since only one adjustment can be in effect
              // at a time I have changed it to set the value
              // and clear the value instead of adding and
              // subtracting.  Wish me luck.
User avatar
jayrshaw
Lo Master
Posts: 388
Joined: Fri Jun 12, 2020 3:39 pm
Location: Washington, DC

Re: DM mechanics - Azizi through the mirror of dawn

Post by jayrshaw »

Thanks for the clarification, Sophia! Do you happen to know if it is also true that the skill level used in these formulas is basically half your general skill level for the skill being tested (e.g., Fighter, Wizard, etc.) plus half the level of specific subskill that is being tested (e.g., Parry, Fire, etc.)? I think I recall reading something to this effect in old posts on this forum...


--Jay
User avatar
Automaton
Journeyman
Posts: 88
Joined: Sat Aug 28, 2004 10:49 am

Re: DM mechanics - Azizi through the mirror of dawn

Post by Automaton »

Looks like scanning code at 3 am makes your brain get foggy. Thanks Paul.

The part of the code I am struggling with is where and how shield timers get reduced. Any help Sophia or Paul?

As you seem to have read through, Sophia, did you see anything else I got wrong or anything new?

Cheers
Nick k
User avatar
Automaton
Journeyman
Posts: 88
Joined: Sat Aug 28, 2004 10:49 am

Re: DM mechanics - Azizi through the mirror of dawn

Post by Automaton »

jayrshaw wrote: Sat Jul 25, 2020 4:41 pm Not sure if it this helps or not, but previous posters on this forum have claimed that the effectiveness of potions does not vary at all based on your characters' Healer experience/level. However, the same posters claimed that the effectiveness of missile spells (e.g., fireball, poison bolt, poison cloud, etc.) does improve as you gain Wizard experience/levels. No idea about whether or not Healer experience/levels improve the effectiveness of the Ya Ir shield spells or Ful Bro Neta fireshield spells, though.
This is all correct as far as I can tell. Potions store only the power rune of the spell used (e.g., lo, um, etc.) with the skill of the spellcaster not mattering, while the power of a magical missile is (2*Skill + 4) * (SpellPower + 2). Much like a potion, the strength of shield spells is based only on the power rune and the caster's skill is not used in the calculation.
I originally said this because on initial testing I got values of 13 and 15 using Lo power potions. I shall do some more testing to see if this was my error or not.

Cheers
Nick K
User avatar
Automaton
Journeyman
Posts: 88
Joined: Sat Aug 28, 2004 10:49 am

Re: DM mechanics - Azizi through the mirror of dawn

Post by Automaton »

jayrshaw wrote: Sat Jul 25, 2020 2:12 am For that matter, do you know how long the shield spells/potions tend to last? I haven't really tried using them during this playthrough yet, but I was considering using them once I start fighting monsters that can't be killed easily with spells (e.g., stone golems, animated armors, etc)...


--Jay
Can't quite get to the crux of this one Jay, hoping Sophia or Paul can point me in the right direction. All I can say is that my stopwatch results for YA IR are;

LO 15s
UM 34s
ON 1m
EE 1m35s
PAL 2m16s

Cheers
Nick K
User avatar
jayrshaw
Lo Master
Posts: 388
Joined: Fri Jun 12, 2020 3:39 pm
Location: Washington, DC

Re: DM mechanics - Azizi through the mirror of dawn

Post by jayrshaw »

Automaton wrote: Sun Jul 26, 2020 9:08 am Can't quite get to the crux of this one Jay, hoping Sophia or Paul can point me in the right direction. All I can say is that my stopwatch results for YA IR are;

LO 15s
UM 34s
ON 1m
EE 1m35s
PAL 2m16s

Wow - I think those numbers alone are enough to tell me that I would probably want to go with Mon level (i.e., Level 6) for the Ya Ir shield spell (and presumably the Ful Bro Neta fireshield spell, as well)! Unlike the potions used to raise your characters' stats, it seems like there is a really big difference between the low power level and high power level shield spells...


--Jay
Last edited by jayrshaw on Sun Jul 26, 2020 4:10 pm, edited 1 time in total.
User avatar
jayrshaw
Lo Master
Posts: 388
Joined: Fri Jun 12, 2020 3:39 pm
Location: Washington, DC

Re: DM mechanics - Azizi through the mirror of dawn

Post by jayrshaw »

Automaton wrote: Sun Jul 26, 2020 9:03 am I originally said this because on initial testing I got values of 13 and 15 using Lo power potions. I shall do some more testing to see if this was my error or not.

Hi Nick,

I can verify that the actual bonus you get due to drinking stat-boosting and mana potions also varies by a small random factor (e.g., drinking a Lo level Dane wisdom potion might raise a characters' wisdom by 9-11 points [these numbers are probably not exactly right]). If I had to take a wild guess as to how this works, I would say that the game probably stores only the power level of the potion, as Sophia mentioned, but then applies a small random factor to determine the actual bonus you get when a character actually drinks the potion.


--Jay
User avatar
jayrshaw
Lo Master
Posts: 388
Joined: Fri Jun 12, 2020 3:39 pm
Location: Washington, DC

Re: DM mechanics - Azizi through the mirror of dawn

Post by jayrshaw »

Also, I was just looking at the armor strength of various pieces of armor on the Dungeon Master encyclopedia, and in some respects, I am starting to agree with what Ameena was saying in the "Elven Boots vs. Actual Foot Armor" thread when he claimed that he didn't see a really huge difference in damage dealt by the enemy regardless of what type of armor his characters were wearing. If you look at most of the armors that are available on earlier floors of the dungeon, their armor strength really doesn't seem to be very high relative to the base amount of damage monsters tend to deal (especially when you consider how heavy some of the metal armors are). Guess it makes you wonder if it might be a better strategy to go with lighter armors just to keep your characters' current load values down...


--Jay
User avatar
jayrshaw
Lo Master
Posts: 388
Joined: Fri Jun 12, 2020 3:39 pm
Location: Washington, DC

Re: DM mechanics - Azizi through the mirror of dawn

Post by jayrshaw »

jayrshaw wrote: Sun Jul 26, 2020 6:00 pm If you look at most of the armors that are available on earlier floors of the dungeon, their armor strength really doesn't seem to be very high relative to the base amount of damage monsters tend to deal (especially when you consider how heavy some of the metal armors are).

Now that I'm looking at the formulas again, I guess I should have said "relative to the value of 130 that absorb is subtracted from before being applied to monster damage" rather than "relative to the base amount of damage monsters tend to deal." For example, a mail aketon's armor strength of 35 really doesn't seem to subtract a very large percentage of the base value of 130 that is applied to monster damage given how heavy the mail aketon is. The armors available later in the dungeon do seem to be quite a bit more effective, though...


--Jay
User avatar
Automaton
Journeyman
Posts: 88
Joined: Sat Aug 28, 2004 10:49 am

Re: DM mechanics - Azizi through the mirror of dawn

Post by Automaton »

Part 4 - What the actual F is going on when a monster hits you?

Part 4c - The gory details....

Note: For those of you unfamiliar with bitwise operations << means leftshift and >> means rightshift. These are binary operations that have the effect of multiplying or dividing a number. >>1 means move the bits right by 1 so 1100 (12) would become 0110 (6). >>2 means move the bits right by 2 so 1100 (12) would become 0011 (3). so the number can mean either divide or multiply (depending on if its a left or right shift) by 1=2 2=4 3=8 4=16 5=32 6=64 7=128 etc. etc.

Note2: If I use "FN" it means a function in the CSBwin code

Note3: The attacktrace I am using has been heavily modified by me, so I can work stuff out, normal CSBwin won't give you the same results.

Note4: True and false are sometimes expressed as 1 and 0. Equally true can mean not 0 and false can mean not non 0.

So....

One of my chars died on level 5 so I had to go back and res him - lots of worms on worm level had respawned, and here is the AttackTrace log of BOB THE BLUE (nabi) getting attacked by a worm.
MONSTER ATTACK ©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©

© Attacking BOB
© Calculating XP with (monster XP class=5) because a monster hit you...

|Entering function to Adjust skills (Reason 6) --------------------------
|
| Base XP=5 target skill=[7] XP*dungeon level multiplier (2) = 10
| [skill >=4] A monster attacked you < 4.17 seconds ago so XP*2 = 20
| skill[7] so Base skill is [0] with mastery level [7]
| skill[7] Adjusting XP: 3921+20=3941
| skill[0] new mastery level=7
| No level up
|
|Leaving function to Adjust skills -------------------------------
Getting XP for getting hit. Magenta worms XP class is 5 (DME). The adjustSkills FN also checks to see if after adding XP to the affected skill and the base skill it is connected to, you have levelled.
© BOB's required to hit is 19
© Monsters to hit is rand(32)=23 + monsters Dex(35) + dungeon level multiplier*2 (4) - 16 = 46
© BOB's required to hit (19) is < monsters to hit roll (46) or monster passed a lucky hit chance (1 in 4)
Your character and the monsters to hit are calculated and then compared. If the monster misses, it gets a lucky 1 in 4 chance of hitting, just like characters do when they miss.
| Entering IsCharacterLucky (BOB , (luckNeeded=60))-------------------------------------
| ran bool=0 ran(100)=8, luckneeded=60
| D0 is either 0 or a rand(currentluck(42))=5
| result(0) = D0W (5)> luckNeeded (60)
| Returning result=false----------------------------------------------------

© BOB's IsCharacterLucky returned False
This is where the Luck attribute (attribute 0) is checked to see if it can get the monster to miss.
© Working out which body part to attack ©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©
© Wound=true
© Final D4=0 Final woundvalue(0)=5
© mask(D4) set to 32
The game has a bit of convoluted code to work out where the monster is attacking you. It gets a random number and "&"'s it with 112, the net result is that you have a 12.5% chance to not be attacked on a body part and an 87.5% chance to be attacked on a body part. If you do get true on a body part, it uses the same random number "&" 15 (this makes the random a 0-15 value) and checks it against monster wound values.

If Wound=false (for a body part) it will pick the left or right hand. (I think)

Magenta worms have wound values in this specific order feet=5 legs=12 torso=15 head=15 (DME). This means that Magenta worms can never attack the head as 15 is the max and it will always be true if it gets to the torso.

Note: On monster wound values, monsters with low height have much greater chances of choosing the feet or legs to attack, like worms, rusters and screamers. Large creatures have a very small chance of picking feet or legs.

In this case, D4=0, woundvalue=5 means that it's attacking my feet, mask =32 is a conversion of D4=0 so it can pass the value to the next function(s),
© D7 Monster damage = (w_2(2*dung lev multi) (4) + STRandom(16) + D3W Monster attack power (45)) - (2*parry skill)(12) =37
© Divide D7 Monster damage by 2=18 and add rand(monster damage)[1] + rand(3)[0] =[19]
© D7 Monster damage= (D7W + STRandom(D7W)=31. D7 Monster damage/4=7. D7 Monster damage=(D7W + STRandom0_3() + 1)=11
This part is working out the base damage the monster will do. It gets divided and multiplied a bit by rands. It gets unlucky in this case as a rand of it's own damage returns only 1 from a possible 18. The monster damage should be clear enough from my log.
Entering damage character function (character=0 damage to do=11 mask=32 damage type=4--------

| Attacking body part D0W=5 (mask) D0 0=L hand 1=R hand 2=head 3=torso 4=legs 5=feet ------------------------
| Sharp attack true setting D1UW = 0x8000 (1000 0000 0000 0000)
| Entering clothing calc TAG01680a(chIdx[0], D0W | D1W[4294934533])
Now it's got the variables it needs worked out, it passes to FN damageCharacter. It's turned the mask (32) back to a 5(feet) and set the sharp bit to 1. Now it is going to hand off to FN TAG01680a (chIdx[0], D0W | D1W[4294934533]. Even though it's only 2 parameters, 3 are getting passed. chIdx=0 is referring to BOB. D0W | D1W is another bitwise operation adding the sharp bit to the possession index (the body part it wants to attack).

Entering TAG01680a(i32 chIdx(0),i32 possessionIndex(-32763))------------------------
As a signed integer, the -32763 means the top bit (sharp attack) is set (Magenta worms do use sharp attack). 32768 is the max so minus the 32763, we get our 5 (the possession index)
| D5 is holding the sharp bit=[4294934528] and possession index is [5]

| Working out if you have a shield--------------------------------------------------------
| D7=0 name index 108 desc index 99
| D0 clothing type=30
| Item had 'adds defense when held flag' set=3
It tests 0 (left hand) and 1 (right hand) for something in the clothing DB (database) that has the bit set that means "adds defence when held". I tried holding my mail hosen in my hands, but the bit was not set, so didn't work :)

In this case it found name index 108 in the left hand (108 is the wooden shield) and the bit was set so it continued on to the next part....
Damage calculation - stage 1 - weighting raw damage-----------------

> Variables: Str=55 chIdx=0 hand=0Raw damage (Str+rand(15)=9)=64 Item weight=14 (Maxload/16)=33

> Passed test 1 - Weapon weight (14) was <= maxload/16(33) so raw damage (raw damage + weapon weight -12)=66

> Stamina check, raw damage = 66
> Log hand=0, D0W (ouches)=0, D1W=1
> Apply limits of 0 and 100 to (raw damage/2) = 33
> Raw damage char=0 hand=0 value=33
This is the same damage check used when you hit a monster. As shields have no weapon damage, it's mostly about your STR here. Notice the "apply limits" - it can't be less than 0 or more than 100. The ouches being true will divide it by 2 and the stamina check will lop off about 25% if you are under half stamina.

I got 33.
| Entering TAG009470 (Get AC) item AC=20 item pierce resist=3 scale=1
| Scale=true (its a piercing attack) so result= AC(20)*(pierce resist(3)+4)(7) / 8 = 17
Now we are in FN TAG009470 which returns either the base AC of an item or the modified sharp attack AC if the damage type is 04. Scale being true means it's a sharp attack and will get modified.

Here I get 17 which is 7/8s of 20.
| D0L = DetermineThrowingDistance(chIdx[0], D7W possesionindex [0])=33
| D1L = TAG009470(clA2[], D5W!=0[1])17
| D0L += D1L;=50
| D1W = (UI8)(d.Byte1412[possessionIndex(5)]);1
| D0L = D0W * D1W=50
| D7(0) != possesionindex(5) so D1=5(5)
| D6(0) = D6 + (D0(50)>>D1(5)) = | Final shield absorb=1
The first 2 lines just reiterate what was previously calculated. Then they get added together and multiplied by a scaler (d.Byte1412).

d.Byte1412 is curious. It took a while to hunt it down but it's inside graphic entry 0x0232.

It's equal to;

5 for left hand
5 for right hand
4 for head
6 for torso
3 for legs
1 for feet

I originally thought it an error that it's multiplying your shield by a body position (the bold line), but now I think (maybe) it scales your shields effectiveness depending on which body part is being attacked with feet and legs being harder to defend with a shield and torso being the easiest.

If it was being fairer I would have made the code D1W = (UI8)(d.Byte1412[D7W]);5 using the multiplier of the hand the shield is in (5) because the last step of shifting the value by 4(/16) or 5(/32) makes shields very low weight in the formula.

As you can see, it's attacking my feet (5) so I get a value of 1 and 50*1 is.... ..50 :(

Finally it works out if the body part being attacked is the same as your shield location and sets a shifter to 4 if true or 5 if false

I got 5 because its attacking my feet, not the left hand and wow - 50>>5 (/32) = 1

1 whole absorb for my shield :(

The same function for the shield of darc with the torso being attacked would be;

Raw damage = 34
AC = 100
d.Byte1412=6

(34+100)*6=804

804>>5 (/32)=25

Shield of darc with the feet being attacked would have been;

(34+100)*1=141 /32 = 4

Shield of darc with the torso being attacked and STR=100 would have been;

(69+100)*6=1014 /32 = 31

Shield of darc with the feet being attacked and STR=100 would have been;

(69+100)*1=169 /32 = 5
| D7=1 name index 34 desc index 33
| Out of for loop D6W = 1
This is working out that my right hand contains a sword (name index 34) and it wants to do nothing else with it.

Now I am wondering what holding 2 shields does.
| D0 is a random=9493231 D1 is current vitality=54
| D1 is current vitality/8+1=7
| D0 & ffff=56047
| D7 (Absorb) = ((D0L mod D1W)=5)=5
| If D5 != 0 (sharp bit set) D7/2 (D5 is currently -32768)
This part is setting the base absorb. It gets a random number, gets VIT/8+1 and performs a mod on it. So basically, it can be from 0 to VIT/8.
If it's a sharp attack, it gets divided by 2.
| D7W (absorb)=2 + word64 (weapon defence modifier)=0 + shieldStrength (shield potion YA BRO)=48+ PartyShield (shield spell YA IR)=72,D6W (shield absorb)=1 = 123
Here, your almost final absorb rating is calculated.

Your base absorb, freshly calculated - I got 2 (5 divided by 2, rounded down)

Word64, this is the modifier added for defence if your action is greyed out and an action defence modifier is active. For example, if you have used block, you get +36 here. If you have used stab you get -20. If you have cast see through walls you get -15 etc. etc. - I got 0

(Hope I got it right this time, I'm sure Sophia will correct me if not :) )

Next is personal shield (YA BRO), as mentioned this is cumulative, the more potions you drink, the higher it gets, with diminishing returns after 50. - I got 48, I think this was 2 PAL level YA BRO potions.

Party shield (YA IR) is much the same as the above. - I got 72, a bunch of PAL and EE shields had been cast.

And finally your shield value is added - I got a measly 1.
| Getting AC modifier of body part attacked (possesionindex [5])-------------------------

| Entering TAG009470 (Get AC) item AC=30 item pierce resist=6 scale=1
| Scale=true (its a piercing attack) so result= AC(30)*(pierce resist(6)+4)(10) / 8 = 37
Now it's doing the last part of calculating your absorb, it's grabbing the AC of the item worn in the body part being attacked.

I am wearing, well, BOB was wearing, the mail hosen in my feet slot (5) so AC is 30 and sharp resist is 6. In this case you can see the sharp formula giving me a better value than the base AC. *10/8 is the same as saying "Give me 10/8's of 30, which is 37"
| D7 (absorb) = D7 (absorb) + AC of item worn = 160
| D0W (Absorb) = ApplyLimits(0, D7W >>1, 100)= 80
| D5W (Absorb) = 80
| If D4W true (a mask was true) D5(Absorb) = (D5 (80) &0xffff)=80 / (D4 (mask true) (1) &0xffff)=1 =| D5 (Absorb)=80
My almost final absorb (123) + my armour in my foot slot (37) =160, divided by 2 within limits comes to 80. Note, another apply limits, so max is 100 and min is 0.

Not sure about the last line as it relies on D4 which is a counter which only seems to be 1 or 0 which will not change the result.

The implications;

Before your absorb is divided by 2, your first goal is to hit as close to 132 as possible. This gets you neutral - the damage the monster does will be the damage you get.

Base absorb - with 100 VIT, the best you could do here is 12 which is 0 to 6% (or 6 for a sharp attack which is 0 to 3%).. ..but it is random up to what you can get. i.e. 100 VIT means you will get between 0 and 12 somewhere.

word64 - Dependant on if you have attacked - Block will net you +36 which is 18%

Potion shield - With a few MON potions you can get to 70+ easy and stay there for some time. 35%

Party shield - With a few MON spells you can get to 70+ easy and stay there for some time. 35%

Shield - Measly - 1 to 40(ish) depending on the shield and the body part being attacked. So up to 18% if torso and shield of darc. A mid range shield like the large shield with 55 STR and the best rand role of 15 and body part attacked...

L hand=13% (gets a /16 instead of /32 if your shield is here)
R hand=6%
Head=5%
Torso=8%
Legs=4%
Feet=2%

AC of item worn - Quite good. Mid range items...

Armet (40 AC base 55 for a sharp attack) 20%/27%
Torso plate (65 AC base 65 for a sharp attack) 32%/32%
Leg plate (56 AC base 56 for a sharp attack) 32%/32%
Foot plate (37 AC base 41 for a sharp attack) 18%/20%

Plate of Lyte (125 AC base 125 for a sharp attack) 62%/62%
Plate of Darc (160 AC base 160 for a sharp attack) 80%/80%
Main calc-------------------------------------

| D0W(Absorb) = 130-D5W(old Absorb)=50. D7W(monster damage)(11) = (D0(absorb)*D7(monster damage))/64=8
This is the big one - most of the calculation done so far ends here.

Absorb = 130 - your absorb rating. 130-80 in my case = 50.

The next part scales the monster damage based on your absorb. (50*11)/64 is 8. So 50 dmg, would have been 39 dmg. 100 dmg would have been 78. So 80 absorb is about 22% reduction here.

If you had max absorb of 100 and monster damage was 100, it would be (30*100)/64= 46.8 or a 53.2% reduction.

2 cases, 1 for 11 dmg (that I had) and 100 dmg

------------11 dmg-------100 dmg--------
Absorb=0 damage=22 damage=205
Absorb=2 damage=22 damage=200
Absorb=10 damage=20 damage=187
Absorb=20 damage=18 damage=171
Absorb=30 damage=17 damage=156
Absorb=40 damage=15 damage=140
Absorb=50 damage=13 damage=125
Absorb=60 damage=12 damage=109
Absorb=64 damage=11 damage=100
Absorb=70 damage=10 damage=93
Absorb=80 damage=8 damage=78
Absorb=90 damage=6 damage=62
Absorb=98 damage=5 damage=50
Absorb=100 damage=5 damage=46

So the centre point is 64 absorb with 2 doing *2 dmg and 98 doing /2
© Determining if character gets injured--------------------------------------------------

© Testing characters vitality against random(128)+10=29

[][] Entering test attribute - attribute [4] which is [54] value to modify [29]-----------------------------

[][] D7 = 170-[54] which is [116]
[][] D7 (test result) >= 16 so (D0(29)*test result(57))/128 = [26]
[][] Tag016426(chIdx=0,attrNum=4,P3=29) = 26
This part is testing vitality to see if you will sustain an injury to the body part.
© If D7(damage)[8] > vitality test result [26] you have a chance to get injured
The worm only does 8 dmg and my test returned 26, so the part of the code that works out IF you sustain an injury is skipped.
$ Damage character 0 incremented by 8 = 8
$ d.PendingDamage[chIdx] = 8;

Returning damage charcter with value (8)------------------------------------------------
And finally, the damage is added to the queue to be done.

I was never aware when originally playing DM all those years ago that the different shield spells were so potent. Or that they stacked.

Before, at low level, I would get to the worm level and do the "square dance" so they could not hit me, knowing that a few nasty worm hits of 60+ dmg would total my characters. It's easy to see now that worm hits on badly equipped heroes with no shield spells can double the damage you take.

Now, I've tried being shielded up and it is easily possible to stand your ground and fight. It's quite different get hit for 10-30 dmg instead of 40-90 dmg.

Cheers!
Nick K.
User avatar
jayrshaw
Lo Master
Posts: 388
Joined: Fri Jun 12, 2020 3:39 pm
Location: Washington, DC

Re: DM mechanics - Azizi through the mirror of dawn

Post by jayrshaw »

Interesting information, Nick - thanks for posting it! Your post is consistent with some older threads in this forum that also mention that shields in Dungeon Master do not typically assist very much with your characters' defense. However, I was not aware that vitality also helps your characters' defense by only a very small amount.

If I'm understanding your post correctly, though, the shield potions and party shield spell both look like they can actually help a great deal. Is there any reason why you would use both the shield potions and the party shield spell instead of just stacking the party shield spell repeatedly? It just seems like it would be easier to stack the party shield spell than to create shield potions since it takes 4 separate shield potions to apply the shield potion defense bonus to your entire party.

I also noticed in your post that monsters apparently have a dexterity value that is used to help determine whether or not they hit the character they are attacking. As far as I can tell, monsters' dexterity values are not included in the "creature details" section of the Dungeon Master encyclopedia. Do you happen to know offhand whether or not couatls have a particularly high dexterity value? I am asking because I recently performed an experiment where I allowed a couatl to attack my front row characters 10 times and discovered that the couatl hit my characters 8 out of the 10 times despite the fact that my characters' dexterity values were buffed into the 140s...


--Jay
User avatar
Automaton
Journeyman
Posts: 88
Joined: Sat Aug 28, 2004 10:49 am

Re: DM mechanics - Azizi through the mirror of dawn

Post by Automaton »

Hi Jay,

On the shields - it is easy to get them to 50+ not too hard for 70ish but above that trickier. I only use the potions on the dudes getting attacked and why would you not want 2* +70 absorb instead of 1? ;-) They get added regardless of which body part is attacked so more useful than armour really.

Monster DEX is the same as defence. It's been classified on DM encyc as monster defence, but its used both in defence and attack, so it's more accurate to call it monster DEX. So yeah, it's 88 for couatls.

Cheers!
Nick K.
User avatar
jayrshaw
Lo Master
Posts: 388
Joined: Fri Jun 12, 2020 3:39 pm
Location: Washington, DC

Re: DM mechanics - Azizi through the mirror of dawn

Post by jayrshaw »

Thanks, Nick! I'll try a monster with lower defense/dexterity once I encounter one and see if my characters dodge it any better; 88 is a pretty high defense/dexterity value and may account for why the couatls are hitting my characters so much despite their highly-buffed dexterity values.

For the shield potions and spells, are you saying that there are two separate bonuses that can get as high as 70 (meaning that if I approach 70 bonus absorb points with the party shield spell that the shield potions will not bump against that limit but apply to their own, separate bonus limit)? If that's the case, I can definitely see why you would want to use both the party shield spell and the shield potions...


--Jay
User avatar
Automaton
Journeyman
Posts: 88
Joined: Sat Aug 28, 2004 10:49 am

Re: DM mechanics - Azizi through the mirror of dawn

Post by Automaton »

Correct,

Party shield and personal shield are 2 different bonuses.

Nick K
User avatar
Sophia
Concise and Honest
Posts: 4240
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Re: DM mechanics - Azizi through the mirror of dawn

Post by Sophia »

The way DM determines your skill level for any given ability is actually a little bit weird. It adds up your base skill xp, your subskill xp, and your temporary xp for that skill, and then divides by 2 and uses the result from the xp table to get your current level.

Temporary xp (called tempAdjust in CSBwin) is given for a skill every time you gain xp in that skill; you get temp xp equal to the xp award divided by 8, with a minimum of 1 and a maximum of 100. The total amount of temporary xp you can have is capped at 32000, and you lose 1 temp xp in every skill every 10 seconds or so.
User avatar
jayrshaw
Lo Master
Posts: 388
Joined: Fri Jun 12, 2020 3:39 pm
Location: Washington, DC

Re: DM mechanics - Azizi through the mirror of dawn

Post by jayrshaw »

Definitely good to know, Nick! I'll try using both the party shield spell and shield potions once I start encountering enemies I can't easily kill with ranged spells.


--Jay
User avatar
jayrshaw
Lo Master
Posts: 388
Joined: Fri Jun 12, 2020 3:39 pm
Location: Washington, DC

Re: DM mechanics - Azizi through the mirror of dawn

Post by jayrshaw »

Sophia wrote: Sun Jul 26, 2020 10:57 pm The way DM determines your skill level for any given ability is actually a little bit weird. It adds up your base skill xp, your subskill xp, and your temporary xp for that skill, and then divides by 2 and uses the result from the xp table to get your current level.

Temporary xp (called tempAdjust in CSBwin) is given for a skill every time you gain xp in that skill; you get temp xp equal to the xp award divided by 8, with a minimum of 1 and a maximum of 100. The total amount of temporary xp you can have is capped at 32000, and you lose 1 temp xp in every skill every 10 seconds or so.

Thanks for the additional clarification, Sophia! Based on your description, it sounds like the temporary experience is almost like a kind of bonus you get for having used a skill recently that is tacked on to your base/subskill experience levels when skill tests are performed. Based on the numbers you cited, it sounds like the temporary experience is most likely to have an impact earlier in the game when your base/subskill experience levels are lower...


--Jay
User avatar
jayrshaw
Lo Master
Posts: 388
Joined: Fri Jun 12, 2020 3:39 pm
Location: Washington, DC

Re: DM mechanics - Azizi through the mirror of dawn

Post by jayrshaw »

jayrshaw wrote: Sun Jul 26, 2020 10:50 pm Thanks, Nick! I'll try a monster with lower defense/dexterity once I encounter one and see if my characters dodge it any better; 88 is a pretty high defense/dexterity value and may account for why the couatls are hitting my characters so much despite their highly-buffed dexterity values.

I just tried letting a couple mummies attack my group 10 times, and this time my characters dodged 8 out of the 10 times (compared to dodging a couatl 2 out of 10 times). Based on this, it looks like a monster's defense/dexterity value has a pretty significant impact on how often the creature will hit your characters...


--Jay
User avatar
Sophia
Concise and Honest
Posts: 4240
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Re: DM mechanics - Azizi through the mirror of dawn

Post by Sophia »

That's essentially the best you're ever going to get, because both characters and monsters have a 25% chance of hitting even if they'd "miss" due to the quickness comparison.
User avatar
jayrshaw
Lo Master
Posts: 388
Joined: Fri Jun 12, 2020 3:39 pm
Location: Washington, DC

Re: DM mechanics - Azizi through the mirror of dawn

Post by jayrshaw »

Sophia wrote: Mon Jul 27, 2020 3:51 am That's essentially the best you're ever going to get, because both characters and monsters have a 25% chance of hitting even if they'd "miss" due to the quickness comparison.
Maybe that's why I never noticed having too much difficulty hitting giant wasps and/or gigglers with normal attacks despite their high defense/dexterity values. If you can still hit them 25% of the time, that might have been enough for me not to get too frustrated about it (especially since the wasps often die the first time you manage to score a direct hit on them).


--Jay
User avatar
Automaton
Journeyman
Posts: 88
Joined: Sat Aug 28, 2004 10:49 am

Re: DM mechanics - Azizi through the mirror of dawn

Post by Automaton »

Part 5 - How much XP do spells give me?

The formula that works out XP looks like;

=rand(7)+((spell difficulty+spell power)*16)+(8*((spell power - 1)*spell difficulty))+((spell difficulty+spell power)*(spell difficulty + spell power))

And here's the table

Note: The first component is a rand(7) which accounts for the small variances in xp. In the table I've set it to 4, so values will be true in the table +/-4

Note2: Dain (or dane) potions are the lowest mana cost, difficulty 4 spell/potion.

Image

Cheers!
Nick K
User avatar
jayrshaw
Lo Master
Posts: 388
Joined: Fri Jun 12, 2020 3:39 pm
Location: Washington, DC

Re: DM mechanics - Azizi through the mirror of dawn

Post by jayrshaw »

Thanks, Nick! I believe that the Ma Potion (i.e., Stamina Potion) spell gives the most Healer experience per mana point consumed (by far) and the Poison Cloud spell give the most Wizard experience per mana point consumed. However, I ended up using the Magic Torch spell for most of my Wizard training, anyway, because it gives almost as much experience per mana point consumed as the Poison Cloud spell and it teaches the Fire subskill, which is useful if you plan to use a lot of fireball spells.


--Jay
User avatar
PaulH
Ghastly gastropod
Posts: 3763
Joined: Wed Aug 07, 2002 10:27 pm
Location: Level 6

Re: DM mechanics - Azizi through the mirror of dawn

Post by PaulH »

Stunning work!
User avatar
Automaton
Journeyman
Posts: 88
Joined: Sat Aug 28, 2004 10:49 am

Re: DM mechanics - Azizi through the mirror of dawn

Post by Automaton »

Part 6 - Are missile weapons broken?

Is the following code well broken or am I misunderstanding something?

I'm hoping Paul or Sophia can shed some light.

Code: Select all

w_42 = sw(DetermineMastery(pParam->charIdx, 11));
pParam->attdep.shoot.range = pWeapon_18->uByte3 + pWeapon_22->uByte3;
This works fine, getting mastery of shoot skill and then it gets the weapon and ammo range and adds it.

Code: Select all

pParam->attdep.shoot.damage = 2 * (pWeapon_18->word4 + w_42);
Eh? word4 is huge numbers. 8312 for the crossbow, 8242 for the sling. etc. Shouldn't it be grabbing the shoot damage of the weapon (&FF of word4)?

If 2 * (pWeapon_18->word4 + w_42) did get passed as damage, it would do over 16k damage per hit!

Code: Select all

pParam->attdep.shoot.damage = D4W;
D4 is currently the weapon class-32 for the sling (7) or -16 for the bows (Bow=4 speedbow=10 crossbow=14). Surely this is meant to be the decay rate referenced by the 2 functions LaunchObject and LaunchMissile?

Code: Select all

LaunchObject( pChar,obj_4, pParam->attdep.shoot.range, pParam->attdep.shoot.damage, pParam->attdep.shoot.damage );
To me it seems like the decay rate in D4 is being passed as both decay rate and damage?

If I were to guess how this should work it should be;

pParam->attdep.shoot.damage = D4W; (This needs to go)
Range = fine as it is
Damage = 2* (pWeapon_18->word4 & FF) + shoot mastery (Anding word4 withh FF will get the proper shoot damage and the 2* would make it waaaay to powerful) (I'd get 256 dmg with a crossbow)
Decay = D4

In any case the net result is that this mechanic seems very broken to me at the moment and will produce 1-14 ish damage max .

Cheers!
Nick K
User avatar
ChristopheF
Encyclopedist
Posts: 1538
Joined: Sun Oct 24, 1999 2:36 pm
Location: France
Contact:

Re: DM mechanics - Azizi through the mirror of dawn

Post by ChristopheF »

You can compare with source code in ReDMCSB (http://dmweb.free.fr/Stuff/ReDMCSB_Release2.7z file MENUS.C, search for "case C032_ACTION_SHOOT" to find the code corresponding to what you describe). Based on your explanation, I agree the csbwin code does seem wrong there.
User avatar
jayrshaw
Lo Master
Posts: 388
Joined: Fri Jun 12, 2020 3:39 pm
Location: Washington, DC

Re: DM mechanics - Azizi through the mirror of dawn

Post by jayrshaw »

Automaton wrote: Sat Aug 01, 2020 11:07 am In any case the net result is that this mechanic seems very broken to me at the moment and will produce 1-14 ish damage max .
I have no idea about the actual code, but I can say anecdotally from just experimenting in the game that enemies with halfway decent armor values (e.g., rockpiles, magenta worms, giant wasps, etc.) seem like they are essentially totally invulnerable to missile weapons. This is probably well known by now, but I thought I'd throw it out there...


--Jay
User avatar
Automaton
Journeyman
Posts: 88
Joined: Sat Aug 28, 2004 10:49 am

Re: DM mechanics - Azizi through the mirror of dawn

Post by Automaton »

ChristopheF wrote: Sat Aug 01, 2020 2:15 pm You can compare with source code in ReDMCSB (http://dmweb.free.fr/Stuff/ReDMCSB_Release2.7z file MENUS.C, search for "case C032_ACTION_SHOOT" to find the code corresponding to what you describe). Based on your explanation, I agree the csbwin code does seem wrong there.
Merci Christophe.

I had ReDMCSB already, but hadn't checked it.

Code: Select all

F326_ozzz_CHAMPION_ShootProjectile(
 L1247_ps_Champion,
 A1250_T_Object, L1256_ps_WeaponInfoActionHand->KineticEnergy + L1257_ps_WeaponInfoReadyHand->KineticEnergy, 
 (M65_SHOOT_ATTACK(L1256_ps_WeaponInfoActionHand->Attributes) + F303_AA09_CHAMPION_GetSkillLevel(P787_i_ChampionIndex, 
 C11_SKILL_SHOOT)) << 1, 
 A1246_i_StepEnergy);
Yeah, that puppy looks healthier.

Would your M65_SHOOT_ATTACK(L1256_ps_WeaponInfoActionHand->Attributes) get 120 for the crossbow and 50 for the sling?

I see the leftshift 1, so it is multiplied by 2! Damn my crossbow should be pumping out 250+ dmg

Cheers!
Nick K.
User avatar
Paul Stevens
CSBwin Guru
Posts: 4318
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Re: DM mechanics - Azizi through the mirror of dawn

Post by Paul Stevens »

This code has undergone several modifications. Here is the original translation:

Code: Select all

//01c3ac 206e ffee                MOVE.L   -18(A6),A0
//01c3b0 3028 0004                MOVE.W   4(A0),D0
//01c3b4 c07c 00ff                AND.W    #255,D0
//01c3b8 d06e ffd6                ADD.W    -42(A6),D0
//01c3bc e340                     ASL.W    #1,D0
//01c3be 3f00                     MOVE.W   D0,-(A7)
//01c3c0 206e ffee                MOVE.L   -18(A6),A0
//01c3c4 1028 0003                MOVE.B   3(A0),D0
//01c3c8 206e ffea                MOVE.L   -22(A6),A0
//01c3cc c07c 00ff                AND.W    #255,D0
//01c3d0 4243                     CLR.W    D3
//01c3d2 1628 0003                MOVE.B   3(A0),D3
//01c3d6 d043                     ADD.W    D3,D0
//01c3d8 3f00                     MOVE.W   D0,-(A7)
//01c3da 3f2e fffc                MOVE.W   -4(A6),-(A7)
//01c3de 2f0b                     MOVE.L   A3,-(A7)
//01c3e0 4ead 042c                JSR      1068(A5)    (=0x017498)
//01c3e4 defc 000c                ADD.W    #12,A7
      LaunchObject(
                   pChar,
                   obj_4,
                   pWeapon_18->uByte3 + pWeapon_22->uByte3,
                   2 * (pWeapon_18->word4 + w_42),
                   D4W );
At (Atari) relative address 01c3b4 you will see the 'AND 0xff' that you wanted
to see. It was clearly overlooked in the process of translation. Sorry about that.

My situation is such that I will probably have to abandon CSBwin soon. Because of that,
I will fix this little problem and release a new version of the source and executable.
As I recall there are one or two other changes (less important than this particular change)
that have been incorporated but not yet released.
User avatar
Sophia
Concise and Honest
Posts: 4240
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Re: DM mechanics - Azizi through the mirror of dawn

Post by Sophia »

Interesting. I noticed this in DSB as well, but at the time I thought it was a bug in DM, not CSBwin.

I'll also point out that this issue has less of an effect than you might think because the "damage" value was of lesser importance (compared to the "kinetic energy" or whatever you'd call the fly distance) to the actual impact damage calculation.
Post Reply