AI Queues!


A continuation of the way we're getting the AI characters to do stuff:

The behavior tree is super useful for getting them to make granular decisions - I'd dare say it makes them quite independent agents already! Just with the trees, we can have them go to a point (yeah, I know this is actually pathfinding), wait in a queue if an object they want to use is being used by someone else, drop whatever they're doing when someone's trying to talk to them, etc.

Now comes the task of defining their higher-level thinking. This entails what objects to actually use, who to talk to at a certain moment and what to say to them, and so on. It also includes sequences of actions, like introducing the player, which entails going to the entrance, going to the hacking room, talking to them several times in between depending on what is being introduced, and so forth.

For this, we ended up using a priority queue. I find that it's flexible enough to accomodate emergent behavior, while also still good for organizing scripted actions that the story requires. Basically, tasks are fed into this priority queue. If the task has a high priority, it will be able to supersede and overtake lower-priority tasks in the queue. It is these tasks that are, by design, granular enough for the behavior tree to handle.

From this basis of the queue, we can just have multiple components running concurrently, sending tasks to the queue as the need arises. So we can have a routine component, a storyline component, etc.

Leave a comment

Log in with itch.io to leave a comment.