| MAIN | NEWS | FAQS | LINKS | ARTICLES | WORKSHOP |
Send Mail To:Steve Register


Equipment Wear and Tear - Michael Heinich.
This article was originally written for Darren Hebden's RLNews

  Every piece of equipment should have a durability. One example of this 
system is demonstrated in a popular series of commercial hack and slash games
with some Rogue-Like tendencies. Another example can be found in ADOM. Both 
of these implementations could be improved upon.
 
  In the commercial games, durability played a very important if limited role.
If an item's durability reached 0, it was broke beyond repair. This was 
normally kept as a ratio of current:maximum durability. The game allowed a 
character class a repair skill to partially repair an item. The drawback was 
that the maximum durability was reduced. Or a member of the town was able to 
provide this service. Found items had a lower then maximum durability and 
equipment that was used, lost durability during the course of weilding or 
wearing them. Durability also effected the value of the item in question. An 
item in great shape was worth more then the same item in bad repair. While 
the measurement system was easy to understand and to manage, it could still 
be improved upon. 

  One area is in the item's use. The equipement was either broke or not. A 
better method would be to reduce the effectivness of the item in question. 
Using a sword for example, as it becomes worn out, the sword may cause less 
damage because it has become dull with use. Or the sword may have an ever 
increasing change where it may break during an attack as it's durability 
decreases. An armor example would be that the protection a chain mail shirt 
provides may be reduced as it's durability worsens. 

  ADOM does take some of these factors into consideration, but it can be 
confusing to figure out the multitude of stats offered (some would say that 
this is one of it's strengths)and it lacks adequate skills or town services 
for the repairing of items. Usually it is usually better to replace an item 
then to repair it. 

Here are some more ideas thrown out more or less at random that build on this 
concept. The use of durability can also open other possibilities for object 
descriptives and use. For example, a sword that is undamaged and is like 
brand new may have a desciption before identification of Shiny and Sharp, as 
the sword becomes used, the description may change to dull and nicked. 
Durability provides an interesting twist to potions or items made of glass. 
Potions may be in delicate containers. In Angband, potions sometimes break 
when they are subject to heat or cold attacks. But what if a potion is dropped 
or thrown. They should spill, spreading their contents over the floor, wall or
monster. This could cause interesting effects if the Potion was healing or Acid. 
A Crystal Ball may not last too long under a heavy attack by giants or earth 
hounds. Just how sturdy is a Lantern full of Oil anyway? Why hasn't one of 
these broke after an attack, spilling flaming oil all over the user. Or throwing 
the lantern, to have it's flaming contents spill over the monster. This is much 
preffered to the Flask of Oil attack in Angband. Since it assumes that you have 
lit the Flask first somehow. 

The code to add statistics for wear and tear should not be to hard to add to your 
Roguelike. Specially if you are using an Object Oriented programming language. 
You can just add an extra two lines to the Class for starters.

int CurrentWear, NoWear;	// Measure how much wear and tear
int Durability;				// How durable is this item

In your object definition for a sword you would add the value for NoWear an the 
value for Durability. During the Object creation you would assign the value of 
NoWear to CurrentWear.

CurrentWear = NoWear;		// set CurrentWear value to NoWear

Then when ever the item is used or after a certin number of uses, you would 
subtract from the value.

if (NumOfUses == 10) {
CurrentWear--;
if (possiblebreak(Sword.CurrentWear)) Sword.Status = BROKE;
NumOfUses=0;
}

I hope these meanderings showed you a new diminsion for your Game. The code examples 
were way oversimplified but will hopefully point you in the right direction. 

Happy Coding!
Copyright 2001 Steve Register.