Add a new building type
Add a new placeable building by duplicating an existing in-game child of BP_CBT_BaseResidential or BP_CBT_BaseCommercial, then registering it in the building picker UI.
Inheritance
Section titled “Inheritance”flowchart TB Base[BP_CBT_BaseBuilding] Res[BP_CBT_BaseResidential] Com[BP_CBT_BaseCommercial] House[BP_CBT_House] Apt[BP_CBT_Apartment] Shop[BP_CBT_Shop] Office[BP_CBT_OfficeBuilding] New[BP_CBT_YourBuilding] Base --> Res Base --> Com Res --> House Res --> Apt Com --> Shop Com --> Office Res --> New
Example — add a park (residential-flavoured)
Section titled “Example — add a park (residential-flavoured)”Goal: a cheap decorative residential building that adds a small population bump without commercial income.
1. Duplicate the parent
Section titled “1. Duplicate the parent”- In Content Browser, navigate to
Blueprints/Buildings/InGameBuildings/Residential/. - Duplicate BP_CBT_House → rename BP_CBT_Park.
- Open BP_CBT_Park and confirm parent class is BP_CBT_BaseResidential.
2. Set class defaults
Section titled “2. Set class defaults”| Property | Example value | Notes |
|---|---|---|
| BuildingName | Park | Shown in UI |
| BuildingDescription | Short flavour text | Also add to ST_CityBuilderTemplate for localization |
| BuildingIcon | Your texture asset | 256×256 recommended |
| BuildingMeshes | Single static mesh | Or array for variants |
| BuildingCost_Currency | Lower than House | Read house default, then reduce |
| ConstructionTime | 5–15 seconds | Fast placement |
| UnlockLevel | 1 | Available immediately |
| bSpawnAmbientLights | false | Optional for parks |
Assign mesh SM_ asset under Meshes/Buildings/ (import or reuse).
3. Population timer
Section titled “3. Population timer”BP_CBT_BaseResidential uses Inhabitant Add Delay and Inhabitant Max Limit (shipped House defaults: delay 2 s, max 4) with TimerHandle_AddInhabitant to call AddPopulation after construction.
- Open the Event Graph on BP_CBT_Park only if you need custom population timing.
- Otherwise set Inhabitant Add Delay / Inhabitant Max Limit on class defaults and inherit parent timer behaviour.
4. Register in the building picker
Section titled “4. Register in the building picker”BP_CBT_PlayerController → Class Defaults lists spawnable buildings in two arrays (verified in v1.7):
| Array | Shipped entries |
|---|---|
| Residential Buildings | BP_CBT_House, BP_CBT_Apartment |
| Commercial Buildings | BP_CBT_Shop, BP_CBT_OfficeBuilding |
- Open BP_CBT_PlayerController → Class Defaults.
- Add BP_CBT_Park to Residential Buildings (or the commercial array for a shop-style building).
- Open WBP_BuildingSelect and mirror the new entry in the UI list (typically ST_BuildingSelect rows tied to the same classes).
5. Save data
Section titled “5. Save data”BP_CBT_SaveGame → AddBaseResidentialSaveValues must recognize the new class.
- If you only changed defaults on a BP_CBT_BaseResidential child, existing save functions usually work.
- If you added custom variables, extend ST_BaseResidentialSave and OnBuildingSave on your Blueprint.
6. Test
Section titled “6. Test”flowchart LR Pick[WBP_BuildingSelect] --> Preview[GetPreviewBuilding] Preview --> Place[Internal_StartConstruction] Place --> Save[OnBuildingSave] Save --> Load[Internal_LoadGame]
- Play DemoMap.
- Select Park, place on a road-adjacent cell.
- Confirm construction, population, save, and reload.
Example — add a café (commercial)
Section titled “Example — add a café (commercial)”Duplicate BP_CBT_Shop instead:
| Property | Café tweak |
|---|---|
| Revenue Per Worker | Between shop (268) and office (1240) values |
| Profit Delay | Between shop (60 s) and office (120 s) |
| Worker Max Limit | Match or exceed shop (10) |
| bAutoCollectIncome | false for manual collect gameplay |
| Currency Collect XP | Slightly higher than shop (3) |
| UnlockLevel | 2 (same as shipped shop) |
Update ST_CityBuilderTemplate with ShopDescription-style entry for localized name.
Commercial vs residential checklist
Section titled “Commercial vs residential checklist”| Concern | Residential | Commercial |
|---|---|---|
| Parent class | BP_CBT_BaseResidential | BP_CBT_BaseCommercial |
| Primary reward | AddPopulation (via Inhabitant Max Limit) | CollectIncome (Revenue Per Worker × workers) |
| Save struct | ST_BaseResidentialSave | ST_BaseCommercialSave |
| UI tab | Residential on WBP_BuildingFrame | Commercial tab |
| Widget | — | Optional CurrencyWidgetButton |