Page 2 of 2

Posted: Tue Apr 03, 2007 12:52 pm
by zoom
Gambit, I read this, and got it theoretically.(translation of Charlatan's notes)
http://www.dungeon-master.com/forum/vie ... hp?t=23605

I would have liked to see a relation between ID and special colour slot 9 and 10.
This was merely speculation (as most things from me)and no wonder leads to nothing but irritation here. Sorry.


Anyway, are there any unused bits/ free space in monster data structure next to X1,X2 andX3 that could be used for a dsa or sth.?

Posted: Tue Apr 03, 2007 4:57 pm
by Paul Stevens
I assume you mean the monster type
descriptions rather than the individual
instance of a monster.

There appear to be 8 bits unused in
the Monster Descrition record. Word
14 bits 4-7. And in word 16 bits
0-3.

Words 18 and 20 might have some space
but it would require an hour's work
to verify this.

Posted: Tue Apr 03, 2007 10:02 pm
by zoom
Thanks for clearifying that!
:o

someday, possibly, they will get used.

edit:
I found some spell casting thread:
rain describes that the power of spells have everything to
do with the power stat of creatures. Maybe he
means STR?
read here:
the power of the spell is hard to know exactly but I'm sure it has everything to do with the monster's "power" stat and a tad bit of randomness
http://www.dungeon-master.com/forum/vie ... hp?t=23650

Posted: Wed Apr 04, 2007 8:52 pm
by Adamo
well, it`s high time now to get know something about the DM2 monster`s AI. Doug Bell says that they`re yet far more intelligent than from the first part. But it`s not the task for me.. Suule and Kentaro knows DM2 structure better. If there are some huge changes comparing to rthe first part, go on tell us your observations. Maybe we could make a monster characteristic for DM2 someday.

Posted: Fri Apr 06, 2007 2:47 am
by Adamo
A quick observation:
"status speed" factor in monster editor can be never set to zero; otherwise the game crashes.
System Error 0
50000 timer events in 1/6 second.
That seems excessive.
Please contect your friendly dungeon designer
Status speed is responsible for changing frequency of mirroring monster, as long for frequency of changing x/y shiftgroups; the less number is, the more probability that monster will randomly mirror its image along with randomly changing its shiftgroup.

rain` wrote:
Status speed: Amount of time to 'turn' ????
I don`t know about "turning" monster (changing its side like back to its side to its front); my observations leeds the speed of L/R mirroring and changing its X/Y shiftgroup in the same status (front).
Screamers, rocks and golems has this factor set to 15, wchich means they should never change their L/R position when facing the party when they`re at "front" status.
When a monster has low status speed factor AND word4"mirror image" flag unset, it only changes its X/Y shiftgroup.
***********************************************
The game crashes when you try to force rock pile to mirror its front image EVEN when its attack image is disabled.

rain` wrote:
Atk Stat Spd: The amount of time after turning required to pass until an attack can be made ????
I think it`s the same as above, but for attack status. Changing this factor to zero doesn`t crash the game.

***********************************************
- updated factor values code list for "ordinary attack" (thanx to Sophia!)

Posted: Fri Jan 25, 2008 7:57 pm
by Adamo
Monster AI docs says:
http://www.dianneandpaul.net/CSBwin/doc ... terAI.html
could someone (Sophia..?) explain the diagrams like just did with the "To understand attack computations" thread?

Paul Stevens wrote:
Complete understanding will probably always elude me.
why do you think so? What is needed to find out everything?
Here are some 'sub-problems', starting with the simplest.

* Simple Movement on Non-party level.
* Monsters on same level as party but far away
so, what are the others problems? There are only two mentioned, as far.

Posted: Fri Jan 25, 2008 8:23 pm
by Sophia
Not me. I gave up trying to understand DM's monster AI. DSB's AI was programmed by "look and feel." Truthfully the monsters in DSB are generally a little smarter than in DM so it all worked out. ;)

Posted: Fri Jan 25, 2008 8:35 pm
by Paul Stevens
Adamo wrote: What is needed to find out everything?
Some clever fellow like you with an intense
interest and about a thousand
hours to waste. Someone like a Graduate
Student. :wink:

I do not exaggerate much. A three-credit
undergraduate college course won't suffice.

Posted: Fri Jan 25, 2008 9:15 pm
by Adamo
Who told you I`m clever? I never managed even to learn programming DSAs! :(

and about a thousand
hours to waste
for observing the monster`s behaviour in a way you proposed here..?:

Code: Select all

Then I began adding some trace code, enabled with the Misc Menu item 'MonsterAI Trace'.  The trace is intended to be used as follows:

   1. Play a game with recording enabled.
   2. Identify some part of the game that contains curious monster behaviour.
   3. Edit the recording and enable the AI trace (#AITraceOn-#AITraceOff) during the curious behaviour.
   4. Replay the game to get the trace listing.
   5. Edit the trace listing to delete all monsters other than the one of interest.
   6. Study the trace listing in combination with the flowcharts to see what is happening.
   7. Ask Paul to fix the flowcharts, fix the trace, explain the strange nomenclature.
   8. Repeat at step 4 until full understanding is obtained.
   9. Add a section to this documentation to make the new understanding public.

The entire sequence of  steps ought not to take more than a couple of months.  Then you can begin studying another curious behaviour.  The first thing I wanted to see was how simple movement was accomplished in monsters on a level different from the party level. 

what are the main unsolved problems/mysteries of the monster AI? What do you expect to get know by this method? I would really like to help a bit - as far as I can for my little possibilities - when I just know what to search for in first order.

Posted: Fri Jan 25, 2008 11:29 pm
by Paul Stevens
Adamo wrote:what are the main unsolved problems/mysteries of the monster AI
What is the probability that a Vexirk will
turn away from me when I blow the
Horn of Fear?

Posted: Sat Jan 26, 2008 5:13 am
by Adamo
with 122 tries Vexirk turned away 90 times, so it`s about 73% probability.
character`s luck= 100, vex awareness=3.

Posted: Sat Jan 26, 2008 5:46 am
by Adamo
ok, this time on 144 tries 105 were "positive", which is about 74%. char`s luck= 100, vexirk`s awareness= 3.

Posted: Sat Jan 26, 2008 5:55 am
by Paul Stevens
Adamo wrote:so it`s about 73% probability
Does it change with the "Level's Difficulty"?
Does it change with the Character's Wisdom?
Do any of the Character's 20 skills have an
influence on this probability? Which ones?
How much? Does it change with the Vexirk's
Hit Points? If I "Blow Horn" twice in succession,
does the second have the same probability as
the first? Does it change depending on my
current Stamina? Strength? Is it the same
for every Vexirk in the game?

I doubt these questions can be answered by
statistical methods such as you have applied.
I think one must delve into the code itself to
know what this probability would be under
other circumstances.

Posted: Sat Jan 26, 2008 6:00 am
by Adamo
ok, my previous tries were with one vex. When there are 4 vexirks on the tile, they almost always turn away, because it is sufficient that only one of them will get scary, so the rest will turn away too after a while.
______________________________________________________
but.. I though all these were already known?

Posted: Sat Jan 26, 2008 6:24 am
by Sophia
Unfortunately, we don't know if there's a complicated calculation or if it's just an "if (random(4))." Methods like this don't tell us much and so you're probably just wasting your time, Adamo.

The code is extremely difficult to comprehend. Paul has torn it apart and made more sense of it than I ever could, and it still doesn't make much sense. :)

Posted: Sat Jan 26, 2008 6:35 am
by Adamo
Does it change with the "Level's Difficulty"?
Does it change with the Character's Wisdom?
Do any of the Character's 20 skills have an
influence on this probability? Which ones?
How much? Does it change with the Vexirk's
Hit Points? If I "Blow Horn" twice in succession,
does the second have the same probability as
the first? Does it change depending on my
current Stamina? Strength? Is it the same
for every Vexirk in the game?
well, some of them can be checked. Here`s how: we take two identical folders, each with the same files (dungeon. dat, graphics.dat, etc).
We run CSbuild and modify character`s properities so that every one of them should, as far as it can, vary from the previous. We start two games simultanesly on one monitor and compare the differences in monster behaviour. At lest that`s what I did when searched for the monster flags properities. First of all, we need to get know, which skills (if any) has influence on this. If Vexirk #1 seems to turn more or less frequently comparing to Vexirk #2 (with a game where things such as character values, level`s difficulty and Vexirk`s HP has modified values), that would mean something has permanent influence on this. We need to identify what is it, by excluding. Knowing what influences on this particular behavior, we could check how much does it affects..
of course, if there`s no difference in frequency, that means none of the changes done by us affected on this particular behaviour.
you're probably just wasting your time, Adamo.
unfortunately, that`s the only way I can check things like that. What can I do? I`m not a programmer. Well, I know that checking probability of turning around a monster when a character blows horn isn`t very entertaining, but I can try if it still remains unknown.
The code is extremely difficult to comprehend.
that`s why observation and exclusion methods may be the only way to obtain things like that.

Posted: Sat Jan 26, 2008 9:25 am
by beowuuf
Paul Stevens wrote:
Adamo wrote:so it`s about 73% probability
Does it change with the "Level's Difficulty"? etc
As anecdotal evidence of further complications, in my dungeon I have a four member monster group you were supposed to scare away. On one member party, this seemed to be pretty hard (I seemed to recall impossible with a normally levelled character). On a four member party, the difficulty was as i would expect.

Posted: Sat Jan 26, 2008 4:40 pm
by Paul Stevens
Adamo:

Your methods are 100 percent valid. Even
mathematics is done this way on occasion.
I was reading the other day about some
topologists who wanted to know what the
probability of a string forming a knot.
(They may have noticed that the cables
behind their computer always became knotted.)
So they put a string in a box, turned the
box over and over for 30 seconds, and then
examined the string. They did this hundreds
of times. More than a dozen different
knots were formed. Knots formed a high
percentage of the time. Of course, they
attempted to explain these things using
mathematical manipulations, and they
succeeded to a small degree.

We pay experimental physics billions of
dollars to see what atoms do under various
circumstances:
1) temperature (like level difficulty)
2) pressure (like monster armor value)
3) magnetic field (like character's strength)
4) electric field (like ninja level)
5) et cetera........
They should be able to determine all these
things using quantum-mechanical equations
but it is too complicated. So they measure
things. But, of course, the quarks are
always coming up with some unpredicted
behaviour. The Vexirks have unexpected
behaviour too, if the comments by beowuuf
are correct.

We have already admitted that CSB is too
complex for us to figure out from first
principles (examination of the code). So
your method of measuring it is perfectly
valid.

I guess I asked the wrong question. We
were discussing the diagram that I had
drawn and the meaning of the various
parts of that diagram. When you asked
what problems remained, what I really
meant to ask was: "How does CSB compute
the probability that a Vexirk will turn away
when I blow the Horn of Fear". "What does
the diagram for the Vixirk look like".
And, once that diagram is drawn and
understood, then, like in physics, one has
to do some measurements to see if the
Vexirks really do behave as we have
predicted. They certainly should---but we
(or at least I) am forever making mistakes.
I don't think we have really done many
controlled measurements such as yours.
We have relied on 'Look and feel" and
seat-of-the-pants observations like beowuf's
"seemed pretty hard" and "seemed to recall".

Posted: Sat Jan 26, 2008 7:05 pm
by Adamo
There are two schools in modern physics investigations: experimentators and theoreticals [*I`m not sure if I use proper english terms for that I have in mind- it`s english!!*]. Theoretists predicts the physics behaviour (builds theory) and rejects these that not agree with factual state, and experimentators investigate curious behaviour and repeats the experiments to prove something (usually to overthrow old theory). In case of physics it`s easier to be theoretical, because complicated experiments requires really lot of funds (giantic accelerators for hundreds millions $$ etc, supercomputers for extremally complicated calculations etc).

************************************************
what really interested me in a problem you suggested ("how does CSB compute the probability that a Vexirk will turn away when I blow the Horn of Fear") was not the pure percentage of probability, but rather "what influence on Vexirks behaviour". If it is really unknown (I don`t want to waste my time for examinating problems, that are already solved!). Most of all, I`m interested in existing (prooved or unprooved) connections between various things, like cursed armour - character`s luck (prooved) or character`s wisdom - Vexirk`s bravery when using horn of fear (unprooved), etc.

When you asked this question ("What is the probability that a Vexirk will turn away from me when I blow the Horn of Fear?"), I though: "hmm.. so there is something strange in Vexirk`s behaviour- something, that even Paul doesn`t understand. There must be some unknown/unusual things that influences on its behaviour, that is unknown. I may try to investigate that". Investigate, of course, by excluding suspicious like, for example, character`s skills. It`s indeed a hard work, but quite promising, IMHO. Especially if you compare behaviour of two identical vexirks in two identical dungeons with identical dungeon.dat and graphics.dat etc, all in the same time, but with changed only these factors that we`re interested in. I was investigating monster`s flags and unknown X1-X4 factors (I didn`t know they are unused yet; I was quite sure they are responsible for something) that way and it was quite entertaining (well, ok, first 6 hours were entertaining :roll: ).

I`m not saying I would try to investigate everything - there are some problems that I rather don`t care, for some of them I`m too dumb - but more enigmas in monster AI means more challenges! That`s why I would like to see the list of unsolved problem/ unproof theories to start investigating (if doable) from most interesting ones. I realize that investigating some of them will be a pure waste of time, because cannot be confirmed nor rejected in any way, but it`s worth to try.

Posted: Sat Jan 26, 2008 8:15 pm
by Adamo
there`s a good example already: a thing observed by Paul what Beo called "antitelefraglismness": when a monster has one of its factors above 10, it cannot be teleported to the level where it would die (each level has its own habit, wchich lets up to 15 monsters live in; others are immediatelly killed). I doubt if I could get know about that by experimenting, but who knows? Maybe after dozens of hours of tries and changes in a small experimental dungeon, by searching for other thing, I would discover that by accident.. It`s easier when you know exactly what you looking for, but there was no premisses to believe that. Some says things are divided for four kinds: known known, unknown known, known unknown and unknown unknown, but I prefere repartition for known prooved, known unprooved (suspected) and unknown things.

Posted: Sat Jan 26, 2008 9:14 pm
by Paul Stevens
I set up a little dungeon and turned
on the attack trace. Then I blew the
Horn of Fear in front of a Vexirk.

Code: Select all

K attacks from 00(03,03) to 00(02,03)
Attack type = 4 = BLOW HORN
Skill number required = 14
Byte20046[attackType=4] = 1
staminaCost = Byte20046[attackType=4] + Random(1) = 2
experiencedGained = Byte20178[attackType=4] = 0
  Entering 'WarCryEtc' for skill 14(WARCRY, CALM, BRANDISH, BLOWHORN).  Setting D4W = 0
  Attack = BlowHorn....Set Mastery = 6, Set skillIncrement = 20
  Increment Mastery by (DetermineMastery(14)=1) --> 7
  effectiveMastery = Random(Mastery) --> 2
  requiredMastery = i26.bravery() --> 5
  Attack Failed and Divide skillIncrement by 2 because requiredMastery > effectiveMastery

So it appears that the only thing that prevented the
attack was that Random(myMastery(skill#14))
was less than the 'Bravery' of the Vexirk.

When you tried it, you must have had a much
higher experience in skill #14. Probably about
four times 5 (about 20) in order for the attack
to succeed three times out of four.

Of course the function 'DetermineMastery' is
rather complex in itself. I think there is an
outline of that function somewhere:

http://www.dianneandpaul.net/CSBwin/doc ... stery.html

Posted: Sat Jan 26, 2008 11:17 pm
by Adamo
while BLOW HORN has always influence subskill (priest), in CSB WAR CRY is assigned to the fighter:

Code: Select all

NR ATTACK TYPE EXP DEF STA LKR DAM FAT SKILL   SUBSKILL    CSB
00 N           0   0   0   0   0   0   fighter -
01 BLOCK       8   36  4   22  15  6   fighter (parry)
02 CHOP        10  0   8   48  48  8   fighter (club)      STA= 10
03 X1          0   0   0   0   0   0   fighter -
04 BLOW HORN   0  -4   1   0   0   6   priest  (influence)
05 FLIP        0  -10  0   0   0   3   priest  (identify)
06 PUNCH       8  -10  1   38  32  1   ninja   (fight)
07 KICK        13 -5   3   28  48  5   ninja   (fight)
08 WAR CRY     7   4   1   0   0   3   priest  (influence) fighter (parry)
09 STAB1       15 -20  3   30  48  5   ninja   (fight)
10 CLIMB DOWN  15 -15  40  0   0   35  ninja   (steal)
11 FREEZE LIFE 22 -10  3   0   0   20  priest  (influence)
12 HIT         10  16  3   20  20  4   ninja   (fight)
13 SWING       6   5   2   32  16  6   fighter (swing)
14 STAB2       12 -15  4   42  60  10  fighter (thrust)
15 THRUST      19 -17  13  57  66  16  fighter (thrust)    STA= 17
16 JAB         11 -5   3   70  8   2   fighter (thrust)
17 PARRY       17  29  1   18  8   18  fighter (parry)
18 HACK        9   10  6   27  25  8   fighter (swing)
19 BERZERK     40 -10  26  46  96  30  fighter (swing)     STA= 40
20 FIREBALL    35 -7   5   0   0   42  wizard  (fire)
21 DISPELL     25 -7   2   0   0   31  wizard  (air)
22 CONFUZE     0  -7   2   0   0   10  priest  (influence)
23 LIGHTING    30 -7   4   0   0   38  wizard  (air)
24 DISRUPT     10 -7   5   46  55  9   wizard  (air)
25 MELEE       24 -5   17  64  60  20  fighter (club)      STA= 25
26 X2          0  -15  1   0   0   10  ninja   (steal)
27 INVOKE      25 -9   2   0   0   16  wizard  -
28 SLASH       9   4   2   26  16  4   fighter (swing)
29 CLEAVE      12  0   10  40  48  12  fighter (swing)
30 BASH        11  0   9   32  50  20  fighter (club)
31 STUN        10  5   2   50  16  7   fighter (club)
32 SHOOT       9  -15  3   0   0   14  ninja   (shoot)     EXP= 20
33 SPELLSHIELD 20 -7   1   0   0   30  priest  (defend)
34 FIRESHIELD  20 -7   2   0   0   35  priest  (defend)
35 FLUXCAGE    12  8   6   0   0   2   wizard  -
36 HEAL        0  -20  1   0   0   19  priest  (heal)
37 CALM        0  -5   1   0   0   9   priest  (influence)
38 LIGHT       20  0   3   0   0   10  wizard  (air)
39 WINDOW      30 -15  2   0   0   15  wizard  (earth)
40 SPIT        25 -7   3   0   0   22  wizard  (fire)
41 BRANDISH    0  -4   2   0   0   10  priest  (influence)
42 THROW       5   0   0   0   0   0   ninja   (throw)
43 FUSE        1   8   2   0   0   2   wizard  -

EXP - experience
DEF - defence
STA - stamina
LKR - luck required
DAM - damage
FAT - fatigue
CSB - differences for CSB (this table is for DM actually)
SKILL wizard SUBSKILL water is not used here

Posted: Mon Sep 08, 2008 12:10 am
by ChristopheF
I have updated the item 559 description with information supplied by Greatstone: http://dmweb.free.fr/?q=node/1395

There are no more "unknown" values in the creature descriptors. Some values may require testing to check that the descriptions are correct.

Posted: Mon Sep 08, 2008 12:30 am
by Gambit37
Woo hoo! Good work everyone! :-)

Posted: Tue Sep 09, 2008 11:40 am
by Zyx
fantastic!
monster descriptors:
04h (04) 1 word
Bit 1-0: Additional front image graphics (the other creature images are not affected by this value).

* '0': No additional graphics generated.
* '1': One set of two additional graphics is generated with a scaled down size (factor 16).
* '2': Two sets of two additional graphics are generated with a scaled down size (factors 16 and 20). This value is not used for any creature.
* '3': -
so, if I set a value of 2 for a monster, how and when exactly will I see these additional, scaled graphics?

Posted: Wed Sep 10, 2008 12:23 am
by Adamo

Code: Select all

16h (22) 1 word (big endian): This word is used to define how the creature can wound champions.
When a creature attacks a champion, there is a 75% chance that it can cause wounds to the champion. In this case, to determine the wounds caused by the attack, the engine generates a random number between 0 and 15. This value is compared to each of the four nibbles in this word starting from the least significant nibble until the number value is lesser than or equal to the nibble value. In order to prevent an infinite loop, the last nibble is always set to 15. The index of the nibble (0 to 3) is used to refer to a table in item 562 (ubyte590 in CSBwin) that contains masks defining which body parts are wounded.

Define the probabilities that the creature will hit each part of the body.

    * Bits 15-12: Head
    * Bits 11-8: Torso
    * Bits 7-4: Legs
    * Bits 3-0: Feet

No matter the value of the number, there is always a 1/8 probability that one hand or the other (random) is wounded.
Example with the Worm that has this word defined to FFC5h. When hit by a Worm:
The champion has 1/8 chance of being wounded to one hand and 7/8 chances of being wounded elsewhere.
6/16 chances of being wounded to the feet (values 5 to 0)
7/16 chances of being wounded to the legs (values 12 to 6)
3/16 chances of being wounded to the torso (values 15 to 13)
0/16 chances of being wounded to the head
(Look in tag f6ee in CSBwin for the code)
Can this be added to the ADGE as another editor ("wounds editor")?

Posted: Wed Sep 10, 2008 2:17 am
by zoom
Some values may require testing to check that the descriptions are correct.
which ones? I only found (quickly)

Code: Select all

# Bits 7-4: Fire resistance (Magic resistance). Value 15 means the creature is immune. Does it apply only to fire or all magic?
to a different matter:

Code: Select all

# Bits 11-8: Poison resistance (Clouds and Bolts). Value 15 means the creature is immune.
On dmcodex there had been a monster page (screamer) which stated a high lightning resistance(11?) but a different cloud/poison resistance(8?) out of 15..
Gambit, was that made up by you, did I just made this up or do you have additional info on creature resistance maybe?

Code: Select all

Bits 7-4: Bravery. Resistance to War Cry, Calm, Brandish and Blow Horn. With a value of 15, the creature is never afraid.
what about confuse?
how can I tell which of these actions
is more powerful/ how powerful it is at all?; does it depend on the item used or the
champion using the item or the monster being influenced on or a combo of the above? Probably does not matter much... :roll

////////////
after some getting used to, the site(ency.) is well structured and you find what you seek easily and not spoiling everything on first glance for new visitors :) two thumbs up!

Posted: Wed Sep 10, 2008 2:58 am
by Gambit37
zoom wrote:On dmcodex there had been a monster page (screamer) which stated a high lightning resistance(11?) but a different cloud/poison resistance(8?) out of 15..
Gambit, was that made up by you, did I just made this up or do you have additional info on creature resistance maybe?
Anything you may have seen on old codex pages will be very out of date compared with this new information and may well have been calculated incorrectly by me in the first place.

Posted: Wed Sep 10, 2008 7:09 pm
by ChristopheF

Code: Select all

so, if I set a value of 2 for a monster, how and when exactly will I see these additional, scaled graphics?
I don't know! This was not tested, the information comes from a study of the code. As no creature has this value, the effect is yet unknown (maybe it does not even work).

Code: Select all

Can this be added to the ADGE as another editor ("wounds editor")?
There is more to say about wounds. In fact this word of data is used to refer to another table in item 562 (not yet decoded) that contains masks for wounds that may also be editable.

Code: Select all

what about confuse?
I don't know yet if it is missing in the list (probably yes). Maybe in fact this applies to all actions that refer to the "Influence" skill (hidden priest skill)?
About difference between these attacks, you can refer to http://dmweb.free.fr/?q=node/690. Does the effect depend on the champion using these actions? I don't know, the code must be studied to answer that question.

I will update the page in order to add questions that have not been answered yet about all these values.

Posted: Wed Sep 10, 2008 8:32 pm
by ChristopheF
I have just updated the page with some details supplied by Meynaf and remaining questions are highlighted.