JavaScript EditorFree JavaScript Editor     Ajax Editor 

Main Page
  Previous Section Next Section

Chapter 11. Rule-Based Systems

Key Topics

Rule-based systems (RBSs) essentially consist in a collection of "if...then" statements. Such statements are particularly suited to encoding rules-of-thumb, similar to human expertise. Experts generally apply such knowledge mechanically to a problem to solve it. By transferring their experience into the computer, the same process can be done with similar reliability, but in a much more efficient and automated fashion.

In games, RBSs can be used in nonplayer characters (NPCs) for two distinct purposes: problem solving (reaching a single conclusion from initial facts) or control (producing a sequence of actions in a simulation). In problem solving, the rules explain the connection between different truths (for instance, "If an item is absent, then someone picked it up") so the system can reach the answer. As for control, the rules describe the action that should be taken in each situation (for instance, "If there's a wall ahead, then stop").

In practice, RBSs have the advantage of separating behaviors from the code. Of all the techniques that allow this data-driven approach, RBSs are the simplest to develop, extremely fast at runtime, very flexible, and easily extended.

This chapter covers the following topics:

  • Rule-based systems within the context of AI, compared to other similar systems

  • The different components in the system from a high-level point of view: the rulebase, the working memory, and the interpreter

  • The methods commonly used with RBS, notably how the knowledge is acquired and modeled

  • The different benefits and pitfalls of rule-based systems, and the typical approach taken by game developers

The next chapter covers the implementation and application of RBSs, but this chapter will provide a solid background to build upon.

      Previous Section Next Section

    JavaScript EditorAjax Editor     JavaScript Editor