Skip to main content

Purpose

We have a new combat system and many people are unaware of why or how we came to this position so this document explains some of the background.

Some Background

In Discworld's history there have now been three combat iterations. The original one was somewhat simple and temporary. It survived from 1992 until 1995. In 1995 the original system was significantly updated to include the taskmaster and some other improvements.

In the last 7 years Discworld has changed enormously. The size, complexity and quality has increased beyond recognition. Our old combat system was showing its age. It had runtimes that we could never track down. It had been tweaked and hacked at in numerous ways to address deficiencies and problems. It had functions that were hundreds of lines long with complexity that few could really follow. In short it was inflexible, unmaintainable and inefficient. Hence a replacement was born.

The primary goals of the rewrite were to produce a more flexible system with readable, efficient and maintainable code.

Starting out

The new system breaks down combat into distinct stages. Each stage has a specific purpose with pre and post conditions, is documented and commented.

The new system also provides a powerful and flexible system for specials (offensive and defensive) that can override, alter or even cancel any stage of an attack. This is in distinct contrast to the old system that only had very limited hooks and significantly restricted what a special (or anything else!) could do to alter combat. In addition to write a special for the old system required a command, an effect and a shadow. The combat specials have been rewritten as a single file (a command). They are shorter and more concise and thus significantly easier to debug and maintain.

Don't just fix it, enhance it

Given that combat was being rewritten anyway it seemed sensible to take advantage of some of the newer capabilities of the Discworld mudlib and bring the combat system up to the standards that are now being used on the mud.

Since the last combat system was created we have added a taskmaster capability called compare_skills(). It does a weighted comparison of two skills and will determine an outcome (including special & critical success or failure) and possible awards for either party. Since combat is, by definition, adversarial the use of this adversarial system seemed appropriate. The old system, by comparison, did an offence skill check followed by a defence check. The defence difficulty included the damage which his what made specials so impossible to parry or dodge!).

The Discworld combat system has always had hits go to specific body parts but this has not been made clear to players or even obvious. So with the new system players are told not only what location was hit but also have the ability to choose to focus on a single location.

Hooks are in place now for a system of critical injuries such that doing a large amount of damage to someones arm could cause it to be broken, or possibly even severed. Similar effects will be possible for other body parts.

The combat system takes account of relative heights. If you fight a cockroach you'll find it mostly hits your feet. This relates to mounted combat. While mounted combat is not yet fully supported the hooks are present to enable it (such as heigh differentials). As mounts finish development the combat system will support mounted combat and combat between mounted and standing opponents.

A long standing issue with combat is the tendancy for it to be very simplistic. In the original system it was "kill xxx". In the second one it was "kill xxx; crush xxx with <large weapon>". The new system supports far more tactical fighting with greater flexibility and range of actions and tactics. Tactical specials (that do no damage but that may give an advantage to their user) such as feint, trip and shove are, hopefully, the shape of things to come.

The old system took very few factors into account when determining outcomes. There was no difference between fighting in the pitch black or in full sunlight. Wearing or carrying large quantities of equipment made almost no difference to combat. The rule was that the bigger and heavier the weapon the better. There are now advantages and disadvantages to large heavy weapons, small light weapons, lots of armour, little armour, shields, multiple weapons etc. etc. The aim has been to facilitate many different styles of combat each with their own strengths and weaknesses.

Since the earliest days combat has had the ability for players to leap in front of friends and take a hit for them. While this is nice it's rather strange. Surely it would be more common, when trying to defend a friend, to try and block or parry on their behalf rather than jumping in and taking a sword through the head. So the 'defend' command has been added making both defending or protecting options available to players.

Related Things

Given the huge changes to combat some other related issues came up and were addressed at the same time.

In the past weapons were single or two-handed. In practice many weapons were not just one but both or either. The hand-and-a-half sword for example or the katana. So with the new system two-handed weapons (those with a hilt long enough to deal with two hands) can be held in one or two hands.

We have never had a proper system for magical armour. The only method used was shadowing of existing armour which meant all magical protection ended up being outside physical protection. This made no sense for things like chalk skin (CCC). So an efficient system for magical shielding that allowed shielding both outside existing armour and inside it was added.

Ceres, 5 August 2002