Skip to main content

Brightmare Gestaltbrain

Based on game build 714014 | Last updated: 2026-03-03

Overview

GestaltBrain is the behavior tree brain for the Brightmare Gestalt boss entity. It implements layered combat logic based on behaviour_level, dynamically switching between fleeing from shadows, avoiding players, facing/charging at players, and retreating when in combat cooldown. The brain uses behavior tree nodes (PriorityNode, WhileNode, SequenceNode, ActionNode, IfNode) to evaluate threats and select appropriate actions via a priority-ordered hierarchy. It depends on the combat component to manage targeting and the locomotor component to halt movement when necessary.

Usage example

This brain is automatically assigned to the Brightmare Gestalt prefab and does not need manual instantiation. Typical integration is handled in the prefab definition:

inst:AddBrain("brightmare_gestaltbrain")

The brain dynamically responds to changes in inst.behaviour_level and external events such as droppedtarget.

Dependencies & tags

Components used: combat, locomotor
Tags: Uses oneoftags group "SHADOW_TAGS" (includes nightmarecreature, shadowcreature, shadow, shadowminion, stalker, stalkerminion, nightmare, shadow_fire) for avoidance logic.

Properties

PropertyTypeDefault ValueDescription
inst._ignorerelocatingbooleannilIf set to true, disables relocation logic.
inst.tracking_targetentity or nilnilTracks current target; relocation is skipped if a player is nearby.
inst.behaviour_levelnumber1Controls behavior behavior layer (1 = fleeing players, 2 = cautious aggression, 3 = aggressive chase).

Main functions

OnStart()

  • Description: Initializes the behavior tree. Creates a root PriorityNode that evaluates state tags and behavior level to select actions such as relocate, flee shadows/players, stand and attack, chase and attack, or wander.
  • Parameters: None.
  • Returns: Nothing.
  • Error states: Relies on external components (combat, locomotor) being attached to self.inst; behavior fails if components are missing.

Events & listeners

  • Listens to: No events registered directly; behavior reacts to combat component state (e.g., combat.target) and internal stategraph state tags (e.g., busy, jumping).
  • Pushes: None directly; delegates to stategraph transitions (e.g., relocate state via inst.sg:GoToState("relocate")).