Boatrace Spectator Dragonlingbrain
Based on game build 714014 | Last updated: 2026-02-27
Overview
This brain component defines the behavior tree for a spectator dragonling entity during the Boat Race event. Its primary responsibility is to make the dragonling follow and face the "indicator" entity (the moving boat or race marker) while avoiding interfering with flight-related states. It inherits from Brain and constructs a priority-based behavior tree that executes Follow and FaceEntity actions concurrently, using tunable distance parameters. The component relies on the EntityTracker component to locate the indicator entity by name.
Dependencies & Tags
- Components used:
entitytracker: Used to retrieve the "indicator" entity viaGetEntity.behaviours/follow: Provides theFollowbehavior function.behaviours/wander: Listed in file require but not used in this brain.
- Tags: None identified.
Properties
| Property | Type | Default Value | Description |
|---|---|---|---|
inst | Entity | (inherited) | The entity instance the brain is attached to. |
UPDATE_RATE | number | 0.25 | Time interval (in seconds) between behavior tree updates. |
Main Functions
BoatraceSpectatorDragonlingBrain:OnStart()
- Description: Initializes the behavior tree for the dragonling. Sets up a priority node that blocks behavior updates while the entity is flying (
flightstate tag), and otherwise runs two concurrent behaviors:Follow(to chase the indicator entity) andFaceEntity(to orient toward it). Called automatically when the state graph transitions to the brain's active state. - Parameters: None.
- Returns:
nil.
Events & Listeners
None.
Implementation Notes
- The
SpectatingBoatracehelper function usesinst.components.entitytracker:GetEntity("indicator")to resolve the target entity. If the "indicator" entity is not tracked, this will returnnil, potentially causing the follow behavior to fail gracefully. - The behavior tree uses
FailIfSuccessDecoratorwith aConditionWaitNodeto suspend updates when the entity is in a flying state. This ensures the dragonling does not attempt to move or reorient while in flight. - Distance parameters for
Followare sourced fromTUNING.BOATRACE_SPECTATOR_TARGET_DISTANCE,TUNING.BOATRACE_SPECTATOR_MAX_DISTANCE(used twice — for start and max separation), and are expected to be defined in the game's tunable constants.