Notes from the Dawn of Time #23:
by Richard Bartle
July 17, 2002
Having suffered my rattling on about parsing for 14 articles, doubtless you were relieved to learn last time that today Im beginning a new theme: mobile AI.
Im using mobile in the MUD sense here, ie. monsters or characters controlled by the game. Strictly speaking, a mobile is an object that can (in game terms) move or otherwise act of its own volition which is controlled by the game itself. Those objects controlled directly by players are characters or personae; those controlled by independent computers or processes are bots. The game cant tell the difference between personae and bots (and in some cases, neither can the players), but that doesnt matter it just lets them get on with their own thing. Mobiles, however, it can control, which is where AI (Artificial Intelligence) comes in.
The field of Artificial Intelligence is a large one, and there are many powerful strategies it can bring to bear. Everything from vision systems to production scheduling, from game theory to robotics, from belief systems to speech synthesis, falls under its auspices. Whats more, its all inter-related: if youre writing a conversational system, for example, you need to be able to model what you know (knowledge representation), what you think your fellow interlocutor knows (belief systems), the effect you want your words to cause (planning), what any response given means (parsing), and you have to be able to do what you intend (acting).
There are many competing ideas on how to go about programming AI. These tend to come in waves (or, for the cynical, bandwagons). At the moment, for example, neural networks and parallel systems are still big, the idea being that you can get complex behaviours to emerge from vast numbers of simple processes that are interconnected at a low level. Fifteen years ago, expert systems were the cutting edge, driven by the hypothesis that intelligence is due to interaction between bodies of complex knowledge.
There are also philosophical differences as to where intelligence lies, and whether it can be partitioned into sub-systems at all. Is consciousness best defined in terms of processes or logic systems? Is it something tangible, spiritual, or simply delusional a trick played by the brain on itself to get better behavioural results?
Fortunately, we dont have to worry about things like that here. Were only talking MUDs, not self-aware automata. We can afford to take a pragmatic point of view, because we know that there isnt the processing power available to us even to approach the complexity of the top research projects. For MUDs, its enough that something behaves generally sensibly and occasionally surprisingly; no-ones going to think a mobile is a real player for long (if at all), but that doesnt mean we have to make them dumb.
An Outline for Mobile AI
Youll always find someone willing to argue with you concerning AI, but the following is a reasonably non-contentious (because its very simplified) outline of how an entity with intelligence (artificial or otherwise) can be modelled:
The basic mechanism is:
- Events local to the mobile that occur in the game world are detected (either passively or actively) by the mobiles senses and parsed into meaningful units.
- The resulting observations are used to update the mobiles internal view of the world (which may be incomplete and/or inconsistent), stored in its episodic memory.
- Sensory information is also used to inform the mobiles emotional system (which is defined by its personality, instincts etc.).
- Inconsistencies in the world model (episodic memory) also inform the emotional system.
- The emotional system generates goals: things that the planner wants to do. It inserts these at the head of a plan a sequence of operations that the mobile intends to do.
- The planner manipulates the plan, informed by its beliefs about the current and past states of the world, to generate a new plan that describes its intentions in more detail.
- When the plan indicates instructions for the mobile to undertake some action in the game world, this is executed by the appropriate effector.
- Occasionally the planner can get into a loop or a deep recursion, which the emotional system can detect and interrupt.
- The planner stores plans and plan segments in its semantic memory, which it can later retrieve to re-use for other plans.
This all seems very complicated, especially given I said it was simple (!), but dont panic. Next time, Ill explain how in practical terms we dont need it all for MUDs.
Recent Discussions on Notes from the Dawn of Time: