This document is about: QUANTUM 2
SWITCH TO

State Behaviour Editor


Available in the Gaming Circle and Industries Circle
Circle

Overview

As animation and gameplay are tightly intertwined in fighting games, It is crucial for a fighting game to have tick precise control over an animation’s state; this includes the state of animation motion, the behaviour and last -but definitely not least- the position of the associated hit and hurt boxes.

It is possible to harness the deterministic nature of Quantum for animations by using the Custom Animator and extending it. The Custom Animator bakes the animation motion into the CustomAnimatorGraphAsset by default. The Quantum Animation State Behaviours with Main Bounds, HitBox and HurtBox setup on the other hand is unique to the fighting template.

Basic Setup

The initial setup of the Unity Animator in the Fighting Sample is identical to the setup steps explained in the Customer Animator documentation.

N.B.: Read carefully through the Known Issues section of the Addons > Custom Animator page as this may impact the design and implementation of the finite state machine.

Create New State Behaviour Asset

The QTASB Container script is used to facilitate the editing, organization and visualization of the QuantumAnimatorStateBehaviour assets associated with an animation state in the Unity Animator Controller.

To set-up a new animation state in Unity for use with the QTASB:

  • Add a QTASB Container behaviour script to your animation state.
Fighting Sample, QTASB Setup
Add the behaviour script called QTASB Container.
  • In the QTASB Container, link the State Asset Directory field with the folder holding all of a character’s states. This will create a FighterAnimatorStateAsset with the same name as the state and reference it in the QTASB Container’s State Asset field.
Fighting Sample, QTASB Setup
Populate the State Asset Directory field.
  • In the Behaviours section at the bottom of the new section, drag and drop concrete FighterBehaviourAsset implementation to the Add Behaviour field. These assets will be added to the FighterAnimatorStateAsset referenced in the State Asset field. Alternatively, click the + symbol to add or create a new FighterAnimatorStateAsset. N.B.: FighterBehaviourAssets can be reordered in the list of behaviours.
Fighting Sample, QTASB Setup
Add FighterBehaviourAssets to the QTASB Container.

Once the set up is completed, the FighterBehaviourAsset and FighterAnimatorStateAsset associated with this animation state can all be edited in this window.

Special Moves

Creating a new special move is as simple as setting up a new animation state, its behaviours and baking the animator.

Create New Character Edit Scene

Each character has their own edit scene (e.g. the Orc character can be edited in the OrcEditScene).

To create a new character editing scene follow these steps:

  1. Create a new GameObject and add the Character Editor Behaviour to it.
  2. Reference the Animator and CustomAnimatorGraphAsset of the character to be edited.
  3. (Optional) Add the CharacterBase for visual reference.
  4. (Optional) Ensure the Transform component for both the State Editor and CharacterBase GameObjects are in the same position.

N.B.: To scrub an animation, make sure the CustomAnimatorGraphAsset has been imported. When opening an existing scene, it might be necessary to re-link the CustomAnimatorGraphAsset to trigger a refresh before being able to edit it.

Create Bounds, HitBoxes and HurtBoxes

After setting up the edit scene, it is possible to edit, modify and create the Main Bounds, HitBoxes and HurtBoxes for the character.

  • HurtBoxes (Blue): trigger reaction to collisions with HitBoxes.
  • HitBoxes (Red): determine collision area for hits.
  • Main Bounds (Green): control how characters collide against one another.
Fighting Sample, QTASB Setup
Main Bounds, HitBox and HurtBox visualization at EditTime.

N.B.: Before starting to edit, press the “Import Animator” button.

HurtBoxes

Instead of defining collision data for every single frame of the animation, HurtBox Sets are defined. A HurtBox Set is a set of boxes that begin on a particular frame. To adjust existing HurtBoxes at a certain frame -e.g. frame 10-, press Add Hurt Box Set while on frame 10. This will copy the hurt box data from the previous set and then allow adding new or deleting existing HurtBoxes to the set.

HitBox

To define HitBox data, the state being edited needs a QTABAttackStateAsset referenced in its behaviour list.

Main Bounds

Similarly to HurtBoxes, the main bounds collider can be copied between frames as it only changes punctually when the pose of the character model changes.

Back to top