An engine for describing games built around Xerces, exprtk, and SFML.
Status: implemented
A game is a single XML file, validated against assets/xmlgameengine.xsd.
The author picked XML on purpose, for three reasons:
pong.xml and roughly follow it. The name and class attributes are borrowed from HTML id and class on purpose (06).Reasons 2 and 3 were undermined by the old function-call expression syntax, which is gone (03); the arithmetic left in value text still hides a little from both (04).
| Option | Notes |
|---|---|
| XML + XSD | Chosen. Familiar, validatable, transformable. Verbose. |
| Text VGDL (academic style) | The original VGDL uses compact text files: a game description (SpriteSet, LevelMapping, InteractionSet, TerminationSet) plus an ASCII-art level file. Very compact, unfamiliar, no schema tooling. |
| YAML | What Griddly’s GDY uses. Compact and readable; weaker validation story. |
| JSON | Easy to parse everywhere; awkward for comments and for humans to author. |
Academic VGDL splits rules and level layout into two files. XMLGameEngine keeps everything in one XML file, and lays out grids of objects with the <grid> sprite element instead of an ASCII map. Whether a separate level file will ever be needed for larger games is open.
window, variables, objects, states; inside an object sprite, position, velocity, collisions, then optional actions and variables). The engine’s own element lookup is by name, not position, so it does not depend on this order.valueType: expression text or one value tag, so it is not limited by the schema. The one exception is <framerate>, an xs:unsignedByte (0 to 255).xsi:noNamespaceSchemaLocation skips validation. See 15 for how strong (Xerces) and weak (built-in) validation differ.name is an attribute, because it is identity, while width, height, color and the like are configuration and go in child elements (already the direction in 03). Alternatives: grouping related properties under a sub-element (size, background, display), or making name an element too.The schema also checks the shape of every game: attributes are names and picks, values and commands are elements, and <condition> must hold exactly one of <atleast>, <atmost>, <remaining>. Expression text inside a value is still a plain string to the schema.