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:
- In a Blueprint (typically
BeginPlay), callUCGameManager::storeNewGameBoardwith a name and all the configuration structs (players, biome, world, rooms, tiles, skills, resources, quests). UCGameManagerconverts every Blueprint struct into internal DataTable rows consumed by each module’s spawner.- Place an
ACCoordinatorin the level. CallcleanAllThenSpawnGameBoardwith a seed, board name and player tag. - The coordinator retrieves the stored
FCBP_GameStruct, assigns DataTable row handles, then spawns subsystems in order: Player → Fog → Room → World → Hexa → Actor → Map. - When all spawners report ready, the coordinator fires
onGameBoardReady(Blueprint-implementable event). - Level transitions are handled via
enterLevel/exitLevelwith a breadcrumb stack for backtracking.