CGAMEUMODULE

Overview

The CGAMEUMODULE is the plugin’s coordinator module. It provides a data-driven approach to level creation through Blueprints: define players, world, rooms, NPCs, foliage, skills, resources and quests as Blueprint structs, then let the module orchestrate all other plugin modules to build the game at runtime.

Depends on all other modules.

Functionalities Overview
UCGameManager UGameInstanceSubsystem singleton that stores game board definitions (FCBP_GameStruct) and converts Blueprint structs into internal DataTable rows
ACCoordinator Main level actor that reads a stored game board and spawns all subsystems (world, rooms, hexas, players, fog, map, NPCs) in the correct order
UCGameBPLibrary Blueprint function library for player switching, skill creation, animation montage conversion, and array concatenation utilities
Data Blueprint-exposed structs (FCBP_Player, FCBP_World, FCBP_RoomCluster, FCBP_TileAndGrass, FCBP_Skill, etc.) that describe every aspect of a game board

Architecture

The game board creation pipeline works as follows:

  1. In a Blueprint (typically BeginPlay), call UCGameManager::storeNewGameBoard with a name and all the configuration structs (players, biome, world, rooms, tiles, skills, resources, quests).
  2. UCGameManager converts every Blueprint struct into internal DataTable rows consumed by each module’s spawner.
  3. Place an ACCoordinator in the level. Call cleanAllThenSpawnGameBoard with a seed, board name and player tag.
  4. The coordinator retrieves the stored FCBP_GameStruct, assigns DataTable row handles, then spawns subsystems in order: Player → Fog → Room → World → Hexa → Actor → Map.
  5. When all spawners report ready, the coordinator fires onGameBoardReady (Blueprint-implementable event).
  6. Level transitions are handled via enterLevel / exitLevel with a breadcrumb stack for backtracking.