Components

Overview

All components follow the same lifecycle pattern: created in the constructor via UCInitializerComponent::prepare_CSTR_*, initialized at runtime via init() with a UCActorInformation*, and reset via reset(). Dynamic delegate binding/unbinding is managed through boundDynamic() / unboundDynamic().

UCInitializerComponent

Central orchestrator. Created first, it drives the initialization cascade for all other components. Provides static prepare_CSTR_* methods for constructor-time creation and an init(advIdx) interface method for runtime initialization.

Name Description
commonDetailInformation Runtime UCActorInformation reference shared across all components
actorId Actor identifier (advIdx from the spawner)
prepare_CSTR_CACTOR_ONLY Static: creates components for ACActor
prepare_CSTR_CPAWN_ONLY Static: creates components for ACPawn
prepare_CSTR_CCHARACTER_ONLY Static: creates components for ACCharacter
prepare_CSTR_CPROJECTILE_ONLY Static: creates components for ACProjectile
complete_CSTR_CPLAYER_FIRST_PERSON_ONLY Static: adds player-specific components (camera, spring arm, input, FOW, minimap, compass)
complete_CSTR_CPLAYER_FLY_PAWN_ONLY Static: adds fly-pawn-specific components
init Interface: initializes all components from a DataTable row (advIdx) or player maker (advIdx=-1)
resetAll Interface: resets all components to their initial state
// Constructor-time: prepare_CSTR_* creates all components for the base class.
UCInitializerComponent::prepare_CSTR_CCHARACTER_ONLY(this);

// Player classes call complete_CSTR_* to add camera, input, etc.
UCInitializerComponent::complete_CSTR_CPLAYER_FIRST_PERSON_ONLY(this,
    cameraInit, cameraTick, cameraReset,
    springArmInit, springArmTick, springArmReset);

// Runtime: init(advIdx) cascades to all components.
// advIdx == -1 means player (reads from PlayerSpawner).
// advIdx >= 0 means NPC/actor (reads from ActorSpawner).
ICInitializerComponent_::Execute_init(component, advIdx);

UCLifeComponent

Health and damage management. Extends UWidgetComponent to display a life bar. Listens to OnTakeAnyDamage, applies armor reduction, triggers damaged/killed animations and skills.

Name Description
currentLife Current health points
maxLife Maximum health points (from FCCharacterDetailMaker::baseLife)
internalOnTakeADamage Damage reception: computes armor, triggers damaged skill and animation
whatIfDeath Death sequence: triggers death skill, plays killed montage, enables ragdoll, disables collision
definitiveDeath Marks the actor as killed, broadcasts onKilled
// Damage flow:
// 1. OnTakeAnyDamage fires
// 2. UCDamageReceptionContainer is created with damage, armor, etc.
// 3. executeDamagedSkill is consumed
// 4. Damaged animation plays if damage > 0
// 5. currentLife is reduced
// 6. If currentLife <= 0, whatIfDeath() triggers death sequence

// Death sequence:
// 1. executeDeathSkill is consumed
// 2. Killed montage plays
// 3. After 50% of anim: collision disabled, ragdoll enabled
// 4. After 200% of anim: physics disabled, skeleton frozen

UCInteractionComponent

Capsule-based overlap interaction system. Extends UCapsuleComponent. Manages begin/end overlap events, closest-interactable selection, team-based filtering, and skill consumption on interaction.

Name Description
actorToInteractWith Currently overlapping actor eligible for interaction
selectionMode LAST_OVERLAPED_PRIORITY or CURRENT_OVERLAP_PRIORITY
executeInteraction Triggers the executeInteractionSkill on the target
canInteractWith Checks activation, team attitude, player-only flag, dynamic canInteract delegate
myGetGenericTeamId Returns the team ID from FCCharacterDetailMaker::teamId
myGetTeamAttitudeTowards Computes attitude: same team = Friendly, no team = Neutral, else Hostile
// Interaction flow:
// 1. OnBeginOverlap: finds closest interactable, checks canInteractWith
// 2. Consumes beginOverlapInteractionSkill
// 3. On explicit interaction (E key): consumes executeInteractionSkill
// 4. OnEndOverlap: consumes endOverlapInteractionSkill, finds next closest

// Team attitude logic:
// NoTeam (255) on either side => Neutral
// Same team => Friendly
// Different teams => Hostile

UCCombotterComponent

Combat system with three state machines: melee attack (combo), range attack (bow), and block. Uses CSimpleStateMachine from CCOREUMODULE. Drives montage playback and damage application.

Name Description
proceedAttack Starts a melee attack combo sequence
proceedStartRangeAttack Starts drawing the bow (range attack)
proceedEndRangeAttack Releases the bow
proceedStartBlock Starts blocking
proceedEndBlock Ends blocking
isBlocking Returns true if currently in blocking state
isAttacking Returns true if currently in attacking state
collisionTestIfAttack Sphere sweep to detect hittable actors considering team attitude
whatIfHitMelee Applies melee damage to hit actors via TakeDamage
whatIfProjectileLaunch Spawns a projectile actor with speed from bend-time curve
// Melee attack state machine:
// S_NOT_ATTACKING -> (user click) -> S_ATTACKING -> (montage end) -> S_ATTACK_FINISHED
//                                 -> (can combo) -> S_COMBO_WINDOW -> (user click) -> S_ATTACKING

// Range attack state machine:
// S_BOW_NOT_DRAWING -> S_PREPARE_BOW_DRAW -> S_BOW_DRAWING -> S_BOW_SHOT -> S_ATTACK_FINISHED

// Block state machine:
// S_NOT_BLOCKING -> S_PREPARE_BLOCKING -> S_BLOCKING -> (end block) -> S_NOT_BLOCKING

UCSelectComponent

Decal-based selection indicator. Extends UDecalComponent. Supports permanent selection and temporary (hover) selection. Decal size adapts to the mesh bounds.

Name Description
select / deselect Toggle permanent selection
toggleTempSelected Toggle temporary (hover) selection
deselectAllBut Static: deselects all actors in the world except specified ones
retrieveAllSelectedActorBut Static: returns all permanently selected actors
retrieveTemporarySelectedActorBut Static: returns the temporarily selected actor
UCSelectComponent::deselectAllBut(GetWorld());
UCSelectComponent::retrieveAllSelectedActorBut(GetWorld());

UCSkillComponent

Skill list management and skill widget display. Maintains a currentSkillArray of FName skill identifiers. Broadcasts onSkillListChange when skills are added or removed.

Name Description
currentSkillArray Active skill list
addSkill / removeSkill Add or remove a skill by name
runSkill Triggers a skill by index via the skill widget
displaySkillWidget Creates and displays the skill dock widget
removeSkillWidget Removes the skill widget from viewport
skillComponent->addSkill(FName("Fireball"));
skillComponent->removeSkill(FName("Fireball"));
skillComponent->runSkill(0); // trigger first skill via widget

UCActionMappingComponent

Enhanced Input action mapping system. Creates a default UInputMappingContext at runtime with all standard game actions, binds them to the owning pawn’s ICInputReceiver interface, and spawns the mobile widget on mobile platforms.

Name Description
inputActionMap Map of ECInputActionType to UInputAction*
createDefaultInputAction Creates the default input mapping context with all actions
setup Binds all actions to the UEnhancedInputComponent and registers the mapping context
retrieveKey Returns the first key mapped to a given action type
init Spawns the mobile widget if running on mobile
// ECInputActionType enum values:
// MOVE, ROTATE, JUMP, TOUCH_CLICK, LMB_CLICK, CTRL_LMB_CLICK, RMB_CLICK,
// TOUCH_PINCH, SCROLL, CTRL_SCROLL, BLOCK, INTERACT, CHANGE_VIEW,
// DISPLAY_RESOURCE, DISPLAY_MAP

// Default key bindings:
// MOVE: ZQSD / Arrow keys / Gamepad Left Stick
// ROTATE: Mouse XY / Gamepad Right Stick
// JUMP: SpaceBar
// LMB_CLICK: Left Mouse Button
// INTERACT: F
// BLOCK: Tab
// CHANGE_VIEW: V
// DISPLAY_RESOURCE: I
// DISPLAY_MAP: M

ICInputReceiver

Interface implemented by pawns to receive input events from UCActionMappingComponent.

Name Description
moveEvent FCInputStruct<FVector2D> for movement input
rotateEvent FCInputStruct<FVector2D> for rotation input
jumpEvent FCInputStruct<bool> for jump
touchEvent FCInputStruct<bool> for touch (mobile)
LMBEvent FCInputStruct<bool> for left mouse button
ctrlLMBEvent FCInputStruct<bool> for Ctrl+LMB
RMBEvent FCInputStruct<bool> for right mouse button
pinchEvent FCInputStruct<float> for pinch (mobile)
scrollEvent FCInputStruct<float> for mouse wheel
alternativeScrollEvent FCInputStruct<float> for Ctrl+scroll
blockEvent FCInputStruct<bool> for block
interactEvent FCInputStruct<bool> for interact
changeViewEvent FCInputStruct<bool> for perspective change
displayResourceEvent FCInputStruct<bool> for resource inventory
displayMapEvent FCInputStruct<bool> for map toggle
cleanAllInputEvent Resets all event callbacks to no-op
// Each FCInputStruct<T> provides 5 callbacks:
// onTriggered, onStarted, onGoing, onCanceled, onCompleted
// Signature: (T value, float elapsedSec, float triggeredSec, const UInputAction*)

moveEvent.onTriggered = [this](FVector2D v, float e, float t, const UInputAction*) {
    AddMovementInput(GetActorForwardVector(), v.X);
    AddMovementInput(GetActorRightVector(), v.Y);
};

UCAIPerceptionStimuliSourceComponent

AI perception stimuli source that registers/unregisters with the perception system based on actor activation state. Extends UAIPerceptionStimuliSourceComponent, implements ICActorBoundable.

Name Description
commonDetailInformation Shared UCActorInformation reference
init Registers for UAISense_Sight, binds to actor events
reset Registers or unregisters from perception based on activated state
onActorEvent Re-evaluates registration when actor status changes
// Requires in DefaultGame.ini:
// [/Script/AIModule.AISense_Sight]
// bAutoRegisterAllPawnsAsSources=false

// Automatically managed by UCInitializerComponent lifecycle

UCAutomationComponent

Automation command sequencer. Reads FCAutomationStruct from the character maker and exposes a circular command queue via ICAutomationComponent_.

Name Description
automation UCAutomation object holding the command array
init Parses automationStructArray from maker into typed commands
read Returns the current command as TPair<FName, FCVariantType>
next Advances to the next command (circular)
isEmpty Returns true if no commands are defined
// UCAutomation stores commands as (FName, FCVariantType) pairs
// Supported commands: LOCATION (FName), WAIT (float)
// The AI behavior tree reads commands via ICAutomationComponent_ interface

UCCameraComponent

Camera component with custom init/tick/reset callbacks. Extends UCameraComponent.

Name Description
customInit Lambda called during init()
customTick Lambda called each TickComponent()
customReset Lambda called during reset()
// Callbacks are set by UCInitializerComponent::complete_CSTR_CPLAYER_FIRST_PERSON_ONLY
// providing player-specific camera behavior

UCCapsuleComponent

Collision capsule auto-sized from the skeletal mesh bounds. Extends UCapsuleComponent, implements ICCapsuleComponent_.

Name Description
init Sets collision profile to Pawn, computes capsule size from skeletal mesh bounds, adjusts actor transform for half-height offset
// Capsule radius = max(X, Y extent) * 0.25
// Capsule half-height = Z extent * 0.5
// Also considers skeletalMeshChildArray for modular characters

UCCharacterMovementComponent

Character movement with jump state machine. Extends UCharacterMovementComponent, implements ICCharacterMovementComponent_.

Name Description
defaultMaxWalkSpeed Base walk speed from maker
stateMachineMap Jump state machine (M_JUMP)
init Sets walk speed, step height, acceleration for paths, jump velocity
updateSpeed Multiplies walk speed and braking by a factor
proceedStartJump Triggers jump via state machine event
proceedEndJump Ends jump via state machine event
// Jump state machine:
// S_NOT_JUMPING -> (E_USER_CLICK_START_JUMP && !blocking && !attacking) -> S_JUMPING
// S_JUMPING -> (E_USER_CLICK_END_JUMP) -> S_NOT_JUMPING

movementComponent->updateSpeed(1.5f); // 150% speed

UCCompassComponent

3D compass widget that tracks activated actors on screen. Shows direction, distance and alpha-based closest indicator. Hides in top-view perspective.

Name Description
compassWidgetClass Widget class from coordinator (W_COMPASS)
dataMap Map of advIdx to mainTag for tracked actors
init Populates dataMap from actormaker, binds to actor and perspective events
proceedWithTick Each tick: projects actor positions to screen, computes alpha, sends data to widget
onActorEvent Adds/removes actors from tracking based on status
onPerspectiveTypeChange Hides compass in TOP_VIEW, shows in FIRT_VIEW
// Automatically managed by UCInitializerComponent lifecycle
// Tracks all activated actors that have character metadata
// Sends per-actor data to the compass widget each tick:
// position, distance, alpha, z-order, visibility

UCFloatingMovementComponent

Floating pawn movement with ground-following via line trace. Extends UFloatingPawnMovement.

Name Description
capsuleComponent Reference to the owning capsule for height offset
init Sets max speed from maker, stores capsule reference
TickComponent Line traces from top to bottom of capsule, snaps actor to ground
// Used for flying/floating pawns that need to follow terrain
// MaxSpeed is set from maker.maxWalkSpeed * scale

UCFOWComponent

Fog of War renderer. Draws view and revealed areas to render targets using material brushes. Supports actor agents, room agents and complex raycasting for line-of-sight.

Name Description
brush Dynamic material for view area drawing
brushRevealed Dynamic material for revealed area drawing
fowActorAgentArray Array of advIdx whose vision contributes to FOW
fowRoomAgentArray Array of (clusterId, roomId) pairs for room-based reveal
init Creates brush materials, sets tick interval from maker
addFOWActorAgent / removeFOWActorAgent Manage actor vision agents
addFOWRoomAgent / removeFOWRoomAgent Manage room reveal agents
whatToDoInViewArea Draws view circles for all agents on the view render target
whatToDoInRevealedArea Draws revealed area with optional complex ray line-of-sight
// FOW is tick-driven, refresh rate from maker.fogOfWarRefreshRate
// Complex ray mode: casts rays in a circle to detect occlusion
// Simple mode: draws a single brush circle for revealed area

UCMinimapComponent

Top-down scene capture for minimap rendering. Extends USceneCaptureComponent2D.

Name Description
minimapWidget Reference to the spawned minimap widget
zDistance Capture height above actor (default 10000)
init Spawns minimap widget, retrieves render target
reset Configures show flags (disables most rendering features for clean top-down capture)
// Captures FinalColorLDR with most visual features disabled
// Only Translucency is enabled (for fog of war overlay)
// Widget provides the render target via ICMinimapWidget_::currentMinimapData

UCNavigationInvokerComponent

Dynamic navigation mesh generation around the actor. Extends UNavigationInvokerComponent, implements ICActorBoundable.

Name Description
init Sets generation radii from maker.navigationRadius * scale
reset Activates/deactivates based on actor activation state
onActorEvent Re-evaluates activation when actor status changes
// Generation radius = navigationRadius * 1.0 * scale * 0.5
// Removal radius = navigationRadius * 1.7 * scale * 0.5
// Deactivated actors don't generate navmesh

UCProjectileMovementComponent

Projectile movement with optional bend-time-to-speed curve. Extends UProjectileMovementComponent.

Name Description
bendTimeToSpeed Optional UCurveFloat: maps bend time (seconds) to speed (m/s)
// Used by UCCombotterComponent::whatIfProjectileLaunch
// Speed is read from the bendTimeToSpeed curve based on bow draw time

UCSkeletalMeshComponent

Skeletal mesh management with modular character support, animation instance setup and actor visibility control. Extends USkeletalMeshComponent, implements ICActorBoundable and ICSkeletalMeshComponent_.

Name Description
cAnimInstance Cast reference to UCAnimInstance (may be null)
skeletalChildCreated Whether modular child meshes have been created
init Sets collision, relative transform from capsule, binds to actor events
reset Sets skeletal mesh, creates child meshes, sets anim class, physics asset, configures animation priorities
onActorEvent Triggers reset when actor status changes
// Reset flow:
// 1. Set skeletal mesh from maker (or null if deactivated)
// 2. Create child skeletal meshes with SetLeaderPoseComponent for modular characters
// 3. Set anim class and physics asset
// 4. Configure animation priorities on UCAnimInstance
// 5. Update meshBound on actorInformation
// 6. Toggle actor visibility

UCSpringArmComponent

Spring arm with custom init/tick/reset callbacks. Extends USpringArmComponent.

Name Description
actorInformation Shared UCActorInformation reference
cameraComponent Attached camera component
customInit Lambda called during init()
customTick Lambda called each TickComponent()
customReset Lambda called during reset()
// Callbacks are set by UCInitializerComponent::complete_CSTR_CPLAYER_FIRST_PERSON_ONLY
// Probe size, arm length, location and offset are configured in reset()

UCStaticMeshComponent

Static mesh component with actor event-driven visibility. Extends UStaticMeshComponent, implements ICActorBoundable.

Name Description
init Sets collision profile to BlockAll, WorldStatic object type
reset Updates meshBound, toggles actor visibility based on activation
onActorEvent Triggers reset when actor status changes
// Used for non-skeletal actors (props, interactables)
// Collision: BlockAll profile, Visibility=Block, Camera=Ignore

UCTurnByTurnComponent

Turn-by-turn combat orchestrator using a multi-state state machine. Manages actor ordering, target selection, AI movement, attack execution and camera focus.

Name Description
stateMachineMap Turn-by-turn workflow state machine
orderedActorArray Ordered list of advIdx participating in combat (-1 = player)
enable Whether turn-by-turn is enabled for this actor
flyPawn Reference to the fly camera pawn during combat
init Initializes state machine from maker.turnByTurnAttack
fightReasonUpdated Triggers state machine re-evaluation when adversary set changes
// State machine workflow:
// S_END_OF_TURN_BY_TURN -> S_ORDERING_ACTOR -> S_CHOOSE_TARGET
//   -> S_MOVE_ACTOR_TO_TARGET -> S_ATTACK -> S_CHOOSE_NEXT_ACTOR
//   -> (loop back to S_CHOOSE_TARGET or S_ORDERING_ACTOR)

// During combat:
// - Player is possessed by an AI controller with the basic enemy BT
// - Camera switches to a fly pawn that orbits the battle
// - Hexagonal tiles in the battle area are banned from spawning

UCDamageEmissionContainer

Data container for outgoing damage information.

Name Description
attackCount Number of attacks in the combo
damage Damage amount
damageEvent FDamageEvent data
hitResult FHitResult from the collision test

UCDamageReceptionContainer

Data container for incoming damage information, passed to damage skills.

Name Description
animMontage Damaged animation montage to play
damageCauser Actor that caused the damage
damagedActor Actor receiving the damage
instigatedBy Controller that instigated the damage
damageReceived Raw damage before armor
armor Armor value
damage Final damage after armor reduction
damageType UDamageType reference
// Created internally by UCLifeComponent::internalOnTakeADamage
// Passed to the executeDamagedSkill for custom damage processing

UCMappingManager

UGameInstanceSubsystem that stores the current UInputMappingContext across player switches.

Name Description
inputMappingContext Transient reference to the active mapping context
// Accessed internally by UCActionMappingComponent::setup
// Ensures the old mapping context is removed before adding the new one

UCDebugComponent

Debug overlay widget attached to actors. Extends UWidgetComponent, implements ICDebugComponent_ and ICPlayerControllerBoundable. Created by UCInitializerComponent::prepare_CSTR_* for all base classes. Displays a world-space or screen-space debug widget using the W_DEBUG widget class from the coordinator.

Name Description
debugWidgetClass Widget class retrieved from CoordinatorUtility::retrieveWidget(ECWidget::W_DEBUG)
commonDetailInformation Shared UCActorInformation reference
interactionComponent Reference to the owning actor’s UCInteractionComponent (used for capsule height positioning)
init Creates the debug widget, configures world-space or screen-space rendering, binds to player controller events
reset Reserved for future use (currently empty)
addDebugWidgetWith Delegates to ICDebugWidget_::addDebugWidgetWith — adds a custom TFunction<FText(AActor*)> debug line
onPerspectiveTypeChange Responds to camera perspective changes (FIRT_VIEW / TOP_VIEW)
boundDynamic / unboundDynamic Binds/unbinds to ACPlayerController perspective events
// UCDebugComponent is created automatically by UCInitializerComponent.
// On init, it retrieves the W_DEBUG widget class from the coordinator,
// creates the widget, and configures its display mode:
//   - If the widget implements ICWorldWidget_: world-space with transform, drawSize, material
//   - Otherwise: screen-space positioned at capsule half-height

// Adding custom debug text:
ICDebugComponent_* debug = Cast<ICDebugComponent_>(debugComponent);
debug->addDebugWidgetWith([](AActor* actor) {
    return FText::FromString(FString::Printf(TEXT("HP: %d"), GetLife(actor)));
});