1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- intro
- a game structure file describes how the data of a video game is structured.
- this should only be useful for someone wishing to write a compiler
- that compiles an abstract video game into an actual game in another language.
- example
- here is an example file to understand what a game structure looks like
- .game
- @scene ~ # scenes in game
- .scene
- ^ # name
- @object ~ # scene objects
- .object
- $ ~ # object shape
- $ ~ # object color
- $ 16 # object matrix
- this basically describes a game with an unspecified amount of scenes,
- considering that every game has different scenes.
- each scene has an unspecified number of objects, and each object has a shape (described in vertices)
- a color (for each vertex) and a 4x4 matrix.
- symbols
- the first symbol declares a structure, used for grouping data
- . create a new structure of data
- these symbols describe data types that belong to a structure
- $ number
- ^ string
- @ structure
- after that, an optional symbol can appear, showing quantity of the data
- [1-9] amount of data
- ~ arbitrary amount of data, until '~' is encountered
- comments
- # comment until end of line
- syntax
- the first symbol of any file must be a dot (.) to create a new structure.
- then, either dots (.) or other data-types can be followed.
- after a data-type an optional quantity can follow, the default is "1".
- the structure "game" is the top-level one, and should always be active.
-
- note that everything after the # is a comment, it is only there to make it human-readable
- data-types can describe anything the developer wants, for example to include the game's title:
- .game
- ^ # game's title
- it is possible to describe multiple data-types:
- .vector
- $ 3 # vector has 3 numbers for x y and z
- this says there are 3 numbers inside a vector. if the number of data-types is different
- for each game, use the tilde array (~):
- .object
- $ ~ # object's shape - every object has different amount of vertices
- it is possible to create new data structures and add them in another:
- .game
- @vector # a vector that is stored inside the game
- .vector # describe the vector structure
- $ 3 # it has 3 numbers for x y z
|