CrimsonCommon · Lesson 3 of 4
Adopt the Modular Base Classes
Before you start
- Completed: Enable the Plugin
- A project with a Character, controllers, game mode/state, and game instance to reparent
Chapters
Swap base classes
Replace Unreal's default framework classes with the Crimson modular equivalents:
| Replace | With |
| ACharacter | ACrimsonModularCharacter |
| APawn | ACrimsonModularPawn |
| APlayerController | ACrimsonModularPlayerController |
| APlayerState | ACrimsonModularPlayerState |
| AGameModeBase / AGameMode | ACrimsonModularGameModeBase / ACrimsonModularGameMode |
| AGameStateBase / AGameState | ACrimsonModularGameStateBase / ACrimsonModularGameState |
| UGameInstance | UCrimsonCommonGameInstance |
Adopt incrementally
You don't have to swap everything at once. The base classes are independent — reparent the Character today and the Player State later, and use only the ones your project actually has.
Also: AI controllers
If your project uses a custom AI controller, there's
ACrimsonModularAIController (base AAIController) — reparent it the same way.Reparent in Blueprint
You don't recreate anything — you reparent. Open each core Blueprint, click Class Settings, and in the Details panel set Parent Class to the Crimson modular type. Compile and Save. Your components and graphs are preserved; only the base changes.
The Game Instance is set in Project Settings → Maps & Modes → Game Instance Class — point it at CrimsonCommonGameInstance (or your own Blueprint reparented onto it).
Change inheritance in C++
Same idea, expressed as inheritance — change what your classes extend, fix the includes, and rebuild.
// Beforeclass ACrimsonStartCharacter : public ACharacter { /* ... */ };// After#include "Actors/CrimsonModularCharacter.h"class ACrimsonStartCharacter : public ACrimsonModularCharacter { /* ... */ };
Reminder
Referencing CrimsonCommon types requires the module add from the previous lesson:
PublicDependencyModuleNames.Add("CrimsonCommon").