Core concepts

Overview

UPulseSkillTree (asset)                    UPulseSkillComponent (per player, replicated)
 └ FPulseSkillTreeNode                      ├ SkillTrees        which trees the player can use
    ├ Skill ─► UPulseSkillDefinition        ├ Skills            skill tag → rank
    │           ├ Ranks[]                   ├ Points            point tag → available / spent
    │           │  ├ Conditions             └ AppliedGrants     (authority) handles per skill and grant
    │           │  ├ Costs                            │
    │           │  ├ Rewards                          ▼
    │           │  └ Grants[]               UAbilitySystemComponent
    │           └ Grants[]                  
    └ Prerequisites[]                        abilities, gameplay effects, loose tags

Skill

A UPulseSkillDefinition is a data asset. It is identified by its SkillTag, which is saved and replicated. A skill has ranks: rank 0 means locked, the highest rank is the number of entries in Ranks. Each rank has its own conditions, costs, rewards and extra grants.

Skill tree

A UPulseSkillTree groups skills into nodes and sets the prerequisites between them (“Whirlwind needs Charge rank 1”). Prerequisites belong to the node, not to the skill, so the same skill asset can be part of several trees. A component can use several trees; when a skill is in more than one of them, the first tree in SkillTrees wins.

Conditions, costs, rewards and grants

The building blocks are picked inline in the asset:

Type Question it answers Examples
Condition May this rank be unlocked? level, rank of another skill, points spent in the tree, an item, a finished quest
Cost What does this rank cost? Can the player pay it? skill points, an attribute such as gold, items
Reward What does unlocking this rank give once? items, experience, skill points, a skill tree
Grant What does the skill give while it is unlocked? ability, gameplay effect, loose tags

Conditions, costs and rewards are the Pulse lists of Pulse Foundation, so every entry of every Pulse plugin works here (items of Pulse Gameplay, quests of Pulse Quest, …). Grants are UObjects of Pulse Skill (EditInlineNew). All of them are shared by every player that uses the asset, so they never store per-player state. See Conditions, costs, rewards and grants.

Skill points

The component keeps any number of point pools, identified by gameplay tags. Each pool has Available and Spent points. The built-in skill point cost moves points from available to spent, refunds move them back. An empty point tag means the default pool (see Settings).

Rank changes and grants

Every rank change (unlock, refund, reset, load, SetSkillRank) ends in the same step on the authority: the component compares the grants the skill should have at its rank with the grants it has applied, and

  • removes grants that no longer apply,
  • calls UpdateLevel on grants that stay (abilities and effects get the new level without being removed),
  • applies new grants.

The same step runs when the ability system changes, for example after a respawn, and when trees are added or removed. Grants that need an ability system wait for one; attribute modifiers are applied without GAS and come back when the attribute source of the player changes (a new pawn, a load).

Rules and state

The rules of Pulse Skill are pure functions in Pulse::Skill (Rules/PulseSkillRules.h, Rules/PulseSkillProgressionRules.h, Rules/PulseSkillLoadState.h): they read the data assets (trees, skills, progressions) and the state, either through a rank query or a Pulse::Skill::FStateView over plain save data, and need no world and no component. The component is the shell around them: it owns the replicated state, calls the rules and writes their result.

  • Plan, then apply: every change is planned first, without changing anything (PlanUnlock / CheckUnlock / PlanRefund give an FPulseSkillRankPlan, BuildLoadState an FPulseSkillLoadPlan), then the component applies the plan in one step and fires the events after the write. An unlock is an exchange of PulseFoundation (Pulse::Skill::MakeUnlockExchange): costs, rank, rewarded rank and rewards are written first, then the events fire in the order of the writes (cost, rank, reward), so inside the rank event GetRewardedRank is already the new rank. A listener that unlocks the next rank therefore runs after the whole unlock and gets the rewards of its own rank.
  • Game thread: the rules run on the game thread. Tree lookups fill a cache of the tree asset, and level curves and experience modifiers are Blueprint events.
  • Saved state: FPulseSkillSaveData is the plain form of the saved state of a player: ranks, point pools, progressions and rewarded ranks. The setup (SkillTrees, Progressions, also trees a reward added), whether the starting points were given and the applied grants are not part of it.

Authority

All changes happen on the authority (server or standalone). Clients send requests, the server checks everything again and replicates the result. See Multiplayer.


This site uses Just the Docs, a documentation theme for Jekyll.