
This segment is a key challenge area in CrowdRunner. When the player enters its trigger zone, it spawns a group of BP_Enemy
units and initiates a battle, commanding both its enemies and the player's followers to a central clash point. It also manages the lifecycle of this battle, determining when all its enemies are defeated. Parent Class: BP_BaseGroundSegment
.
Components
- FlatGround: (Inherited from
BP_BaseGroundSegment
) The main ground mesh for this segment.
- BattleAudioComp: (AudioComponent) Plays battle-related audio (e.g., looping battle music/ambience). Auto Activate is likely off, controlled by battle state.
- BattleTriggerVolume: (BoxCollision or SphereCollision) A trigger volume that, when overlapped by the player, initiates the battle sequence for this segment.
- Enemy: (SceneComponent) Acts as a reference point or general spawn origin area for the
BP_Enemy
units within this segment.
- R_GroundBoundary, L_GroundBoundary: (Inherited or specific meshes/collision) Define the side boundaries of the segment.
- Generator: (Inherited from
BP_BaseGroundSegment
, BoxCollision) Trigger at the end of the segment to signal the Game Mode to spawn the next track piece.
- Spawn_Point: (Inherited from
BP_BaseGroundSegment
, SceneComponent/ArrowComponent) Marks where the next segment should connect.
- EnemyCounterWidgetComponent: Displays the UI for this segment's enemy count (icon + number).
Functions
RefreshEnemyGroupCountDisplay
: Updates this segment's EnemyCounterWidgetComponent
with the correct enemy icon (EnemyGroupIconTexture
) and the current number of enemies (length of the SpawnedEnemies
array).
Key Variables for Configuration
EnemiesToSpawn
(Integer):
- Default: 0 (but calculated in BeginPlay).
- What it does: Determines the number of
BP_Enemy
units this segment will spawn. (Currently calculated based on player's follower count / 2).
- Why change it: Directly impacts the difficulty of this enemy encounter. A user could change the calculation in BeginPlay or expose a Min/Max range here.
CheckBattleStatusInterval
(Float):
- Default: 0.5
- What it does: How often (in seconds) the segment checks if all its spawned enemies have been defeated.
- Why change it: Lower values mean a quicker response once the last enemy dies but more frequent checks. Higher values are more performant but have a slight delay in recognizing battle end.
EnemyGroupIconTexture
(Texture 2D):
- Default: T_Enemy (as seen in HUD category)
- What it does: The icon displayed on this segment's enemy counter UI.
- Why change it: Customize UI visuals for different enemy groups or factions if you expand.
BattleForceStrength
(Float, within BP_Enemy
but relevant):
- Although this variable is in
BP_Enemy
, the type of enemies spawned by this segment and their aggression (controlled by their force strength) is a key aspect of this segment's design.
- Sound Cues/Audio Components (e.g.,
BattleAudioComp
sound):
- What it does: Defines the ambient audio or music for battles in this segment.
- Why change it: Customize the atmosphere of encounters.