Most games today require purposeful yet responsive behaviors from the AI actors. This implies that actors must do two things:
Pursue active long-term goals in the game.
Respond to events from the world.
A solution without concurrency would have to resolve each goal one by one in a sequence, and incoming events would presumably suspend the current goal (or, less often, be enqueued for later). This isn’t ideal for many reasons:
Different behaviors are often mutually compatible and can run in parallel.
For the overall performance of the actor to be realistic, it must often do multiple things at the same time.
Games are highly dynamic, so both events and current goals must be dealt with as soon as possible, rather than enqueued or suspended.
In practice, with good support for concurrency in your AI engine, you’ll notice the following:
Actors deal with events in the world at the same time as the main behavior.
There are no limitations on what actors should do when handling events.
The engine supports actors doing anything at the same time, though it may look unrealistic.
The designer can impose restrictions on what behaviors should not be done concurrently.
The next post in this section looks at concurrent behaviors in more detail. What are they exactly, and what makes them different from other behaviors?