Skip to main content

Berniebrain

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

Overview

BernieBrain is a behavior tree-based AI controller for the "Big Bernie" entity. It handles dynamic transitions between states such as transforming into Big Bernie mode when near a qualifying player, taunting nearby sanity-based enemies to shift their aggro, following a designated leader, and default wandering behavior. It interacts with the combat, sanity, and timer components to make context-aware decisions.

Usage example

This component is added automatically to the prefab during initialization. Modders typically do not instantiate it directly but can inspect or extend it. A typical usage in a prefab file might be:

inst:AddBrain("berniebrain")
inst.components.sanity.dotters = true -- Enables sanity monster attraction logic

Note: The actual usage is internal to the game engine and handled by inst:AddBrain("berniebrain").

Dependencies & tags

Components used: combat, sanity, timer Tags: Checks tags like shadowcreature, _combat, locomotor, INLIMBO, notaunt, bernieowner; does not add or remove tags itself.

Properties

PropertyTypeDefault ValueDescription
_targetstable (of Entities) or nilnilList of tauntable shadow creatures currently in range.
_leaderEntity or nilnilThe player entity currently recognized as the leader for following/transforming.

Main functions

OnStart()

  • Description: Initializes the behavior tree for Bernie. Constructs a priority-based root node that evaluates conditions in order: Go Big (transform), taunt, check for leader presence, follow leader, or wander.
  • Parameters: None.
  • Returns: Nothing.
  • Error states: None identified; requires the instance to have inst.sg, inst.components.timer, and support the GoBig(leader) function.

Events & listeners

  • Listens to: None identified.
  • Pushes: None identified.