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

Generating a program

Status: Built: xgecli --generate windows-cpp covers every game. XSLT writes the game file out as the engine’s own data, and the program plays it with the engine’s own code on SFML. A test compares each game’s data with what the engine reads, field by field, and plays the two side by side. Reference: programs.

What we looked for

The format was chosen partly so a game could be transformed with XML’s own tools: XSD to check it, XSLT to turn it into a program of its own. The rule set later: a generated game must play exactly as xgecli and xgegui play it, using the same code for the frame, physics, collisions, keys and sound, differing only in having no XML to read and no choice of libraries. And it stays XSLT.

What we looked at

Option Verdict
G1. XSLT writes the rules out as C++ statements Readable, but every verb and the frame order written a second time. Built first, drifted, replaced
G2. Embed the XML and link the whole engine Plays the same, but is the engine with one game, and no transform at all
G3. C++ writes the engine’s data, runtime copied in Plays the same, but no XSLT. Built and replaced the same day
G4. XSLT writes the engine’s data, runtime copied in Chosen. A second reader, in XSLT, kept honest by a test against readGame
G5. xgecli dumps XML, XSLT templates it into C++ Uses the tool without the point of it

How it runs

What G1 taught

The first target wrote each game as a program a person might write (Pong about 480 lines). Its verbs moved into the engine’s play/geometry.cpp and the sweep was shared, but differences remained (thrust applied as the key was read, members never touching each other). A copy of the engine’s behaviour, however carefully kept, drifts. So the stylesheets write only what the file says.

A readable game on the shared frame (set aside)

Open