Quick Start¶
Get a working quest system running in under 10 minutes with a quest database, a kill quest, and progress tracking.
Overview¶
By the end of this guide you will have:
- A quest database with one quest definition
- A Player Controller with
UFWQuestManagerComponentattached - A kill quest that tracks enemy deaths and grants XP on completion
- Event-driven UI updates for quest progress
Step 1 -- Create the Quest Database¶
- In the Content Browser, right-click and select Miscellaneous > Data Asset.
- Choose
FWQuestDatabaseas the class. - Name it
DA_QuestDatabase.
This asset holds references to all quest definitions in your game.
Step 2 -- Create a Quest Definition¶
- Create another Data Asset, this time choosing
FWQuestDefinition. - Name it
QD_SlayWolves. - Open it and configure:
| Property | Value |
|---|---|
| Quest Name | Slay the Wolves |
| Description | The wolves near the village have become aggressive. Thin their numbers. |
| Category | Side |
| Priority | Normal |
| Repeat Type | None |
| Party Mode | None |
Add a Task¶
- In the Tasks array, click the + button.
- Set the task class to
FWTask_Slay. - Configure:
| Property | Value |
|---|---|
| Task Name | Kill Wolves |
| Target Tag | Enemy.Wolf |
| Required Count | 5 |
| Description | Slay 5 wolves in the Whispering Woods. |
Add a Reward¶
- In the Rewards array, click the + button.
- Set the reward class to
FWReward_Experience. - Configure:
| Property | Value |
|---|---|
| XP Amount | 250 |
Add to Database¶
- Open
DA_QuestDatabaseand addQD_SlayWolvesto its quest definition list.
Step 3 -- Add the Component to Your Player Controller¶
In C++¶
// MyPlayerController.h
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Quest")
TObjectPtr<UFWQuestManagerComponent> QuestManager;
// MyPlayerController.cpp (constructor)
QuestManager = CreateDefaultSubobject<UFWQuestManagerComponent>(TEXT("QuestManager"));
Then in BeginPlay:
void AMyPlayerController::BeginPlay()
{
Super::BeginPlay();
// Load the quest database
UFWQuestDatabase* DB = LoadObject<UFWQuestDatabase>(
nullptr, TEXT("/Game/Data/DA_QuestDatabase"));
QuestManager->SetQuestDatabase(DB);
// Bind events
QuestManager->OnQuestAccepted.AddDynamic(this, &AMyPlayerController::HandleQuestAccepted);
QuestManager->OnTaskProgressChanged.AddDynamic(this, &AMyPlayerController::HandleTaskProgress);
QuestManager->OnQuestCompleted.AddDynamic(this, &AMyPlayerController::HandleQuestCompleted);
}
In Blueprints¶
- Open your Player Controller Blueprint.
- Click Add Component and search for
FWQuestManager. - Select FW Quest Manager Component.
- In the Details panel, set Quest Database to
DA_QuestDatabase.
Step 4 -- Accept the Quest¶
- Get a reference to the Quest Definition asset.
- Call Can Accept Quest to check prerequisites.
- Call Accept Quest to begin tracking.
Step 5 -- Report Enemy Kills¶
When an enemy dies, call OnEnemyKilled on the quest manager:
void AMyPlayerController::HandleEnemyDeath(AActor* Enemy)
{
// Get the enemy's gameplay tag (e.g., "Enemy.Wolf")
FGameplayTag EnemyTag = GetEnemyTag(Enemy);
// Report the kill to the quest system
QuestManager->OnEnemyKilled(EnemyTag, 1);
}
The FWTask_Slay task automatically matches the EnemyTag against its TargetTag and increments progress.
Step 6 -- Handle Events¶
void AMyPlayerController::HandleQuestAccepted(UFWQuestDefinition* QuestDef)
{
UE_LOG(LogTemp, Log, TEXT("Quest accepted: %s"), *QuestDef->QuestName);
// Show quest accepted notification in UI
}
void AMyPlayerController::HandleTaskProgress(UFWQuestDefinition* QuestDef,
int32 TaskIndex, int32 CurrentProgress, int32 RequiredProgress)
{
UE_LOG(LogTemp, Log, TEXT("Task %d: %d/%d"), TaskIndex, CurrentProgress, RequiredProgress);
// Update quest tracker widget
}
void AMyPlayerController::HandleQuestCompleted(UFWQuestDefinition* QuestDef)
{
UE_LOG(LogTemp, Log, TEXT("Quest completed: %s"), *QuestDef->QuestName);
// Show completion notification, rewards are granted automatically
}
Step 7 -- Turn In the Quest¶
When all tasks are complete, the quest moves to ReadyToTurnIn state. Call TurnInQuest to grant rewards:
Check the quest state with Get Quest State, and if it returns Ready To Turn In, call Turn In Quest.
Result¶
You now have a quest system that:
- Loads quest definitions from a data-driven database
- Accepts quests and tracks kill progress
- Fires events for UI updates on each kill
- Grants XP rewards on quest turn-in
Next Steps¶
- Read the Data Definitions guide for all task, condition, and reward types.
- See the Quest Manager Component for the full API reference.
- Follow the Tutorial to build a complete quest chain with prerequisites, party sync, and daily resets.