Unlockables, Quests & Dialogues - MassiveMiniteam/OddModKit GitHub Wiki

Unlockable Data Assets

Unlockable Data Assets (or short “Unlockables”) are the core of progession in Oddsparks. They have an Unlock function and some basic configurations, like name, description and icon references.

Most of the times they are used as a base class for more specific Unlockables. Namely:

  • ConstructableConfigs
  • Recipes
  • Quests
  • etc..

If the Unlock function is called, we store a reference to the Data Asset in the UnlockHandlingSimulationComponent. The UnlockHandlingSimulationComponent dispatches an event (OnItemUnlocked) that notifies other game elements about this unlock.

QuestManager

The QuestManager is a SimulationActorComponent that handles the quest progression in the game. It handles Accepting, Completing and Pinning Quests and has various getter functions to retrieve for example active or completed quests

If a quest is accepted, the quest manager spawns a QuestInstance, an Actor that represents an active quest in the world.

The QuestManager has various useful events

  • OnQuestCompleted
    • Called when any quest was completed
  • OnQuestAborted
    • Not used in the game, but the functionality to abort quests is there. So this is called when a quest got aborted.
  • OnNewQuestAccepted
    • Called when a new quest is accepted
  • OnAnyQuestStepUpdated
    • Called when any quest step behavior was updated
  • OnUpdateAvailableQuests
    • Notifier event that’s called after accepting, completing or aborting any quest or unlocking any Unlockable. This is used to notify Quest Givers that there may be new quests available to them.

QuestConfig

A quest config defines how a quest is played out and visualized in the game. It determines when it becomes available, who ist the quest giver, which steps need to be completed and what the player rewards are.

Important configurations are:

  • Prerequisites
    • Prerequisites that have to be met, before the quest can be accepted/becomes available. It is an array of Unlockable Configs that have to be unlocked first.
  • Quest Step Behavior Classes
    • Steps that need to be completed to finish the quest. However, some quest step behaviours only contain logic and are invisible to the player
  • Reward Items
    • Items that get added to the player inventory when the quest is completed.
  • Reward Unlockables
    • Data Assets that are unlocked when the quest is finished (Can be recipes, other prerequisites or tier unlockables)

QuestInstance

The instanced version of a quest. A quest instance is a SimulationActor that is spawned when a quest gets accepted. It contains references to the single QuestStepBehaviors and knows its QuestData as well as their QuestGiver. It handles the auto completion, if the quest is set to auto-complete.

Most quests use the base class of the QuestInstance. However, some have a specific implementation: namely, the Monument Quests and Boss Quests.

Monument Quests use the AInventoryQuestInstance, a specific Quest Instance class that provide an extra inventory for the quest.

Boss quests use the ABossQuestInstance, that handle the start and stop of boss phases on quest start and finish.

QuestGiver

The QuestGiverSimulationComponent is attached to NPCs that provide quests for the player. The component knows which quests are available for the NPC and which quests can be completed or are currently active. It returns the quest state as an enum EQuestState (Unknown, Available, Accepted, Completed).

Dialogues

Players often encounter dialogues in Oddsparks. Be it for the interaction with NPCs or the unlocking of shrines - dialogues are the main driver of Oddsparks narration.

Technically they consist of serveral components and pieces of data. In this part of the documentation we want to highlight their most important parts.

DialoguePlayerComponent

The UDialoguePlayerComponent is a component that is attached to the player. This component is responsible to show the dialogue and create the according UI.

DialogueConfig

The Dialogue Config holds an array of dialogue slides and some additional dialogue configurations

grafik

DialogueSlide

Dialogue Slides contain the actual dialogue info. The dialogue line is responsible for the text. The tag property defines the headline, the icon and the voiceline that is played along the the slide. The slides receives this information from the SpeakerData DataAsset.

SpeakerData

A mapping of a gameplay tags to VoicelineSensationData. VoicelineSensationData contains:

  • Healine
  • Image
  • Voiceline

grafik