!Help for !XdY+ 1.10 (07 Jul 1998)  Musus Umbra, 1997
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Part of the AngbandUtils suite of, um, utilities for use
with, um, Angband. Uh.

XdY+ was created using Desklib (the freeware C library for
Risc OS machines).

Full source code is available - see my web pages, or drop me
a line.

The calculations are based on data from the spoiler file
'ATTACK.SPO', version 1.12 (for Angband 2.7.9v6;  I'm not sure
how accurate this is for 2.8.3, but it's better than the
previous version 1.01 that was for 2.7.8.2).

Okay, what you have here is a (fairly) simple little proggy to
compare the performance of different weapons 'statistically'.

Whoah, I can multiply _and_ add up! Why do *I* need it?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Well, it's not quite as simple as just averaging the damage indicated
by the 'xdy (+h,+d)' figures quoted for the weapon. Oh, no.  There's
all sorts of hidden extras to be computed.  Every piece of information
supplied on the 'Details' (ie. main) window of !XdY+ is *needed* to
accurately compute the average damage done per player turn.

If you're still not convinced, get a hold of ATTACK.SPO (the spoiler
file dealing with this sort of thing), and have a read. Then, either
do what I did (write XdY+), settle down with a calculator, or (and
I know it's a long shot)... use XdY+.

Okay, So what _exactly_ does it do?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
XdY+ computes the probability of landing a hit (both critical and normal),
and uses that information to produce a figure for average damage done per
round, along with damage per hit (ie. ignoring the hit probability) and
max/min damages (note that the max figure is for the best critical hit
possible with that weapon).

Basically, the average damage/round figure is the one to compare weapons
on, as it takes account of all the other statistics.

Grumble, grumble, how do I use it then?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Clicking on the iconbar icon with select will open the weapon/character
details window; clicking with adjust will open the statistics window.
Basically, fill in all the relevant details in the details window, then
click on Results (or on the icon bar icon with adjust) to start the
statistics window.

Ok, what's all this, like /stuff/, in the Details Window?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Right, the details window is divided into three main sections, one
section each for details about your character, the weapon in question,
and the other factors that affect weapon performance.

The sections are:

 Character
        In this section, you enter your character's details.
        STR and DEX are strength and dexterity, just as they are shown on the
        playing screen (ie. including any bonuses from rings, etc).  Use the
        up/down icons to alter the figure.
        Level is your experience level (1-50) as shown on the game screen.
        The two icons at the bottom of this section allow you to specify the
        race (upper icon) and character-class (lower icon).  Click on the
        'pop-up menu' icon next to each field to, um, pop up a menu of choices.

 Weapon
        This is where you specify the weapon's characteristics.  Notice the
        'pop-up menu' button at the top-right of this section?  Clicking on
        this will allow you to choose any of the 'standard' weapons from a
        menu (and then fill in the 'X' d 'Y', 'weight' and 'edged weapon'
        icons appropriately).
        Set the line of icons to the appropriate values (just copy them
        from the description that Angband gives - note that you must have
        Identified the weapon to get the (+x,+y) bits).  Hopefully this
        bit is self-explanatory.
        Set the weapon's weight in the, uh, weight field, and if the
        weapon grants extra attacks (eg. a Short Sword of Extra Attacks)
        adjust the + to attacks field. NB: this is the *weapon's* bonus
        to attacks, NOT the figure given on the 'C'haracter screen.

 Other
        This section allows you to include Rings of Slaying, Rings of
        Damage, Gauntlets of Slaying, etc. in the calculations.
        Basically, add up all the bonus to-hit' and bonus to-damage's
        your armour/rings give (NB: don't include the weapon, or
        any bow/sling you might be wielding).  NB: These figures are NOT
        the ones shown on the 'C'haracter screen - you must add them up
        yourself. (eg. a Ring of Slaying (+2,+5), a Ring of Damage (+10),
        Gauntlets of Slaying (+2,+2) add up to (+4,+17) ).
        The Armour penalty is the negative figure in brackets after your
        armour (if any) - eg. Chain Mail is, usually, (-2) IIRC.
        The Edged Weapon field only affects Priests, and should be set
        if the weapon is edged/pointed ("You do not feel comfortable with
        your weapon").

The bottom of the window has some 'action' buttons that, er, do things:

 Previous
        XdY+ holds two sets of details at any time.  Clicking on this button
        will swap between them (mainly so that you can set one up as your
        current weapon, and then compare other weapons against it).  Note
        that *all* the details are 'swapped' in this way.

 Save
        Clicking on this button saves the current details (both sets) as the
        default details when XdY+ is started.

 Results
        This opens the results window (if it isn't already open), and then
        computes the statistics from the details given.

 Automatic
        When this option is on, any alterations to the details will cause
        the statistics to be recomputed.  When off, the statistics are only
        computed when 'Results' is clicked.


And the Results Window?
~~~~~~~~~~~~~~~~~~~~~~~
Okay, before we go any further I should point out that for reasonable
results, you need to specify what AC the weapon is being wielded against.
In practice, you don't need to fiddle with this much - just set it to the
AC of the sort of monster you think of as 'reasonably tough' for the
dungeon level you've reached.  The highest AC in the game is 200 (one of the
deeper unique monsters), and values of about 30, 75, 100, 150 are reasonable
depending on your experience level.

The statistics presented in this window are:

 Blows per Round
        This is how many 'attacks' (per player turn) your character
        may make with the weapon.  This figure is affected by strength,
        dexterity, class and (last but not least) the weight of the weapon.

 Melee Combat Skill
        This is your character's combat skill in hand-to-hand combat. It
        doesn't really have any relevance outside of the calculations.
        Suffice to say, the higher the better.

 Probability to hit AC
        This figure is *statistically* the percentage of attacks that
        will hit a monster having the specified AC.  Note that this
        figure includes the fact the 5% of attacks _always_ hit, and
        5% _always_ miss.  The other 90% of the time is calculated
        using the AC and character's melee combat skill.

 Probability of critical hit
        Some 'hits' are counted as 'critical' - this means (when all's
        said and done) that they do extra damage.  These hits are the
        "You hit the Balrog, it was a great hit" style of thing.  In
        theory, this figure gives the percentage of hits that will go
        on to become 'critical'.  It is determined by (part of) the
        melee combat skill, the character's experience level and the
        weight of the weapon.
        There are 5 types of critical hit, ranging from simply 'good'
        through to '*GREAT*'.  Once a critical hit happens, the
        weight of the weapon affects the type.  The figures given
        refer to the percentage of critical hits that will be of each
        type.

 Average Damage per Hit
        This figure gives the avaerage damage per succesful hit with the
        weapon.  Critical hits are also taken into account when calculating
        this figure.
        The minimum possible damage _of a successful hit_ is also given,
        along with the maximum.  Note that the max. is for the best
        critical hit _possible_ with the details given, in practice,
        you won't do this much damage very often at all.

 Average Damage per Round
        Finally, the probability to hit is used to calculate, on average,
        how much damage per player turn would be inflicted against a
        monster having the AC specified.  This is probably the most
        useful figure computed.

I See... Is there anything else I should know?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Firstly, the results are statistics.  This, roughly, means that they
should be taken with a whole cellar of salt (but no lemon, that's
tequila).  The figures produced ought to be accurate, but that doesn't
mean that they are.  No siree.  Random is random, and statistics is
statistics.  Things get even wierder when you consider that statistics are
used in the design of random number generators.  But, at the end of
the day: Use XdY+ as an evaluation tool, play with it, have fun.
DO NOT TAKE THE RESULTS AS HAVING ANY REAL SIGNIFICANCE.  Whatever you
do, don't do the "Well, it's AC24 4d6HD so, -click,click- I should defeat
it about turn 12 and still have 32HP left." - you *will* die if you try
this sort of thing (ask any AD&D player :-).

Ah, so it's useless then!
~~~~~~~~~~~~~~~~~~~~~~~~~
Um, no.  Perhaps I was a bit, ahem, scathing there.  It's very useful
for comparing two different weapons, or seing how, say, a ring of
strength affects your fighting ability.

Aha. So, what's missing?
~~~~~~~~~~~~~~~~~~~~~~~~
Well, there's no account taken of 'ego' weapon powers (eg. Slay Evil,
*Slay* Dragon, '... of Flame', etc).  This is largely because in order to
generate meaningful results there would have to be about 12 (twelve!)
separate lots of the damage figures.  I may implement this in a later
version.  If you're lucky.  If I can decide on the best way to organise
it. If.

Anything else to say?
~~~~~~~~~~~~~~~~~~~~~
Well, XdY+ is primarily for low level characters.  At low levels, you
need to choose weapons well - 10HP don't go a long way in melee.  It
can still be useful at later levels (perhaps to see at what str/dex
your character will get another attack per round, or to weigh up
rings of slaying, etc), but the ommission of 'ego' powers becomes
a factor then. Still, if you've got that far, you can probably take
'ego' powers into account yourself when deciding - I do.

Priests:  beware - the edged weapon penalty goes further than XdY+
indicates...  It also slaps a wopping great 25% extra on your prayer
failure rates!

History
~~~~~~~
1.01    (First 'real' version)
              * based on attack.spo 1.01 for 2.7.8.2
1.10    (This version)
              * Ammended for 2.7.9v6 (attack.spo 1.12)
              * Std. Weapon list is now alphabetically sorted
              * Added an option to force the 2D templates (see !Run)
              * Changed my email address and added a smidgen of code
                so you can just click on it in the 'about the author' window

Disclaimer
~~~~~~~~~~
Use of this software is completely at your own risk. The author can accept no
responsibility for any damage/loss arising from the use, or inability to use
this software. No warranty, express or implied, applies to this software.
This is not PD: the Copyright in this software belongs at all times to the
author. However, permission is granted for unrestricted distribution
prodividing that *no* charge is made for the distribution [a charge may be made
for handling/media] and that the whole of the software is supplied intact and
unaltered. Permission is also granted for unrestricted use and alteration of
the software [but if you fix a bug / add anything nice, let me know so I can
patch the 'master' version].

Bug reports / comments / etc to:

e-mail: mailto:musus@argonet.co.uk
   web: http://www.argonet.co.uk/users/musus/
 snail: Adny Holdsworth,
        c/o 23 Baronsway,
        Whitkirk,
        Leeds,
        LS15 7AW,
        England.


