Rog-o-matic: A Belligerent Expert System

Rogomatic is a program written to play rogue. It uses both algorithmic and production systems programming techniques which cooperate to explore a hostile environment. Its objective is to explore and survive in a complex and hostile world. Rogue is an environment especially suited to designing this expert system.

  • Success in Rogue depends heavily on successful exploration
  • It is a human game
  • It has an objective and scalar measure of performance (score)
  • There are allot of humans willing to calibrate performance

Rogomatic was designed as a knowledge based system (also known as an expert system) because it is impractical to do a search based system. At any time there may be as many as 500 possible actions. For each action, there could be several thousand possible successive states.

As an expert system, Rogomatic differs from others:

When uncertainty is low, algorithmic methods provide fast calculation of relevant information. When things are not certain, heuristic rules provide a reasonable behavior.

Production rules include:

  • Weapon hander - chooses weapon to wield
  • Melee expert - handles combat
  • Target acquisition expert - controls pursuit of targets
  • Missile fire expert - Fires missiles at targets
  • Battle stations expert - Performs special attacks, and initiates retreat
  • Retreat expert - using the map, chooses the path for retreat
  • Object acquisition expert - picks up items
  • Armor hander - Chooses armor to wear
  • Magic item handlers - Manipulates magic items
  • Health maintenance - Decides when to eat and heal
  • Exploration expert - Chooses places to go and controls movement

One production rule set sample (from the Battle stations expert):

   /*
    * If we can die in 1 turn and we are not at peak strength, we might want
    * to retreat.  Don't try to run if we are confused or being held by 
    * something.  If we are on a door, wait until the monster is next to us
    * (that way we can shoot arrows at him, while he catches up). Don't run
    * away from Dragons!!!  They'll just flame you from behind. 
    */ 

   if ((die_ in (1) && Hp+Explev < Hpmax) &&
       !confused && !beingheld && (!on(DOOR) || turns < 1) &&
       !streq(monster, "dragon") &&
       runaway ())
   { display ("Run away! Run away!"); return(1); } 

   /*
    * We can't run and there is a monster next to us who could kill
    * us in 1 turn.  If we have a scroll of teleportation, read it.
    */ 

   if (die_ in (1) && turns == 0 && 
       (obj = havenamed (scroll, "teleportation")) >= 0 && reads (obj))
   { return (1); }  

The algorithmic knowledge sources include path calculation, avoiding unknown squares and possible dangers (traps, monsters) moving to the nearest specified place (unknown object, escape route).

When the melee expert has determined that a battle is underway (there's a monster moving to intercept), it places knowledge about the battle such as strength of the monster, the intercept time, into the 'brain', and invokes the battle stations expert. The battle stations expert then decides what weapon to attack with, or magical item, or retreat.

Rogomatic also learns. It has a short term memory for what objects are what this play session. For example the red potion is a potion of healing this game. This knowledge isn't useful in the next game when a red potion is poison.

Rogomatic's long term memory is more interesting. To play properly, the strengths and weakness of monsters is necessary. Different installs have different values for various monsters, so rather than having it customized for each installation, it learns the characteristics of the monsters.

By 1986, Rogomatic played more than 7000 games of rogue. Compared to the 15 best Rogue players at CMU over a two month period, rogomatic played as well as the experts. Rogomatic obtained the 7th best high score and had the best median score of any player.

There are some problems with rogomatic. It is at times too single minded. Some of the rule orders could be optimized. Its combat heuristics fight the most dangerous monster first when its not always advisable.

Log in or register to write something here or to contact authors.