Skip to main content

Crystal Projector

The map of the world, gleaned from the world file.

This is a library for manipulating data structures in the video game Crystal Project. This currently can read:

  • World files
  • Database files
  • Texture packs
  • Save files
  • Mod files

This will hopefully soon be able to modify and write out the above, as well as read additional things, like logfiles.

Using Crystal Projector as a Set of Schemas

JSON Files

The JSON Schema formats for each Crystal Project format can be found in schema/json.

Binary files

The Kaitai Struct formats for Crystal Project's .dat and .sav files can be found in schema/ksy.

Using Crystal Projector as a Python Library

You will need Python, version 3.8 or later.

To install Crystal Projector:

python3 -m pip install --upgrade --pre git+https://github.com/kaitai-io/kaitai_struct_python_runtime.git
python3 -m pip install crystal-projector

Then you can invoke it with:

crystal-projector --help

And use it in Python scripts like so:

import crystal_projector

image = crystal_projector.world.visualize_world_map(input("enter your Crystal Project 'Content' folder:"), "field")
image.save("map.png")

Developing Crystal Projector

Dependencies

Kaitai Struct

You need Kaitai Struct and its Python bindings, latest nightly.

KSC has some issues with Python:

  • No type annotations.
  • It imports sub-KSY file dependencies incorrectly; import X should be from . import X.
  • It does not stop keywords from being used as names.

The latter two are fixed by us.

Quicktype

We use Quicktype; you'll need its NPM package. However, Quicktype also has issues:

  • No support for integer enums; if you omit type: integer from such enums, Quicktype crashes.
  • Does not support multi-file $refs in a smart manner.

Python packages

  • kaitaistruct: Do NOT pull this from PyPI. Do this instead:
    python3 -m pip install --upgrade --pre git+https://github.com/kaitai-io/kaitai_struct_python_runtime.git
    
  • Pillow: For PIL.

For developing and testing:

  • pre-commit.
  • pyyaml: For yaml.
  • jsonschema.

Installing the Project

python3 -m pip install -e .[dev, test]
pre-commit install

Building the Project

python3 build_schemas.py

Distributing the Project

python3 -m build

Metadata

Release files for crystal-projector 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for crystal-projector 0.1.0
File Size Uploaded
crystal_projector-0.1.0.tar.gz 15.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for crystal-projector 0.1.0
File Interpreter ABI Platform
crystal_projector-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 32.4 kB

Release files / crystal_projector-0.1.0.tar.gz

Download URL crystal_projector-0.1.0.tar.gz
Size 15.6 kB
Tags Source
SHA-256 checksum
How to use checksums
4726fffaf791e0d800226cd145de3c8a07d8ea7b4d80fe72fc9af73a190c4c46
BLAKE2b-256 checksum
How to use checksums
e6cb5c7133b9df00f57ee2cb162e6319f3e1178e69db6eb2eb775d1c5f74d7b2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.8.10

Release files / crystal_projector-0.1.0-py3-none-any.whl

Download URL crystal_projector-0.1.0-py3-none-any.whl
Size 16.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e4903c95cb9de0f06328f22d44910d42fc672701bc810d4303c8711d91d81430
BLAKE2b-256 checksum
How to use checksums
2a4a03503829254a4ce9c2b123afcae73d0305932d86c6e7cfcc020147e2eaf9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.8.10

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page