Manipulate Crystal Project game data.
Project description
Crystal Projector
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 Xshould befrom . 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: integerfrom 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: ForPIL.
For developing and testing:
pre-commit.pyyaml: Foryaml.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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file crystal_projector-0.1.0.tar.gz.
File metadata
- Download URL: crystal_projector-0.1.0.tar.gz
- Upload date:
- Size: 15.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4726fffaf791e0d800226cd145de3c8a07d8ea7b4d80fe72fc9af73a190c4c46
|
|
| MD5 |
4618fb87dd2b7a2617f815b2a242d1fa
|
|
| BLAKE2b-256 |
e6cb5c7133b9df00f57ee2cb162e6319f3e1178e69db6eb2eb775d1c5f74d7b2
|
File details
Details for the file crystal_projector-0.1.0-py3-none-any.whl.
File metadata
- Download URL: crystal_projector-0.1.0-py3-none-any.whl
- Upload date:
- Size: 16.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e4903c95cb9de0f06328f22d44910d42fc672701bc810d4303c8711d91d81430
|
|
| MD5 |
40da196edbfa6844a0a168180ce22f68
|
|
| BLAKE2b-256 |
2a4a03503829254a4ce9c2b123afcae73d0305932d86c6e7cfcc020147e2eaf9
|