crimsonland 0.1.0.dev13__py3-none-any.whl → 0.1.0.dev14__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,197 @@
1
+ Metadata-Version: 2.3
2
+ Name: crimsonland
3
+ Version: 0.1.0.dev14
4
+ Requires-Dist: construct>=2.10.70
5
+ Requires-Dist: pillow>=12.1.0
6
+ Requires-Dist: platformdirs>=4.5.1
7
+ Requires-Dist: raylib>=5.5.0.4
8
+ Requires-Dist: typer>=0.21.1
9
+ Requires-Python: >=3.13
10
+ Project-URL: Documentation, https://crimson.banteg.xyz/
11
+ Project-URL: Repository, https://github.com/banteg/crimson
12
+ Description-Content-Type: text/markdown
13
+
14
+ # Crimsonland 1.9.93 decompilation + rewrite
15
+
16
+ This repository is a **reverse engineering + high‑fidelity reimplementation** of **Crimsonland 1.9.93 (2003)**.
17
+
18
+ - **Target build:** `v1.9.93` (GOG "Crimsonland Classic") — see [docs/provenance.md](docs/provenance.md) for exact hashes.
19
+ - **Rewrite:** a runnable reference implementation in **Python + raylib** under `src/`.
20
+ - **Analysis:** decompiles, name/type maps, and runtime evidence under `analysis/`.
21
+ - **Docs:** long-form notes and parity tracking under `docs/` (start at [docs/index.md](docs/index.md)).
22
+
23
+ The north star is **behavioral parity** with the original Windows build: timings, RNG, UI/layout quirks, asset decoding, and gameplay rules should match as closely as practical.
24
+
25
+ **[Read the full story](https://banteg.xyz/posts/crimsonland/)** of how this project came together: reverse engineering workflow, custom asset formats, AI-assisted decompilation, and game preservation philosophy.
26
+
27
+ ---
28
+
29
+ ## Quick start
30
+
31
+ Install [uv](https://docs.astral.sh/uv/getting-started/installation/) package manager.
32
+
33
+ ### Run the latest packaged build
34
+
35
+ If you just want to play the rewrite:
36
+
37
+ ```bash
38
+ uvx crimsonland@latest
39
+ ```
40
+
41
+ ### Run from a checkout
42
+
43
+ ```bash
44
+ gh repo clone banteg/crimson
45
+ cd crimson
46
+ uv run crimson
47
+ ```
48
+
49
+ ### Keep runtime files local to the repo
50
+
51
+ By default, runtime files (e.g. `crimson.cfg`, `game.cfg`, highscores, logs, downloaded PAQs) live in your per-user data dir.
52
+ To keep everything under this checkout:
53
+
54
+ ```bash
55
+ export CRIMSON_RUNTIME_DIR="$PWD/artifacts/runtime"
56
+ mkdir -p artifacts/runtime
57
+ uv run crimson
58
+ ```
59
+
60
+ ---
61
+
62
+ ## Assets + binaries
63
+
64
+ There are two separate “inputs” to this repo:
65
+
66
+ 1. **Runtime assets for the rewrite** (PAQ archives)
67
+ 2. **Original Windows binaries for reverse engineering** (`crimsonland.exe`, `grim.dll`, …)
68
+
69
+ We keep them out of git and expect a local layout like:
70
+
71
+ ```text
72
+ game_bins/
73
+ crimsonland/
74
+ 1.9.93-gog/
75
+ crimsonland.exe
76
+ grim.dll
77
+ crimson.paq
78
+ music.paq
79
+ sfx.paq
80
+ artifacts/
81
+ runtime/ # optional: where you run the rewrite (cfg/status/paqs)
82
+ assets/ # optional: extracted PAQs for inspection/tools
83
+ ```
84
+
85
+ ### Running the rewrite
86
+
87
+ The rewrite loads the assets from original archives:
88
+
89
+ - `crimson.paq`
90
+ - `music.paq`
91
+ - `sfx.paq`
92
+
93
+ ### Extracted assets
94
+
95
+ For inspection/diffs/tools, you can extract PAQs into a filesystem tree:
96
+
97
+ ```bash
98
+ uv run crimson extract crimsonland_1.9.93 artifacts/assets
99
+ ```
100
+
101
+ Same as the original, many loaders can work from either:
102
+
103
+ - **PAQ-backed assets** (preferred when available), or
104
+ - the **extracted filesystem layout** under `artifacts/assets/`.
105
+
106
+ ---
107
+
108
+ ## CLI cheat sheet
109
+
110
+ Everything is exposed via the `crimson` CLI (alias: `crimsonland`):
111
+
112
+ ```bash
113
+ uv run crimson # run the game (default command)
114
+ uv run crimson view ui # debug views / sandboxes
115
+ uv run crimson quests 1.1 # print quest spawn script
116
+ uv run crimson config # inspect crimson.cfg
117
+ uv run crimson extract <game_dir> artifacts/assets
118
+ ```
119
+
120
+ Useful flags:
121
+
122
+ - `--base-dir PATH` / `CRIMSON_RUNTIME_DIR=...` — where saves/config/logs live
123
+ - `--assets-dir PATH` — where `.paq` archives (or extracted assets) are loaded from
124
+ - `--seed N` — deterministic runs for parity testing
125
+ - `--demo` — enable shareware/demo paths
126
+ - `--no-intro` — skip logos/intro music
127
+
128
+ ---
129
+
130
+ ## Docs
131
+
132
+ Docs are authored in `docs/` and built as a static site at https://crimson.banteg.xyz/
133
+
134
+ For development, it's useful to have a live local build:
135
+
136
+ ```
137
+ uv tool install zensical
138
+ zensical serve
139
+ ```
140
+
141
+ ---
142
+
143
+ ## Development
144
+
145
+ ### Tests
146
+
147
+ ```bash
148
+ uv run pytest
149
+ ```
150
+
151
+ ### Lint / checks
152
+
153
+ ```bash
154
+ uv run lint-imports
155
+ uv run python scripts/check_asset_loader_usage.py
156
+ ```
157
+
158
+ ### `justfile` shortcuts
159
+
160
+ If you have `just` installed:
161
+
162
+ ```bash
163
+ just --list
164
+ just test
165
+ just docs-build
166
+ just ghidra-exe
167
+ just ghidra-grim
168
+ ```
169
+
170
+ ---
171
+
172
+ ## Reverse engineering workflow
173
+
174
+ High level:
175
+
176
+ - **Static analysis is the source of truth.**
177
+ - Update names/types in [analysis/ghidra/maps/](analysis/ghidra/maps/).
178
+ - Treat [analysis/ghidra/raw/](analysis/ghidra/raw/) as generated output (regenerate; do not hand-edit).
179
+ - **Runtime tooling** (Frida / WinDbg) validates ambiguous behavior and captures ground truth.
180
+ - Evidence summaries live under [analysis/frida/](analysis/frida/).
181
+
182
+ ---
183
+
184
+ ## Contributing notes
185
+
186
+ - Keep changes small and reviewable (one subsystem/feature at a time).
187
+ - Prefer *measured parity* (captures/logs/deterministic tests) over “looks right”.
188
+ - When porting float constants from decompilation, prefer the intended value
189
+ (e.g. `0.6` instead of `0.6000000238418579` when it’s clearly a float32 artifact).
190
+
191
+ ---
192
+
193
+ ## Legal
194
+
195
+ This project is an independent reverse engineering and reimplementation effort for preservation, research, and compatibility.
196
+
197
+ No original assets or binaries are included. Use your own legally obtained copy.
@@ -140,7 +140,7 @@ grim/sfx.py,sha256=cpn2Mmeio7BSDgbStSft-eZchO9Ot2MrK6iXJqxlLqU,7836
140
140
  grim/sfx_map.py,sha256=FM5iBzKkG30Vtu78SRavVNgXMbGK7ZFcQ8i6lgMlzVw,4697
141
141
  grim/terrain_render.py,sha256=EZ7ySYJyTZwXcrJx1mKbY3ewZtPi7Y270XnZgGJyZG8,31509
142
142
  grim/view.py,sha256=oF4pHZehBqOxPjKMU28TDg3qATh_amMIRJp-vMQnpn4,334
143
- crimsonland-0.1.0.dev13.dist-info/WHEEL,sha256=fAguSjoiATBe7TNBkJwOjyL1Tt4wwiaQGtNtjRPNMQA,80
144
- crimsonland-0.1.0.dev13.dist-info/entry_points.txt,sha256=jzzcExxiE9xpt4Iw2nbB1lwTv2Zj4H14WJTIPMkAjoE,77
145
- crimsonland-0.1.0.dev13.dist-info/METADATA,sha256=zmr0z7DJR6Z72vu_5i0IQbCO1qJ-sDd25SGmghwEtWA,244
146
- crimsonland-0.1.0.dev13.dist-info/RECORD,,
143
+ crimsonland-0.1.0.dev14.dist-info/WHEEL,sha256=fAguSjoiATBe7TNBkJwOjyL1Tt4wwiaQGtNtjRPNMQA,80
144
+ crimsonland-0.1.0.dev14.dist-info/entry_points.txt,sha256=jzzcExxiE9xpt4Iw2nbB1lwTv2Zj4H14WJTIPMkAjoE,77
145
+ crimsonland-0.1.0.dev14.dist-info/METADATA,sha256=oXFIziqtI4gQTabCnabSQ9Q9omr3LkcdySpATsnsuqA,5262
146
+ crimsonland-0.1.0.dev14.dist-info/RECORD,,
@@ -1,9 +0,0 @@
1
- Metadata-Version: 2.3
2
- Name: crimsonland
3
- Version: 0.1.0.dev13
4
- Requires-Dist: construct>=2.10.70
5
- Requires-Dist: pillow>=12.1.0
6
- Requires-Dist: platformdirs>=4.5.1
7
- Requires-Dist: raylib>=5.5.0.4
8
- Requires-Dist: typer>=0.21.1
9
- Requires-Python: >=3.13