Skip to content

Track

A Track is an IEntity that contains a list of Activatables that are activated and completed sequentially. Tracks encourage players to progress through the Track and complete the sequence of Activatables to gain rewards. An example of an IActivatable is an IGoal or IMilestone.

The ITrackService handles all loading and unloading of Global Tracks and Timed Tracks, see Global Entities Loading for more information.

Relationships

track_relationships

ITrack

ITrack is implemented by all Track entities and contains a list of Activatables. ITrackData contains a list of ids of the Activatables, and ITrackSavedData saves the index of the currently active Activatable, which marks the player's progression through the Track.

Track

An abstract Track class implements ITrack and provides much of the common functionality used by concrete Track implementations, such as the activation and deactivation of the Track and its activatables. This is an abstract class because the type of the Activatables dictates the specific functionality of a Track. For example, Goals in a GoalTrack are claimed differently than Milestones in a MilestoneTrack.

Each Track implementation must have an associate concrete TrackData class and may either extend or use the base TrackSavedData.

GoalTrack

GoalTrack extends the abstract Track class and IGoalTrack. The player progresses through the Track by claiming the goals sequentially. Goal Tracks are used in stages to manage the different sequences of goals.

PassiveGoalTrack

PassiveGoalTrack is an example of a concrete Track class with custom functionality. PassiveGoalTrack extends GoalTrack and differs from the basic GoalTrack in that it progresses once the current Goal can be claimed. Players do not need to claim the active Goal to progress and activate the next Goal.

MilestoneTrack

MilestoneTrack extends the abstract Track class and the IMilestoneTrack. The player progresses through the Track by completing the Milestones sequentially. The rewards for the completed Milestones are awarded when the MilestoneTrack is completed or deactivated. A MilestoneTrack can be active in an IContent and have its rewards claimed in the same or a different IContent.

GlobalTrack

GlobalTrack extends the IGlobalTrack. It is different from the other concrete Track implementations in that it uses the component approach and uses one of the other Track types as its components. It is a track that is active across different contents and overrides the regular Track's reward claiming logic to ensure its rewards are only claimable in one content.

Note

When creating a Global Goal Track, it is important to choose only Goals that can target entities that are active across different contents, such as CollectCurrencyTypeGoal targetting a hard currency, or MakeAnyTradeGoal. Likewise, when creating a Global Milestone Track, ensure the targetted CurrencyId is a global currency.