Reference
Data that fits the contract
Four ideas make a mod loadable. Back to the packs anytime: Open the validator →
- A schema is a contract
A schema states exactly what valid data looks like: which fields are required, what type each is, which values are allowed, and what ranges are sane. If your data fits the contract, the game can load it without crashing — no matter who wrote it.
- Enums pin the allowed values
Some fields may only be one of a fixed set — here rarity ∈ {common, uncommon, rare, legendary}. Anything else ("mythic") is rejected at load, not silently accepted, so a typo fails loudly and early instead of breaking the game later.
- Ranges and types
stack must be a whole number from 1 to 999. A validator checks the type (a number, not text), then the range. Catching "5000" or "2.5" here is far cheaper than discovering it when an inventory overflows in play.
- Beyond the schema: invariants
Some rules a plain schema can’t express — like "every item id must be unique within the pack". PackForge checks that as an extra semantic test after the schema passes. Real mod loaders layer these invariant checks the same way.
Validate early, fail loudly, and a whole community can build on your format safely. Fix a pack →