Behavior Trees
For this project I started experimenting with Behavior Trees for designing AI agents.
Up to that point I only had used State Machines for programming game AIs so this project was very useful to expand my knowledge into different and better ways to create complex and interesting behaviors for game AI.
During this project I also experimented with a Blackboard system in order for the AI agents to share information between eachother and create a more complex and interesting functionality.
Project Overview
For this project I created a simulation of a restaurant, where all the agents would function with a Behavior Tree, and share information between eachother by using a Blackboard system.
I created three different categories of AI agents for this demo:
Clients: Will wander the streets until they are hungry. Once they are hungry they will go to the restaurant and check if there is a clean table available. If there is not, they will go back outside and repeat the process after a while. On the other hand, if there is space they will sit on a table and wait for a waiter to attend them. Once they get their order taken they will wait for their food. Finally, once they have their order served, they will eat it and leave the restaurant, leaving dirty the table they used.
Waiters: If they are free, they will be waiting at the restaurant door greeting clients. Whenever there is a client to be attended, they will move to their table and ask for their order. Once the order has been given they will go to the kitchen and take a plate if there is any available, if not they will wait until the Chefs have finished the order. Once they take the cooked plate from the Chefs, they will take it to the Client. Whenever the Client has finished eating and leaves, a Waiter will go to the table the Client used and will clean it. This will leave it available for a future Client to use.
Chefs: They will be constantly cooking orders, there is a chance that the order burns so they will need to throw it away and start all over with it. Once the order is ready, it will be left at the bar for a waiter to take.
The use of Behavior Trees during this project had proven itself to be very useful for creating complex AI behavior as it allows designing a behavior visually in a simple way while also making it easily expandable.
In my opinion Behavior Trees would be very useful in order to develop complex AI behaviors for professional video game productions.