This guide explains how to add the Skill Tree Manager to an actor and configure it to use your skill trees. The CrimsonSkillTreeManager
is an Actor Component that should be added to the actor that will own the skills.
Multiplayer Note: For multiplayer games, it is highly recommended to add the manager to the PlayerState, as it persists across pawn deaths and respawns.
A Note on Flexibility: While these examples focus on the Player State and Character, the CrimsonSkillTreeManager
can be added to any actor. This allows you to implement progression systems for AI enemies, upgradable turrets, or any other object in your world.
You can add the component in several ways depending on your project's structure.
BP_MyPlayerCharacter
) or your Player State Blueprint.+ Add
and search for CrimsonSkillTreeManager
. Select it to add it to the component list.For C++ projects, you can add the component directly in your actor's header and source files.
class UCrimsonSkillTreeManager;
// ... inside your class definition ...
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Skill Tree")
TObjectPtr<UCrimsonSkillTreeManager> SkillTreeManager;
#include "MyCharacterClass.h"
#include "CrimsonSkillTree/Public/CrimsonSkillTreeManager.h"
AMyCharacterClass::AMyCharacterClass()
{
// ... other code ...
SkillTreeManager = CreateDefaultSubobject(TEXT("SkillTreeManager"));
}
This method will be different depending on how your project has Game Features set up. We will use the Lyra Starter Game as the template for these instructions.
This is an advanced method ideal for modular, encapsulated content using the Game Features framework.
To provide a standardized way of accessing the skill tree system, you should implement the ICrimsonSkillTreeInterface
on the same actor that has the manager component (the Character or Player State). This allows other parts of your game to easily get the correct references without casting.
#include "CrimsonSkillTree/Public/ICrimsonSkillTreeInterface.h"
class YOURPROJECT_API AMyCharacterClass : public ACharacter, public ICrimsonSkillTreeInterface
{
// ...
};
// In the public section of your header file (.h)
virtual class UCrimsonSkillTreeManager* GetSkillTreeManagerComponent_Implementation() const override;
virtual class AActor* GetSkillTreeOwner_Implementation() const override;
virtual class ACharacter* GetSkillTreeOwnerCharacter_Implementation() const override;
A Note on Flexibility: The interface provides a powerful separation between where skill tree data is managed and which actor receives the skill effects. For instance, you can place the UCrimsonSkillTreeManager
on the Player State for persistence, while the interface directs effects like stat boosts to the currently possessed Character.
This extensibility also allows skills to affect other objects. By creating a custom NodeEvent
, you could use the interface to find the character's equipped weapon and apply a stat modification directly to it. This would allow a passive skill to grant a "+10% Fire Damage" bonus to a sword actor whenever it's equipped.
As always, you are encouraged to add more interface functions for your specific game needs!
With the CrimsonSkillTreeManager
added, select it in the Components tab (or open its defaults in the GFA) to see its Details panel.
+
to add a new element to the array.CST_Player_CoreSkills
asset you created earlier.Edit
> Project Settings
> Project
> Gameplay Tags
.SkillTree.Player.Core
.Important: Each Skill Tree Type Tag
must be unique on a single Skill Tree Manager. The manager will only initialize one tree per tag, so you cannot have duplicate tags on the same component.
Save Slot Name
and User Index
if you want the system to automatically save and load player progress.The manager handles initialization in void UCrimsonSkillTreeManager::BeginPlay()