ReadMe - How Tos

Controls and Cheats

Controls

Action

Description

W, A, S, D

Movement Controls

Q, E

Switch Between Defend Type Minion And Attack Type Minion

Space (Hold)

Active Reticle

1 through 0

Switches Minion Group (The Group You Will Spawn Your

Minions In. Each Type Has 10 Groups)

1 through 0 (Hold)

Highlights Minions In That Group

Left Click

Spawns Minions

Right Click

Gives Minions Of A Type And Group A Path

F (Hold) Then Left Click

Adds sequential paths (If Attack Unit Is Selected

Becomes Control Points)

ESC

Brings Up In Game Menu

Cheat Codes

Action

Description

Control N

Kills The Player

M

Brings Up Memory Usage Profiler

,

Brings Up Debug Lines

.

Turns Off Debug Lines

How To Use Behavior Tree System

Behavior Tree Editor

To use the behavior tree editor first select the “Node Graph” tab. The behavior tree editor can open or create new behavior trees. Press the open button to display a list of behavior trees on disk. Press “Clear Graph” button at the top of the window in order to clear away currently displayed graph.

To rename the current tree you are working on you can change its name in the blue box with the tag “Graph Name” at the top of the screen. Type in the desired new name and make sure to press enter when done typing in the name.

“Agents” Button - Shows a list of gameobjects that are using a behavior tree. If an agent from the list is selected then the graph of that agent will appear in the node editor.

NOTE: this also clears away any graph that was previously being displayed.

This agent selection is also available while playing the game (in the editor), you can select one of the agents/npcs using a behavior tree and see in real time what part of the tree they are in (the behavior will glow green).

NOTE: while working with graphs YOU MUST save them before running the game IF you want to see which behaviors the npc is actually working with at any moment in time.

NOTE BUG: If selecting an item from drop down menu, make sure spacebar is not pressed the exact moment when you click on one of the agents in the drop down menu, otherwise a new player squad will be spawned.

Right click on the square grid to display a node creation popup. This popup gives the option to either create a new node or save the current graph. If the “Create Node” option is chosen it will display a menu showing a list of behaviors that can be created. Once a behavior is selected from the menu, it will be created on screen.

Each node in the behavior tree editor by default contains a small blue box that displays what type it is. The three types it can display are “Composite”, “Leaf”, or “Decorator”.

To create a tree the following rules must be followed:

  • Make sure leaf nodes do not have any child nodes.

  • Make sure decorator nodes have only one child node.

  • Make sure any composite node has at least one child node.

To link nodes together to create a tree you simply right click on which node you want to be the parent node, then select the “link” option which displays a menu of nodes that can become a child of the right clicked node. Once selected, the child node which be attached to parent node.

NOTE: the order in which nodes are linked to a parent matters for composite nodes.

Behaviors and the Behavior Tree System

In order to use the behavior tree system here are some rules:

  1. In order for an npc to use a behavior tree you must first create an Agent component in the inspector window. Then inside that component there will be a drop down menu of trees to select.

  2. Writing new behaviors.

    For any behavior you write in c++ please contact me first. Behaviors are essentially a set of instructions that an npc looks at and interacts with. Behaviors do NOT have any state. Since many agents are using the exact same behavior trees in memory, any state that you want to keep track of goes either in the Blackboard or the BehaviorTask.

    Blackboard

    • A container whose key is a string and its storage type can be literally anything. Used by npcs to keep track of their own personal data.

    BehaviorTask

    • Accessed in behavior by GetTask(). BehaviorTask is essentially an object that links an npc to a behavior tree. Any phase that the npc is in, or the results of an npc’s action is stored in here.

    The general setup is this:

    Behaviors have function called tick(). tick - updates npc using behavior.

    4 npc phases:

    1. Starting - npc just started using behavior

    2. Progressing - npc is in the middle of completing a behavior.

    3. Waiting - npc is waiting to resume behavior

    4. Done - npc is done with behavior

    3 behavior results:

    1. RUNNING - behavior is still being run by agent

    2. FAILURE - agent failed while using behavior

    3. SUCCESS - agent succeeded while using behavior

    3 functions to override:

    1. Init - not required to override. By default it sends the task down to the child behavior.

    2. Update - must override. Here is where a behavior will interact with an npc every frame. When behavior is done set BehaviorTask’s phase to BehaviorPhase::Done.

    3. Exit - not required to override. By default the task is sent back to the parent behavior in the BehaviorTree.

Squads

All player minions and enemies are automatically grouped into squads. Enemy squads have a maximum of 9 units.

All squads have a squad leader which is colored yellow or has a duck texture on it.

If a squad leader dies then another unit automatically becomes the leader.

Squads have a certain detection radius. If any hostile unit is within this radius the squad members will rush towards the enemy.

Memory Systems Debugging

To see runtime memory-debug information (details live allocation counts and memory usage for several components), press and hold the “m” key while playing the game. This will not list all components, but rather a handful it has sampled from the memory manager.

Format for debug output

componentName   Alloc Count: _    Memory used: _

memory used is total memory used by combination of all allocated examples of the component “componentName”. Alloc count is how many allocations that memory consists of.

Node Graph Editor

  • To create a node right click the graph and choose Create.

  • To connect nodes, left click a output or input and while holding left click, draw a line to either the output or input of a node.

  • To disconnect hold left alt and left click a circle.

  • To name the graph, enter a name at the top of the graph in the input field.

  • To save a graph press the Save Graph Button.

  • To open a graph press the Open Graph Button.

  • To validate a graph right click the graph and click Validate.

  • If data is inside a node, you can modify the fields.

Waypoint Walkthrough

Select the space you want to create your pathing blockers in. If you’re using a new scene, use Unnamed_space_1. Create a new game object, and attach a Waypoint Node Set component to it.

_images/NewObject.JPG

Increase the scale of the object. Then, set each Node value in the Waypoint Node Set component. The order in the editor should be counter clockwise around the object, and the X and Z values should be .5 larger than the X and Z scales of the object.

_images/NodeSetValues.JPG

To see the current object parameter, go to Graphics tab and click Show Debug Lines. Then, go to the Tools tab and click Generate Node Set Path.

_images/ShowDebugLines.JPG _images/GeneratePath.JPG

Now you can see the path of a single object. Create more objects like this and move them around the scene. When you click Generate Node Set Path again, you will see them stitch together if they intersect. It is advised to press Clear between every set path generation.

_images/Merge.JPG

Create two objects with testingScript attached to them. Position them away from each other, with object parameters in between. Press Generate Node Set Path, then press Find Path. This will show an optimal path from one object to another.

_images/PathFind.JPG

Particle System

Property

Description

emitterShape

allows you to choose the shape of the emitter

Types

Torus, Cone, FireWork, Heart, Sphere, Angle Ring, Circle

Angle

the angle of the for the slope.

Arc

the length of the range arc, in degrees.

BatchCount

it’s counting efficiency of the particle.

BatchSize

how many particles will be created.

Interval

specify the time between the first particle and the last particle.

isTourusRan

the random valuation for the circling the shape.

LifeMax

the maximum lifetime for the particle.

LifeMin

the minimum lifetime for the particle.

MaxParticle

maximum particles will be generated at once.

On

switch for turn on/off the particle.

Radius

basic radius for the circle that uses most of the shapes.

SizeMax

the maximum size for the particle.

SizeMin

the minimum size for the particle.