[MUD-Dev] Re: Stack-Based NPC AI

David Bennett ddt at discworld.imaginary.com
Mon Dec 7 12:02:43 New Zealand Daylight Time 1998

On 12/6/98, at 5:18 PM, Par Winzell wrote: 

>I don't see the stack-based system so much as alternative to a state-based
>as extending it. Many years ago I did write a system such as what Eli
>for an LPMud. It worked quite well, and I was able to use it to allow our
>"mascot" NPC to solve the simplest game quest.

Interesting...  I was working on something a little different to this.
Every npc has a set of goals to acomplish, like 'get rich' or 'stay alive'.
 The goals are fairly high level and are also priority ordered.  Each goal
has a set of strategies to acheive its goal, the strategies are on a lower
level, like heal yourself and run away.  When an event occurs on the npc,
it tells all its goals in priority order and they setup strategies to react
to the goal.  Only one strategy is active at any one time.  Each strategy
has a 'precondition', 'invarient',  'suspend', 'restart' and 'completed'
methods.  These methods control what the strategy does.  A strategy
inherits its goals priority level plus or minus a small amount...

This allows for quite complicated behaviour with quite a simple underling

I partly got this idea from some ideas someone on my mud came up with a
long time ago, although he had three sets of things, goals, strategies and
actions.  Plus some reading I did relatively recently on the net with the
'oz' project:

The Oz project is an interactive fiction project, trying to make up a world
that seems real as if you were reading a book (rather than a mud as such).
But the ideas all carry across quite well.

Fluffy all the way to the coffee mug,

More information about the MUD-Dev mailing list