Skip to content

Registry System

Registries are the core extensibility mechanism in DINOForge. Every moddable content type flows through a registry.

What is a Registry?

A registry is a typed, priority-layered dictionary that maps content IDs to definitions. When a pack declares units, factions, weapons, or buildings, those definitions enter the appropriate registry.

Supported Registries

RegistryContent TypeSchema
UnitsInfantry, vehicles, artillery, heroesunit.schema.yaml
BuildingsBarracks, defenses, economy, researchbuilding.schema.json
WeaponsBallistic, explosive, beam, meleeweapon.schema.json
ProjectilesTracers, rockets, blasters, shellsprojectile.schema.json
FactionsFaction identity, roster, economy, visualsfaction.schema.yaml
DoctrinesCombat doctrine modifiersdoctrine.schema.json
SkillsUnit abilities and special actionsskill.schema.json
WavesEnemy wave composition templateswave.schema.json
SquadsSquad formation definitionssquad.schema.json

Priority Layers

Content is resolved through ordered layers:

PriorityLayerDescription
0Base GameVanilla DINO values
100FrameworkDINOForge defaults
200Domain PluginWarfare/Economy plugin values
300+PackMod pack overrides

Higher priority wins. Within the same priority, load_order in the pack manifest breaks ties (lower load_order = loads first = lower priority within the tier).

Conflict Detection

When two packs at the same priority modify the same registry entry, the system detects a conflict:

CONFLICT: Unit "clone_trooper" defined by both
  - pack "starwars-republic" (load_order: 100)
  - pack "starwars-alt-republic" (load_order: 100)

Resolution strategies:

  • Last-write-wins — Higher load_order takes precedence (default)
  • Explicit conflict — Packs declare conflicts_with to prevent co-loading
  • Merge — Future: field-level merge for compatible partial overrides

Registry Operations

Packs interact with registries through their manifests:

Adding New Entries

yaml
loads:
  units:
    - clone_trooper
    - arc_trooper

These add new entries to the Unit Registry.

Overriding Existing Entries

yaml
overrides:
  units:
    - vanilla_archer    # replaces the base game archer

Overrides replace existing entries at the pack's priority level.

Implementation

The SDK provides a generic Registry<T> class:

csharp
public class Registry<T> where T : IRegistryEntry
{
    void Register(string id, T entry, int priority);
    T? Resolve(string id);
    IReadOnlyList<T> GetAll();
    IReadOnlyList<RegistryConflict> GetConflicts();
}

All registries are populated during pack loading, before the game simulation starts. This allows full validation and conflict detection at boot time rather than during gameplay.

Released under the MIT License.