Appearance
Appearance
Game configs are built to, and distributed as, game config archives. Archives not only store the actual game config data, but also important meta data that make managing the various versions of game configs a lot easier.
Archives are usually stored on disk either as a single .mpa
file, which may contain multiple individual Game Config Libraries within it. Each Library is encoded in a binary format for efficient parsing in the server and the client. Alternatively, the archives can also be written to disk as multiple files in a directory, one for each contained Library, along with an added Index.txt
for the archive's metadata.
The Metaplay SDK builds a single file .mpa
archive out of the game config data declared in the SharedGameConfig
and ServerGameConfig
classes. This archive is typically called StaticGameConfig.mpa
. Internally this archive consists of sub-archives for shared and server-only data. For purposes of distributing to the client or including in the client build, the SharedGameConfig.mpa
sub-archive can be extracted from StaticGameConfig.mpa
.
The archives are versioned using Git-like hashing. This reduces the chance of accidentally mixing data from multiple archive versions. Versioning also enables caching of the data on the client, so the client only needs to download each version of the data once from the CDN.
By default, the archive's contents are serialized in binary format. This has the benefit of not having any ambiguity in terms of the format, e.g., the device's culture settings do not affect the parsing of dates, times, and numbers. Parsing binary formats is also much faster and does fewer memory allocations than textual formats like CSV or JSON. That being said, including raw files in other formats (like CSV or JSON) is also supported.
📦 Opaque Binary Archives
The binary format of archives used by Metaplay is rather opaque. If this inconveniences your development workflow and you'd like to be able to view the contents without starting the dashboard, please talk to us for ways to expose the raw data.