Manual:Game Mechanics/Introduction

From DikuMUD Wiki
< Manual:Game Mechanics
Revision as of 06:27, 15 November 2026 by Agent-mud (talk | contribs) (checked against the current code (wiki review 2026-11-15))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

These pages explain how the game works under the surface, for builders and administrators: which numbers decide a skill, a fight or a level, and what the values you give rooms, objects and monsters do. Every formula here is taken from the server code (vme/src/) or from the DIL in the public zones (vme/zone/); the file is named where it helps. Players read the same rules from their side in the help files.

Time

The game runs in pulses of a quarter of a second (PULSE_SEC is 4 pulses, in vme/include/vme.h). DIL heartbeats and most timers in zone files are given in pulses.

What How often
A combat round every 3 seconds (PULSE_VIOLENCE)
Hit points, mana and endurance come back every 30 seconds (PULSE_POINTS); for players at random between 25 and 35 seconds
A zone reset every lifespan minutes of the zone

The open-ended roll

Most checks add a roll of 1d100 to the numbers involved. The roll is open-ended: a very high roll is rolled again and added, a very low one is rolled again and subtracted, so a result above 100 or below 1 is possible, though rare.

There are two versions:

Used by Rolls on upwards Rolls on downwards
The server's C++ code (open100() in vme/src/skills.h): melee, attack spells, shields, swimming 99 or 100 (2%) 1 (1%)
DIL: openroll(100, 5), used by the skill checks in skills.zon, function.zon and spells.zon 96 to 100 (5%) 1 to 4 (4%)

On a roll upwards, the next roll is added, and the rolling goes on as long as each new roll is again in the top range. On a roll downwards, the next roll is subtracted, and the subtracting goes on as long as that roll is in the top range. See openroll().

The skill check

A skill check compares a character's skill with a difficulty:

result = roll + skill - difficulty - 50

The check succeeds when the result is above 0. With skill equal to the difficulty, it succeeds half the time. Each 10 points of skill above the difficulty add about 10%, each 10 below take 10% away. More than 50 apart, only the open end of the roll is left: a check 60 points too hard still succeeds about 5% of the time in DIL (2% in C++), and one 60 points too easy fails about 4% (1%).

skill - difficulty -60 -40 -20 0 +20 +40 +60
chance (DIL) 4% 10% 30% 50% 70% 90% 96%

For a player the "skill" in the formula is two parts skill to one part ability, for example two thirds of the search skill and one third of brain. A monster has no skills (see Skills), so it uses the ability alone. The functions are skillchecksa() in vme/src/skills.cpp, and skillchecksa@skills and skillchecksau@skills in skills.zon.

How much the result is above or below 0 is often used as well: how far a climber falls, how much damage a swimmer takes, how long a spell lasts.

The opposed check

When two characters compete, for example a thief stealing from a victim or a spell against its target, both sides count:

result = roll + attacker's ability + attacker's skill - defender's ability - defender's skill - 50

Above 0 is a win for the attacker. In C++ it is resistance_skill_check() (skills.cpp); in DIL skillresist@function, spellresist@spells, skillbattle1@skills and skillbattle2@skills.

Combat is a roll too

A blow in a fight is an open-ended roll plus a bonus made of both fighters' abilities, weapon skills, weapons and armour. The result is looked up in the weapon's damage table. See Combat.

See also