ACCoordinator

Overview

ACCoordinator is the main level actor that orchestrates all spawners. It inherits from ACAbstractSpawner and implements ICCoordinatorData. Place one in the level, then call cleanAllThenSpawnGameBoard to build a game board from a previously stored FCBP_GameStruct.

Struct: FCBoardBreadcrumb

Name Description
gameBoardName FName of the board to return to
playerTag FName of the player tag at the time of transition
playerLocation FVector2D of the player position at the time of transition
FCBoardBreadcrumb crumb(FName("Level1"), FName("MainPlayer"), FVector2D(1000, 2000));

Properties

Name Description
gameBoardName FName of the current game board being played
playerTag FName of the current active player
boardBreadcrumb Stack of FCBoardBreadcrumb for level transition backtracking (board name, player tag, location)
resourceDatatable Runtime-created UDataTable of FCResourceStruct rows for the current board
skillDatatable Runtime-created UDataTable of FCSkillDataStruct rows for the current board
biomeNoiseDataAsset UCNoiseDataAsset for biome noise of the current board
gameMakerRH Row handle to FCGameMakerStruct (widgets, metadata, objects)
playerMakerRH Row handle to FCPlayerMakerStruct for the active player
worldMakerRH Row handle to FCWorldSpawnerDataStruct
roomClusterRH Row handle to FCRoomClusterStruct
hexaMakerRH Row handle to FCHexaSpawnerDataStruct
actorMakerRH Row handle to FCNPCMaker
fowMakerRH Row handle to FCFOWMakerStruct
mapMakerRH Row handle to FCMapMakerStruct

Functions

Name Description
misc Applies display settings (resolution, frame rate, anti-aliasing, quality levels) from a FCBP_Misc struct. Returns self for chaining
cleanAllThenSpawnGameBoard Cleans all existing spawners then builds the game board identified by name, seed and player tag
reset CallInEditor shortcut that re-spawns the current board with the same seed and settings
enterLevelSamePlayer Transitions to another game board keeping the current player tag. Pushes current state to breadcrumb
enterLevel Transitions to another game board with a specific player tag. Pushes current state to breadcrumb
exitLevel Pops the breadcrumb stack and returns to the previous game board and player location
onGameBoardReady BlueprintImplementableEvent fired when all spawners report ready (world built + rooms ready)
clean Destroys all spawner actors (player, world, hexa, room, fog, actor, map)
spawnAll Spawns all subsystems in order: Player → Fog → Room → World → Hexa → Actor, then broadcasts onAllInstanciated
showOrHideMap Toggles the minimap spawner on/off
switchPlayer Switches to a different player tag with optional location and blend time
init Override of ACAbstractSpawner::init(). Binds to the navigation system’s OnNavigationGenerationFinished delegate
storeSpawnerSingleton Registers the coordinator as singleton CNAME_Singleton_Coordinator
precheck Validates that CGameInstance, CPlayerController, and CHUD are properly configured. Returns false and logs error if not
changeTrackPawn Updates the tracked pawn on all spawners (room, world, hexa, FOW, actor) when the player switches
innerCleanAllThenSpawnGameBoard Internal implementation called by cleanAllThenSpawnGameBoard, reset, enterLevel, exitLevel. Handles full board rebuild with optional player location
// Place ACCoordinator in the level.
// From Blueprint, call misc() then cleanAllThenSpawnGameBoard():

// misc — apply display settings
coordinator->misc(worldContextObject, miscStruct);

// cleanAllThenSpawnGameBoard — build a game board
// (int seed, FName gameBoardName, FName playerTag)
coordinator->cleanAllThenSpawnGameBoard(42, "Level1", "MainPlayer");

// enterLevel — transition to another board, breadcrumb is pushed automatically
coordinator->enterLevel(worldContextObject, "Dungeon1", "MainPlayer");

// exitLevel — pop breadcrumb and return to previous board
coordinator->exitLevel();

// reset — re-spawn current board (CallInEditor)
coordinator->reset();

ICCoordinatorData interface

ACCoordinator implements ICCoordinatorData, providing global access to game board data via singleton retrieval.

Name Description
retrieveBoardName Returns the current game board FName
switchPlayer Switches the active player with optional teleport location and blend time
retrieveResourceDataTable Returns the resource UDataTable for the current board
retrieveSkillDataTable Returns the skill UDataTable for the current board
showOrHideMap Toggles the minimap spawner
boundToOnAllSpawnerInstanciated Binds an ICCoordBoundable to the onAllInstanciated delegate
unboundToOnAllSpawnerInstanciated Unbinds an ICCoordBoundable
retrieveObject Returns a UObject by ECObject key from the game maker (e.g. decal material)
retrieveWidget Returns a widget class by ECWidget key from the game maker
retrieveSkillMetadata Returns the skill metadata UDataTable
retrieveResourceMetadata Returns the resource metadata UDataTable
retrieveCharacterMetadata Returns the character metadata UDataTable
retrieveRoomMetadata Returns the room metadata UDataTable
// Access coordinator data from anywhere via singleton:
ACCoordinator* coord = retrieveSingleton<ACCoordinator>(
    CSingletonName::CNAME_Singleton_Coordinator);

// Retrieve metadata tables
UDataTable* skillMeta = coord->retrieveSkillMetadata();
UDataTable* resourceMeta = coord->retrieveResourceMetadata();

// Retrieve a widget class
TSubclassOf<UUserWidget> debugWidget = coord->retrieveWidget(ECWidget::W_DEBUG);

// Bind to the "all spawners ready" event
coord->boundToOnAllSpawnerInstanciated(myBoundableObject);