UCGameManager

Overview

UCGameManager is a UGameInstanceSubsystem that acts as the central registry for game board definitions. It is accessed as a singleton via CGameInstance. When storeNewGameBoard is called from Blueprint, it converts all Blueprint structs into internal DataTable rows that each module’s spawner can consume.

Functions

Name Description
getInstance Static helper that returns the UCGameManager subsystem from any actor
createFlyViewPlayer Pure function that builds a FCBP_Player configured for a fly-view (top-down) pawn
create1StViewPlayer Pure function that builds a FCBP_Player configured for a first-person character with skeletal, behavior, interaction and lifecycle
storeNewGameBoard Main entry point: takes all game configuration structs and converts them into DataTable rows stored in a FCBP_GameStruct

Internal Functions

Name Description
storeCharacter Template that creates a FCCharacterDetailMaker row from any NPC room type and stores it in the game struct’s characterDetailMakerDT
staticCreateCharacter Static template that maps common NPC fields (actor class, tags, scale, interaction) to a FCCharacterDetailMaker
mappingCompletionForPlayer Static function for player-specific field mapping: fog of war settings (complex ray, refresh rate, revealed area, line of sight)
mappingCompletionForAIPawnAndChar Static template for AI-specific field mapping: behavior tree, sight perception, automations
mappingCompletionForPawnAndChar Static template for shared pawn/character field mapping: skeletal, movement, lifecycle, combat, skills
acpAssignNPCToRoom Template that assigns NPCs to room detail structs with spawn probabilities and biome filtering
// Get the singleton from any actor
UCGameManager* gm = UCGameManager::getInstance(myActor);

// createFlyViewPlayer — builds a fly-view player struct
// (FName playerTag, TSubclassOf<ACPlayerBaseFLYPawn> actorClass,
//  FCBP_PMovement movement, FCBP_FogOfWarRevealer fogOfWar, TArray<FName> skillsName)
FCBP_Player flyPlayer = UCGameManager::createFlyViewPlayer(
    "MainPlayer", nullptr, FCBP_PMovement(), FCBP_FogOfWarRevealer(), {});

// create1StViewPlayer — builds a first-person player struct
// (FCBP_ACPBasic basic, TSubclassOf<ACPlayer1STCharacter> actorClass, bool turnByTurnAttack,
//  FCBP_CMovement movement, FCBP_FogOfWarRevealer fogOfWar, FCBP_CPSkeletal skeletal,
//  FCBP_CPBehavior behavior, FCBP_PlayerInteraction interaction,
//  FCBP_CPLifecycle lifecycle, TArray<FName> skillsName)
FCBP_Player fpsPlayer = UCGameManager::create1StViewPlayer(
    basic, nullptr, false, FCBP_CMovement(), FCBP_FogOfWarRevealer(),
    FCBP_CPSkeletal(), FCBP_CPBehavior(), FCBP_PlayerInteraction(),
    FCBP_CPLifecycle(), {"Fireball"});

// storeNewGameBoard — registers a complete game board definition
// (FName name, FCBP_GameCommon gameCommon, TArray<FCBP_Player> players,
//  FCBP_Biome biome, FCBP_World world, TArray<FCBP_RoomCluster> roomClusters,
//  TArray<FCBP_TileAndGrass> grassAndTilePaving, TArray<FCBP_Skill> pawnAndCharSkills,
//  TArray<FCBP_Inventory> inventoryItems, FCBP_defineQuests defineQuests)
gm->storeNewGameBoard("Level1", gameCommon, {flyPlayer},
    biome, world, roomClusters, tiles, skills, inventory, questDelegate);

storeNewGameBoard internals

The function processes each configuration section in order:

  1. Game — creates metadata DataTables (skill, resource, character, room) and stores widget class overrides with fallback to plugin defaults.
  2. World — maps FCBP_WorldEffector fields to FCWorldSpawnerDataStruct (cell size, LOD, pool, normals, etc.).
  3. Player — iterates players, stores each as a character detail maker row. An implicit turn-by-turn fly pawn is always added.
  4. Fog — maps FCBP_FogOfWar to FCFOWMakerStruct (render target, blur, intensity).
  5. Map — maps FCBP_Map to FCMapMakerStruct (tile mesh, spline mesh, tangent).
  6. Room & NPC — iterates room clusters and room descriptions, assigns NPCs (actors, pawns, characters) with spawn probabilities and biome filtering.
  7. Hexa — iterates FCBP_TileAndGrass entries, maps tile effectors, room/corridor effectors, biome bounds and mesh probabilities.
  8. Skill — registers skill lambdas or dynamic delegates, plus the preset CToggleTemporarySelect skill.
  9. Resource — registers inventory items.
  10. Quest — stores the quest definition delegate.