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 →

Where this idea comes from

Strict or liberal? The robustness principle

In the early internet, Jon Postel edited the documents (RFCs) that said how computers should talk to each other. In the 1980 and 1981 rules for TCP and IP he wrote a principle for programs that send and receive messages: be careful in what you send, and forgiving in what you accept. In 2023 the Internet Architecture Board published RFC 9413, “Maintaining Robust Protocols”, looking back on what that forgiveness had done.

One thing to hold: A content pack and a schema that refuses it. The schema is the strict choice: a pack either fits or it does not load.

Why it matters: Forgiving readers kept early networks working, but RFC 9413 argues they also let mistakes spread: if every reader quietly fixes a bad message, the sender never learns, and the mistake becomes something everyone has to support forever. A mod loader that refuses a broken pack outright, and says which field is wrong, is choosing to be strict so the author fixes it once.

What we don’t know: Engineers still argue about where the line should be. Some say forgiveness is what let the internet grow; others say it is why old mistakes can never be removed.

In the RFC’s own words:

  • be conservative in what you do, be liberal in what you accept from others. When a game loads a broken mod, should it guess what the author meant, or refuse it and say why? (Jon Postel (ed.), RFC 793, “Transmission Control Protocol”, 1981)

Dates:

  1. 1980 RFC 760 asks programs to be forgiving in what they receive.
  2. 1981 RFC 793 (TCP) states it as one line.
  3. 2023 RFC 9413 looks back on what that forgiveness cost.

Sources: J. Postel (ed.), RFC 760, “DoD Standard Internet Protocol”, January 1980 · J. Postel (ed.), RFC 793, “Transmission Control Protocol”, September 1981 · M. Thomson & D. Schinazi, RFC 9413, “Maintaining Robust Protocols”, Internet Architecture Board, June 2023