Overview
A suite of tools and systems designed specifically for creating robust 3D AI behavior in Unity. Based on Bobby Anguelov's live-streamed presentations about game AI ("Game AI Basics" and "Simple and Scalable Game AI Decision Making"). This project was started as I began researching and working on the AI systems for my parkour game, I had come across the two videos by Bobby Anguelov linked above and really liked the design approach, so I decided I'd start working on my own implementation and version of that system.
Here's a list of the different types and systems that make up the asset:
- Agent - Entity that "perceives" within the AI world, does decision making and performs actions
- Config - Agent configuration data, allows for creating archetypes of agents easily
- Actuation - Performs actions visible to the player
- Actions - Eg. movement/navigation, interactions, attacks
- Knowledge - AI-specific information about the game world
- World - Storage for all global AI knowledge
- Stims (Stimulants) - Small bits of information for a set category that agents use as representations of the game world, eg. an explosion would create a visual stimulant and audio stimulant in the AI world
- Sensors - Determine what an agent "knows" from the AI world, which is used for decision making, eg. visual sensor could have a frustum of what the agent can see, and adds all visual stims from the AI world to that agents knowledge
- Goals - Complex/compound knowledge entries with all relevant information incase of needing to be acted upon, eg. an "avoid explosion" goal could contain the explosion source and explosion size as needed data to perform the avoid action (note, the goal doesn't contain logic how to perform the action, just the information relevant for it)
- Goal Generators - A more advanced sensor that generates all possible goals with the AI world state for a specific agent, eg. an explosion occurs, all agents with a radius of the explosion should have an "avoid explosion" goal assigned
- Decision - Rule evaluation system, uses what the agent "knows" and decides upon the best action
- Behaviors - A sequence of actions to achieve a specific goal, eg. run to waypoint, then rotate torso around
- Groups - A group of behaviors, allowing for the creation of nested groups of behavior shared across multiple agent archetypes more easily
Bobby specifically points out that every game has their own requirements and needs, so there is no single solution for game AI, which I can agree on, this asset isn't too allow people to create any AI possible but rather provide a framework to kickstart creating actual AI behaviors with far less boilerplate code.
Asset Download: Coming Soon!
Source Code: Coming Soon!
Demo
Demo of the asset's runtime debug UI visualizing the AI world's information. Here a group of agents are trying to reach a target, with audio stimulants being generated as they move
Demo of the agent's sensor system, which allows agents to detect stimulants in the AI world for decision making. Here an agent's behavior is to simply patrol a set of waypoints, regardless of the detected stimulants
Demo that the asset is being developed to allow for fast iteration by allowing modifications to be made via the editor during runtime. Here is a demo of sensors being added and edited to a specific agent type
Technical Sheet
Tools that I used whilst working on this project:
- IDE:
- Game Engine:
Helpful Resources
- Bobby Anguelov's YouTube Channel - The two videos below are what this asset is largely based on