Only this pageAll pages
Powered by GitBook
1 of 16

AI Brain Extensions Docs

Loading...

Loading...

Loading...

AIBrain Graph

Loading...

Loading...

Loading...

Loading...

Loading...

AIBrain Debugger

Loading...

Master/Slave Brains

Loading...

Additional Utilities

Loading...

Loading...

Install Instructions

You can install the plugins (for both engines) in two ways:

  1. From the Unity Asset Store: usually the quickest and best solution

  2. From the development repository on GitHub

Corgi Engine

1. From Asset Store

On the Asset Store you will find the latest stable version:

  1. Install the latest version of on your project

  2. Install the extension from the

Downloading the plugin on GitHub will give you access to the latest (and, sometimes, less stable) features. You will have to follow these steps:

  1. Install the latest version of on your project

  2. Download the latest release of (freely available on GitHub) and add it to your Unity project

  3. Download the latest develop branch release of (freely available on GitHub) and add it to your Unity project

On the Asset Store you will find the latest stable version:

  1. Install the latest version of on your project

  2. Install the extension from the

Downloading the plugin on GitHub will give you access to the latest (and, sometimes, less stable) features. You will have to follow these steps

  1. Install the latest version of on your project

  2. Download the latest release of (freely available on GitHub) and add it to your Unity project

  3. Download the latest develop branch release of (freely available on GitHub) and add it to your Unity project

Download the latest develop branch release of (freely available on GitHub) and add it to your Unity project
Download the latest develop branch release of Engine (freely available on GitHub) and add it to your Unity project

2. From the Development Repository on GitHub

TopDown Engine

1. From Asset Store

2. From the Development Repository on GitHub

Corgi Engine
Unity Asset Store
Corgi Engine
xNode
AI Brain Extensions for MMTools
TopDown Engine
Unity Asset Store
TopDown Engine
xNode
AI Brain Extensions for MMTools
AI Brain Extensions for Corgi Engine
AI Brain Extensions for TopDown

Node Reference

The AI Brain Graph comes packed with four main type of nodes:

  • AI Brain State Node

  • AI Transition Node

  • AI Action Node

  • AI Decision Node

Additionally, you'll get some helper nodes:

  • Comment Node

  • AI Brain State Alias Node

  • AI Brain Any State Node

Finally, when you work with a Subgraph, you have access to:

  • AI Brain Subgraph Nodes

  • AI State In Nodes

  • AI Transition Out Nodes

A State node represents a single state in the MMTools AIBrain.

The Set as starting state button will set the state as the first one in the MMTools AIBrain states list.

  • Can Transition To Self: if set to false, self referencing transitions will be removed (for instance Idle > Idle)

  • States In (multiple State connections): a list of entry points from other states transitions

  • Actions (multiple Action connections): a list of actions that should be performed when entering the state itself

  • Transitions (multiple Transition connections): a list of transitions that will let the system exit from this state

A Transition node represents a single transition from a state in the MMTools AI Brain: a state can have more than one transition.

If you wish, you can rename the node by right-clicking the header and choosing Rename but this won't affect the AI generation.

This node has no attributes.

  • Decision (single Decision connection): a single AI Decision Node that will let the AI Brain exit from the actual state

  • Input (single Transition connection): a single connection from the AI Brain State

  • True State (single State connection): a connection to the state that should be activated when the decision is true

  • False State (single State connection): a connection to the state that should be activated when the decision is false

Action nodes are graph representations of AIAction components. They come with a single output element that should be connected to the state. This will tell the state itself that this action should be executed.

A node may have some parameters, corresponding with the Corgi/TopDown engine AIAction components.

If you wish, you can rename the node by right-clicking the header and choosing Rename but this won't affect the AI generation.

  • Label: corresponds to the regular AIAction label

  • Depending on the corresponding AIAction, you'll have access to a list of paramenters

This node has no input connections.

  • Output (multiple Action connections): a single AI Decision Node that will let the AI Brain exit from the actual state

Decision nodes are a graph representation of AIDecision components. They come with a single output element that should be connected to a state transition. This will define the condition to exit the state.

If you wish, you can rename the node by right-clicking the header and choosing Rename but this won't affect the AI generation.

  • Label: corresponds to the regular AIDecision label

  • Depending on the corresponding AIDecision, you'll have access to a list of paramenters

This node has no input connections.

  • Output (multiple Decision connections): a single AIDecision Node that will let the AI Brain exit from the actual state

Comment nodes have the only purpose of letting you add notes in your graph. They won't generate anything in the character AI Brain System.

This node has no input attributes.

This node has no input connections.

This node has no output connections.

The AI Brain State Alias Node will let you create alias elements for your states: this will avoid main spaghetti like brains when things get complicated.

  • Available States: the node will show a list of nodes:

    • In the main graph all nodes and subgraph-exposed nodes will be shown

    • In a subgraph, only inner nodes will be shown

  • States In (multiple State connections): a list of entry points from other states transitions

This node has no output connections.

The AI Brain Any State node will let you generate Decision/Transition logic for all nodes in your graph:

  • If added in a main Graph, also subgraph States will be affected

  • If added in a subgraph, only subgraph States will be affected

This node has no input attributes.

This node has no input connections.

  • Transitions (multiple Transition connections): a list of transitions that will let the system exit all included states

A Subgraph node is a special state node, that lets you create a inner state/decision/action logic.

It can be set as a starting node (in this case its inner starting node will be used).

You can create a subgraph asset and assign it to the Subgraph field.

  • Subgraph: the subgraph data

  • State In (list of multiple State connections): a dynamically generated list of state connections (see AI State In Nodes)

Outputs

  • Transition Out (list of single Transition connections): a dynamically generated list of transition connections (see AI Transition Out Nodes)

The AI State In node exposes an AI Brain State node inside a subgraph to the parent brain graph.

This node has no attributes

This node has no input connections.

  • Input (single State connection): this node will generate a State In connection in the subgraph node of the parent graph

The AI Transition Out node exposes an AI Transition node connection inside a subgraph to the parent brain graph.

This node has no attributes

  • Output (single Transition connection): this node will generate a Transition Out connection in the subgraph node of the parent graph

This node has no output connections.

Main Nodes

AI Brain State Node

Each state should be given a unique name by right-clicking the header and choosing Rename.

Attributes

Inputs

Outputs

AI Transition Node

A Transition node should always have a connected AIDecision node

Attributes

Inputs

Outputs

AI Action Node

Attributes

Inputs

Outputs

AI Decision Node

Attributes

Inputs

Outputs

Helper Nodes

Comment Node

Clicking on the header will let you enter edit note.

Attributes

Inputs

Outputs

AI Brain State Alias Node

Attributes

Inputs

Outputs

AI Brain Any State Node

Attributes

Inputs

Outputs

Subgraph Nodes

AI Brain Subgraph Node

You cannot create nested subgraphs (i.e.: you cannot add a subgraph inside a subgraph)

Attributes

Inputs

AI State In Node

State In nodes are only available in a subgraph.

Attributes

Inputs

Outputs

AI Transition Out Node

Transition Out nodes are only available in a subgraph.

Attributes

Inputs

Outputs

Introduction

Welcome!

Welcome to the AIBrain Extensions for MoreMountains Unity3D engines (i.e.: Corgi and TopDown) documentation.

This project is maintained by and it is free and open-source. If you find it useful, please consider supporting it with a.

The project includes a set of tools that will (hopefully) ease your workflow with the AIBrain system.

What's Corgi Engine?

The Corgi Engine is a Unity 2D + 2.5D Platformer Kit, available on the Unity Asset Store. If you want to know more about it, please read the official documentation.

Alternatively, for a quick introduction, you can check the following feature video:

What's TopDown Engine?

The TopDown Engine is a complete solution for top-down games, available on the Unity Asset Store. Official documentation can be found on MoreMountains website.

For a quick feature walkthrough, please check the video below:

Marco Secchi
one-time donation on Paypal

The AIBrain Graph System

The AI Brain Graph editor is a tool used to create Corgi/TopDown Engines AI logic through a visual node editor.

The tool is built on top of by Thor Brigsted.

Working with the Graph

Creating a Graph

A graph is an asset stored in your project Assets folder. To create one:

  1. Right click anywhere in the Assets folder

  2. Select Create > The Bit Cave > AI Brain Graph

  3. Rename the brain asset

  4. Double click on it to show the editor window

Like the graph, a subgraph is an asset stored in your project Assets folder. To create one:

  1. Right click anywhere in the Assets folder

  2. Select Create > The Bit Cave > AI Brain Graph

  3. Rename the brain asset

  4. Double click on it to show the editor window

To add nodes to the graph (or subgraph) simply right click on any free space and select the desired node.

When you add a graph to a Corgi/TopDown character, the system will parse your nodes and will translate them to AIBrain/AIAction/AIDecision components.

To achieve this, all you have to do is to add one of these components:

  • AI Brain Generator: this component will generate all needed elements to the character

  • AI Brain Pluggable: similar to the previous component, but the generation will be at runtime

Creating a SubGraph

Adding Nodes

Please check the Node Reference page for a list of available nodes.

Using a Graph on a Character

Please check the Corgi and TopDown getting stated tutorials for an example on how to use these components.

xNode

TopDown Engine - Getting Started Tutorial

In this tutorial you'll learn the basic steps of the AIBrain graph for TopDown Engine.

Note: To get you started using the AI Brain Graph, you should first follow the Install instructions and check that everything is working.

The Tutorial Scene

First of all, look for the MinimalAI3D_Tutorial scene (and open it), that will serve as a starting point for this tutorial. Basically, it is the TopDown MinimalAI3D scene with all enemies removed (with the exception of PatrolAndMoveAI).

  1. Open the AIs group to check the content: you will find the PatrolAndMoveAI prefab along with two other gameObjects (stripped out of all AI components): PatrolAndMoveAI_Generated and PatrolAndMoveAI_Pluggable.

Creating the AI Brain Graph

To start working with the graph, you'll need to create an AI Brain Graph:

  1. In the Project panel, right-click the mouse button and select Create > The Bit Cave > AI Brain Graph

  2. Rename the newly created asset PatrolAndMoveBrain (or anything you deem appropriate)

  3. Double-click on the asset to open the Editor

Select the PatrolAndMoveAI prefab in scene and look at the AI Brain, AI Actions and AI Decisions components: we want to replicate the same structure with the AI Brain Graph:

  • The AI Brain has two states: Patrolling and MoveTowardsTarget

  • While in Patrolling the character will perform an AIActionMovePatrol3D and an AIActionAimWeaponAtMovement action

  • While in MoveTowardsTarget the character will perform an AIActionMoveTowardsTarget3D and an AIActionAIMWeaponATMovement action

To create the AI Brain Graph we will need these nodes:

  • Two states

  • Two transistions

  • Three actions

  • One decision

First of all, let's create the two states:

  1. Right click on the AI Brain graph canvas and choose AI > Brain State: this will create a state

  2. Right click on the node header and choose Rename. Rename the state Patrolling and select Apply

  3. Repeat the first two steps, creating another node called MoveTowardsTarget

The Patrolling state has a single transition, so we are going to create it:

  1. Right click on the Graph canvas and select AI > Transition: this will add a transition node

  2. Click on the transitions output in Patrolling state and drag it to the Input element of the transition node

The original character has a single decision, connected with the Patrolling state, so let's add it to the graph.

  1. Right click on the graph canvas and select AI > Decision > 3D > Detect Target Radius

  2. Set the Radius to 8

  3. Set the Target Layer Mask to Player

The swordsman has three actions, with one of them in common with both states: let's add them to the graph.

For the Patrolling state:

  1. Right click on the graph canvas and select AI > Action > 3D > Move Patrol

    1. Set the Obstacle Mask to Obstacles, ObstaclesDoors, NoPathfinding

    2. Connect the Output element to the Actions input of the Patroling state node

For the MoveTowardsTarget state:

  1. Right click on the graph canvas and select AI > Action > 3D > Move Towards Target

    1. Connect the Output element to the Actions input of the MoveTowardsTarget state node

  2. You don't need to create a second Aim Weapon At Movement

The last step to complete the brain graph is to connect the transitions True/False states. In this case we only need the True one:

  1. Connect the True State of the patrolling AI Transition to the States in input of the MoveTowardsTarget state

We are now ready to add the brain graph to a gameObject and generate all the TopDown Engine AI structure: we have two options for this.

The AI Brain Generator component adds a static brain structure to your character, just like you are used to do in TopDown Engine:

  1. Enable the PatrolAndMoveAI_Generated gameObject

  2. Click the Add Component button and select The Bit Cave > AI > AI Brain Generator

  3. Drag the PatrolAndMoveBrain we created above in the AI Brain Graph field

The AI Brain Pluggable generates all Corgi AI system at runtime from a list of brain graphs:

  1. Enable the PatrolAndMoveAI_Pluggable gameObject

  2. Click the Add Component button and select The Bit Cave > AI > AI Brain Pluggable

  3. Drag the PatrolAndMoveBrain in the AI Brain Graphs field: this is an array of elements, so you can add more than one (one will be chosen randomly at runtime)

The chracters will exit the Patrolling state if the target is within range (AIDecisionDetectTargetRadius3D)

  • The character will not exit the MoveTowardsTarget state after a while

  • On the Patrolling node, click the Set as starting state button: this will set the Patrolling node as the entry state in the character brain
    Set the Obstacle Mask to Obstacles, ObstaclesDoors, NoPathfinding
  • Connect the Output element to the Decision input of the patrolling state AI Transition node

  • Right click on the graph canvas and select AI > Action > Aim Weapon At Movement

    1. Connect the Output element to the Actions input of the Patrolling state node

    Connect the Output element to the Actions input of the MoveTowardsTarget state node

    Click the Generate button and you will get the full working TopDown AI system for the PatrolAndMoveAI (try comparing it with the original prefab)

    Editor Play button and you should see the TopDown Engine AI Brain structure generated

    The PatrolAndMoveAI Brain Structure

    Creating the States

    Each state should always have a unique name

    Adding Transitions

    There's no decision for the MoveTowardsTarget state, so we won't need a transition.

    Adding AI Decisions

    Adding AI Actions

    Connecting Transitions

    Generating the Character AIBrain System

    AI Brain Generator

    Once you are happy with your brain, you can safely remove the AI Brain Generator component as it is not used during gameplay

    AI Brain Pluggable

    The AI Brain Pluggable is an extension of the regular TopDown Engine AI Brain, so you'll have to keep it in your gameObject

    Corgi Engine - Getting Started Tutorial

    In this tutorial you'll learn the basic steps of the AIBrain graph for Corgi Engine.

    Note: To get you started using the AI Brain Graph, you should first follow the Install instructions and check that everything is working.

    The Tutorial Scene

    First of all, look for the AIBrain_Tutorial scene (and open it), that will serve as a starting point for this tutorial. Basically, it is the Corgi RetroAI scene with all enemies removed (with the exception of RetroSwordsman).

    1. Open the Enemies group to check the content: you will find the RetroSwordsman prefab and two other gameObjects (stripped out of all AI components): RetroSwordsmanGenerated and RetroSwordsmanPluggable.

    Creating the AI Brain Graph

    To start working with the graph, you'll need to create an AI Brain Graph:

    1. In the Project panel, right-click the mouse button and select Create > The Bit Cave > AI Brain Graph

    2. Rename the newly created asset RetroSwordman AIBrain (or anything you deem appropriate)

    3. Double-click on the asset to open the Editor

    Select the RetroSwordsman prefab in scene and look at the AI Brain, AI Actions and AI Decisions components: we want to replicate the same structure with the AI Brain Graph:

    • The AI Brain has two states: Patrol and Shooting

    • While in Patrol the swordsman will perform an AIActionPatrol action

    • While in Shooting the swordsman will perform an AIActionShoot action

    To create the AI Brain Graph we will need these nodes:

    • Two states

    • Two transistions

    • Two actions

    • Two decisions

    First of all, let's create the two states:

    1. Right click on the AI Brain graph canvas and choose AI > Brain State: this will create a state

    2. Right click on the node header and choose Rename. Rename the state Patrol and select Apply

    3. Repeat the first two steps, creating another node called Shooting

    Each state has a single transition, so we are going to create two and connect them with Patrol and Shooting:

    1. Right click on the Graph canvas and select AI > Transition: this will add a transition node

    2. Click on the transitions output in Patrol state and drag it to the Input element of the transition node

    3. Repeat the first two steps for the Shooting state

    The original swordsman has two decisions, each one connected with a state, so let's add them to the graph.

    For the Patrol state:

    1. Right click on the graph canvas and select AI > Decision > Detect Target Radius

    2. Set the Radius to 4

    3. Set the Target Layer to Player

    For the Shooting state:

    1. Right click on the graph canvas and select AI > Decision > Time In State

    2. Let the fields to their default values

    3. Connect the Output element to the Decision input of the shooting state AI Transition node

    The swordsman has two actions, each one connected with a state: let's add them to the graph.

    For the Patrol state:

    1. Right click on the graph canvas and select AI > Action > Patrol

    2. Check the Avoid Falling value

    3. Set the Hole Detection Offset x value to 1

    For the Shooting state:

    1. Right click on the graph canvas and select AI > Action > Shoot

    2. Check the Aim At Target value

    3. Connect the Output element to the Actions input of the Shooting state node

    The last step to complete the brain graph is to connect the transitions True/False states. In this case we only need the True ones:

    1. Connect the True State of the patrol AI Transition to the States in input of the Shooting state

    2. Connect the True State of the shooting AI Transition to the States in input of the Patrol state

    We are now ready to add the brain graph to a gameObject and generate all the Corgi AI structure: we have two options for this.

    The AI Brain Generator component adds a static brain structure to your character, just like you are used to do in Corgi:

    1. Enable the RetroSwordsmanGenerated gameObject

    2. Click the Add Component button and select The Bit Cave > AI > AI Brain Generator

    3. Drag the RetroSwordsman AIBrain we created above in the AI Brain Graph field

    The AI Brain Pluggable generates all Corgi AI system at runtime from a list of brain graphs:

    1. Enable the RetroSwordsmanPluggable gameObject

    2. Click the Add Component button and select The Bit Cave > AI > AI Brain Pluggable

    3. Drag the RetroSwordsman AIBrain in the AI Brain Graphs field: this is an array of elements, so you can add more than one (one will be chosen randomly at runtime)

    Tips&Tricks

    When connecting two nodes, you can create a reroute by right-clicking the mouse button. The reroute node can then be freely moved.

    To delete the reroute, right-click on it and select the Remove option.

    The swordsman will exit the Patrol state if the target is within range (AIDecisionDetectTargetRadius)

  • The swordsman will exit the Shooting state after a while (AIDecisionTimeInState)

  • On the Patrol node, click the Set as starting state button: this will set the Patrol node as the entry state in the character brain
    Connect the Output element to the Decision input of the patrol state AI Transition node
    Connect the
    Output
    element to the
    Actions
    input of the
    Patrol
    state node
    Click the Generate button and you will get the full working Corgi AI system for the RetroSwordsman (try comparing it with the original prefab)

    Hit the Editor Play button and you should see the Corgi AI Brain structure generated

    The RetroSwordsman AI Brain Structure

    Creating the States

    Each state should always have a unique name

    Adding Transitions

    Adding AI Decisions

    Adding AI Actions

    Connecting Transitions

    Generating the Character AIBrain System

    AI Brain Generator

    Once you are happy with your brain, you can safely remove the AI Brain Generator component as it is not used during gameplay

    AI Brain Pluggable

    The AI Brain Pluggable is an extension of the regular Corgi AI Brain, so you'll have to keep it in your gameObject

    Creating a Reroute Node

    Features

    In this page you will find listed all the features of the package: all of them are tools for MoreMountains AIBrain system.

    1. AIBrain Graph

    The AI Brain Graph system lets you create AIBrains systems by using a node system.

    An AIBrain Graph for Corgi Engine

    The AIBrain Graph is based on xNode, an opensource project by Thor Brigsted.

    The graph includes the following features;

    • A visual editing canvas with nodes for all the official AIDecisions and AIActions of Corgi and TopDown Engines

    • A subgraph system for better reorganization and reusability

    • An AI Brain Generator component, for quick creation of brain system starting from a brain graph

    • An AI Pluggable Brain component for runtime generation of AI systems

    The system will let you peek into some of the AIBrain inner workings and test states at runtime.

    The debugger includes the following features:

    • An AIBrainDebuggable component, that is an extension of the regular AIBrain component

    • An AIBrain Debugger window to check what's going on at runtime including:

      • Force transitions during gameplay

    The system will let you control an AIBrain (or a group of AIBrains) from another point in your game, usually from another AIBrain.

    The Master/Brain system includes the following features:

    • A channel system to send brain commands through the MMEventManager

    • A Master component to send state change commands through a channel

    • A Slave component to receive state change commands from one or more channels

    The AIBrain Debugger

    The AIBrain Debugger tool lets you peek into some inner workings of an AIBrain and modify runtime behaviours.

    To check the debugger in function, please watch the video below:

    To open the debugger window, simply select from the Main menu Tools > The Bit Cave > AI Brain Debugger.

    To debug a brain, you will need an AIBrainDebuggable component, that is an extension of the regular MMTools AIBrain.To add such brain select Add Component > CorgiExtensions > AI > AI Brain Debuggable.

    This brain works exactly like a regular brain, so you can add states and transitions, but it will give some more additional info to the debugger.

    Force the brain Target during gameplay
  • Track current/previous brain state tracking

  • 2. AIBrain Debugger

    3. Master/Slave Brains

    AIBrain Debugger
    Master/Brain
    To start debugging a debuggable AI Brain, all you have to do is to play the scene from the Unity Editor and select a gameobject with an AIBrainDebuggable. The brain is divided in three main sections:
    • Brain state

    • Transitions

    • Target

    The Brain State section shows the brain status during gameplay. Info displayed are:

    • The selected gameobject

    • Brain status (active or not)

    • Current brain target (if any)

    • The previous state and how much time the brain has been in it

    • The current state and how much time has passed since the brain entered it

    • Which actions the brain is performing

    This section will display all available states in the brain. Each state is displayed as a button, so you can force the transition if it is needed. A state can be:

    • [C] The current state: in this case the button will be disabled

    • [>>] A state connected with the current state

    • A state disconnected with the current state

    Note that you can force the transition even to a disconnected state: this is pretty useful if you are working with the Master/Slave brain features.

    This section will allow you to set the brain target or remove it if needed.

    Note that you can force any kind of target, not just the one selected by the brain.

    Opening the AIBrain Debugger Window

    Using the AIBrainDebuggable Component

    Debugging an AIBrain

    The AIBrain Debugger window

    Brain State

    Transitions

    Target

    Editor Resources

    Editor Actions

    Remove Brain System

    This action will clean up a gameobject from all AIBrain, AIDecision and AIActions components.

    How to Use

    • Right click a GameObject in the Hierarchy window

    • Select The Bit Cave > Remove Brain System

    Graph Utilities

    Node Collapsing

    To make the graph (or subgraph) more readable, you can enable node collapsing for AI Action and AI Decision nodes. When enabled, this feature will show only the Label field and the output connection.

    When a node is selected, it will automatically expand to show all available properties.

    • Right click on a free spot in the graph/subgraph canvas

    • Select Enable Node Collapsing/Disable Node Collapsing

    The AIBrain Graph system is based on , an open-source project by : some of the settings can be configured through the Preferences panel (In the Preferences panel, select Node Editor).

    How to Use

    xNode Preferences

    xNode
    Thor Brigsted

    Using Master/Slave AIBrains

    The Master/Slave system implements a set of methods to control AIBrains (set as Slaves) from other AIBrains (set as Masters) or other parts of the application through the Corgi/TopDown Event System.

    Using the System

    The two main actors involved in this system are:

    • Brain Master: not necessarily connected with a brain, it is used to send State change command events through dedicated channels

    • Brain Slave: this element listens for State change command events and forces the AIBrain behavior

    A Master can also be a Slave and listen to events (even those dispatched by itself).

    BrainMaster Ability

    The BrainMaster ability component lets you send state change commands to slave brains through a dedicated channel: usually this is achieved through an AIActionChangeAIBrainStateCommand but you can access the SendCommand method:

    • channel is used to filter who will receive and execute the command

    • newStateName is the state the AIBrain should transition in

    • target is the AIBrain target (if any)

    The BrainSlave ability component is used to receive state change commands through a dedicated channel.

    Whenever an event is received, the slave will try to change the AIBrain to the new state.

    As an alternative, the state change can be also forced through the TransitionToState() method:

    • newStateName is the state the AIBrain should transition in

    • target is the AIBrain target (if any)

    To use the Master/Slave communication system, you will have to create a Channel, that will be added to the slave channel list:

    1. Select Create > The Bit Cave > MasterSlave > State Command Channel

    2. Rename the newly created asset

    3. Add it to your slave Channels list

    4. Add the same channel to the master AIActionChangeAIBrainStateCommand

    component

    This ability doesn't extend the regular Corgi/TopDown abilities, so it doesn't need a Character component: this means you can use anywhere you need (i.e.: with a some trigger or any game logic).

    The Brain Slave Ability

    The slave can listen to one or more channels.

    Channels

    SendCommand(StateCommandChannel channel, string newStateName, Transform target = null)
    TransitionToState(string newStateName, Transform target = null)

    Creating Custom Nodes

    If you are working on a game made with Corgi Engine, chances are you are going to create new AI Decisions and AI Actions: the AI Brain Graph is completely extensible, so you can create your own nodes.

    Basically, each node acts as a component generator for the corresponding action or decision, so you'll just have to pass the correct attributes.

    Creating AI Action Nodes

    To create your own action nodes, you will have to extend the AIActionNode class and override a single method, called AddActionComponent: this component returns an instance of the Corgi AIAction you want to add with this node.

    As an example, please take a look at the AIActionJumpNode that corresponds to the AIActionJump for the Corgi Engine:

    using MoreMountains.CorgiEngine;
    using MoreMountains.Tools;
    using UnityEngine;
    
    namespace TheBitCave.CorgiExensions.AI
    {
        /// <summary>
        /// A node representing a Corgi <see cref="MoreMountains.CorgiEngine.AIActionJump"/> action.
        /// </summary>
        [CreateNodeMenu("AI/Action/Jump")]
        public class AIActionJumpNode : AIActionNode
        {
            public int numberOfJumps = 1;
    
            public override AIAction AddActionComponent(GameObject go)
            {
                var action = go.AddComponent<AIActionJump>();
                action.Label = label;
                action.NumberOfJumps = numberOfJumps;
                return action;
            }
        }
    }

    Please note the [CreateNodeMenu("AI/Action/Jump")] that adds this node to the graph contextual menu.

    Creating AI Decision Nodes

    To create your own decision nodes, you will have to extend the AIDecisionNode class and override a single method, called AddDecisionComponent: this component returns an instance of the Corgi (or TopDown Engine) AIDecision you want to add with this node.

    As an example, please take a look at the AIDecisionHitNode that corresponds to the AIDecisionHit :

    Please note the [CreateNodeMenu("AI/Decision/Hit")] that adds this node to the graph contextual menu.

    using UnityEngine;
    using MoreMountains.CorgiEngine;
    using MoreMountains.Tools;
    
    namespace TheBitCave.CorgiExensions.AI
    {
        /// <summary>
        /// A node representing a Corgi <see cref="MoreMountains.CorgiEngine.AIDecisionHit"/> decision.
        /// </summary>
        [CreateNodeMenu("AI/Decision/Hit")]
        public class AIDecisionHitNode : AIDecisionNode
        {
            public int numberOfHits = 1;
    
            public override AIDecision AddDecisionComponent(GameObject go)
            {
                var decision = go.AddComponent<AIDecisionHit>();
                decision.Label = label;
                decision.NumberOfHits = numberOfHits;
                return decision;
            }
        }
    }