Skip to main content

Construct file definitions for the Retro Studios game engine files

Project description

Retro-data-structures

Construct type definitions for Retro Studios game

Format Prime 1 (Read) Prime 1 (Write) Prime 2 (Read) Prime 2 (Write) Prime 3 (Read) Prime 3 (Write)
PAK
MLVL
MREA ✗ [2]
CMDL
ANCS
ANIM
CSKR
CINF
PART ✓ [1] ✓ [1]
HIER - - - -
STRG
SAVW
  • [1] All existing files parse, but not checked if exhaustive for what the game supports.
  • [2] Missing re-calculation of how sections are split between blocks.

Example Usage

from retro_data_structures.formats.pak import PAK


def read_file(path):
    with open(path, "rb") as f:
        return f.read()


PAK.build_file({
    'named_resources': [
        {"asset": {"type": 'TXTR', "id": 201335801}, "name": 'TXTR_ElevatorIcon_1'},
        {"asset": {"type": 'TXTR', "id": 239414538}, "name": 'TXTR_ElevatorIcon'},
        {"asset": {"type": 'TXTR', "id": 564256465}, "name": 'TXTR_QuaterCurve'},
        {"asset": {"type": 'TXTR', "id": 568030977}, "name": 'TXTR_SaveStationIcon_1'},
    ],
    'resources': [
        {
            "asset": {"type": 'TXTR', "id": 201335801},
            "compressed": 1,
            "contents": {"value": read_file("ElevatorIcon_1.TXTR")},
        },
        {
            "asset": {"type": 'TXTR', "id": 201335801},
            "compressed": 1,
            "contents": {"value": read_file("ElevatorIcon.TXTR")},
        },
        {
            "asset": {"type": 'TXTR', "id": 201335801},
            "compressed": 1,
            "contents": {"value": read_file("QuaterCurve.TXTR")},
        },
        {
            "asset": {"type": 'TXTR', "id": 201335801},
            "compressed": 1,
            "contents": {"value": read_file("SaveStationIcon_1.TXTR")},
        },
    ]
}, "Game.pak")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

retro-data-structures-0.13.0.tar.gz (1.9 MB view details)

Uploaded Source

Built Distribution

retro_data_structures-0.13.0-py3-none-any.whl (3.4 MB view details)

Uploaded Python 3

File details

Details for the file retro-data-structures-0.13.0.tar.gz.

File metadata

File hashes

Hashes for retro-data-structures-0.13.0.tar.gz
Algorithm Hash digest
SHA256 6a8da74879b196eb238d03eea6c923c7db2e14e2e82ce4a2ba4888d57f97f7c3
MD5 12e3a9252c2861d56af8bf2eb3cf0692
BLAKE2b-256 a21ad1ff742a2f6652fa4ba6b98392994c7a64b6d0fb50fd579d810f7d6330a2

See more details on using hashes here.

File details

Details for the file retro_data_structures-0.13.0-py3-none-any.whl.

File metadata

File hashes

Hashes for retro_data_structures-0.13.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bdd7840e3c2b0b8100681a9303b1d94ebb992feac483444d049a223090299e7a
MD5 e812a567d9c484106e132774f1e17ce7
BLAKE2b-256 409afdd3cb88eb706ba6bafd96663304bd781dd2e8a079ce833e0b54e814b3ac

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page