doom-osm-godmode 1.2.0 → 1.2.2
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.
- package/README.md +364 -332
- package/assets/banner.svg +82 -0
- package/assets/header.png +0 -0
- package/assets/logo.svg +87 -0
- package/assets/screens/inside.jpg +0 -0
- package/assets/screens/outside.jpg +0 -0
- package/package.json +5 -1
- package/scripts/build-galway-cathedral-v2.js +600 -0
- package/scripts/build-galway-cathedral.js +738 -0
package/README.md
CHANGED
|
@@ -1,332 +1,364 @@
|
|
|
1
|
-
<p align="center">
|
|
2
|
-
<img src="
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
<
|
|
6
|
-
<
|
|
7
|
-
<a href="
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
```
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
###
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
```
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
```
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
```bash
|
|
280
|
-
#
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="https://github.com/eoinjordan/doom-osm-godmode/releases"><img src="https://img.shields.io/github/v/tag/eoinjordan/doom-osm-godmode?sort=semver&label=release&color=brightgreen" alt="release tag"></a>
|
|
3
|
+
<a href="https://www.npmjs.com/package/doom-osm-godmode"><img src="https://img.shields.io/npm/v/doom-osm-godmode?color=brightgreen" alt="npm"></a>
|
|
4
|
+
<a href="https://github.com/eoinjordan/doom-osm-godmode/actions"><img src="https://github.com/eoinjordan/doom-osm-godmode/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
|
|
5
|
+
<img src="https://img.shields.io/badge/node-%3E%3D20-brightgreen" alt="Node 20+">
|
|
6
|
+
<img src="https://img.shields.io/badge/dependencies-0-blue" alt="Zero deps">
|
|
7
|
+
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-yellow" alt="MIT"></a>
|
|
8
|
+
</p>
|
|
9
|
+
|
|
10
|
+
<p align="center">
|
|
11
|
+
<img src="assets/header.png" alt="DOOM OSM GODMODE" width="800"/>
|
|
12
|
+
</p>
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
Give it a place name, a GeoJSON file, or a config — it geocodes through Nominatim, pulls polygon features from OpenStreetMap via Overpass, projects them into a connected room-and-corridor layout, and writes a PWAD in UDMF format ready for GZDoom.
|
|
17
|
+
|
|
18
|
+
Zero npm dependencies. Node 20+ only.
|
|
19
|
+
|
|
20
|
+
## Quick Start
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
# run the bundled demo (offline, no network)
|
|
24
|
+
npm run demo
|
|
25
|
+
|
|
26
|
+
# build a real place
|
|
27
|
+
node src/cli.js build-place "Colosseum, Rome, Italy" --radius 450
|
|
28
|
+
node src/cli.js build-place "Eiffel Tower, Paris" --radius 450
|
|
29
|
+
|
|
30
|
+
# hand-crafted architecturally accurate building
|
|
31
|
+
node scripts/build-galway-cathedral.js
|
|
32
|
+
|
|
33
|
+
# search without building
|
|
34
|
+
node src/cli.js search "Eiffel Tower, Paris"
|
|
35
|
+
|
|
36
|
+
# build from a config file
|
|
37
|
+
node src/cli.js build-config examples/colosseum.json
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Installation
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
git clone https://github.com/eoinjordan/doom-osm-godmode.git
|
|
44
|
+
cd doom-osm-godmode
|
|
45
|
+
npm test # verify everything works
|
|
46
|
+
npm run demo # generate a WAD from the bundled demo site
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Or install globally from npm:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
npx doom-osm-godmode build-place "Colosseum, Rome" --radius 450
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
No `npm install` needed — there are no dependencies.
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
Start the map on GZDOOM or Ultimate on Windows:
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
"C:\Games\GZDoom\gzdoom.exe" -iwad "C:\Program Files (x86)\Steam\steamapps\common\Ultimate Doom\base\doom2\DOOM2.WAD" -file "C:\Users\Eoin\git\doom-osm-wad\output\galway-cathedral-v3\MAP01.wad" +map MAP01
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
<img width="899" height="689" alt="image" src="https://github.com/user-attachments/assets/894904fe-5e10-4226-ad60-72ff50e7b9ce" />
|
|
65
|
+
|
|
66
|
+
## Screenshots
|
|
67
|
+
|
|
68
|
+
<p align="center">
|
|
69
|
+
<img src="https://raw.githubusercontent.com/eoinjordan/doom-osm-godmode/main/assets/screens/outside.jpg" alt="Galway Cathedral outside" width="400"/>
|
|
70
|
+
<img src="https://raw.githubusercontent.com/eoinjordan/doom-osm-godmode/main/assets/screens/inside.jpg" alt="Galway Cathedral inside" width="400"/>
|
|
71
|
+
</p>
|
|
72
|
+
|
|
73
|
+
<p align="center"><em>Galway Cathedral — hand-crafted map. Some visual clipping bugs are known and will be addressed in future releases.</em></p>
|
|
74
|
+
|
|
75
|
+
## CLI Reference
|
|
76
|
+
|
|
77
|
+
```
|
|
78
|
+
doom-osm-godmode
|
|
79
|
+
|
|
80
|
+
Commands:
|
|
81
|
+
search <query> Search Nominatim for a place
|
|
82
|
+
build-place <query> [options] Geocode + OSM fetch + WAD export
|
|
83
|
+
build-config <config.json> Build from a JSON config file
|
|
84
|
+
demo [--out output/demo-site] Build the bundled demo WAD
|
|
85
|
+
|
|
86
|
+
Options for build-place:
|
|
87
|
+
--radius <meters> Override bounding box with a fixed radius (default: use Nominatim bbox)
|
|
88
|
+
--map <MAPXX> Map lump name (default: MAP01)
|
|
89
|
+
--max-rooms <count> Cap on rooms generated (default: 12)
|
|
90
|
+
--title <name> Override the map title
|
|
91
|
+
--out <dir> Output directory (default: output/<slugified-title>)
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## Programmatic API
|
|
95
|
+
|
|
96
|
+
```javascript
|
|
97
|
+
const { buildFromPlace, buildFromConfig, buildDemo } = require('doom-osm-godmode');
|
|
98
|
+
|
|
99
|
+
// from a place name (hits Nominatim + Overpass)
|
|
100
|
+
const result = await buildFromPlace('Sydney Opera House', {
|
|
101
|
+
radiusMeters: 500,
|
|
102
|
+
mapName: 'MAP01',
|
|
103
|
+
maxRooms: 10,
|
|
104
|
+
outputDir: './output/sydney'
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
// from a config file (place query or offline GeoJSON)
|
|
108
|
+
const result = await buildFromConfig('examples/colosseum.json');
|
|
109
|
+
|
|
110
|
+
// bundled demo (no network)
|
|
111
|
+
const result = await buildDemo('./output/demo');
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
All functions return `{ outputDir, mapPath, featureCount, exportedFeatures }`.
|
|
115
|
+
|
|
116
|
+
## Output
|
|
117
|
+
|
|
118
|
+
Each build writes a folder containing:
|
|
119
|
+
|
|
120
|
+
| File | Description |
|
|
121
|
+
|------|-------------|
|
|
122
|
+
| `site.json` | Normalized feature set with projected metrics |
|
|
123
|
+
| `layout.json` | Room/corridor grid layout used for WAD generation |
|
|
124
|
+
| `TEXTMAP.udmf` | Human-readable UDMF map geometry |
|
|
125
|
+
| `MAPINFO.txt` | GZDoom map metadata (sky, music, title) |
|
|
126
|
+
| `<MAPXX>.wad` | Packaged PWAD — load this in GZDoom |
|
|
127
|
+
|
|
128
|
+
## Config Format
|
|
129
|
+
|
|
130
|
+
Place query (network):
|
|
131
|
+
|
|
132
|
+
```json
|
|
133
|
+
{
|
|
134
|
+
"title": "Colosseum District",
|
|
135
|
+
"mapName": "MAP01",
|
|
136
|
+
"placeQuery": "Colosseum, Rome, Italy",
|
|
137
|
+
"radiusMeters": 450,
|
|
138
|
+
"maxRooms": 10,
|
|
139
|
+
"outputDir": "../output/colosseum"
|
|
140
|
+
}
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
Offline GeoJSON:
|
|
144
|
+
|
|
145
|
+
```json
|
|
146
|
+
{
|
|
147
|
+
"title": "Demo Waterfront",
|
|
148
|
+
"mapName": "MAP01",
|
|
149
|
+
"inputGeoJson": "demo-site.geojson",
|
|
150
|
+
"maxRooms": 8,
|
|
151
|
+
"outputDir": "../output/demo-site"
|
|
152
|
+
}
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
Relative paths in configs resolve from the config file's directory.
|
|
156
|
+
|
|
157
|
+
## Architecture
|
|
158
|
+
|
|
159
|
+
```
|
|
160
|
+
place query / GeoJSON
|
|
161
|
+
│
|
|
162
|
+
▼
|
|
163
|
+
geocode.js ──► Nominatim API
|
|
164
|
+
│
|
|
165
|
+
▼
|
|
166
|
+
osm.js ────► Overpass API (polygon features)
|
|
167
|
+
│
|
|
168
|
+
▼
|
|
169
|
+
feature-set.js project to local coords, filter, sort
|
|
170
|
+
│
|
|
171
|
+
▼
|
|
172
|
+
layout.js grid-based room placement + corridors + theming
|
|
173
|
+
│
|
|
174
|
+
▼
|
|
175
|
+
udmf.js UDMF vertices, linedefs, sidedefs, sectors, things
|
|
176
|
+
│
|
|
177
|
+
▼
|
|
178
|
+
wad.js binary PWAD packaging
|
|
179
|
+
│
|
|
180
|
+
▼
|
|
181
|
+
MAP01.wad ready for GZDoom
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
### Key Source Files
|
|
185
|
+
|
|
186
|
+
| File | Purpose |
|
|
187
|
+
|------|---------|
|
|
188
|
+
| `src/cli.js` | CLI entry point and command router |
|
|
189
|
+
| `src/workflow.js` | Build pipeline orchestrator |
|
|
190
|
+
| `src/geocode.js` | Nominatim geocoding |
|
|
191
|
+
| `src/osm.js` | Overpass polygon fetching |
|
|
192
|
+
| `src/feature-set.js` | Feature normalization and projection |
|
|
193
|
+
| `src/geo.js` | Mercator projection, bbox, polygon math |
|
|
194
|
+
| `src/layout.js` | Grid room placement, corridors, theming |
|
|
195
|
+
| `src/udmf.js` | UDMF text map generation |
|
|
196
|
+
| `src/wad.js` | PWAD binary packing |
|
|
197
|
+
| `src/lib/cli.js` | Argument parser |
|
|
198
|
+
| `src/lib/fs.js` | File I/O utilities |
|
|
199
|
+
|
|
200
|
+
### Room Theming
|
|
201
|
+
|
|
202
|
+
Features are themed by kind:
|
|
203
|
+
|
|
204
|
+
| Kind | Floor | Ceiling | Light | Notes |
|
|
205
|
+
|------|-------|---------|-------|-------|
|
|
206
|
+
| building | stone | flat | 152 | Default indoor |
|
|
207
|
+
| water | nukage | flat | 144 | Floor at -24 |
|
|
208
|
+
| park | grass | sky | 176 | Outdoor feel |
|
|
209
|
+
| road | light stone | flat | 160 | Corridors |
|
|
210
|
+
|
|
211
|
+
## Testing
|
|
212
|
+
|
|
213
|
+
```bash
|
|
214
|
+
npm test # smoke tests via node:test
|
|
215
|
+
npm run check # syntax-check all source files
|
|
216
|
+
npm run validate # structural WAD/UDMF validation (builds + verifies integrity)
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
## Agent Playtest via doom-mcp
|
|
220
|
+
|
|
221
|
+
Generated WADs can be playtested by an AI agent using [doom-mcp](https://github.com/gunnargrosch/doom-mcp) — a Rust MCP server that embeds the real DOOM engine.
|
|
222
|
+
|
|
223
|
+
### Quick setup
|
|
224
|
+
|
|
225
|
+
The repo includes a `.mcp.json` that configures doom-mcp to load your demo WAD:
|
|
226
|
+
|
|
227
|
+
```bash
|
|
228
|
+
# 1. Build a WAD first
|
|
229
|
+
npm run demo
|
|
230
|
+
|
|
231
|
+
# 2. Playtest it (automated agent navigation sequence)
|
|
232
|
+
npm run playtest -- output/demo-site/MAP01.wad
|
|
233
|
+
|
|
234
|
+
# 3. Or playtest a real-place WAD
|
|
235
|
+
node src/cli.js build-place "Colosseum" --radius 450
|
|
236
|
+
npm run playtest -- output/colosseum/MAP01.wad --skill 1 --ticks 300
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
### What the playtest validates
|
|
240
|
+
|
|
241
|
+
The automated playtest spawns doom-mcp, loads the WAD, and runs through a navigation sequence:
|
|
242
|
+
|
|
243
|
+
- **Game starts** — doom engine accepts the WAD
|
|
244
|
+
- **Player spawns** — HP > 0 at spawn point
|
|
245
|
+
- **Player can move** — position changes across multiple actions
|
|
246
|
+
- **Player survives** — doesn't die during baby-difficulty walkthrough
|
|
247
|
+
|
|
248
|
+
### Using doom-mcp interactively
|
|
249
|
+
|
|
250
|
+
For interactive agent playtesting (e.g., in Claude Code or Cursor):
|
|
251
|
+
|
|
252
|
+
```json
|
|
253
|
+
{
|
|
254
|
+
"mcpServers": {
|
|
255
|
+
"doom": {
|
|
256
|
+
"type": "stdio",
|
|
257
|
+
"command": "npx",
|
|
258
|
+
"args": ["-y", "doom-mcp"],
|
|
259
|
+
"env": {
|
|
260
|
+
"DOOM_WAD_PATH": "/path/to/your/MAP01.wad"
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
Then tell the agent: *"Play this DOOM level and tell me if it's fun"*
|
|
268
|
+
|
|
269
|
+
### CI integration
|
|
270
|
+
|
|
271
|
+
The `playtest.yml` workflow runs structural validation on every tag push and can be triggered manually for any place:
|
|
272
|
+
|
|
273
|
+
```
|
|
274
|
+
Actions → Playtest → Run workflow → Enter place name → Go
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
## Playing the WAD
|
|
278
|
+
|
|
279
|
+
```bash
|
|
280
|
+
# GZDoom (adjust path to your install)
|
|
281
|
+
gzdoom -file output/colosseum/MAP01.wad
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
The WAD is a PWAD — it layers on top of any IWAD (DOOM2.WAD, FREEDOOM2.WAD, etc.).
|
|
285
|
+
|
|
286
|
+
## Hand-Crafted Buildings
|
|
287
|
+
|
|
288
|
+
The OSM pipeline creates grid-based rooms. For architecturally accurate buildings (cathedrals, temples, etc.), use a hand-crafted script:
|
|
289
|
+
|
|
290
|
+
```bash
|
|
291
|
+
# Build the Galway Cathedral demo (cross-shaped plan, green copper dome, grand nave)
|
|
292
|
+
node scripts/build-galway-cathedral.js
|
|
293
|
+
|
|
294
|
+
# Launch in GZDoom
|
|
295
|
+
gzdoom -iwad DOOM2.WAD -file output/galway-cathedral-v3/MAP01.wad +map MAP01
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
The cathedral builder demonstrates the `UDMFBuilder` class with polygon-based sector creation, grand interior aisle, raised chancel, self-validation, and exterior forecourt. Use it as a template for new hand-crafted maps.
|
|
299
|
+
|
|
300
|
+
**Example maps included:**
|
|
301
|
+
|
|
302
|
+
| Map | Type | Script / Command |
|
|
303
|
+
|-----|------|------------------|
|
|
304
|
+
| Galway Cathedral | Hand-crafted | `node scripts/build-galway-cathedral.js` |
|
|
305
|
+
| Colosseum, Rome | OSM / live | `node src/cli.js build-place "Colosseum, Rome, Italy" --radius 450` |
|
|
306
|
+
| Eiffel Tower, Paris | OSM / live | `node src/cli.js build-place "Eiffel Tower, Paris" --radius 450` |
|
|
307
|
+
| Demo Waterfront | Offline GeoJSON | `npm run demo` |
|
|
308
|
+
|
|
309
|
+
### Validate any WAD
|
|
310
|
+
|
|
311
|
+
```bash
|
|
312
|
+
# Structural UDMF diagnostic (checks for duplicate linedefs, etc.)
|
|
313
|
+
node scripts/diagnose-udmf.js output/galway-cathedral-v3/TEXTMAP.udmf
|
|
314
|
+
|
|
315
|
+
# Agent playtest via doom-mcp
|
|
316
|
+
npm run playtest -- output/galway-cathedral-v3/MAP01.wad
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
## UDMF Geometry Rules
|
|
320
|
+
|
|
321
|
+
Common issues found when generating DOOM maps from real-world data:
|
|
322
|
+
|
|
323
|
+
| Issue | Symptom | Fix |
|
|
324
|
+
|-------|---------|-----|
|
|
325
|
+
| Duplicate linedefs (same vertex pair) | Flickering/transparent walls | Use a single polygon for complex shapes; deduplicate in `addInnerSector` |
|
|
326
|
+
| Collinear overlapping linedefs | See-through walls, BSP errors | Never let two linedefs share the same 2D line segment |
|
|
327
|
+
| Inner sector outside parent bounds | Rendering void, hall-of-mirrors | Ensure all inner sector vertices are strictly inside the outer polygon |
|
|
328
|
+
| Separate rooms at same crossing | Duplicate shared edges | Use ONE polygon for the union shape (e.g., a cross), not overlapping rectangles |
|
|
329
|
+
| Underground areas sharing x,y with upper | DOOM 2.5D sector conflict | Place underground areas at different x,y coords; connect via teleporter |
|
|
330
|
+
| Invisible walls on two-sided linedefs | Side walls transparent where floor heights match | Set `wrapmidtex = true` + `blocking = true` + `texturemiddle` on the two-sided linedef |
|
|
331
|
+
| Floating mid-textures on promoted linedefs | Choppy half-height walls | Clear `texturemiddle` when promoting one-sided to two-sided; use upper/lower instead |
|
|
332
|
+
| Zero-height pillar sectors (floor = ceiling) | Player stuck, node builder errors | Use Thing-based pillars (type 30) instead of sector-based pillars |
|
|
333
|
+
|
|
334
|
+
### Repeatable pattern for future OSM meshes
|
|
335
|
+
|
|
336
|
+
1. Run `node src/cli.js build-place ...` for the grid-room WAD
|
|
337
|
+
2. Run `node scripts/diagnose-udmf.js output/<name>/TEXTMAP.udmf` to check geometry
|
|
338
|
+
3. Run `npm run playtest -- output/<name>/MAP01.wad` for engine validation
|
|
339
|
+
4. If the grid rooms are too abstract, create a hand-crafted script (see `scripts/build-galway-cathedral.js`)
|
|
340
|
+
5. Always run self-validation before writing the WAD
|
|
341
|
+
|
|
342
|
+
## Notes
|
|
343
|
+
|
|
344
|
+
- Network commands use public OSM infrastructure (Nominatim, Overpass). Keep requests reasonable.
|
|
345
|
+
- Only polygon features become rooms. Roads and linear features are not yet carved into sectors.
|
|
346
|
+
- The layout is a blockout interpretation — connected rooms reflecting real feature hierarchy, not pixel-perfect street geometry.
|
|
347
|
+
|
|
348
|
+
## Roadmap
|
|
349
|
+
|
|
350
|
+
- exact polygon-to-sector carving (replace grid rooms with real building outlines)
|
|
351
|
+
- road and canal line buffering into traversable sectors
|
|
352
|
+
- Doom encounter placement (monsters, ammo, weapons)
|
|
353
|
+
- texture themes per location style
|
|
354
|
+
- multi-map episode generation
|
|
355
|
+
- freeform agent-described layouts (no OSM needed)
|
|
356
|
+
- automatic duplicate linedef detection in the OSM pipeline
|
|
357
|
+
|
|
358
|
+
## Contributing
|
|
359
|
+
|
|
360
|
+
PRs welcome. Run `npm test` and `npm run check` before submitting.
|
|
361
|
+
|
|
362
|
+
## License
|
|
363
|
+
|
|
364
|
+
MIT — see [LICENSE](LICENSE)
|