Skip to main content

Skills and unlocks

Top-level types in Root.Township. Server decides, clients show.

Two separate systems give players new abilities:

  • Skills are bought with progression points at a skill shrine. Each path has a tree of slots, and each slot grants a ProfessionSkill.
  • Player unlocks (PlayerUnlock) are earned by visiting a chain of stations (PlayerUnlockStation), collecting orbs. The climbing tower is the one the code names (climbingUnlock). A PlayerUnlock can widen where you can teleport or climb and raise a maximum stat.

Skill trees​

TypeWhat it is
ProfessionSkillTreeScriptableObject, one per path, loaded from Resources/ProgressionTrees/. static ProfessionSkillTree GetProfessionTree(ProgressionPath path), List<ProgressionSlot> Slots, bool IsEnabled, bool GetSlot(uint hash, out ProgressionSlot slot).
ProgressionSlotA node in a tree: uint Hash, uint Cost, List<uint> Dependencies (slot hashes), ProfessionSkill Skill, ProgressionPath Path. A slot is buyable when it has no dependencies or any one of them is owned.
ProfessionSkillHashedGeneralValue<ProfessionSkill>, abstract. The ability itself. virtual void Unlock(PlayerProgressionManager) and Lock(...) run when a player gains or loses it. static event ProfessionSkillDelegate OnSkillExecuted.
ProfessionSkill<T>Adds static T Instance and static bool PlayerUnlocked(Player). Instance is only set the first time any player unlocks the skill, so PlayerUnlocked is false for everyone until then.
SkillStatusOtherPlayer, NotAllowed, TestingCantBuy, CantBuy, TestingLockedOwned, OwnedLocked, TestingOwned, Owned, TestingAllowed, Allowed. The Testing values mean the player is practising that orb.

The trees in the game​

Asset values

The ProfessionSkillTree assets, build main-1.7.2.1.42203. Every slot costs 1 point, except the two DevDebug slots, which cost 0. The names are the slot names; several slots share one skill asset (both Charged Axe slots use Charged Axe Strike, for example).

TreeEnabledSlotsExamples
Forgingyes7Forging Power Strike (and Plus), Heartcall, Ember and Furor Heartcaller, Ember Composer, Blacksmith Steelsong
Woodcuttingyes6Woodcutting Power Strike (and Plus), Charged Axe Chop, Branch Shatter, Branch Slam Shatter, Wood Gatherer
Miningyes9Mining Power Strike (and Plus), Mining Dynamite Strike, Mining Boulder Destroy, Mining Echo (and Intensity and Range Plus), Ore and Basic Stone Gatherer
Meleeyes6Melee Power Strike (and Plus), Power Hit, Power Shockwave, Power CrossSlash, Blocking Charge
Rangedyes11Bow Quickdraw, Bow Slowdraw, Bow Lightbeam, Bow Two-Shot and Three-Shot, Feather and Arrow Gatherer
Chisellingno3Chiseling Power Strike, Sure Hands
Cookingno0
DevDebugno2Hunger Stat Bonus Skill, Power Stinger

With maxFreePoints 3 and maxBoughtSkills 8 (see Progression), a player can bank at most 3 points per path and own 8 skills in total, out of 39 enabled slots.

Skills in the game include PowerStrike, PowerHit, HeartCall, MiningEcho, Gatherer, SteelSong, EmberComposer, HebiosEnchant, AreaAttackSkill, PowerCrossSlash, PowerStinger, StatBonusSkill, SureHands, Garnisher, BlockingCharge, and the bow skills in Alta.Progression.Skills. Most active ones derive from PickupBasedSkill (they work through a held item) or TargetBasedSkill.

Shrines and orbs​

SkillShrine : ProgressionShrine. When a player opens a shrine for a path, the server (OpenOnServer) spawns a SkillOrb for every slot in that path's tree, each with the player's SkillStatus for it. Orbs aren't saved (SaveMode.Ignore).

What happens to an orb:

With the host setting CanOnlyBuySkillsAfterPracticing on (the default), an orb can only be pulled away to buy once the player has used the skill while practising (MarkSlotPracticed, triggered by OnSkillExecuted). ProgressionSettings.MaxBoughtSkills caps how many a player can own; at the cap, Allowed turns into CantBuy.

Hooking skills​

  • PlayerProgressionManager.UnlockSlot and LockSlot see every buy and sell, including TavernLib's player progression buyskill command. UnlockSlot is also called with isFromLoad while a save loads.
  • ProfessionSkill.Unlock and Lock are virtual and per skill: patch the subclass you care about.
  • Some skills trust the client. SteelSong (forging) takes the hit count the client sends and fires the skill when it reaches the top level.

Player unlocks​

TypeWhat it is
PlayerUnlockHashedGeneralValue<PlayerUnlock>. Has Prerequisites, Orbs, and UnlockingPermissions (teleport layer, climb layer, and an optional MaxStatDefinition to raise). ApplyTo(Player) raises that stat's range and Base on every body the player gets; RemoveFrom(Player) undoes it.
PlayerUnlockManagerPlayerComponent, one per player (player.UnlockManager, also on IPlayer). Unlocks (permanent), CurrentUnlock (the one in progress), Orbs (orb indexes collected), Checkpoint. Saved with the player.
PlayerUnlockStationA station in the world. Its UnlockStationType is Start, Normal, Unlock or Completion.

PlayerUnlockManager members that change state check NetworkSceneManager.IsServer and do nothing on clients:

MemberWhat it does
bool Check(PlayerUnlock unlock)True if the player has it permanently or it's the run in progress.
void SetPermanentUnlock(PlayerUnlock unlock, bool isUnlocked = true)Grants or removes it permanently. Refuses if a prerequisite is missing. Syncs to the client.
void SetCurrentUnlock(PlayerUnlock unlock), void CancelUnlock()Starts or abandons a run.
void AddOrb(uint orbIndex), void RemoveOrb(uint orb), void SetCheckpoint(Vector3)Run progress.

PlayerUnlockStation.Interact(IPlayer player) is async void: on the server it waits interactionDelay with Task.Delay, then a start station begins the run, a normal station or an Unlock station adds its orb and checkpoint (an Unlock station also grants the PlayerUnlock permanently), and the completion station ends the run if the last orb was collected. A station only accepts a player who holds the previous orb. The cooldown is per station, not per player, so two players can't use one station within a second of each other.

See also​