Git Product home page Git Product logo

gamekumo-format's Introduction

GameKumo Format

A general purpose game project description format. Purely JSON-based. Created by Tom Greenaway, @tcmg.

Overview

The GameKumo format is a flexible object data structure that aims to represent a complete game project which can then be easily read and if necessary, further transformed, by other middleware tools and game engines.

A game project is represented as a tree wherein the top node is a game object and all other parts of the project are other game objects which are descendants of the root game project. Depending on an object’s type, it may or may not have children of its own but will almost certainly have default attributes.

Therefore every object:

  • Has a unique ID.
  • Has a parent with regards to its position in the data structure.
  • Has a set of attributes which describes that object.
  • May have subsequent children of its own. The children of an object may be of different types and therefore different arrays of children.

Finally, another key element of the GameKumo format is that objects may optionally have an heir – which is to say, an object from which they inherit attributes from.

Project Structure

Below is an example that shows the overall structure of a project in a GameKumo project. The black lines denote parent-child relationships. While the blue dash-dotted lines denote inheritance relationships.

GameKumo object relationship diagram

Here is an example of the structure of an object:

{
    "id": "00002344793322804578",
    "type": "game",
    "config": {
        "name": {
            "value": "Example Game",
            "type": "directstring",
            "comments": "",
            "meta": ""
        },
        "height": {
            "value": "568",
            "type": "integer",
            "comments": "",
            "meta": ""
        },
        "icon": {
            "value": "00001712611806977053",
            "type": "textureId",
            "comments": "",
            "meta": ""
        },
        "iconSolid": {
            "value": "00004854120959970687",
            "type": "textureId",
            "comments": "",
            "meta": ""
        },
        "startLevel": {
            "value": "00007641181819011078",
            "type": "layout-reference",
            "comments": "",
            "meta": ""
        },
        "version": {
            "value": "1.0",
            "type": "directstring",
            "comments": "",
            "meta": ""
        },
        "width": {
            "value": "320",
            "type": "integer",
            "comments": "",
            "meta": ""
        },
        "zoom": {
            "value": "1",
            "type": "integer",
            "comments": "",
            "meta": ""
        }
    },
    "classes": [...],
    "layouts": [...],
    "behaviours": [...],
    "textures": [...]
}

All objects in GameKumo have at least these 3 JSON properties:

  • id:
  • type:
  • config:

Children objects are collected as arrays with individual labels denoting their relationship to the parent, for example:

  • classes:
  • layouts:
  • behaviours:
  • textures:

Predefined Object Types & Default Config Values

For a definition of all predefined object types, consult the templates.json file in the project root. The following are the most core object types.

Game

  • Config:
    • name
    • width
    • height
    • startLayout
    • version
    • zoom
  • Children:
    • classes
    • layouts
    • behaviours
    • textures

Class

  • Config:
    • name
    • width
    • height
  • Children:
    • behaviours

Instance

  • Inherit: this object type can inherit from another object (specifically a class)
  • Config:
    • width
    • height
  • Children:
    • behaviours

Layout:

  • Config:
    • name
    • width
    • height
  • Children:
    • layers
    • behaviours

Layer:

  • Config:
    • name
    • z
  • Children:
    • instances
    • behaviours

Behaviour:

  • Inherit: this object type can inherit from another object (specifically other behaviours)
  • Config:
    • width
    • height

Texture:

  • Config:
    • src

Other object types:

  • Font
  • Sound
  • Music

Attribute Types

  • string
  • integer
  • float
  • enum
  • boolean
  • class-reference
  • instance-reference
  • layout-reference
  • layer-reference
  • behaviour-reference
  • texture-reference

Short Names

All structural parts of the GameKumo format should be reducible to a shorter notation for reducing bloat in JSON. The following keys and attribute types can be replaced for size reduction:

Core:

  • id: id
  • inherit: it
  • config: cg
  • children: cn

Attribute internals:

  • type: t
  • value: v

Attribute types:

  • string: s
  • integer: i
  • float: f
  • enum: e
  • boolean: b
  • class-reference: cr
  • instance-reference: ir
  • layout-reference: ltr
  • layer-reference: lrr
  • behaviour-reference: br
  • texture-reference: tr

Children types:

  • classes: cs
  • instances: is
  • behaviours: bs
  • layouts: lts
  • layers: lrs
  • animations: as
  • textures: ts

gamekumo-format's People

Contributors

tcmg avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.