Helpline Issue 31 Contents Issue 32

mind games



Hero needed - must conform

Quentin Heath examines his attributes and explains how to develop real character

IN THE AUGUST issue of Sinclair User I explained the techniques used by computers which enable them to react intelligently when playing strategy games.

The rules of play outlined in that issue are almost the same when applied to adventure gaming but the ways in which they are applied are substantially different. Most strategy games rely on objects which have a strict relationship with the positions which they occupy and those of the enemy pieces. In adventure games the programming problem is just as complex but the extra factor of characterisation has also to be introduced. Those new factors create several complications for adventure programmers which are:

  1. Interaction between character and object;
  2. Interaction between objects;
  3. Interaction between characters.

It is possible to treat characters as objects so that they are just moved around the adventure world but if you want to include the third factor, interaction between characters, within an adventure then you need some code which stimulates emotions, intellect, and action for each character. The simplest way to do that is to create a character matrix in which a numeric representation of a character can be built.

SLAYMOR
Endurance+3
Strength+1
Lawful+6
Intelligent+6
Figure 1a.

Most of the planning of such a matrix is done on paper. A list of the characteristics is compiled. It includes the normal role-playing devices, such as strength and endurance, but also includes personality traits such as how 'lawful' or 'unlawful' a character can be, whether they can accept defeat easily, how intelligent they are and in which areas they can appear in the adventure. The final criteria, dealing with habitat, is important as you do not want a monster such as a giant fish to appear flying through the air or finning its way through the desert.

The list of traits does not have to be long and you could probably produce some interesting characters with those listed above. The complex part of the operation involves programming the computer to make characters react in a believable way to the situations in which they are placed.

For instance, if the programmer measures the character attributes on a scale of (-10) to (+10) the computer might assign traits for characters such as those in figure one. At the bottom end of the scale (-10) the character lacks or has the reverse of a stated trait. At the other end of the scale (+10) the character will exhibit an extreme manifestation of the trait in certain situations.

Figure 1a shows Slaymor, who is a law-abiding peasant from the Dark Vale and figure 1b shows Stab, an evil stoat from Iminsane. In the current game location, a blasted heath where King Lear would have been at home, the two characters meet. Stab has just had a bout at the local inn and has run out somewhat the worse for wear. As a result his endurance score is down but his strength remains at a good level, (+3). As he is the character controlled by the computer the program must decide whether a fight should take place.

When the two characters meet the computer examines the Lawful traits of each and finds that Stab is evil because he has (-4). A plus and a minus never mix so a fight is likely to occur. The computer then takes Endurance and Strength into account. Stab's Endurance is low but his Strength is high. A further decision is needed and consequently the computer looks to see just how much Good Sense Stab has. Unfortunately, he was born with little brains; a fight is now inevitable because of the results obtained from the character matrices. A human player might believe that Stab is reacting intelligently but the computer is merely examining numbers in order to arrive at a decision.

Interaction with objects is dealt with similarly. If you want another character to pick up a dangerous object for you he might decline either because the object is too heavy or because that character possesses enough sense not to touch an object which might endanger life. The Good Sense trait is brought into play here. If it is low, as it is for Stab in figure 1b, the character would pick up the object perhaps for no other reason than greed if the Lawful trait is not dominant.

The technique is simple but very powerful when applied and it is also easy to code into a program. All that is required is to put the matrices into the equivalent of arrays, or data tables in machine code, and then use decision-making statements, such as IF ... THEN in Sinclair Basic.

STAB
Endurance-1
Strength+3
Lawful-4
Intelligent-3
Figure 1b.

The power of the technique is in its simplicity and the only hard work which is necessary is in covering all possible areas in which all characters will require intelligence during an adventure. That will depend upon the plot and the incidents which are experienced. It is not a case of discovering how each character will react when confronted by another but more a case of looking at an individual's traits and how you would like them to behave as a character. The computer will do the rest when encounters occur.

Some characters will be more developed than others at the start of the adventure but there is no reason why that should not change and the weak become strong. A powerful enemy can be realistically reduced to a gibbering idiot when the character matrix rules are followed. In the same way an ignorant peasant, such as Slaymor, can gain strength in all traits and become powerful. The programmer might also note that the more powerful Slaymor becomes the greater the possibility that he uses those powers for corrupt ends.

It is possible, therefore, to use simple techniques as decision making with a matrix and turn a mundane adventure into something approaching The Hobbit and with a great deal more potential.



Helpline Issue 31 Contents Issue 32

Sinclair User
October 1984