Update worldgen exporter features

This commit is contained in:
chelsea
2026-05-02 13:54:15 -05:00
parent 5bb1e05acf
commit 2f11a5b5fa
9 changed files with 320 additions and 27 deletions

101
README.md
View File

@@ -0,0 +1,101 @@
MC Worldgen
===========
Procedural Minecraft Java region exporter. The C exporter is the maintained path:
it builds without Python dependencies and writes `.mca` region files that can be
copied into an existing world's `region/` folder.
Requirements
------------
- GCC or Clang
- `make`
- zlib development headers (`zlib1g-dev` on Debian/Ubuntu)
- pthreads, normally included with libc toolchains
Build
-----
```sh
cd worldgen-c
make
```
Quick smoke test:
```sh
./bin/worldgen --radius 0 --out /tmp/mcworldgen-smoke
```
That should create `/tmp/mcworldgen-smoke/r.0.0.mca`.
Diagnostic feature scan:
```sh
make scan
./bin/worldgen-scan --radius 2 --center-x -3200 --center-z 3200
```
The scanner prints counts for cabin blocks, gravel/path columns, redwood biome
columns, and titan-height tree trunks.
Generate Regions
----------------
Small area around chunk 0,0:
```sh
./bin/worldgen --radius 4 --trails --out output
```
Specific chunk rectangle:
```sh
./bin/worldgen --min-x -8 --max-x 8 --min-z -8 --max-z 8 --trails --out output
```
Useful options:
- `--radius N`: generate chunks from `center - N` through `center + N`.
- `--center-x X --center-z Z`: center chunk for radius mode.
- `--min-x --max-x --min-z --max-z`: explicit chunk bounds.
- `--threads N`: worker thread count.
- `--seed S`: deterministic world seed.
- `--sea-level L`: sea level, default `70`.
- `--snow-line H`: snow threshold, default `sea-level + 38`.
- `--trails`: enable trail and cabin prepass.
- `--format mca|bin`: write Minecraft region files or raw debug chunks.
- `--out DIR`: output directory.
Features
--------
- Redwoods are enabled automatically. The biome classifier marks high-rainfall,
higher-relief areas as redwood forest, then places titan trees, dirt/mulch
floor cover, tall grass, and occasional fallen logs.
- Cabins are enabled automatically. With `--trails`, cabins only try to spawn on
chunks crossed by the trail network so their spur paths can connect to roads.
Without `--trails`, cabins can still spawn, but they are rarer and unconnected.
- Trails are optional because they need a prepass over the target area. Use
`--trails` when you want roads and better-connected cabins.
Minecraft Version
-----------------
The exporter writes Java Edition 1.17.1 chunk data (`DataVersion` 2730). That
version is chosen because the generator includes copper ore. Open the generated
regions in Minecraft Java 1.17.1 or a newer version that can upgrade old worlds.
The exporter writes region files only. To use them in game, create or choose a
Java world, close Minecraft, back up the save, and replace or add files under:
```text
<minecraft save>/region/
```
Python Exporter
---------------
`export_mca.py` is the older prototype exporter. It now shares the same 1.17.1
data version and maps generated coal correctly, but the C exporter is faster and
has the current terrain features.