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

XMLGameEngine documentation

A game is one XML file of tags, checked against games/xgedef.xsd. The engine reads it and plays it, with no code in the file. This page is the way in: what each part of the docs is for, a short tour, and an index of every word.

Where to look

Folder For Use it when
reference/ how the engine works today: every tag, what it does, the programs, the build writing a game, or checking what a tag does. The code is the truth; these pages follow it
designs/ one small file per topic: what was looked at, what was chosen and why, what is open changing the language or the engine
agents/notes.md gotchas and working rules for anyone (or any AI) changing the code before a change

New to it: read the tour below, then the game file, objects, collisions, input and states, with a game from the shipped games open beside them.

A tour in six words

<game xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xgedef.xsd">
  <window name="Bounce"><width>640</width><height>480</height></window>
  <states>
    <state name="playing">
      <objects>
        <object name="ball">
          <sprite><circle><radius>8</radius></circle></sprite>
          <position><x><centered /></x><y><centered /></y></position>
          <velocity><x>3</x><y>2</y></velocity>
          <collisions>
            <collision edge="vertical"><bounce /></collision>
            <collision edge="horizontal"><bounce /></collision>
          </collisions>
        </object>
      </objects>
      <inputs>
        <input button="space"><reset /></input>
      </inputs>
    </state>
  </states>
</game>

A ball bounces round the window, and Space puts it back. Run a game with output/Debug/xgecli <name> (programs).

The reference

Page What is in it
The game file layout, the one rule, values and arithmetic, names, window, variables, styles, colours
Objects parts of an object, groups, columns and rows, the kit and from=, spawn and despawn
Pictures shapes, lines, polygons, bitmaps, SVG, text, animation, looks, poses, turning, light, height
Sounds notes, waves, music, playing
Collisions rules, filters, how a touch is found, knocks
Commands every verb, where each may go, refused presses
Input keys, mouse and pads, press/hold/release, held keys
Timers and paths timers, time left, paths
States and scenes the stack, scenes, conditions, keeps, best tables, turns, demos, computer players
Maps ASCII maps, mazes, cells for grid puzzles
Board games moves, the picker, marks, put pieces
Cards decks, piles, hands, patterns, tricks, the computer
The shipped games the key convention and each game, by kind
Programs xgecli, xgegui, generating a program
The engine loading, each frame, backends, building, source map
Known limitations what it cannot do yet

Word index

Family Words Page
moving move, hop, jump, leap, land, climb, accelerate, thrust, turn, swing, reverse, stop, track moving
steering aim, chase, hunt, wander, follow, go steering, paths, mazes
touching bounce, deflect, knock, stick, wrap, ride, carry, hole touching, knocks
in and out of play die, reveal, fire, release, drop, spawn, despawn, reset in and out of play, spawn
numbers inc, dec, set, copy, rank, formula numbers, arithmetic
look and sound become, play, silence, music look and sound
flow push, pop, enter, turns, pass, out, demo, trigger flow
cells settle, slide, cycle, fall, grow, split, send, through cells
boards pick, place, put, flank, moves boards
cards deal, take, lay, piles, patterns, tricks cards
computer computer, hold, think computer players

Keeping the docs