Entering the game
The party · Creating a party · The creation screen · Characters of the game
In brief
A new character starts with 69,000 experience points divided by its number of classes, at the levels of a separate table: level 7 for a single fighter, mage, cleric or thief, 6 for a paladin or ranger. Its hit points are rolled for each starting level. When the player selects PLAY, every character gets 100 food, starting items chosen by class and two dice rolls, and, for a mage, nine known spells; the first character also receives Khelben's Coin.
Starting levels and hit points
Every new character starts with 69,000 experience points divided by its number of classes: 69,000, 34,500 or 23,000. The 69,000 is a constant in the code, not computed from anything; the division uses the number of classes stored with the starting levels, and the result is written to all three experience totals, including unused ones. The starting levels are not computed from the experience either: they come from a separate table, which agrees with these totals:
| Class | Levels |
|---|---|
| FIGHTER, MAGE, CLERIC, THIEF | 7 |
| RANGER, PALADIN | 6 |
| FIGHTER/CLERIC, FIGHTER/THIEF, CLERIC/THIEF | 6/6 |
| FIGHTER/MAGE, THIEF/MAGE, CLERIC/MAGE | 6/5 |
| RANGER/CLERIC | 5/6 |
| FIGHTER/MAGE/THIEF | 5/5/6 |
| FIGHTER/CLERIC/MAGE | 5/5/5 |
The figure places these totals on the experience thresholds of each base class. 69,000 gives level 7 to a fighter, mage, cleric or thief and level 6 to a paladin or ranger. It is 1,000 points short of a thief's level 8, so a single-class thief rises to level 8 after its next 1,001 points; the other classes need much more.
Hit points are rolled once for each starting level of each class, with the
hit points for a level; starting levels are all below the
last rolled level, so every level rolls its hit die. hit_points_max is set
to the total.
Entering the game
When the player selects PLAY, the game prints "Entering game. Please wait." and prepares each of the four characters:1
- it marks the slot
CHARACTER_STATUS_PRESENT, setsfoodto 100 and stores the slot number in the record's first byte; - it gives starting items, below, then recomputes the defense from them;
- a mage, alone or combined, knows nine spells of the mage and cleric spells: Burning Hands, Detect Magic, Shield, Shocking Grasp, Detect Invisible, M's Acid Arrow, Dispel Magic, Fireball and Ice Storm;
- a cleric or paladin receives Turn undead in its cleric spell slots;
- every attribute and the hit points are copied into their second bytes,
hit_points_maxincluded, which also applies the changes made on the modify screen.
The starting items depend on the class, on two dice rolls and, for the weapon, on whether the character is a dwarf; the attributes, sex and alignment play no part. For each character in turn, the game:
- Armour and weapon by class group. The class falls into one of four groups: any class with a fighter, ranger or paladin component; MAGE; CLERIC, CLERIC/THIEF and CLERIC/MAGE; THIEF and THIEF/MAGE. One armour record is drawn at random from the group's list of one to three. A second roll chooses between two weapons where the group has a choice; dwarves of the fighter and thief groups always get an Axe.
- Common items. Everyone gets two Iron Rations and a Potion.
- Extras for each component. A mage component adds a Spellbook and two mage scrolls, of spells 4 and 13 (Magic Missile and Fireball); a cleric or paladin component a holy symbol and a scroll; a thief component Lock picks. A combined class gets the extras of all its components: a FIGHTER/MAGE has a fighter's armour and weapon, and a Spellbook.
- Khelben's Coin for the character in the first box.
Each item is a copy of a template item of ITEM.DAT.
The template numbers are written in the code, except the armour records,
which form a small table in the executable. Some items are given a value,
for example 1 for the scale mail, the chainmail and some shields and
weapons. A weapon's value is added to its
hit roll and its damage; an armour's
value lowers the defense by as much. The value 49 of the cleric scroll is the definition
number of Cure Serious in the mage and cleric spells; reading it as
that spell is inferred.
A prepared party
The creation code also contains a routine that fills the party with prepared characters, then enters the game the same way. Nothing in the executable calls this routine or stores its address, so it is never run (inferred).2
The prepared-party routine fills six characters, but its name, portrait, class, race, alignment and level tables have four entries each. For the fifth and sixth characters it reads the next table instead: classes come from the race table, levels from the bytes of the "Entering game" text (32 and 69), and names from portrait numbers taken as an address. Since nothing in the game reaches the routine, this cannot happen in play (inferred). A reimplementation that offers this party should give it four characters.
Sources
Locations refer to the game executable reference;
comparative sources are listed in the technical references.
The figures are drawn by make_party_figures.py.