This document is about: QUANTUM 2
SWITCH TO

Bot SDK Sample

Level 4

Overview

This is a very simple showcase of Bot SDK features. Use it to decide if it fits your needs, or to get inspired on how to approach AI on your projects.

Download Stable

Version Release Date Download
2.1.8.1 May 20, 2024 Quantum BotSdk Sample Stable 2.1.8.1 Build 386

Download Development

Version Release Date Download
2.1.0 Dec 05, 2022 Quantum BotSdk Sample Development 2.1.0 Build 21

The Sample Versions

This project comes in two different versions: the Stable and the Development versions.
The Development version is exclusive to the Photon Circle and has additional AI tooling which is still under development.

The Little Guys Sample

Little Guys Sample
The bots' objective is to collect jewels and put it in the box.

The sample contains:

  • Sample code and AI documents for :
  • Hierarchical Finite State Machine (HFSM);
  • Behaviour Tree (BT);
  • Goal Oriented Action Planning (GOAP) - exclusive to the Development build;

The quantum solution also comes with some samples on how to handle:

  • Player Replacement: how to replace a player by a Bot if the player got disconnected during the match;
  • Filling Room: how to fill the room with Bots if there are not enough players connected to the match;
  • Bot Entities: creating entities which are not related to Players at all.

All of these configurable using the RuntimeConfig.User.cs file.

The Spellcaster Sample

The sample contains:

  • Sample code and an AI document for a Utility Theory agent (UT);
    This sample is exlusive to the Development Build.
Spellcaster Sample
The Spellcaster is the AI agent. It's objective is to protect it's castle from the enemies.

Once you have downloaded the sample, these are the most important parts that you should take a look at:

  • When running the demo from the Game scene, select the QuantumRunner game object and define how many/which HFSMs, GOAPs and Players entities will be created for the offline test;
  • When running it from the Menu scene, go to the UIRoom.CheckForGameStart() method to define by code what are the HFSM/GOAP Bots (not related to players at all), and fill some booleans, such as the ReplaceOnDisconnect to inform if players should be replaced by Bots if they get disconnected, the FillRoom boolean to inform if the room should be populated with Bots if the game doesn't have enough players, and the FillRoomCooldown FP in order to define how many seconds it takes for the room to be filled by the bots;
  • On Quantum solution:
    • At quantum_code\quantum.code\State_LittleGuys you will find a sample .qtn and two files with Decisions and Actions samples;
    • At quantum_code\quantum.code\Systems_LittleGuys you will find a systems that deal with HFSM and GOAP code, and the LittleGuysSystem which handles players connectivity/filling the room/replacement by Bots and so on.
  • On Unity
    • At Assets\BotDocuments you will find the HFSM and GOAP files used on the Visual Editor;
    • At Assets\Resources\DB\CircuitExport you will find the HFSM, GOAP and Blackboard files for the deterministic AI generated from the compile process;
    • At Assets\Quantum\Lobby\UIRoom.cs you will find the place where the RuntimeConfig fields should be defined before starting the online match.

The sample HFSM provided:

Sample HFSM

The sample GOAP provided:

Sample GOAP
The sample BT provided:
Sample BT

A small part of the sample Utility Theory provided:

Sample UT

3rd Party Assets

The Projectiles Sample includes several assets provided courtesy of their respective creators. The full packages can be acquired for your own projects at their respective site:

IMPORTANT: To use them in a commercial project, it is required to purchase a license from the respective creators.

Back to top