VisAI splits AI functionality into 3 core pieces. Behaviour, Decision, and Action.
Behaviours are the Structure of an AI, giving you a comprehensive way to plan dynamic AI behaviour.
Decisions are the Thought of the AI, giving you complete control over the way your AI plans its next move.
Actions are the Instructions for the AI, giving you a straightforward way to bring life to your AI.
On this page, we’ll be focusing on Action, the Instructions. Let’s get started!
With VisAI, Behaviour defines what’s possible for the AI, and Decisions are handling what the AI should be doing. All that’s left, is actually doing it; that’s where Actions come in.
Actions are essentially just Behaviour Tree Tasks, designed to be straightforward. They are run in order from left to right, and are encapsulated within a Plan. Some Plans may have many Actions, some may only have one. It’s up to the designer!
As an Example:
For an advanced Plan such as “Tactical Attack”, you might have the Actions “Find Nearby Vantage Point”, “Fire Weapon”, “Throw Grenade”, “Use Ability”, or something else more fitting.
zActions provide you an easy way to define how an AI can complete a plan. Use them in cohesion with Decisions. For example, “Find Nearby Vantage Point” needs to be successful, so you would want to incorporate a check for nearby vantage points in the decision to ensure the Action is successful.
The last step of creating your AI is to create Actions for each of your Plans. If you need some help designing actions, take a look at the Designing Action page.
Let’s get started!
Creating a new action blueprint is incredibly simple.
- Open the Behaviour Tree for the AI you’re creating an Action for, then select “New Task”
- Search for “BTT_Action_Base”, then select it by left clicking.
- Your new Action is created!
The next part you’ll need to do is create the actual logic for your Action. When a task is called on the Behaviour Tree, the event “Event Receive Execute AI” is called. Use this event by right clicking in the event graph, and searching for it.
This is your starting point, everything within the Action depends on what you want to do with it. Remember that you have access to all AI systems, these are where they really help. If you’re confused on what to do, try taking a look at some of the examples provided with the pack, or checking out the Designing AI page here.
Once you’ve created your Action, all you need to do to use it is place it in the Behaviour Tree. Simply right click anywhere in your tree, search and select your Action, then drag from the top of the node to the bottom of the Plan, linking them together as shown below
That’s it! Make sure to adjust the settings of the Action if necessary by left clicking on it and viewing the details panel.
That’s it for creating AI!
The key to creating AI with VisAI is having a solid design before starting. Be sure to check out the examples in the pack, and ask questions in the Discord if you’re having troubles!
Next steps are to go out there and do it! If you have screenshots or something to share, all of us in the Discordcommunity would love to see it!