XMLGameEngine is a VGDL (video game description language) and an engine for running games completely contained within an XML file.
Status: Built: detection, dispatch and execution apart; swept touches; pixel tests; riding and carrying; unless=; deflect; side, checks and triggers in rules; contacts and <knock>; solid inks and hitboxes; bounce by the normal. Reference: collisions, commands.
play/collision.h, play/geometry.h).Commands from game/command.cpp).CommandExecutor::run, one std::visit for every place a command runs, told by a Doer what it has (an object, what it touched, a key, an action).<bounce />; the “if” lives in detection.moveObjects, play/frame.cpp): each round the earliest touch anywhere wins, everything advances to it, that pair’s rules run, and the rest of the frame plays on. A pair reacts at most once a frame.<set> of x, a teleport, a spawn). Each object keeps last frame’s Moment in before. Put somewhere by a load or a reset between frames is not a move (placed); reset in the middle of a frame is. Rejected: a list of verbs that move by place (one would be missed).Donkey Kong lagged: about 50,000 pairs compared each frame. Kept every touch and its order exactly, and:
FrameRules::partners);A screen grid was rejected: it needs a cell size per game, and what is left after pruning is a few hundred cheap tests. Open: a grid if a game has thousands of movers; nearest searches still look at everything.
<ride /> lends the other’s velocity for the frame, recomputed from current touches, so stepping off needs no undo. Rejected: copying the velocity (must be undone), parent/child attachment (an ownership model the language lacks).<carry /> is the carrier’s: it remembers what and where, lends its motion before the move (so the carried thing’s touches run) and places it after. One thing at a time; taking another puts the first down. <drop /> remembers the dropped thing until they part. Open: several things, a thief that steals only by rule.unless="class" skips a rule while touching that class (Frogger’s water unless on a log), so it does not depend on pair order. Rejected: rule order, a “safe” class overriding a “hazard”.<stick /> corrects only the touched axis, so a pushed object slides along.<type>pixel</type> is opt-in. The box sweep runs first; only a touching pair is walked in half-pixel steps to the first shared solid pixel. Any alpha counts as solid. Refused on text and images (their pixels are a backend’s).<solid char> names which inks of a bitmap touch (Q*bert’s cube tops); the mask goes with flips and turns. <hitbox> is a smaller box or circle used for every touch. Rejected: a separate collision picture, polygon hitboxes. Open: a hitbox per look.<slower>/<faster>: the speed is read once per touch, so a landing rule and a crash rule never both run.side= is the side of the rule’s own object that was touched; same words as edge= but a separate attribute, since edge= means a screen edge.<condition>, <all>, <any>); one with no object= means the object itself. Not yet on edge rules.<trigger> in rules runs one of the object’s actions, so a death is one action that every killing rule names.Pong’s rule: the paddle’s middle sends the ball straight back, its ends at 45 degrees. <deflect>45</deflect> measures from the side’s middle and keeps the speed. Rejected: <bounce>45</bounce> (bounce also runs on edges).
contactOf): edges, point, normal, where along each side, depth, time. Each side’s rules see it from their own side; commands read touch.x, touch.normal.x and so on. Chosen over every sweep returning it, or each verb measuring for itself.<knock> is a one-dimensional collision along the normal by <mass>, its content the bounce. Nothing happens unless closing, so both sides may say it. No mass is as heavy as can be. Chains of balls pass a knock on with no extra mechanism.through="class" takes only such felt-through touches.<drag>.<bounce> mirrors the velocity about the touch normal, as off a surface standing still, keeping its content’s share of speed (above 1, a bumper). A box side faces straight out, so every box game plays as before; the tests passed unchanged.<knock>’s job.pixelContactAt): round the touch point, each side’s solid pixels are measured for how they spread; the flattest is the surface. Otherwise middle to middle, which handles the end of a gun barrel.