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
  • [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.10.0.tar.gz (5.8 MB view details)

Uploaded Source

Built Distribution

retro_data_structures-0.10.0-py3-none-any.whl (358.9 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for retro-data-structures-0.10.0.tar.gz
Algorithm Hash digest
SHA256 a50ed227bb7fe3abe85e9849e4aaf637582f95d3137f23dcc4feac0f9d7c393d
MD5 3d30133a78478a3bdb31a957bf2c67c4
BLAKE2b-256 c5f9657e9188ee8020eaf315f43a910b13354c7cb0072bf65bfb23f8c9a918d9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for retro_data_structures-0.10.0-py3-none-any.whl
Algorithm Hash digest
SHA256 80aa50ccf2e8a888bf1c9e055869d8e146d6812a417810d3b829185b501fd27b
MD5 eb7d9a019ef8ad700efd31d62904a222
BLAKE2b-256 2da767c4a66b072aed357de3ad46b557657c6baee264e27d1d6b8fd2a5372648

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