Skip to content

How Roots Work

Roots are Townstead’s data-driven identity and genetics system. They describe what a villager or player is, where that identity comes from, what biological and cosmetic genes they can carry, how those genes are inherited, how mixed heritage should be named, and which appearance assets the game can offer for that identity.

Root is the top-level concept players and pack authors see. A root is what gets assigned to a villager or player. It references species for body base, asset compatibility, and rig; ancestry for broad inherited population data; and lineage for the sub-race or biological branch within that ancestry. Genes, heritage, life cycles, traits, rigs, and loaded appearance assets support that root identity.

If you only need the basics, read these in order:

  1. Root is the identity a villager or player is assigned.
  2. Species decides the body base and what can interbreed.
  3. Ancestry and lineage describe inherited populations within a species.
  4. Genes add inherited appearance, needs, abilities, life stages, and traits.
  5. Heritage records mixed ancestry fractions.
  6. Species rigs and appearance genes decide which body, face, overlay, and attachment assets can be used.

For pack work, start with one root, one species, one ancestry, one lineage, and one or two genes. Add mixed heritage, custom rigs, and complex inheritance after that first path works in game.

Roots system
├─ Root: assigned identity
│ ├─ Species: body base, rig, animations, broad biological defaults
│ ├─ Ancestry: inherited population within a species
│ └─ Lineage: sub-race or biological branch within an ancestry
├─ Heritage: the carried ancestry fractions of an individual
├─ Genome: genes layered from species, ancestry, and lineage
│ ├─ Gene: one inherited or applied feature
│ ├─ Variant: one option inside a gene
│ ├─ Locus: the inheritance slot where related genes compete
│ └─ Genotype: the carried allele pairs
├─ Life cycle and traits: stage progression and trait grants
└─ Rig and appearance: render model, body metrics, face parts, overlays, attachments, and generated character tabs

The important split is between the assigned root and the carried heritage. A villager can be assigned a root such as my_pack:starlit_moon_elf, while their heritage can still record mixed ancestry fractions inherited from parents.

TermMeaning
RootThe top-level identity concept assigned to villagers and players. A root references species, ancestry, and lineage.
SpeciesThe body-level identity: rig, animation defaults, body genes, breeding boundary, and cross-ancestry biological defaults.
AncestryA broad inherited population within a species. An ancestry can provide genes, demonym, backstory, founder weighting, and personality policy.
LineageA sub-race or biological branch within an ancestry. It layers extra genes and text on top of ancestry data.
HeritageThe realized ancestry fraction map carried by an individual. This is what lets mixed ancestry be represented without pretending everyone is only one root.
TermMeaning
GeneA data file that defines one inherited or applied capability, appearance feature, physiological trait, life cycle, resource, or behaviour.
VariantA named option inside a gene. For example, an eye-colour gene could be brown, blue, or silver.
LocusThe inheritance slot where related genes compete. Genes at the same locus behave like alleles of the same trait.
AlleleOne carried copy of a gene or variant. Most inherited genes carry two copies: one from each parent.
GenotypeThe full set of carried gene copies stored on the person. A genotype can carry recessive or unexpressed genes.
Expressed geneThe winning allele after dominance, weight, and tie-breaking have been resolved. Runtime systems read expressed genes.
TermMeaning
TraitA Townstead/MCA trait data file that can be granted by a trait occurrence gene.
RigA render definition used by a species or life stage. Rigs describe model, texture, bones, equipment anchors, poses, face, and related rendering data.
Appearance assetA texture, face strip, overlay, attachment, or related visual option that is compatible with a species rig and can be selected by genes or generated character UI tabs.
Life cycleA gene-defined ordered list of life stages, such as baby, child, adult, senior, or custom stages like egg and larva.
File TypePathSchema
Rootdata/<namespace>/root/<path>.jsontownstead:root/v1
Speciesdata/<namespace>/species/<path>.jsontownstead:species/v2
Ancestrydata/<namespace>/ancestry/<path>.jsontownstead:ancestry/v1
Lineagedata/<namespace>/lineage/<path>.jsontownstead:lineage/v1
Heritagedata/<namespace>/heritage/<path>.jsontownstead:heritage/v1
File TypePathSchema
Genedata/<namespace>/gene/<path>.jsontownstead:gene/v2
Chronotypedata/<namespace>/chronotype/<path>.jsontownstead:chronotype/v1
Traitdata/<namespace>/trait/<path>.jsontownstead:trait/v1
Rigdata/<namespace>/rig/<path>.jsontownstead:rig/v1
  1. Townstead loads species, ancestry, lineage, root, heritage, chronotype, gene, rig, and trait JSON from data packs.
  2. Each root resolves an effective species, effective genome, effective spawn bias, demonym, backstory, personality policy, and life cycle from its layered data.
  3. New villagers choose a root from spawn weights, village restrictions, and optional same-species admixture.
  4. Founders receive a root, heritage, personality, body metrics, trait rolls, life-stage timing, and genotype.
  5. Children inherit one allele from each parent at every diploid locus and average their parents’ heritage fractions.
  6. Runtime systems read the expressed gene set to apply abilities, attributes, visuals, resources, sounds, restrictions, and other behaviours.
  7. Character creation and customization screens can build body and appearance tabs from the loaded roots, species, rigs, genes, and compatible assets.

Start with File Basics and Root Profiles for authoring structure, then Gene Files and Inheritance for the genetic model. For visuals, see Rigs and Appearance Assets.