Repository navigation
Generate Space
Science fiction maps: a star map of hexes, a star system, a planet texture and a ship or station deck plan. Each is a recipe folder (Recipe format), checked by proof bars and exported where a tool takes it (Export). All take --seed, --out and --json; the named ones take --name-style.
One world per occupied hex of a subsector (8 x 10, the default) or a sector (32 x 40, --size sector). --density is the share of hexes with a world; --jump the jump range in hexes. Worlds are joined by the relative neighbourhood graph plus the minimum spanning tree, so the route graph is always connected; routes longer than the jump range are marked long. It writes a T5 tab-delimited file (sector.tab) as well as the drawing.
python scripts/mpw.py gen sector --seed 5 --out spin.mapwrote spin.map: Vovivio, 57 worlds, 90 routes (0 long) in 0.03 s
python scripts/mpw.py check spin.mapbar 1 PASS: sector: route graph connected (57 worlds, 90 routes, 1 component(s), 6 bridges (chokepoints listed, not failed))
bar 2 PASS: sector: jump routes within jump 2, longer ones marked long (90 jump, 0 long, 0 mislabelled)
bar 3 PASS: sector: worlds inside the grid, one per hex (57 worlds, 0 outside, 0 sharing a hex)
bar 4 PASS: sector: T5 tab file reads back (57 rows read back by header, hex, name and UWP match: True)
bar 5 PASS: same seed gives byte-identical files (6 files identical)
bar 6 PASS: labels: none overlap (57 labels, 0 overlapping pairs)
bar 7 PASS: labels: none cut by the edge (0 cut)
bar 8 SKIP: labels: read back by OCR (skipped: tesseract not found (install it to run this bar))
--real places the stars of a small bundled table (scripts/data/near-stars.csv) by parallax; --radius-pc sets how far out, and --jump is then in parsecs.
python scripts/mpw.py gen sector --real --radius-pc 4 --out near.mapwrote near.map: Near stars within 4.0 pc, 12 worlds, 13 routes (7 long) in 0.02 s
A star (--star M|K|G|F), planets kept at least 12 mutual Hill radii apart, and moons inside each planet's Hill sphere. --planets N sets the count. It writes a schematic (map.svg) and an orbit diagram (orbits.svg); render --view scale draws the system to scale.
python scripts/mpw.py gen system --seed 5 --star G --out sol2.mapwrote sol2.map: Quusa (G7 V), 5 planets, 0 moons in 0.02 s
python scripts/mpw.py check sol2.mapbar 1 PASS: system: every orbit outside the star (5 planets, 0 too close; star radius 0.00482 AU)
bar 2 PASS: system: neighbours at least 10 mutual Hill radii apart (orbits ascending True, closest pair 35.9 mutual Hill radii)
bar 3 PASS: system: moons inside their planet's Hill sphere and outside the planet (0 moons, 0 outside the bounds)
bar 4 PASS: system: habitable zone scales with sqrt(L) and zones match it (1.037-1.823 AU for L = 1.1915, 0 bodies in the wrong zone)
bar 5 PASS: same seed gives byte-identical files (6 files identical)
bar 6 PASS: labels: none overlap (10 labels, 0 overlapping pairs)
bar 7 PASS: labels: none cut by the edge (0 cut)
bar 8 SKIP: labels: read back by OCR (skipped: tesseract not found (install it to run this bar))
bar 9 PASS: labels: none overlap (orbits.svg) (5 labels, 0 overlapping pairs)
bar 10 PASS: labels: none cut by the edge (orbits.svg) (0 cut)
bar 11 SKIP: labels: read back by OCR (orbits.svg) (skipped: tesseract not found (install it to run this bar))
The generator spaces planets at least 12 mutual Hill radii apart (CHANGELOG 0.6.0); the bar passes at 10, so it leaves a margin.
python scripts/mpw.py render sol2.map -o sol2-scale.svg --view scalewrote sol2-scale.svg
gen sector --systems also writes a full system for every world in systems/<hex>/, each seeded from the sector seed and its hex (place_seed(seed, "system", hex), blake2b, 8 bytes). gen system --sector-seed S --hex H makes that same system on its own, byte-identical, so a sector and any one of its systems can be rebuilt separately. From a real run on v0.17.0:
python scripts/mpw.py gen sector --seed 5 --systems --out spin.map
python scripts/mpw.py gen system --sector-seed 5 --hex 0102 --out one.map
diff -r spin.map/systems/0102 one.mapwrote spin.map: Vovivio, 57 worlds, 90 routes (0 long) in 0.23 s
wrote one.map: Saeha (M8 V), 7 planets, 10 moons in 0.02 s
spin.map/systems/ holds 57 folders, one per world, and diff prints nothing. Without --systems the sector folder is unchanged from 0.16.0.
An equirectangular texture of one of six kinds (--kind rocky|ice|ocean|gas|moon|locked), sampled from 3D noise on the sphere, so it has no seam and no pinch at the poles. --width is even and at least 512; the height is half.
python scripts/mpw.py gen planet --seed 5 --kind ocean --width 512 --out blue.mapwrote blue.map: ocean planet texture 512x256, 0 craters in 0.72 s
export --to sphere checks the seam and poles and writes the texture with a note for three.js and Blender (Export).
Ship (--hull ship) or station decks with a spine corridor, rooms, doors, an airlock and lifts that line up between decks. --w is the length and --h the beam, in 1.5 m squares; --decks N; --pps pixels per square in map.svg.
python scripts/mpw.py gen deck --seed 5 --hull ship --decks 2 --out ship.mapwrote ship.map: Botomabiom, 2 deck(s), 26 rooms in 0.02 s
python scripts/mpw.py check ship.mapbar 1 PASS: deck: every room reached from the airlock (26 rooms on 2 deck(s), 0 unreached)
bar 2 PASS: deck: every floor square reached (759 of 759 reached)
bar 3 PASS: deck: every door joins two floors (26 doors, 0 bad)
bar 4 PASS: deck: airlock has an inner door and an outer door to space (outer at [18, 1] opens to space: True; inner door: True)
bar 5 PASS: deck: lifts line up on every deck (lift squares per deck: [1, 1])
bar 6 PASS: same seed gives byte-identical files (5 files identical)
bar 7 PASS: labels: none overlap (26 labels, 0 overlapping pairs)
bar 8 PASS: labels: none cut by the edge (0 cut)
bar 9 SKIP: labels: read back by OCR (skipped: tesseract not found (install it to run this bar))
Decks are numbered from 1 in path and export --deck. render --title is unused on space maps and says so.
This wiki describes mapwright 0.24.0 (released 2026-11-16) and was last updated on 2026-11-16. mapwright is MIT licensed. Report problems in the issues.