Skip to content

Behaviour Tree

Warhammer 40,000: Space Marine 2 AI uses the Behaviour Tree technology. All behaviour trees are executed on the server side.

Each tree node returns a result: it is either success or failure.

  • Selector executes branches from left to right until one succeeds.
  • Sequence executes branches from left to right until one fails.
  • Active selector works like a Selector, but branches to the left of the currently active branch can request execution. For example: got enemy > stop patrolling and engage this enemy.

Behaviour trees use blackboards — the sets of variables to works with. These variables are:

  • Parameters, such as cooldown length, fighting range, etc.
  • Values passed from external sources, such as an enemy.

Nodes obtain the information from providers. For example, the Shoot Target node has the Target field of the Object type. In the tree, this field is set to Object Provider: Current Enemy, which provides the node with information about which target to shoot.


Warhammer 40,000: Space Marine 2 © Games Workshop Limited 2024. Space Marine, the Space Marine logo, GW, Games Workshop, 40K, Warhammer, Warhammer 40,000, 40,000, the 'Aquila' Double-headed Eagle logo, and all associated logos, illustrations, images, names, creatures, races, vehicles, locations, weapons, characters, and the distinctive likeness thereof, are either ® or TM, and/or © Games Workshop Limited, variably registered around the world, and used under licence. Focus Entertainment and its logos are trademarks, registered or not, of Focus Entertainment. Saber Interactive and its logos are trademarks, registered or not, of Saber Interactive. Powered by Wwise © 2006 – 2024 Audiokinetic Inc. Havok software is © 2024 Microsoft. Uses Bink Video. Copyright © 1997-2024 by Epic Games Tools LLC. All rights reserved to their respective owners.