Documentation
Docs/en/reference/prototype-format/validation.md
Prototype Validation Rules
Generated reference. Do not edit directly. Update
BuildTools/PrototypeFormatInterface.jsonor the owning engine metadata, then runpython BuildTools/docs_prototype_format.py --write.
| Index | Syntax | Properties | Validation | Canonical JSON | Authoring guide |
These rules are enforced by the parser, metadata registrators, property serializer, or the side-specific prototype bake. Stable IDs let CI track contract changes.
| Stable ID | Rule | Requirement | Notes | Authority |
|---|---|---|---|---|
prototype-format.rule.config-syntax |
Configuration syntax | Use repeated INI-like sections, key = value assignments, # comments, whitespace-prefixed trailing backslash continuation, and key += value append where appropriate. | Prototype files use the shared ConfigFile parser; quoted or escaped comment characters remain part of the value. | Source/Common/ConfigFile.cpp |
prototype-format.rule.file-filter |
Extension filter | Only files whose extension occurs in Baking.ProtoFileExtensions enter ProtoBaker. | Directories and conventional extension names do not select a prototype type; the section does. | Source/Tools/ProtoBaker.cpp |
prototype-format.rule.identity-per-type |
Identity and duplicates | A migration-resolved prototype id must be unique within its resolved type across the complete pack input. | The same text id may exist in different prototype types; duplicate ids in one type fail the bake. | Source/Tools/ProtoBaker.cpp |
prototype-format.rule.identifier-characters |
Reserved identifier characters | Prototype ids must not contain / or $ because both characters are reserved for nested section addressing. | The baker rejects either character after applying the file-basename fallback and before hashing or duplicate detection. | Source/Tools/ProtoBaker.cpp |
prototype-format.rule.inheritance-scope |
Inheritance scope | Every parent must resolve inside the same prototype type and current pack input. | Parents may be declared in another file, but cross-type and missing parents fail the bake. | Source/Tools/ProtoBaker.cpp |
prototype-format.rule.inheritance-precedence |
Inheritance precedence | Merge ancestors depth first, then parents from left to right, then the child; later property values replace earlier values. | $-prefixed control directives are not copied into the merged property map. | Source/Tools/ProtoBaker.cpp |
prototype-format.rule.acyclic-inheritance |
Acyclic inheritance | Prototype parent graphs must be acyclic. | ProtoBaker and ProtoTextBaker track the active parent path and reject self, pair, and longer cycles under every repeated-parent policy. | Source/Tools/ProtoBaker.cpp |
prototype-format.rule.repeated-ancestors |
Repeated ancestors | A parent reached through several inheritance paths contributes only where it is first reached; Baking.AllowRepeatedProtoParents decides whether the later reach is skipped or rejected. | The default is permissive; set the option false when a project wants every inheritance diamond to fail baking. ProtoBaker and ProtoTextBaker apply the same rule. | Source/Tools/ProtoBaker.cpp |
prototype-format.rule.property-resolution |
Property resolution | Every non-control key must resolve to a property available for the current bake side. | Unknown, disabled-for-this-side, virtual, and temporary properties are rejected; opposite-side-only properties are skipped for that side. | Source/Common/Properties.cpp |
prototype-format.rule.strict-values |
Strict text values | Property values must parse according to the metadata type without overflow, unknown enum/prototype references, non-finite numbers, or malformed collection structure. | The property serializer is the authority for scalar, enum, struct, array, dictionary, RefType, FixedType, and Proto reference text. | Source/Common/PropertiesSerializer.cpp |
prototype-format.rule.init-script-signature |
InitScript callback signatures | A non-empty built-in Item, Critter, Map, or Location InitScript property must resolve to a global void callback receiving that entity type and bool firstTime. | Server baking validates ScriptFuncType metadata for every authored callback property and rejects missing functions or mismatched signatures before runtime. | Source/Tools/Baker.cpp |
prototype-format.rule.proto-reference |
Prototype references | FixedType and Proto entity property references must resolve after migration unless the property is nullable and the authored value is empty. | A removed or renamed referenced id needs an explicit Proto migration rule to a valid target or Remove according to the owning persistence policy. | Source/Common/PropertiesSerializer.cpp |
prototype-format.rule.proto-migration |
Prototype migration | Proto migration rules are applied to declared ids, parent ids, lookups, and persisted references before final resolution. | Author migrations in native/project metadata with ///@ MigrationRule Proto <Type> <Old> <NewOrRemove>. | Source/Tools/ProtoBaker.cpp |
prototype-format.rule.side-specific-output |
Side-specific output | The same source set is parsed and serialized separately for server, client, and mapper metadata. | A source property can be meaningful on one side and skipped on another; server output also validates script callback properties. | Source/Tools/ProtoBaker.cpp |
Current diagnostic limitation
Parent graphs must be acyclic. The current baker recursively expands parents without a dedicated cycle diagnostic, so embedding projects should validate cycles before baking and keep inheritance chains shallow. This is a documented implementation limitation, not a supported cyclic behavior.