Skip to content
davebaol edited this page Nov 10, 2014 · 2 revisions

To build a general-purpose AI system, we need to have some infrastructure that makes it easy to get the right information to the right bits of AI code at the right time. Typically, AI systems use (at least) two infrastructure components in order to achieve this result:

  • Message Handling: Communication is essential for even simple AI, but comes into its own when multiple characters need to coordinate their behaviors. A message system, sometimes called event system, is the most common approach for getting information to and between characters in a game. Polling is another common approach, but currently it's not supported by the framework. Also, some developers find that it is easier to manage the game information only using events (messages).
  • Scheduling: Processor resources available to a game are obviously limited. Processor time can easily get eaten up by some AI techniques like pathfinding or complex decision making. AI is also inherently inconsistent. Sometimes you need lots of processing time (planning a route, for example), and sometimes a tiny amount is enough (moving along the route). All game characters may need processor resources at the same time, or you may have hundreds of frames where the AI has nothing to do. Scheduling systems try to solve this kind of problems in order to keep the frame rate at acceptable values.