XMLGameEngine

XMLGameEngine is a VGDL (video game description language) and an engine for running games completely contained within an XML file.

View the Project on GitHub beefviper/XMLGameEngine

Arithmetic in text and as tags

Status: Built: text arithmetic of + - * / (load/calc), and <formula> tags for everything more. Reference: arithmetic as tags.

What we looked for

Arithmetic (window.width.center - ball.radius) was the last thing hidden from XSD and XSLT: a string a tool cannot see into. Wanted: a form a schema can check and a transformation can walk, that does not cost every game its readability, and that needs no second tool.

Option Verdict
E1. Paste the string through Fine for C++ targets, not assembly
E2. XSLT parses it Awkward precedence parsing
E3. Parse in C++ to an AST as XML for XSLT Adds a step
E4. Computation as elements Built as <formula>, beside plain text for sums

<formula>

The text cut down

Schema

A formula’s operands hold operations, so the schema’s types contain themselves. Xerces handles that; load/xsd was taught to follow a named type that refers to itself. The operations are listed twice (formula and operand), since a group containing itself is still refused there.

Open

tangent, square root, power and pick: added when a game needs one. A schedule (a list of lengths, one per wave) would say Pac-Man’s timings plainly.