XGameML Draft

16 February, 2010

Originally written by Victor Vikene

This is a very early and uncomplete draft and do only exist for discussion purposes.

Introduction

There's a lot of discussion around implementing a game library in XBMC Media Center. The challenge is to create a system that can handle game information for all platforms with less code. The games can be splitted into three main categories: Console games, arcade games and computer games. The communities and collection that allready exist are often focused on only one of these categories. The main reason for this is the diffence in how the games are distrubuted and on which hardware they're played, since this creates a small difference in the information structure.

Why should we bother to create this tool for storing game data? I'm not aware of any good solution handle this kind of information between platforms and different systems. This tool would make it possible to create awsome informative and visual game libraries, not only in XBMC, but opens for easy implementation for this in new and existing Media Centers and front ends for almost all games ever made.

The goals is a tool making it possible to handle game library collection for all platforms without the need to handle platforms induvidually and creating a code base that can be shared between emulators and emulator front ends

The recommendation is built around two sets. One simple and one complete

Platforms

Arcade Games

Arcade game roms are dumps from a arcade machine, which makes the hardware and bios a important piece of the information. The most popular emulator around are MAME. MAME uses a specific romset for every version, and the roms might be depended on other roms/bios. Every game is a archive, and uses a short defined name, so the actual files must not be renamed.

Cabinet, flyers, marque, control pad and custom art works are in addition to screenshots (intro and action) the important graphical elements in a arcade rom collection

Hardware specifications are a important part of this for a lot of enthusiasts, so it would make sense to create space for this so this tool can be used outside XBMC for collections of sets by arcade game enthusiast also.

Console Games

Unlike arcade games, console games are mainly distrubuted on a removable media such as cartridge, cd or dvd. It exist a lot of different dumps for each game, and there's many hacked roms, translated roms, alpha/beta- releases, and prototypesin addition to the different regions. The roms don't have any naming restrictions, so it is hard to determine a game from a badly named rom. There exist some commonly used naming convention, and some data-files identified by crc.

The typical scans wanted from the package of a console game are the front of the box or the cover, the back of the box or cover, the side of the box or cover, the label of the media and a introshot and a actionshot.

Regions

Computer Games

Computer games covers a broad specter of games. To clear things up, this tool will only cover games that have been published on a physical media.

There's alot of variations in media and packaging, not only across platforms, but also each platform. Commodore 64 used both tapes and 5,25" floppy disks, and the IBM-PC have used 5.25" and 3.5" floppy disk, cd-roms, dvd-roms and probably some other. Anyways it should generally be about the same graphical definition as for the console games.

File Compensation

To create a fully portable offline collection there are some parts that need file compensation. These are the thumbnail, preview and artworks elements. This is done by creating a standard structure and naming convention.

File Structure

File naming
filename description
game.bin Rom/Game
game.tbn Thumbnail image. The tbn extension orginates from XBMC
game.nfo A valid XGameML XML Document. The tbn extension orginates from XBMC, who used this to support reading info from the scene releases nfo
game-artwork.png/jpg  
game-altart.png/jpg  
game-extart.png/jpg  
game-mediaart.png/jpg  
game-introshot.png/jpg Screenshot of the title screen
game-actionshot.png/jpg Screenshot of the gameplay
game-video.avi/mpg Preview of the gameplay
game-screenshot[N].png/jpg Screenshot for game with number as a afix
game-fanart.png/jpg HiRes images created for use as a backdrop
Non-game related file naming
filename description
DefaultIcon.png The default icon for games in current path and child directories. Might be based on platform
DefaultFolder.png The default folder icon for games in current path and child directories. Might be based on the platform or other grouping elements
folder.jpg Works as a thumbnail for containing directory if directory are a root dir and you can't use a DirectoryName.tbn

The file structure use cascading information storage. This makes it possible to store general information in one document and region specific information in another document

Example file structure

/root/
  |---DefaultIcon.png
  |---DefaultFolder.png
  |---My roms.tbn
  '---My roms/
  |    |---My rom.bin
  |    |---My rom.tbn
  |    |---My rom.nfo
  |    |---My rom-artwork.png
  |    |---My rom-altart.png
  |    |---My rom-extart.png
  |    |---My rom-mediaart.png
  |    |---My rom-introshot.png
  |    |---My rom-actionshot.png
  |    |---My rom-video.avi
  |    |---My rom-screenshot1.jpg
  |    '---My rom-screenshot2.jpg
  |
  '---My Other Roms/
       |---folder.jpg
       |---fanart.jpg
       |---My Other Rom.bin
       |---My Other Rom.tbn
       |---My Other Rom-fanart.jpg
       |---My Other Rom-artwork.png
       |---My Other Rom[Region].bin
       |---My Other Rom[Region]-artwork.png
       |---My Other Rom[Region][Some][other][stuff].bin
       '---My Other Rom[Region][Some][other][stuff].nfo

Naming conventions

TODO
Some filesystem have limited filename length. Naming conventions like the Good naming used on many romsets for consoles are not supported by the fatx (xbox filesystem). The orginal xbox are a popular hardware for emulation, and should therefore be supported. The naming convention needs a max limit, and a good tagging system that makes it easy to store information in a hiearchy matter. The MAME roms must have their naming intact. Is it possible to use filenames to determine related roms? Otherwise the parent documents could be found by a store a identifier in the childs document

File Extensions

To determine platform from the filename a simple solution is to use file extensiosn as a identifiers. This requires each platform to have a unique extension. In most cases there allready exist a good scheme, but it may be some issues with images from cd and dvd where a cue is required. Renaming might break compability for various emulators.

MAME roms must use the common zip extension to work, so MAME necessarily must use the zip extension.

DOS games are fat16 directories requring a 8.3 filename. The best method be to create a archive for distrubution. What archive to use? For compability and avoid confusion, the archive should keep the common extension for that archive. e.g. rar and use a 8.3 filename

Another challenge with DOS games are the games executable. The root directory of the game often contains two or more executable. One are the game, the other commonly a setup. How to ensure that the game can be automaticlly launched and correctly executable runned? This must also be implemented in the emulators or launchers, but there must be something to implement before that happens

List of extensions

Atari 2600
a26
Atari 5200
a52
Atari 7800
a78
Atari 8-bit series
a8s
Atari Jaguar
jag
Atari Lynx
lyx
Bandai Wonderswan
ws
Bandai Wonderswan Color
wsc
Commodore 64
d64
Commodore Amiga
adf
GCE/MB Vectrex
vec
GamePark GP32
gxb
NEC Supergrafx / PC-Engine 2
pce2
NEC Turbografx-16 / PC-Engine
pce
Nintendo DS
nds
Nintendo Entertainment System
nes
Nintendo Famicom/FDS
fds
Nintendo GameBoy
gb
Nintendo GameBoy Advance
gba
Nintendo GameBoy Color
gbc
Nintendo Gamecube
gcm
Nintendo N64
n64
Nintendo Pokémon mini
min
Nintendo Super Nintendo
smc
Nintendo Virtual Boy
vb
SNK NeoGeo Pocket
ngp
SNK NeoGeo Pocket Color
npc
Scumm Virtual Machine
gme
Sega Game Gear
gg
Sega Master System
sms
Sega MegaDrive 32X
32x
Sega MegaDrive/Genesis
gen
Sega SG-1000
sg

Graphic Quality

This is not a specification, but a recommendation for the graphics added to a collection. This makes it simpler for people exchanging sets and secure a good ratio between size and quality.

There should be no watermarkings of the videos and images contained in a collection.

Videos should be encoded with widely supported codec and avoid formats as Windows Media Video, Real Media and QuickTime The best videos should be possible to run in a loop without breaking it up with a pause, intro, logo etc. Pure gameplay

TODO
What would be the best resolution for the different images?

Inheritance

To avoid a huge amount of repeating data, a simple way of inherit data are supported.

The super element are refered to by a URI with a fragment e.g. ../mygames.nfo#supermario. The super element can exist in the same document or in whatever location the URI points to.

The sub element are not complete without the super element, so if the super element don't exist the application should generate a warning

<library>
  <game
    id="supermarioworld2">
    <title>Super Mario World 2</title>
    <synopsis>Funny platform game</synopsis>
  </game>
  <game
    id="snes_supermarioworld2"
    inherit="#supermarioworld2">
    <max-players>1</max-players>
  </game>
  <game
    id="gen_supermarioworld2"
    inherit="#supermarioworld2">
    <title>Super Sonic World 2</title>
    <max-players>2</max-players>
  </game>
</library>

equals

<library>
  <game
    id="snes_supermarioworld2">
    <title>Super Mario World 2</title>
    <synopsis>Funny platform game</synopsis>
    <max-players>1</max-players>
  </game>
  <game
    id="gen_supermarioworld2">
    <title>Super Sonic World 2</title>
    <synopsis>Funny platform game</synopsis>
    <max-players>2</max-players>
  </game>
</library>

Game Description

<ENTITY description "( title | synopsis | teaser | )*">
title
The most important part of information is the games title and it's required since it would be pointless without it

Attributes:

Sorttitle
If present, this can be used to sort the games using a common prefix in title like The Lion King, sort title would then be Lion King, The, otherwise the title is used for sorting.
Synopsis
A text describing the gameplay, introduction to the history, goal of the game, audience and other things that might be of interest for the user. Not to be filled with technical stuff or details, but give the user a good overview of the game. Should be written as a continuing and formatted text

Attributes:

language
See: language support
teaser
A short and unformatted text that gives the user really short introduction and the best sides of the game.
language
See: language support

Game Information

game
Contains information about a game

Attributes:

id
A unique id for the document. Used to reference a game
inherit
Reference to a parent game element

See: inheritance

Value: URI

filename
see naming conventions
long-filename
Used to support a alternative set of filenames. e.g. goodnaming
remote-site
Defined name of a site to scrape content.
remote-id
The identification a remote site use to identify this game. This along with remote-site can be used if a scraper is embedded in the document

Contents: title?, base?, ( max-players | developers | publishers> | language | advanced | %sorting; | %grouping; | graphics | publisher | rated | languages | released )? | (%text;)* )>

platform

Attributes:

pid
A short string identifier for platform

See: platforms

logo
Logo, icon or thumbnail for platform

Value: URI

Contents:

[CDATA] Name of platform for overiding name for id or to be used if pid = "OTHER"

max-players
Max number of players on one media. Many will look for 2 player games to play locally with a friend, so don't include online, lan or link multiplayer possibilities here

CDATA: Number

release
Many also uses a date, but the year should be enough. When do you need to know the exact release date for a game? Different dates for different regions would also make this a lot of extra data not falling in the general game information.

If releases for regions differs over years, use the oldest release

perspectives
Holds a collection of perspectives for current game

Elements: perspective

genres
Holds a collection of genres for current game

Elements: genre

graphics
Holds a collection of multimedia elements for current game

Elements: graphics

soundtracks
Holds a collection of soundtracks

Elements: sountrack

soundtrack

Attributes:

track
Index of song
logo
Location of media

Value: URI

Language support

Documents can store text in multiple languages. Languages are set in the language attribute of the respective elements. Use Country identification, such as en-US (this usage is described in ISO 639)

<teaser language="en-US">
  Don't be left behind in the race to save humanity..
  Control Captain Gideon Wyeth in a exciting mission to greet the first
  alien culture ever known to man in this action packed game.
</teaser>

Platforms

Platform defintion
Platform ID string
Not Defined OTHER
Arcade ARCADE
Nintendo NES
Super Nintendo SNES
Sega Genesis GEN
Sega Master System SMS
Windows WIN
MS-DOS DOS
TODO
Complete the list of platform identifiers

Perspectives

TODO
Complete the list of perspectives

Genres

TODO
Complete the list of genres. Should there be a recommendation for sub genres? Sports, simluation, driving etc. is a bit obscure

Categories

Graphics

The general naming convention makes it possible to use the same naming for rom collections of both arcade roms, console roms, and games in general

For example: "main-art" could be boxart, or front cover on computer and console games, but migth rather be cabinet or marque for a arcade game

A good solution might be:
name Console/Computer games Arcade games
main-art box/cover-front Marque
alt-art box/cover-back Flyer
ext-art box/cover-side ?
media-art media label cabinet
<ENTITY graphics "( thumbnail | artwork | screenshot | video | fanart )*">
%graphics;

Attributes:

src
URI pointing to the media

Value: a Uniform Resource Identifier, see [RFC2396]

quality
Can be used for filtering on low-bandwith systems.

Value: low|medium|high

default: defined by app

thumbnail

Attributes:

format
Gives the possibility to switch between normal, wide and 3D icons.

Value: normal|wide|3d

default: normal

size
Gives a hint about the thumbnails size

Value: small|medium|large

default: medium

video

Attributes:

encoding
Makes it possible to support different systems
screenshot

Attributes:

index
Store order or quality of screenshots

Value: Positive integer

name
Describing the name of the screenshot. Used to identify actionshots and introshots
artwork

Attributes:

name
Describing the name of the artwork.

Use to identify:

fanart

Attributes:

intensity
Gives a hint if the text should be rendered in bright or dark color

Value: low|medium|high

default: low

Elements: color, color, color

color

Attributes:

intensity
Set the intensity of the color. Used for creating a three color theme
color
Set the volor value

Value: RGB/ARGB - "FFFFFF"/"FFFFFFFF"

Advanced Specifications

Intended for Arcade Machine hardware specification and extended information for other collection

multiplayer
Detailed description of multiplayer support
video
Resolutions, 3D rendering, colors etc.
sound
Supported sound systems
input
Supported input devices. Joypad, Light gun etc. See also: controls

Controls

To define a set of default controls that fits different ways of rendering requires some logic.

<ELEMENT event (logic? | (instruction, logic?))>
<ATTLIST event
  title     CDATA                    #REQUIRED  -- description of event --
  alt       CDATA                    #REQUIRED  -- textual representation --
  >
<ELEMENT instruction EMPTY>
<ATTLIST instruction
  unit      CDATA                    #IMPLIED   -- input unit used  --
  input     CDATA                    #REQUIRED  -- input from unit  --
  action    (press|hold|move)        "press"    -- action performed on input --
  direction (up|down|left|right|any) "any"      -- sub instruction --
  >
<ELEMENT logic EMPTY>
<ATTLIST logic
  type      (and|or|while|for)       "and"      -- type of logic  --
  value     CDATA                    #IMPLIED   -- value for type of logic --
  >
<event
  title="Free view"
  alt="hold button A while moving left thumbstick in any direction">
  <instruction
    action="hold"
    input="button A"<
  <logic
    type="while">
    <instruction
      action="move"
      input="left thumbstick"
      direction="any">
  </while>
</event>

Above markup may produce something like:
hold button A while moving left thumbstick in any direction

Manual

The manual could be in two formats. Either one pdf file or multiple images

Following show how to refer to a pdf manual hosted online:

<manual href="http://mydomain.com/manual/mygame.pdf" />

Manual consisting of several images:

<manual>
  <manpage page="1" href="http://mydomain.com/manual/mygame/1.jpg" />
  <manpage page="2" href="http://mydomain.com/manual/mygame/2.jpg" />
</manual>

Text Formating

Head lines formatting
    +Header1
    ++Header2
    +++Header3
    
List formatting
    *listitem1
    *listitem2
    *listitem3
    
Font Boldness
_bold text_
New paragraph
skip one line

Defintions

URI

URI attribute values are Uniform Resource Identifiers (URIs), as defined in RFC 2396.

References

Game Databases