Overview
Bots for Singleplayer, Local & Online Multiplayer
Bots can be tremendously important for the success of a multiplayer game.
While they can be used to fill up rooms, they can also be used to replace a player who left a running game session.
With Quantum Bot SDK this happens absolutely seamlessly: if a player loses his connection the bot takes over instantly and the player can simply rejoin moments later.
Even better, it's a time saver: the code for bots is the same whether for singleplayer, local or online multiplayer.
Download the Bot SDK v1.1.1F1 here.
PS: the minimum Unity Version required is 2018.4.0f1.
Introduction
This AddOn is mainly divided into two parts:
- The Visual Editor created for you to deploy your own AI in a fast and efficient way
- The Deterministic AI API which has the implementation of the AI models
Bot SDK currently supports two AI models:
- Hierarchical Finite State Machine (HFSM)
- Goal Oriented Action Planning (GOAP)
This document describes the usage of the visual editor, listing its functionalities and giving you samples of how to use it in your own games.
When using this framework, the choice for the AI model that will be used is completely up to you:
- You can design all of your bots using only one model;
- You can design some bots using HFSM and others using GOAP;
- It might also be possible to use a GOAP just to decide what HFSM will be executed (or vice versa), thus combining the two models.
Take a look at the Bot SDK Sample.
Note: The HFSM framework is based on the same data-driven approach provided with Quantum's Action RPG Sample.
Opening the Editor
Go to the Unity's top menu and click on "Window" > "Circuit" > "Open Editor".
This is the screen that you will see:

Release History
Plain Old Text
Mar 01, 2021
- Bot SDK 1.1.1 F1
* Visual Editor
- Fixed issue in which closing and reopening AI documents would lead to a crash in the Bot SDK window;
- Fixed issue related to compilation and to playing the scene with the Circuit window opened;
- Fixed issue upon creating new AI documents;
- Fixed issue related to having an “ANY Transition” and no State on that same hierarchy level;
Feb 16, 2021
- Bot SDK 1.1.0 F1
* Visual Editor
- Major improvements on the Circuit Editor performance;
- Blackboard Variables can now be converted to Constants and Config. On existing nodes, the “Key” slot connection is lost and the “Value” slot’s connection is maintained;
- Constants and Configs can now be converted to Blackboard Variables. On existing nodes, the “Key” is added and the “Value” slot’s connection is maintained;
* Quantum code
- Added new API for resolving AIParams which only needs the Frame and the Entity* as parameter;
* Debugger
- On the HFSMDebugComponent, added null checks regarding to the Quantum Game;
Jun 17, 2020
- Bot SDK 1.0.1 F1
* GOAP Editor
- Included the Blackboard panel
- Included the Constants panel
- Included the Configs panel
- Using assets cache to reduce the compile time
- Added complete solution to slots baker, to consider the Blackboards/Constants/Configs;
- Added a reference to an AIConfig on the GOAPAgent component
- Added Hotkey: press “F2” to edit Tasks
* Quantum code
- HFSM and GOAP main methods doesn’t receive an AIContext as parameter anymore
- Removed allocations from AIBlackboard.HasEntry and GetEntry methods
- Removed the parameter “HFSMData* fsm” from the abstract Decide method
* Visual Editor
- On the History panel, highlighting the last compiled entry, and the active entry
- Added Filter button on the top bar
- Added “Compilation succeeded” message when Bot SDK finishes compiling
- The compilation button now turns green when the current state of the circuit was already compiled;
- Added Bot SDK version label to the top bar
- The left size panel is now resizable
- Support for the creation of AIParam<T> with an Enum as the type. Connections enabled with Blackboard/Constant/Config nodes
- Support for implicit cast on numerical nodes/slots. It is possible now to connect Byte/Int32/FP slots and nodes
- When editing slots, the edited value now appears close to Node (achor is now MiddleRight instead of MiddleLeft)
- Removed the “Promote to Variable” alternative from Action/Decision fields
- Added button which shows a panel with the most important Hotkeys
- Included panel for correcting Actions/Decisions types if they had their names changed
- The middle mouse button now closes tabs
- When Action/Decision nodes types are broken, they appear on the Left Panel upon compilation. Circuit window will focus on the broken node if the user click on the error message
* Folders and files
- Added panel to select the output folder for the result of Bot SDK’s compilation process. The Panel can be found at the bottom of the asset SettingsDatabase, the field name is BotSDKOutputFolder
- Config files are now generated on the subfolder AIConfig_Assets
March 16, 2020
- Bot SDK 1.0.0 Final
* Visual Editor
- Support for adding Labels to Actions/Decision Nodes (from the right click menu)
- Allowed connection between Event Nodes and String/AIParamString slots
- Fixed the Constant Nodes drawer: its width is now defined by the size of the Node value instead of its name
- Removed log message when adding Constant nodes to the graph
- Fixed issue in which uninitialized AIParam fields would generate broken Nodes on the Visual Editor
- Fixed issue in which the compilation process tried to find for the Events on the Constants panel, which would lead to unnecessary logs showing up
- Fixed issues regarding the History view
- Fixed issue that happened when drag-and-dropping assets into AssetLink fields on Actions and Decisions
- Fixed issue in which the Priority values were initialized as null instead of zero
- Fixed issue with the “Compile Project” functionality
- Changed the tooltip from “Compile Project” to “Compile All”
- On the Unity top toolbar, changed the tool name from “Circuit” to “Bot SDK”
* Hotkeys
- Added Hotkey: press “M” to mute and unmute States/Actions/Transitions Links
- Added Hotkey: press “F2” to edit States/Actions/Decisions/Transitions Nodes/TransitionSets
- Added Hotkey: press “Esc” to go upper on the states hierarchy or out of a transiton graph
* Configs panel
- Created new panel on the left side menu named Config
This panel should be used for agents which use the same HFSM but need different constant values from each other
* Blackboard
- The Blackboard getter method is now generated automatically. Instead of Entity.GetBlackboardComponent(entity), use Entity.GetAIBlackboardComponent(entity)
- Fixed issue regarding destroying and re-initializing Blackboard components
* GOAP
- Fixed issue on muting Tasks
* Unity files
- Moved the AssetLinkDatabase and SettingsDatabase to a new folder. It is not on the Resources folder anymore
- Removed duplicated Gizmos Icon images
* Debugger
- Added support to debugging Blackboard Vars
- Event nodes can now be linked to String fields
- Fixed transition color when there is only one transition to be debugged
Dec 17, 2019
- Bot SDK 1.0.0 Release Candidate 3
* Visual Editor
- Changed the line drawers which are used to link states, actions, decisions, etc
- Keyboard numeric Enter is now also used to confirm some editing actions
- Clicking on some transition slot doesn't delete that transition anymore. Instead, drag and drop it to re-direct some transition to another state
- Right click transitions to access the Delete button
- Variables on the left side menu are now ordered by alphabetical order
- Actions and Decisions are also now ordered by alphabetical order
- Actions and Decisions nodes can now have its names changed on the Visual Editor (right click on it to edit). This makes no difference to the actual actions and decisions classes
- Created a menu to fix events/blackboard variables from former Bot SDK versions
- Added the transition Priority to the top view on the graph, on the state node
- No longer generates a Blackboard asset when there is no Blackboard Variable on the visual eitor
* ANY Transition
- Added Excluded List to it, which allows the user to inform states that should not consider that ANY transition
* Compilation
- Removed code which was causing the compilation process to take the double of the time needed
- Improved a lot the compilation time by re-using the previous data assets structure to prevent re-creating assets unnecessarily
* Debugging
- Added new toolset for debugging HFSM agents. Its main features are:
Select some Game Object on your Hierarchy tab which represents some HFSM Agent and has the HFSMDebugComponent added to it in order to open its HFSM editor
See what is the current state in which the HFSM Agent is
See what are the last three transitions taken by that HFSM Agent (works hierarchically)
See what are the current states on the left panel, to easily see all of the current states considering the hierarchy
* Quantum code
- Created the AIContext, which is used to reference Constants and Config data assets and can be set differently for bots which has the same HFSM but uses different values
- Changed the way that Transition Sets were handled on the HFSM core code
* Constants
- Created the Constants menu on the left side part of the editor
- Constants can be used to define nodes with a default type, and the same constants node can be used as input for many fields
* Blackboard
- On the Visual Eitor, added a new slot on every Blackboard node: the value slot, which can be used to define where some Action/Decision reads some value from
- Fixed serialization issue for entities which has the Blackboard Component and are Created -> Destroyed-> Created (respawned)
- Fixed serialization issue regarding using the Blackboard component during matches between different platforms (cross platform)
- Fixed serialization issue regardinsg usint the Blackboard component on replays
* AI Param
- Created a new type that easily changes the source from where it reads values: the AIParam
- Public AIParam fields can be defined, on the Visual Editor, from a value set by hand (click to edit), from a Blackboard node or a Constant node
- AIParams are strongly typed, so they are used as AIParamInt, AIParamFP, AIParamBool, etc
* Unity Assets
- Added new asset: HFSMDebugComponent
* Issues
- Fixed issue on using Events on ANY transitions
- Reduced the amount of SetDirty called for the data assets created, which was causing a bug during compilation on some Mac OS machines
- Added custom header on the default Bot SDK actions/decisions to prevent the Reset method to be created. It was also the cause of issues during compilation
- Fixed precision issues regarding closing/opening circuits with FP values. Every re-open would make the FP value change. FPs are now stored as their internal long value
- Fixed issue when (de)serializing the XML document. It didn't use InvariantCulture so it would cause errors depending on the machine's localization. Issue happened with some czech localized Windows machines
- Fixed issue in which OnExit actions would be called right after entering some state which has children states
- Fixed compilation and runtime issues when some states were named the same
- Fixed nodes being in incorrect states if it was created as a result of drawing a new transition. It was generating broken nodes after copying and pasting it
- Documents are now saved before assembly recompilation to prevent loss of document modifications
- Fixed the Circuit window when the game is on Play mode
Aug 15, 2019
- Bot SDK 1.0.0 Release Candidate 2
* Visual Editor
- Mute Transition option, accessible by right clicking on a any transition's line or on
its in/outbound slot. Muted transitions will be ignored during the compilation process;
- Mute State option, accessible by right clicking on a State node. Muted states are
ignored during the compilation process, so no transition will lead to that state. The
HFSM will not compile if you mute the Default State;
- Mute Action option, accessible by right clicking on a Action node. It is possible to
mute any Action, no matter its position on the actions list. If a muted action is linked
to another action, then the other action will still be executed;
- Editor screen panning using direcional arrow keys;
- Actions and Decision nodes will automatically add or remove its fields list based on
changes performed on the quantum_code (such as adding/removing fields);
- Actions and Decisions nodes fields are initialized with the values defined on quantum_code;
- Warning logs if some Action/Decision isn't serialized. Those Actions/Decisions wont show on the pop up menu in this case;
- Actions/Decision fields always showing its values. There is no need to select the node to see the values anymore;
- Transitions are now labelled with their Event name if there is no custom label defined;
- Added menu to create Blackboard information within the editor view from which your
custom Blackboards are created and from where you can drag and drop the Blackboard keys as nodes.
* Blackboard
- Blackboard Initializer asset, which can be used to define initial values for blackboard instances;
- Fixed issue on Blackboard's memory allocation;
- Added optional compilation symbol (USE_BLACKBOARD_FRAME_METHODS) to define if the Blackboard will not use Frame's partial methods.
* Unity Assets
- Compiling a HFSM generates both a Blackboard asset and a BlackboardInitializer asset for that agent;
- Fixed redundancy between SettingsDatabase and AssetLinksDatabase assets which led to invalid cast errors;
- Downgraded all assets versions. Assets were previously generated from Unity 2019.1.0f2, now it is generated from Unity 2018.4.0f1 LTS.
* GOAP
- Reduced the amount of GOAP re-planning: it now happens when the agent's Goal changes and when the agent's Current State changes
* Changes on quantum_code BotSDK folder's content:
- Included the Samples folder with some very simple pre-defined Actions and Decisions
Jul 1, 2019
- Bot SDK 1.0.0 Release Candidate 1
Back to top