Reference for Blueprint assets under Content/CityBuilderTemplate/. Property names, enums, and class defaults were read from the template project (v1.7) via Unreal MCP.
flowchart TB
GI["BP_CBT_GameInstance<br/>CityBuilderSaveGameObject · owns BP_CBT_SaveGame<br/>CreateSaveGameObject() · GetIsLoadGame()"]
PC["BP_CBT_PlayerController<br/>GridActor · BuildingSelectWidget<br/>Internal_SaveGame() · CreateRoad()"]
Singleton["BP_CBT_Singleton<br/>CurrentCurrency · CurrentPremiumCash · CurrentXP · OnLevelUp<br/>UpdateCurrency()"]
BaseBuilding["BP_CBT_BaseBuilding<br/>BuildingCost_Currency · ConstructionTime · BuildingState<br/>Internal_StartConstruction()"]
BaseResidential["BP_CBT_BaseResidential<br/>InhabitantAddDelay · InhabitantMaxLimit · TimerHandle_AddInhabitant<br/>→ House · Apartment"]
BaseCommercial["BP_CBT_BaseCommercial<br/>RevenuePerWorker · ProfitDelay · WorkerMaxLimit · bAutoCollectIncome<br/>→ Shop · OfficeBuilding"]
Road["BP_Road<br/>PreviewRoad · CreateRoad()"]
RoadTile["BP_RoadTile<br/>RoadType · AddRoadToSave()"]
PC -->|spawns| BaseBuilding
PC -->|previews| Road
BaseBuilding --> BaseResidential
BaseBuilding --> BaseCommercial
Road -->|spawns tiles| RoadTile
Singleton -->|events| BaseBuilding
Drives BP_CBT_GameState and simulation buttons on WBP_PlayerHUD.
| Value | Effect |
|---|
| None | Uninitialized / default |
| Paused | Simulation timers and day/night progression stop |
| NormalSpeed | Default simulation rate |
| DoubleSpeed | Accelerated simulation |
Stored on BP_CBT_GameState → Simulation State. Access via GetSimulationState / UpdateSimulationState (BFL_CBT_GlobalFunctions). WBP_PlayerHUD simulation buttons call SetSimulationSpeed.
Lifecycle for every BP_CBT_BaseBuilding child.
| Value | Meaning |
|---|
| None | Uninitialized |
| Previewing | Ghost building following cursor — not yet placed |
| Constructing | Placed; ConstructionTime timer running |
| ConstructionFinished | Build complete; ready for inhabitants or workers |
| Occupied | Residential or commercial building at operating capacity |
| Abandoned | No new inhabitants or workers allowed |
| GettingDestroyed | Bulldoze in progress — state locked |
Update through UpdateBuildingState / GetBuildingState on the building or controller.
| Value | Used by |
|---|
| Residential | BP_CBT_BaseResidential, WBP_BuildingFrame residential tab |
| Commercial | BP_CBT_BaseCommercial, commercial tab |
| Value | Used by |
|---|
| Straight | SM_RoadTile_Straight — default segment |
| Fourway | SM_RoadTile_Fourway — intersection via Internal_UpdateToFourwayIfRequired |
Meshes: Meshes/Roads/Straight/, Meshes/Roads/Intersection/.
Returned when the player confirms placement (Internal_StartConstruction).
| Value | Meaning |
|---|
| Success | Construction started; currency consumed |
| NotEnoughMoney | Insufficient BuildingCost_Currency or BuildingCost_PremiumCash |
| NotNearRoad | No qualifying BP_RoadTile adjacent |
| InvalidState | Building not in a valid EBuildingState for placement |
| InPreview | Building still in Previewing state |
| Value | Used by |
|---|
| PointLight | Point-style window lights |
| RectangleLight | Rect area lights on building meshes |
Configured per entry in Ambient Light Configs on BP_CBT_BaseBuilding.
| Field | Type | Purpose |
|---|
| Building transform / class | — | Respawn saved buildings |
| BuildingState | EBuildingState | Restore operating state |
| ConstructionRemainingTime | Float | Resume in-progress builds |
Extend base save data with population, worker, and income timer fields for each building instance.
| Field | Purpose |
|---|
| RoadType | ERoadType mesh variant |
| Transform | Tile location on grid |
Saved ambient vehicle state for BP_Vehicle respawn on load.
Row data for WBP_BuildingSelect icons, costs, and unlock level.
Payload for WBP_LevelUpNotification (title, description from ST_CityBuilderTemplate).
| Field | Purpose |
|---|
| Particle Effect / Sound Effect | Optional VFX/SFX |
| Ambient Light Type | EAmbientLightType material variant |
Static library used across actors and widgets.
| Function | Description |
|---|
| GetCityBuilderGameInstance | Typed BP_CBT_GameInstance accessor |
| GetCityBuilderPlayerController | Typed controller accessor |
| GetCityBuilderSaveGame | Active BP_CBT_SaveGame object |
| GetSingleton | BP_CBT_Singleton in the level |
| GetGridSize | Reads BP_CBT_Grid → Current Grid Size (falls back to Default Grid Size) |
| GridSnap_Float | Snaps world coordinate to grid |
| GetWorldLocationAtMousePoint | Deproject cursor for placement |
| AddCurrency / ConsumeCurrency | Economy helpers |
| AddPremiumCash / ConsumePremiumCash | Premium currency |
| GetCurrentCurrency / GetCurrentPremiumCash | Read singleton wallet |
| GetSimulationState / UpdateSimulationState | Pause and speed |
| GetSimulationSpeed / SetSimulationSpeed | Numeric sim multiplier |
| GetTimeAsText | Formats timespan for UI |
| Property / function | Purpose |
|---|
| CityBuilderSaveGameObject | Live save object |
| CreateSaveGameObject | Instantiates BP_CBT_SaveGame on new game |
| GetIsLoadGame | true when continuing from Load Game |
| GetSaveGameObject | Returns save for controllers and widgets |
| OpenLevel | Travels between MainMenu and DemoMap |
| Property | Default | Purpose |
|---|
| Starting Currency | 100000 | Wallet on new game |
| Starting Premium Cash | 10 | Premium currency on new game |
| Current Level | 1 | Player city level |
| Max Player Level | 50 | Level cap |
| Grid Size | 200 | Placement snap size (world units) |
| GridActor | — | Reference to level BP_CBT_Grid |
| BuildingSelectWidget | — | WBP_BuildingSelect instance |
| Residential Buildings / Commercial Buildings | — | Arrays of spawnable building classes |
| Road Spline Update Time | 0.1 s | Preview road refresh interval |
| bWantsToPlaceRoad | — | Road mode active |
| bIsPreparingToBulldoze / bIsWantsToBulldoze | — | Bulldoze mode |
| Function | Description |
|---|
| GetSelectedBuilding | Class for next placement |
| GetPreviewBuilding | Active preview actor |
| HasEnoughCurrencyToConstruct | Validates wallet before build |
| CreateRoad | Finalizes spline into BP_RoadTile chain |
| Internal_PreviewRoad / ClearPreviewRoad | Road ghost mesh |
| Internal_Bulldoze | Removes target building or road |
| Internal_SaveGame / Internal_LoadGame | Serialize/deserialize city |
| GetSaveGameSlotNameAndIndex | Slot CityBuilderSaveGame + user index |
| AddLeveledUpElements / ClearLeveledUpElements | Level-up UI queue |
| Internal_GetExperienceForLevel | XP threshold curve |
| Property | Default | Purpose |
|---|
| Camera Rotation Speed | 100 | Q / E orbit speed |
| Min Zoom | 500 | Closest camera distance |
| Max Zoom | 4500 | Farthest camera distance |
| Zoom Increment | 600 | Per scroll-wheel step |
| Zoom Interp Speed | 5 | Smooth zoom blend |
| Camera Pitch Curve | Misc/CameraPitchCurve | Pitch vs zoom |
Building rotate actions: BuildingRotateLeft / BuildingRotateRight. Delegates OnSaveGame fire when the controller persists state.
| Property | Purpose |
|---|
| CurrentCurrency / CurrentPremiumCash | Player wallets |
| CurrentResidents / TotalResidents | Residential population |
| CurrentWorkers / TotalJobs | Commercial employment |
| Event | Broadcast when |
|---|
| OnCurrencyUpdated / OnPremiumCashUpdated | Wallet changes |
| OnXpChanged | XP bar should refresh |
| OnLevelUp | City level increases — unlock buildings |
| OnPopulationChanged | Residential count changes |
| OnWorkerChanged / OnAllJobsFilled | Commercial staffing updates |
| OnDayStarted / OnNightStarted | BP_CBT_TimeOfDay phase change |
| OnSaveGame | Serialize singleton stats |
| Function | Description |
|---|
| UpdateCurrency / AddCurrency | Modify wallet |
| AddPopulation / RemovePopulation | Residential simulation |
| AddLeveledUpElements / GetLeveledUpElements | Level-up notification queue |
| Property | Default | Purpose |
|---|
| Sun Speed | 10 | Sun rotation speed at normal simulation |
| Night Threshold | 0 | Sun rotation at/above which IsNight is true |
| bEnable Day Night Cycle | true | Master toggle for day/night delegates |
| bRotate Sun Based On Player View | false | Sync sun yaw to camera |
| Sun | Directional light ref | Scene sun actor |
| Sun Color Curve | Misc/SunCurveColor | Color over sun angle |
| Function | Description |
|---|
| IsNight | Gates vehicle visibility and building lights |
| Internal_BroadcastDayNightEvent | Fires singleton day/night delegates |
| Internal_CheckIsNight | Periodic night test |
Listens to OnSimulationStateChanged from BP_CBT_GameState. Simulation speed multipliers come from BFL_CBT_GlobalFunctions → SetSimulationSpeed, not from this actor.
| Property | Default | Purpose |
|---|
| Default Pawn Class | BP_CBT_PlayerPawn | Top-down camera pawn |
| Player Controller Class | BP_CBT_PlayerController | Placement and economy authority |
Referenced in Config/DefaultEngine.ini as the project game mode.
| Property | Default | Purpose |
|---|
| Simulation State | NormalSpeed | ESimulationState — pause / normal / double speed |
Updated by WBP_PlayerHUD simulation buttons via SetSimulationSpeed / UpdateSimulationState.
| Property | Purpose |
|---|
| BuildingName / BuildingDescription / BuildingIcon | UI + tooltips |
| BuildingCost_Currency / BuildingCost_PremiumCash | Placement cost |
| ConstructionTime | Seconds until ConstructionFinished |
| UnlockLevel | Minimum city level (per child building) |
| XP | XP awarded when construction completes |
| BuildingMeshes / BuildingMeshesRandomSeed | Mesh variants |
| bUseSeedToRandomizeBuildings | Deterministic visual variety |
| bSpawnAmbientLights | Window lights (ST_AmbientLight) |
| GridActor | Snap reference |
| Function | Description |
|---|
| Internal_StartConstruction | Begins timer, consumes currency |
| Internal_CheckNearRoad | Validates bIsNearRoad |
| UpdateBuildingState | EBuildingState transitions |
| BulldozePrepare | Start destruction |
| OnBuildingSave | Writes ST_BaseBuildingSave |
| HasEnoughCurrencyToConstruct | Pre-check before place |
| Property | Purpose |
|---|
| Inhabitant Add Delay | Seconds between adding inhabitants after construction |
| Inhabitant Max Limit | Cap on residents for this building |
| TimerHandle_AddInhabitant | Timer driving inhabitant growth |
| AddBaseResidentialSaveValues | Persist residential state |
| Property | Purpose |
|---|
| Worker Add Delay | Seconds between hiring workers after construction |
| Worker Max Limit | Cap on workers for this building |
| Profit Delay | Seconds between income generation ticks |
| Revenue Per Worker | Currency earned per worker per tick |
| Generated Income | Runtime payout (computed from workers × revenue) |
| Currency Collect XP | XP on manual collect when bGetXpWhenCollectingCurrency |
| bAutoCollectIncome | Auto-collect vs WBP_CollectCurrency button |
| CurrencyWidgetButton | World-space collect widget class |
| Function | Description |
|---|
| CollectIncome | Adds Generated Income to singleton |
| Class | Currency | Premium | Build (s) | Unlock | XP | Extra defaults |
|---|
| BP_CBT_House | 10 | 0 | 5 | 1 | 70 | Inhabitants 4, delay 2 s, mesh SM_House |
| BP_CBT_Apartment | 10 | 10 | 15 | 1 | 128 | Inhabitants 12, delay 2.2 s, mesh SM_Apartment |
| BP_CBT_Shop | 5 | 12 | 5 | 2 | 135 | Workers 10, hire delay 1.5 s, revenue/worker 268, profit delay 60 s |
| BP_CBT_OfficeBuilding | 10 | 24 | 10 | 1 | 200 | Workers 10, hire delay 2.3 s, revenue/worker 1240, profit delay 120 s |
Localized names live in ST_CityBuilderTemplate; icons under Textures/UI/T_UI_*.
| Property | Default | Purpose |
|---|
| Default Grid Size | 100 | Base cell size for visual grid |
| Grid Divisions | 4 | Subdivisions per cell |
| Current Grid Size | runtime | Active snap size (may differ from default) |
BFL_CBT_GlobalFunctions → GetGridSize reads from the level grid actor. BP_CBT_PlayerController → Grid Size (200) is the placement snap used during building/road placement.
| Function | Description |
|---|
| CreateRoad | Spawns tile actors along spline |
| PreviewRoad / ClearPreviewRoad | Ghost mesh while dragging |
| SetSplinePoints | Mouse-driven road path |
| Property | Purpose |
|---|
| RoadType | ERoadType mesh selection |
| RoadMeshComponent | Instanced static mesh |
| Function | Description |
|---|
| AddRoadToSave | Appends ST_RoadSave |
| Internal_UpdateRoadType | Neighbour-aware mesh swap |
| Internal_AddLampToStraightRoad | Street lamp prop |
| BulldozePrepare | Road removal |
Ambient traffic on roads.
| Function | Description |
|---|
| Internal_TraceForRoadTile | Finds next tile along spline |
| Internal_OnDayStarted / Internal_OnNightStarted | Show/hide with day cycle |
| Internal_PlayTimeline | Movement along road |
| Array / field | Contents |
|---|
| BaseBuildingSaveArray | All buildings |
| BaseCommercialSaveArray / BaseResidentialSaveArray | Typed extensions |
| RoadSaveArray | ST_RoadSave tiles |
| Vehicles | ST_Vehicle |
| CurrentCurrency, CurrentXP, CurrentLevel, CurrentMaxXP | Progression |
| Function | Description |
|---|
| AddBaseBuildingSaveValues | Serialize building instance |
| AddRoadToSave / AddVehicle | World object persistence |
| ClearSavedValues | New game reset |
| Widget | Role |
|---|
| WBP_MainMenu | Play, load, exit — uses DoesSaveGameExist |
| WBP_PlayerHUD | Currency, XP, level, population, simulation buttons, save/load |
| WBP_BuildingFrame | Category tabs and bulldoze entry |
| WBP_BuildingSelect | Building picker grid |
| WBP_RoadFrame | Road tool activation |
| WBP_Bulldoze | Bulldoze mode UI |
| WBP_ConstructionTimer | World-space construction countdown |
| WBP_CollectCurrency | Commercial income button |
| WBP_LevelUpFrame / WBP_LevelUpNotification | Level-up modal |
Blueprint macro library for shared traces, save slot helpers, and math used by buildings and roads. Exposes GetSaveGameSlotNameAndIndex consumed by HUD and main menu widgets.