@onimaxxing/worldgen-node 0.15.2 → 0.17.0
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 +6 -2
- package/index.d.ts +30 -0
- package/oni_wasm_bg.wasm +0 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -323,6 +323,10 @@ interface WorldMapData {
|
|
|
323
323
|
backwall_element_idx: Uint16Array; // U59 backwall layer; Vacuum-filled outside DLC5 aquatic biomes
|
|
324
324
|
backwall_mass: Float32Array; // f32 per cell, kg; 0 on Vacuum cells
|
|
325
325
|
backwall_temperature: Float32Array; // f32 per cell, K; 0 on Vacuum cells
|
|
326
|
+
zone_idx: Uint16Array; // u16 per cell -> zone_table; 0xFFFF = no biome polygon
|
|
327
|
+
zone_table: string[]; // distinct ZoneType strings (same vocab as biome_cells[].zone_type)
|
|
328
|
+
subworld_idx: Uint16Array; // u16 per cell -> subworld_table; 0xFFFF = no biome polygon
|
|
329
|
+
subworld_table: string[]; // distinct subworld type paths (same vocab as biome_cells[].type)
|
|
326
330
|
biome_cells: BiomeCell[];
|
|
327
331
|
geysers: GeyserSpawn[];
|
|
328
332
|
buildings: EntitySpawn[];
|
|
@@ -418,9 +422,9 @@ option (`MUWF1`) enabled. 8 worlds, ~170,000 cells total.
|
|
|
418
422
|
| Runtime | Time |
|
|
419
423
|
|---|---|
|
|
420
424
|
| In-game World Generation | 10.4 s |
|
|
421
|
-
| This package (Node 24) | 0.
|
|
425
|
+
| This package (Node 24) | 0.41 s |
|
|
422
426
|
|
|
423
|
-
WASM worldgen runs roughly
|
|
427
|
+
WASM worldgen runs roughly 25x faster than the game's C# worldgen.
|
|
424
428
|
|
|
425
429
|
**Memory usage** (one worldgen at a time, measured on the same
|
|
426
430
|
cluster, resident memory only):
|
package/index.d.ts
CHANGED
|
@@ -234,6 +234,36 @@ export interface WorldMapData {
|
|
|
234
234
|
backwall_mass: Float32Array;
|
|
235
235
|
/** U59 backwall temperature per cell, in K. Zero on Vacuum cells. */
|
|
236
236
|
backwall_temperature: Float32Array;
|
|
237
|
+
/**
|
|
238
|
+
* u16 per cell, row-major (`width * height`, same layout as
|
|
239
|
+
* `element_idx`): index into this world's `zone_table`, i.e. the
|
|
240
|
+
* `ZoneType` of the biome (Voronoi) region the cell falls in. Copied
|
|
241
|
+
* from the generator's own cell→region assignment (the containment
|
|
242
|
+
* pass that fills each region's element bands), not recomputed from
|
|
243
|
+
* `biome_cells` polygons. `0xFFFF` marks cells inside no biome
|
|
244
|
+
* polygon — the Unobtanium/Void world-border ring plus the odd
|
|
245
|
+
* integer point landing exactly on a shared polygon edge.
|
|
246
|
+
*/
|
|
247
|
+
zone_idx: Uint16Array;
|
|
248
|
+
/**
|
|
249
|
+
* Distinct `ZoneType` strings for this world, indexed by `zone_idx`.
|
|
250
|
+
* Same vocabulary as `biome_cells[].zone_type`; a region whose
|
|
251
|
+
* subworld path can't be resolved (where `biome_cells[].zone_type`
|
|
252
|
+
* is `null`) contributes the literal `"Unknown"`.
|
|
253
|
+
*/
|
|
254
|
+
zone_table: (ZoneType | 'Unknown')[];
|
|
255
|
+
/**
|
|
256
|
+
* u16 per cell, same layout and `0xFFFF` sentinel as `zone_idx`:
|
|
257
|
+
* index into `subworld_table`. Finer-grained than `zone_idx` — one
|
|
258
|
+
* entry per distinct subworld type rather than per `ZoneType`.
|
|
259
|
+
*/
|
|
260
|
+
subworld_idx: Uint16Array;
|
|
261
|
+
/**
|
|
262
|
+
* Distinct subworld type paths for this world, indexed by
|
|
263
|
+
* `subworld_idx` — e.g. `"expansion1::subworlds/jungle/med_Jungle"`.
|
|
264
|
+
* Same vocabulary as `biome_cells[].type`.
|
|
265
|
+
*/
|
|
266
|
+
subworld_table: string[];
|
|
237
267
|
biome_cells: BiomeCell[];
|
|
238
268
|
geysers: GeyserSpawn[];
|
|
239
269
|
buildings: EntitySpawn[];
|
package/oni_wasm_bg.wasm
CHANGED
|
Binary file
|