The skills registry
The nodes of the game's skill tree: what each costs in skill points, how much it gives (and how that grows with its level), how many levels it has, its kind and class, the nodes it is linked with and the ability it unlocks.
Schema version 0.1.2, experimental (KILNX031: may change in any release until it is marked stable). C# entry type Kiln.Registry.SkillNodeEntry. What registries are, the stages, the conflict rules and how ids are made: README.
Edits per call: 4,096. One OnRegistry callback (one phase of one entry point) or one Registries.Change takes at most this many edits of this registry; a call with more is refused whole, with the reason in kiln.log and registry.json, and nothing of it applies (the other calls do). The default for a registry whose schema declares none (4,096).
Ids
- Game entries:
game:skill_<node id>. Mod entries:<mod id>:<name>. All ids are lower case. The mod idsgameandkilnare reserved: no mod's entries use them. - A node has no debug name: it is game:skill_<its 32-bit node id as 8 hex digits> (game:skill_4475e8dd), the name Kiln's skills data-pack section and catalogs already give it. A node a mod adds is
: , its 32-bit node id FNV-1a of its GUID. - Names:
DisplayName(never empty; display names) is the game's text of the node's name, else one made from its id (game:skill_4475e8dd is "Skill 4475e8dd"); a node a mod adds has a name made from its id.
Fields
Applies: now = takes effect at the next use; worldLoad = takes effect when a world loads; restart = takes effect after a game restart. Ops: number = a value or the relative operations (mul, add, min, max, raiseOnly, lowerOnly); set = a value; list = clear, append, remove, replace; indexed = a list of fixed length, edited one element at a time (xpPerLevel[2]) with a value or a number operation. A field of a list's elements is named with [] in this table and with the element's index in an edit (entries[3].chance, or [*] for every element). Mapping: whether this Kiln maps the field onto the game; an unproven or unmapped field is refused per entry, with the reason, until a Kiln update maps it. Joined client: when a joined Kiln client consumes a server edit; see README.
| Field | Type | Applies | Ops | Since | Mapping | Joined client | About |
|---|---|---|---|---|---|---|---|
cost |
int 0..65535 | now | number | 0.1.0 | mapped | now | The skill points one unlock costs (each level of a node with levels costs it again). The game counts it at every unlock, at every join and at a respec: a character whose unlocked nodes now cost more than their skill points gets the game's free reset of the whole tree at their next join. |
maxLevel |
int 0..7 | now | read-only | 0.1.0 | mapped | serverOnly | How many levels the node has: 0 is one unlock, 1 to 7 are levels. Read-only: a character's saved level above it would reset the whole tree at the next join, and a node without levels has no level slot. |
kind |
enum (root, attribute, active, passive) | now | read-only | 0.1.0 | mapped | serverOnly | The node's kind: a root of the tree, an attribute, an active skill (it unlocks an ability) or a passive skill. |
class |
enum (warrior, mage, ranger, neutral) | now | read-only | 0.1.0 | mapped | serverOnly | The class the node belongs to (its colour on the skill screen). |
unlocks |
ref items, optional | now | read-only | 0.1.0 | mapped | serverOnly | The ability item the node unlocks; absent for every node that unlocks none. |
amount |
float -100000..100000 | now | number | 0.1.1 | mapped | now | How much the node gives: the amount its effect adds (an attribute node's +1 to its attribute, a passive's share: 0.2 for 20 %). A node whose amount is a whole number takes whole numbers only (a fraction is refused, never rounded), and an amount kept without a sign takes no negative number. A node with levels whose amount grows with its level gives 0 here and its growth in amountPerLevel. The node's effect reads it when it starts: an unlock, a character's join; an effect already running keeps what it started with. Nodes without an amount (roots, most active skills) read null and an edit of them is refused for that node. |
amountPerLevel |
float -100000..100000 | now | number | 0.1.1 | mapped | now | How much more a node with levels gives at each level (the game scales it by the node's level, over amount). Read as amount is: when the node's effect starts. Null for a node whose amount does not grow with a level (an attribute node, a passive without levels), and an edit of it is refused for that node. |
links |
list of ref skills | now | list | 0.1.1 | mapped | serverOnly | The nodes linked with this one, in either direction: a node can be unlocked once one of them is unlocked (a root always can). An added node's links are given at its add (its links in the tree the world builds). On a node of the game's tree: a link taken away applies now on the server's tree, where every node the world's tree reaches from a root is still reached without it; one that would cut a node off is refused (a character in a save with that node unlocked would get the game's free reset of the whole tree at the next join). A link added between two nodes goes into the tree Kiln's skill-tree service builds when the game starts; one added after the start is refused as RestartRequired until the next start. A link is in both nodes: the other node's links change in the game with it, not in its own registry value. |
Traits
Selectors ask for these with has / hasNot.
| Trait | Means |
|---|---|
active |
unlocks an ability (kind active) |
leveled |
has levels (maxLevel above 0) |
grows |
has an amount that grows with its level (amountPerLevel) |
gives |
has an amount (amount): most attribute nodes and passives; roots, most active skills and six attribute nodes of the game's tree have none |
Entries
- Add (stage add, id
<your mod id>:<name>): yes. GameStart only. A node of the game's tree like a game node (its effect, kind, class and levels) under the mod's id, made by Kiln's skill tree service (kiln.skills) and built into the tree when a world loads; links (given at the add, else the like node's) name the nodes it is unlocked from. Every character's save stays valid with or without the mod (a node that is gone is taken off before the game checks the tree). A node like a root is refused: a mod's node is never a new root. - Add requires GameStart and an explicit present Kiln
likeid; clone chains end at a game entry. Kiln retains the stable identity and pins the structural base install-wide. Use a new id for an incompatible base. - Remove: no. A game node is never removed: a character whose save holds it, or a node it links to, would get the game's free reset of the whole tree at the next join.
- Raw game paths in edits (the Advanced tier): refused.
Edit it from a data pack
A node's id is game:skill_<its node id> (game:skill_4475e8dd is Airborne Architect, the glider build node). cost, amount
and amountPerLevel are editable (skills 0.1.1): the other fields tell the node's kind and class, what it unlocks and which nodes
it is linked with, and select nodes by trait (active: it unlocks an ability; leveled: it has levels; gives: it has an
amount; grows: its amount grows with its level).
"field": "cost", "op": 0or{"add": -1, "min": 0}. A node with levels charges its cost again for each level."field": "amount", "op": {"mul": 2}: what the node gives (an attribute node's +1, a passive's 0.2 for 20 %);amountPerLevelhow much more a node with levels gives at each level (itsamountis 0). The game reads them when the node's effect starts: when a character unlocks the node and when the character comes into a world. A node without the value (a root, most active skills; six of the 65 attribute nodes) readsnull: select"has": ["gives"]foramountand"has": ["grows"]foramountPerLevel, since a relative op over a selection with such a node is refused whole. A whole-number amount refuses a fraction (not_exact).linkslists the nodes a node is linked with: it can be unlocked once one of them is. An added node is given its own at its add. On a game node (0.2.0-dev.32):{"list": {"remove": ["game:skill_..."]}}takes a link away now, on the server's tree, where every node the tree reaches from a root is still reached without it; one that would cut a node off every root is refused with that reason (a character with such a node unlocked would get the game's free reset of the whole tree at the next join). Anappendadds a link between two game nodes in the tree Kiln's skill-tree service builds when the game starts; added after the start it is refused as RestartRequired until the next start. A link is in both nodes: the other node'slinksvalue does not list the change, the game does. A joined client's skill screen still draws a link taken away (its own tree); the server's unlock check decides.- Raw game paths are refused here.
- Entry add (0.2.0-dev.32, GameStart only):
{"registry": "skills", "entry": "add", "id": "<mod>:<name>", "like": "game:skill_cfa5985b", "fields": {"links": ["game:skill_cfa5985b"], "cost": 2}}(C#Skills.AddLike(id, like, links, ...)) is a kiln.skills node like the game node (its effect, kind, class and levels), built into the tree when the world loads (skills service); its 32-bit node id is FNV-1a of its GUID. Withoutlinksit is linked as its like node is. A node like a root is refused. Nodes a mod defines through kiln.skills itself (skills/*.json,GameTree.Define) stay that service's definitions.
Edit it from C#
registry.Alter(stage =>
{
stage.Skills["game:skill_4475e8dd"].Cost = 0; // Airborne Architect is free
foreach (var node in stage.Skills.Select())
if (node.Kind == SkillNodeKind.Active) node.Cost = Math.Max(0, node.Cost - 1);
});
stage.Skills is a RegistryEntries<SkillNodeEntry>; Cost, Amount and AmountPerLevel are writable (MaxLevel, Kind,
Class, Unlocks and Links read the node; a node without an amount reads 0 there: tell such nodes by Kind or id). RegistryEdits sample.
Views
RegistryViews.Find("skills") is the stable view (243 nodes on the current server build); unlocks is a Ref to the items
view (the ability item the node unlocks) (views.md).
Worked example
Airborne Architect costs nothing, and every node that unlocks an ability costs one point less, never less than nothing:
{
"format": 1,
"registry": {
"alter": [
{ "registry": "skills", "select": { "id": "game:skill_4475e8dd" }, "field": "cost", "op": 0 },
{ "registry": "skills", "select": { "id": "*", "has": ["active"] }, "field": "cost", "op": { "add": -1, "min": 0 } }
]
}
}
This is mods/samples/SkillCosts.
In multiplayer
cost is now: the server's edit is kiln.gamedata's skills slot of that node, which the content sync carries. A Kiln client
writes it into its own skill tree resource, so its skill screen and its point count follow at the next draw; a vanilla client keeps
the game's costs on its screen while the server's unlock check decides. A pack of skill-cost edits is clients: kiln
(choosing clients). amount and amountPerLevel go the same way. The other
fields are serverOnly and read-only.
Known limits
- A character in a save whose unlocked nodes now cost more than their skill points gets the game's free reset of the whole tree at their next join (the points come back; the nodes have to be unlocked again). Raising a cost warns (edits that change existing saves); lowering is safe.
maxLevelis read-only: a saved level above it would reset the tree at the next join.- An effect that is already running keeps the amount it started with until the next unlock or join; the skill screen's text does not follow the amount (these configs have no tooltip row).
- Links between game nodes: taken away live only where nothing is cut off from a root; added only at the start (above).
- Not yet seen in a real game: a joined client's skill screen after a server edit, a changed amount or growth on a character.