# RaceDef

> Kinbarrow modding reference — content tree `45d0fe274f851548`, version `0.2.0+main.c05ef2b`.

`races/<id>.srd.ron` — one per file; stem == id.

**Note on syntax:** these files are RON, not JSON. The shapes below are exact,
but punctuation follows RON — read a real `data/*.ron` file alongside.

## Fields

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `age_adult` | `uint32` | required | Age of adulthood, in years. |
| `age_lifespan` | `uint32` | required | Typical lifespan, in years. |
| `alignment_bias` | `AlignmentBias` | required | The race's alignment tendency (OURS, not the SRD's). |
| `asi` | `any[][]` | required | Fixed racial ability bumps. |
| `asi_choice` | `AsiChoice` | optional | A player-assigned bump (half-elf's "two others +1"); absent = none. |
| `blindsight` | `integer` | optional | SRD special senses in FEET of radius — blindsight (perceive without sight), tremorsense (locate a grounded creature), truesight (see the invisible, and in darkness). Stamped onto the soul at compose (`SENSE_*`), read by `soul::senses_of`. ABSENT = none but sighted (the absent-default): no SRD playable race carries these, so per-race sense depth is LEDGERED and every composed soul reads no special sense. |
| `creature_type` | `string` | optional | The race's creature type: a `tables/creature_types.srd.ron` id, stamped onto the soul at compose (`CREATURE_TYPE`) — the read the hold-person gate consults. ABSENT means humanoid (the size precedent): every SRD playable race is a humanoid, so no race file carries this and every composed soul reads humanoid by default. |
| `darkvision` | `boolean` | required | SRD darkvision: the soul reads darkness as dim and dim as bright (`light::seen`). Stored as the trait's presence — the SRD's 60 ft range waits for the battlemap's per-square light (ledgered). |
| `id` | `string` | required |  |
| `immunities` | `string[]` | default `[]` | SRD damage immunities — damage-kind ids, stamped at compose (`IMMUNITIES`); the matching kind deals ZERO. The resistance mirror; absent = none (no core race carries any yet). |
| `languages` | `string[]` | default `[]` | SRD known languages — `tables/languages.srd.ron` ids, stamped onto the soul at compose (`LANGUAGES`). ABSENT MEANS COMMON (the absent-default): no SRD race file declares any, so every seeded soul reads Common by construction and `soul::shares_language` is true realm- wide — the sim is byte-identical. Per-race tongues (dwarf → Dwarvish) are LEDGERED depth, added as one row each where a consumer wants them. |
| `name` | `string` | required |  |
| `resistances` | `string[]` | default `[]` | SRD damage resistances (dwarf poison, tiefling fire) — damage-kind ids, stamped onto the soul at compose (`RESISTANCES`), halved at damage application. |
| `size` | `Size` | required | The race's creature size. |
| `source` | `Source` | required |  |
| `speed` | `uint32` | required | Walking speed in feet — the composition source of NPC speed. |
| `subraces` | `SubraceDef[]` | required | The race's subraces (the SRD one-per-race picks). |
| `traits` | `string[]` | default `[]` | SRD racial traits WITH an engine substrate — ids resolving against the engine's implemented registry (`classes::RacialTrait`), the ledger-don't-fake rule made data: a trait appears here only once combat or generation actually consumes it (darkvision keeps its own field). Absent = none (older files read unchanged). |
| `tremorsense` | `integer` | optional | Tremorsense radius in feet; absent = none. |
| `truesight` | `integer` | optional | Truesight radius in feet; absent = none. |
| `vulnerabilities` | `string[]` | default `[]` | SRD damage vulnerabilities — damage-kind ids, stamped at compose (`VULNERABILITIES`); the matching kind is DOUBLED. Absent = none. |

## Nested shapes

### Ability

The six ability scores (SRD 5.1). The engine's own `stats::Ability` is the runtime type; this is the data-layer mirror, bridged by [`Ability::engine`].

`Str`, `Dex`, `Con`, `Int`, `Wis`, `Cha`

### AlignmentBias

OURS, not the SRD's — the alignment-tendency distillation.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `ethic` | `double` | required | Law↔chaos tendency (−1..+1). |
| `moral` | `double` | required | Good↔evil tendency (−1..+1). |

### AsiChoice

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `amount` | `int32` | required | The bump each chosen ability gets. |
| `count` | `uint32` | required | How many abilities the choice raises (half-elf's two). |

### Breath

A Breath Weapon's DATA: its damage KIND and the SAVE ability its area throw asks — the two axes that vary by draconic ancestry (a red dragonborn's fire on a Dex save, a silver's cold on a Con save). The area is the archetypal 15-ft cone for every ancestry (the SRD's per-ancestry line/cone split is LEDGERED — the shape reads the same to the bubble's `area_targets`); dice scale by level and the DC derives from Con, both at assemble, so neither rides the data.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `kind` | `string` | required | A `tables/damage_kinds.srd.ron` id — validator-checked, and the ancestry's own resistance kind (a fire-breather resists fire). |
| `save` | `Ability` | required | The saving-throw ability every creature caught in the cone rolls. |

### Size

Creature size — the full SRD ladder (Tiny..Gargantuan). Races span Small/Medium; the bestiary's monsters reach the rest, and the hit die swings by it (`combat::srd::hit_die`).

`Tiny`, `Small`, `Medium`, `Large`, `Huge`, `Gargantuan`

### Source

Every file's top-level value carries `source`.

#### Source::Srd51

SRD 5.1 — the System Reference Document, the shipped baseline.

#### Source::Original

Original content authored for this game (not from the SRD).

#### Source::Personal

A player's own transcription or third-party content in a mod tree — provenance stays honest without borrowing the base tree's markers. Never used by shipped files.

### SubraceDef

One subrace of a race — the SRD's one-per-race pick (hill dwarf, high elf, lightfoot, rock gnome) and the dragonborn's draconic ancestry distilled to the same shape (a required in-race choice granting mechanics). Chosen in the character creator; generation still composes the base race only (the ledger row stands).

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `asi` | `any[][]` | required | Fixed ability bumps the subrace grants. |
| `breath` | `Breath` | optional | The draconic ancestry's Breath Weapon — the activated racial action the subrace ledgered. Absent = the subrace has none (the dwarf/elf/gnome subraces, and every base race): stamped onto the soul at compose only where present, so the sim is byte-identical without it. |
| `id` | `string` | required |  |
| `name` | `string` | required |  |
| `resistances` | `string[]` | default `[]` | SRD damage resistances the subrace adds (draconic ancestry's acid/ lightning/fire/poison/cold) — damage-kind ids, unioned with the base race's at compose (`RESISTANCES`). Absent = none. |

