Everything a designer authors is KDL. Top-level nodes:
| node | key=value |
children |
|---|---|---|
namespace "core" |
— | — (applies to the rest of the file) |
archetype "Name" |
parent="Other" |
values, and meta |
meta "Name" |
priority=50 |
values |
surface "Name" |
— | values, and meta |
object "Name" |
archetype="A" (required) |
values |
link "Flavor" |
from="A" to="B" |
the link's own values |
namespace "core"
meta "Alert" priority=50 {
vision-range 45.0
}
archetype "Physical" {
mass 10.0
}
archetype "Guard" parent="Physical" {
max-hit-points 100
can-attach-rope
meta "Alert"
}
surface "WoodPlanks" {
meta "Wooden"
}
object "Guard01" archetype="core.Guard" {
max-hit-points 75 // this one is wounded
transform { position 10.0 0.0 4.0 }
status "Alerted" "Dead"
}
link "Contains" from="Guard01" to="Sword01" {
slot "RightHand"
}Every child node that is not meta is a value, stored under its own name. What it means is up to the
game that reads it:
- no arguments — a flag,
dos.hasanswers it; - one argument — a number, string or boolean,
dos.valuereturns it; - several — a list,
dos.argsreturns them; - children — a struct or anything nested,
dos.readfills your type ordos.nodehands you the tree.
On an object these are the object's own values, and they beat everything its archetype says. Names
are matched loosely when a value is read into a struct field or an enum: letter case, - and _ are
ignored, so RightHand, right_hand and Right-Hand all mean Right_Hand.
Nothing checks a name against a list, so a file may carry values no game reads yet — and a typo is
found by unread rather than by the loader.
Names are dotted. namespace "core" prefixes every name declared in the rest of the file, and a
reference is tried first inside the current namespace, then as written. Archetypes, metas and
surfaces share one namespace; objects have their own.