View on GitHub

retrokit

RetroPie and ROM automation platform

metakit

metakit is a tool used to create a unified definition for game metadata in all systems supported by retrokit. Since metadata is pulled from a variety of sources, it’s important to define a standard schema so that all downstream tools (like romkit) can use that metadata without having to worry about what system it’s dealing with.

Design

metakit is designed with a few goals in mind:

These goals are intended to help ensure that this data is high-quality and can be kept up-to-date as system DAT files are updated.

Dependencies

The minimum metakit dependencies are:

To install the relevant Python dependencies:

# Install the minimum Python dependencies
metakit/setup.sh depends

Usage

# Downloads any external metadata that hasn't already been downloaded (this will not update)
bin/metakit.sh cache_external_data <system>

# Reformats the system metadata file, keeping the data clean
bin/metakit.sh format <system>

# Removes unneeded data from the metadata and scraper files (e.g. data for games that no longer exist)
bin/metakit.sh vacuum <system>

# Forces any external data used by the system to be re-downloaded
bin/metakit.sh recache_external_data <system>

# Forces all scraped metadata to be refreshed from the source
bin/metakit.sh rescrape <system>

# Forces machines that have incomplete scrape metadata to be refreshed from the source
bin/metakit.sh scrape_incomplete <system>

# Forces machines that have were never found in the scraper sources
bin/metakit.sh scrape_missing <system>

# Brings all romset dats up-to-date
bin/metakit.sh update_dats <system>

# Migrates groups to their current names as defined by the system's DAT
# files and the priority settings defined in the metakit configuraiton
bin/metakit.sh update_groups <system>

# Discovers new manuals on preconfigured website sources that have been added
# since the given date.
# 
# The date passed in should be the date of existing snapshots (if available).
bin/metakit.sh find_manuals <system> [<date>] [<website_name>]

# Snapshots all manual website sources so that they can be compared against
# on a future date to see if any new manuals have been added
#
# The date passed in should be the *current* date (i.e. when the content was
# downloaded)
bin/metakit.sh snapshot_manuals <system> <date>

# Update the content of the database based on internal/external data
bin/metakit.sh update_metadata <system>

# Runs the following (in order):
# * update_dats
# * update_groups
# * vacuum
# * recache_external_data
# * scrape
# * update_metadata
bin/metakit.sh update <system>

# Validate the content of the system's database
bin/metakit.sh validate <system>

# Validates that machines are mapped properly to names in each romset's discovery data.
# That is, this ensures that the machine is found in any external archives configured
# for a system (based on either the machine's name or its alternates).
bin/metakit.sh validate_discovery <system>

Supported metadata

The following types of metadata are currently supported.

Age Rating

The maturity rating for the game.

Property: age_rating

Systems:

Sources:

Aliases

Other titles that are associated with the game via the parent->child datfile relationship.

Property: aliases

Systems:

Sources:

Alternate Names

Other names the game may be referred to as. This can be useful if an archive source is different from the latest DAT file for a system.

Property: alternates

Systems:

Sources:

Buttons

The action associated with each button on the controller.

Property: buttons

Systems:

Sources:

Category

The type of rom (e.g. game, tool, etc.).

Property: category

Systems:

Sources:

Controls

The types of controllers used (e.g. lightgun, joy, etc.).

Property: controls

Systems:

Sources:

Custom

An open-ended dictionary that allows you to define key-value attributes on a group rather than open-ended strings like you can with tags.

Property: custom

Systems:

Sources:

Developer

The name of the company that developed the game.

Property: developer

Systems:

Sources:

Discs

The number of discs associated with the title. Note that this is based on the primary region (in case you see discrepancies between regions).

Property: discs

Systems:

Sources:

Emulation

The preferred emulator and compatibility rating.

Property: emulation

Systems:

Sources:

Genres

The genres associated with the game.

Property: genres

Systems:

Sources:

Languages

The languages used within the game.

Property: languages

Systems:

Sources:

Manuals

Manuals available for the game.

Property: manuals

Systems:

Sources:

Mechanical

Whether the game requires mechanical features.

Property: mechanical

Systems:

Sources:

Media

Additional media used for the game, such as: artwork, overlay, etc.

Property: media

Systems:

Sources:

Merge

Additional game titles to mark as clones when not specified explicitly in the system’s DAT files.

Property: merge

Systems:

Sources:

There are important differences between what’s considered the parent and what’s considered the clone between different systems.

No-Intro DAT files generally sort games based on the rules laid out here:

  1. Final/Complete > Proto/Beta/Demo
  2. Games containing En language > Other languages
  3. World > Continent/Multi Country > Country
  4. Old “main” console regions (EUR/USA/JPN) > Other countries (so i.e. Japan > Spain)
  5. Country with earlier dump available
  6. Highest revision

On the other hand, Redump DAT files are sorted chronologically based on the order in which they were dumped. Additionally, Redump does not provide clone metadata for its ROMs.

In order to (a) provide some consistency, (b) provide some stability in the metadata, and (c) make it easier to work with, the same general rules are applied to the merge groups generated from Redump DAT files.

Peripherals

System peripherals supported, such as link_cable, multitap, etc.

Property: peripherals

Systems:

Sources:

Players

Maximum number of players supported.

Property: players

Systems:

Sources:

Publisher

The company that published the game.

Property: publisher

Systems:

Sources:

Rating

Community-based rating.

Property: rating

Systems:

Sources:

Screen

Details about the screen (e.g. orientation).

Property: screen

Systems:

Sources:

Series

A series name to associate multiple games together.

Property: series

Systems:

Sources:

Tags

Custom, user-defined tags.

Property: tags

Systems:

Sources:

Year

Release year.

Property: year

Systems:

Sources:

System-specific usage

pc

metakit settings are used to manage the pc dosbox configuration files that are mapped from the eXoDOS project. To generate new configurations:

rm -f config/systems/pc/configs/*.conf
PROFILES=metakit,filter-reset EXODOS_V6_HOME=... bin/romkit.sh install pc resources=config
PROFILES=metakit,filter-reset EXODOS_IGNORE_MISSING_CONFIGS=true EXODOS_V6_HOME=... bin/romkit.sh install pc resources=config