+ All Categories
Home > Documents > Behaviour Trees - Seminar · Behaviour Trees Directed tree Nodes are either composites or leaves...

Behaviour Trees - Seminar · Behaviour Trees Directed tree Nodes are either composites or leaves...

Date post: 29-Aug-2019
Category:
Upload: others
View: 3 times
Download: 0 times
Share this document with a friend
29
Behaviour Trees Seminar Pascal Folleher Universit¨ at Hamburg 27.10.2014
Transcript
Page 1: Behaviour Trees - Seminar · Behaviour Trees Directed tree Nodes are either composites or leaves Root is ticked every time step Pascal Folleher Behaviour Trees 4

Behaviour TreesSeminar

Pascal FolleherUniversitat Hamburg

27.10.2014

Page 2: Behaviour Trees - Seminar · Behaviour Trees Directed tree Nodes are either composites or leaves Root is ticked every time step Pascal Folleher Behaviour Trees 4

Outline

1 Behaviour Trees

2 Extensions

3 vs HFSM

4 Handling Complexity in the Halo 2 AI

Pascal Folleher Behaviour Trees 2

Page 3: Behaviour Trees - Seminar · Behaviour Trees Directed tree Nodes are either composites or leaves Root is ticked every time step Pascal Folleher Behaviour Trees 4

Motivation

Behaviour Trees are reusable=>BTs scale wellBTs are easily authored

Pascal Folleher Behaviour Trees 3

Page 4: Behaviour Trees - Seminar · Behaviour Trees Directed tree Nodes are either composites or leaves Root is ticked every time step Pascal Folleher Behaviour Trees 4

Behaviour Trees

Directed treeNodes are either composites or leavesRoot is ticked every time step

Pascal Folleher Behaviour Trees 4

Page 5: Behaviour Trees - Seminar · Behaviour Trees Directed tree Nodes are either composites or leaves Root is ticked every time step Pascal Folleher Behaviour Trees 4

Behaviour Trees 2

Ticks traverse down towards leavesResults traverse up towards the rootPossible results: Success, Failure, Running

Pascal Folleher Behaviour Trees 5

Page 6: Behaviour Trees - Seminar · Behaviour Trees Directed tree Nodes are either composites or leaves Root is ticked every time step Pascal Folleher Behaviour Trees 4

Composites

SelectorSequenceParallelDecorator

Pascal Folleher Behaviour Trees 6

Page 7: Behaviour Trees - Seminar · Behaviour Trees Directed tree Nodes are either composites or leaves Root is ticked every time step Pascal Folleher Behaviour Trees 4

Selector

Behaves similar to logical ORReturns Success (Running) if any child returnsSuccessReturns Failure if all children return Failure

Pascal Folleher Behaviour Trees 7

Page 8: Behaviour Trees - Seminar · Behaviour Trees Directed tree Nodes are either composites or leaves Root is ticked every time step Pascal Folleher Behaviour Trees 4

Selector 2

?

Evade_Obstacles Find_Path

Pascal Folleher Behaviour Trees 8

Page 9: Behaviour Trees - Seminar · Behaviour Trees Directed tree Nodes are either composites or leaves Root is ticked every time step Pascal Folleher Behaviour Trees 4

Sequence

Behaves similar to logical ANDReturns Success if all children return SuccessReturns Failure (Running) otherwise

Pascal Folleher Behaviour Trees 9

Page 10: Behaviour Trees - Seminar · Behaviour Trees Directed tree Nodes are either composites or leaves Root is ticked every time step Pascal Folleher Behaviour Trees 4

Sequence 2

->

Position_Hand Grasp

Pascal Folleher Behaviour Trees 10

Page 11: Behaviour Trees - Seminar · Behaviour Trees Directed tree Nodes are either composites or leaves Root is ticked every time step Pascal Folleher Behaviour Trees 4

Parallel

Allows parallel execution of behavioursReturns Success if >= S children succeedReturns Failure if >= F children succeedReturns Running in any other case

Pascal Folleher Behaviour Trees 11

Page 12: Behaviour Trees - Seminar · Behaviour Trees Directed tree Nodes are either composites or leaves Root is ticked every time step Pascal Folleher Behaviour Trees 4

Parallel 2

->

->->

Grasp

Position_LeftHand Position_RightHand

Pascal Folleher Behaviour Trees 12

Page 13: Behaviour Trees - Seminar · Behaviour Trees Directed tree Nodes are either composites or leaves Root is ticked every time step Pascal Folleher Behaviour Trees 4

Decorator

Can only have ONE childManipulate return value of childe.g. Inverter, Counter, Timer ...

Pascal Folleher Behaviour Trees 13

Page 14: Behaviour Trees - Seminar · Behaviour Trees Directed tree Nodes are either composites or leaves Root is ticked every time step Pascal Folleher Behaviour Trees 4

Decorator 2?

-> Recharge

!

Battery_Low

Search

Pascal Folleher Behaviour Trees 14

Page 15: Behaviour Trees - Seminar · Behaviour Trees Directed tree Nodes are either composites or leaves Root is ticked every time step Pascal Folleher Behaviour Trees 4

Leaves

ActionsConditionsLeave can be another BT

Pascal Folleher Behaviour Trees 15

Page 16: Behaviour Trees - Seminar · Behaviour Trees Directed tree Nodes are either composites or leaves Root is ticked every time step Pascal Folleher Behaviour Trees 4

Behaviour Tree in Action

?

lefthandgrasp righthandgrasp bothhandgrasp

Pascal Folleher Behaviour Trees 16

Page 17: Behaviour Trees - Seminar · Behaviour Trees Directed tree Nodes are either composites or leaves Root is ticked every time step Pascal Folleher Behaviour Trees 4

Behaviour Tree in Action 2

First Experiment (0:00 - 1:15)http://www.youtube.com/watch?v=kEd2YxysBtI

Pascal Folleher Behaviour Trees 17

Page 18: Behaviour Trees - Seminar · Behaviour Trees Directed tree Nodes are either composites or leaves Root is ticked every time step Pascal Folleher Behaviour Trees 4

Behaviour Tree in Action 3

->

squatdown positionarm grasp

Pascal Folleher Behaviour Trees 18

Page 19: Behaviour Trees - Seminar · Behaviour Trees Directed tree Nodes are either composites or leaves Root is ticked every time step Pascal Folleher Behaviour Trees 4

∼Decorator

used to synchronize actions with other agentsone agent broadcasts intended bevahiourother agents can respond if interested

Pascal Folleher Behaviour Trees 19

Page 20: Behaviour Trees - Seminar · Behaviour Trees Directed tree Nodes are either composites or leaves Root is ticked every time step Pascal Folleher Behaviour Trees 4

Parametrized Behaviour Trees

Subtrees can be parametrizedSmartEvents contain parametrized Behaviour TreeAgents involved in SmartEvent will execute the BTonce, then restart personal BT

Pascal Folleher Behaviour Trees 20

Page 21: Behaviour Trees - Seminar · Behaviour Trees Directed tree Nodes are either composites or leaves Root is ticked every time step Pascal Folleher Behaviour Trees 4

HFSM

Large FSM can be hard to handleHSFM allows to use FSM as nodes...... but still has the same problems

Pascal Folleher Behaviour Trees 21

Page 22: Behaviour Trees - Seminar · Behaviour Trees Directed tree Nodes are either composites or leaves Root is ticked every time step Pascal Folleher Behaviour Trees 4

HFSM Example

Init

Leave

ShowOBJ

Idle

ThatIs

Wrong Right

NotOk OkThanksBye

Listen

Init

ShutDown

StartClassify

Leave

IThink

Pascal Folleher Behaviour Trees 22

Page 23: Behaviour Trees - Seminar · Behaviour Trees Directed tree Nodes are either composites or leaves Root is ticked every time step Pascal Folleher Behaviour Trees 4

Implicit vs Explicit State Transitions

BT state transition similar to procedure call(H)FSM state transition similar to GoTo

Pascal Folleher Behaviour Trees 23

Page 24: Behaviour Trees - Seminar · Behaviour Trees Directed tree Nodes are either composites or leaves Root is ticked every time step Pascal Folleher Behaviour Trees 4

General Ideas

Behaviour Trees are shared between charactersCharacters have a memory pool (e.g. GrenadeCooldown)Bitvectors represent characters world-knowledge andcan lock behaviours

Pascal Folleher Behaviour Trees 24

Page 25: Behaviour Trees - Seminar · Behaviour Trees Directed tree Nodes are either composites or leaves Root is ticked every time step Pascal Folleher Behaviour Trees 4

Impulses & Stimuli

Impulses reference other parts of BTStimuli are inserted into BT when certain eventshappenBecause of priority sorting stimuli only interruptcertain behaviours

Pascal Folleher Behaviour Trees 25

Page 26: Behaviour Trees - Seminar · Behaviour Trees Directed tree Nodes are either composites or leaves Root is ticked every time step Pascal Folleher Behaviour Trees 4

Orders

Orders group Firing PositionsOrders are assigned to SquadsTrigger (e.g. Squadleader died) may assign newOrders

Pascal Folleher Behaviour Trees 26

Page 27: Behaviour Trees - Seminar · Behaviour Trees Directed tree Nodes are either composites or leaves Root is ticked every time step Pascal Folleher Behaviour Trees 4

Styles

Styles can be assigned to OrdersStyles can block certain behaviours (e.g. aggressivestyle prevents fleeing behaviour)

Pascal Folleher Behaviour Trees 27

Page 28: Behaviour Trees - Seminar · Behaviour Trees Directed tree Nodes are either composites or leaves Root is ticked every time step Pascal Folleher Behaviour Trees 4

The End

Thank you for your attention.Any questions?

Pascal Folleher Behaviour Trees 28

Page 29: Behaviour Trees - Seminar · Behaviour Trees Directed tree Nodes are either composites or leaves Root is ticked every time step Pascal Folleher Behaviour Trees 4

Michele Colledanchise and Petter Ogren.How behavior trees modularize robustness and safety in hybrid systems.In Intelligent Robots and Systems (IROS), 2014 IEEE/RSJ International Conference on. IEEE, 2014.

Damian Isla.Handling Complexity in the Halo 2 AI.In Game Developers Conference, Mar 2005.

A. Johansson and P. Dell’Acqua.Emotional behavior trees.In Computational Intelligence and Games (CIG), 2012 IEEE Conference on, pages 355–362, Sept 2012.

Chong-U Lim, Robin Baumgarten, and Simon Colton.Evolving behaviour trees for the commercial game defcon.In Proceedings of the 2010 International Conference on Applications of Evolutionary Computation - Volume Part I,EvoApplicatons’10, pages 100–110, Berlin, Heidelberg, 2010. Springer-Verlag.

A. Marzinotto, M. Colledanchise, C. Smith, and P. Ogren.Towards a unified behavior trees framework for robot control.In Robotics and Automation (ICRA), 2014 IEEE International Conference on, pages 5420–5427, May 2014.

Petter Ogren.Increasing Modularity of UAV Control Systems using Computer Game Behavior Trees.Guidance, Navigation, and Control and Co-located Conferences. American Institute of Aeronautics and Astronautics,Aug 2012.

Pascal Folleher Behaviour Trees 29


Recommended