@onimaxxing/worldgen-node 0.22.0 → 0.24.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/index.cjs +1 -1
- package/index.d.ts +19 -25
- package/oni_wasm.d.ts +3 -2
- package/oni_wasm.js +9 -16
- package/oni_wasm_bg.wasm +0 -0
- package/package.json +1 -1
package/index.cjs
CHANGED
|
@@ -89,7 +89,7 @@ const worldgen = {
|
|
|
89
89
|
},
|
|
90
90
|
// Partial worldgen; see index.js for the full contract notes.
|
|
91
91
|
partials(coord, opts) {
|
|
92
|
-
return
|
|
92
|
+
return _wasm.partials_from_coordinate(coord, JSON.stringify(opts ?? {}));
|
|
93
93
|
},
|
|
94
94
|
clear() {
|
|
95
95
|
_wasm.clear_cluster_cache();
|
package/index.d.ts
CHANGED
|
@@ -470,9 +470,8 @@ export interface PartialsOptions {
|
|
|
470
470
|
}
|
|
471
471
|
|
|
472
472
|
/**
|
|
473
|
-
* One generated world from `worldgen.partials`. Grid fields
|
|
474
|
-
*
|
|
475
|
-
* pre-settle state.
|
|
473
|
+
* One generated world from `worldgen.partials`. Grid fields are the
|
|
474
|
+
* same typed arrays `generate` returns and hold pre-settle state.
|
|
476
475
|
*/
|
|
477
476
|
export interface PartialWorld {
|
|
478
477
|
/** Placement index in the cluster layout (stable slot identity). */
|
|
@@ -485,30 +484,25 @@ export interface PartialWorld {
|
|
|
485
484
|
height: number;
|
|
486
485
|
is_starting: boolean;
|
|
487
486
|
world_traits: string[];
|
|
488
|
-
geysers: GeyserSpawn[];
|
|
489
487
|
/**
|
|
490
|
-
*
|
|
491
|
-
*
|
|
492
|
-
*
|
|
493
|
-
*
|
|
494
|
-
*
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
backwall_element_idx: number[];
|
|
507
|
-
backwall_mass: number[];
|
|
508
|
-
backwall_temperature: number[];
|
|
509
|
-
zone_idx: number[];
|
|
488
|
+
* Complete geyser list (broad tag predicate). Since 0.24.0 this is
|
|
489
|
+
* the geyser surface of the payload; the digest-format
|
|
490
|
+
* `geyser_*_sha`/`_count` verification hashes that ≤ 0.23.x carried
|
|
491
|
+
* per world exist only in `--features debug` builds (they are
|
|
492
|
+
* parity-tooling internals, not consumer data).
|
|
493
|
+
*/
|
|
494
|
+
geysers: GeyserSpawn[];
|
|
495
|
+
element_idx: Uint16Array;
|
|
496
|
+
mass: Float32Array;
|
|
497
|
+
temperature: Float32Array;
|
|
498
|
+
disease_idx: Uint8Array;
|
|
499
|
+
disease_count: Int32Array;
|
|
500
|
+
backwall_element_idx: Uint16Array;
|
|
501
|
+
backwall_mass: Float32Array;
|
|
502
|
+
backwall_temperature: Float32Array;
|
|
503
|
+
zone_idx: Uint16Array;
|
|
510
504
|
zone_table: string[];
|
|
511
|
-
subworld_idx:
|
|
505
|
+
subworld_idx: Uint16Array;
|
|
512
506
|
subworld_table: string[];
|
|
513
507
|
biome_cells: BiomeCell[];
|
|
514
508
|
buildings: EntitySpawn[];
|
package/oni_wasm.d.ts
CHANGED
|
@@ -96,7 +96,8 @@ export function noise_node_kinds(): string;
|
|
|
96
96
|
* Partial worldgen: generate only the selected worlds of a cluster.
|
|
97
97
|
* Cluster-level pre-passes (mixing, trait selection) run over every
|
|
98
98
|
* placement; per-world phases run only for the selected slots.
|
|
99
|
-
* Stateless; does not touch `CLUSTER_CACHE`.
|
|
99
|
+
* Stateless; does not touch `CLUSTER_CACHE`. Per-cell grids ship as
|
|
100
|
+
* typed arrays on the returned value, as with `generate_map_data`.
|
|
100
101
|
*
|
|
101
102
|
* Geyser output matches a full generate exactly, and each world
|
|
102
103
|
* carries the digest-format geyser hashes. Verified element-wise by
|
|
@@ -109,7 +110,7 @@ export function noise_node_kinds(): string;
|
|
|
109
110
|
* grids are pre-settle, as with `generate`; there is no partial
|
|
110
111
|
* settle (use `generate` + `advance` for settled state).
|
|
111
112
|
*/
|
|
112
|
-
export function partials_from_coordinate(coordinate: string, options_json: string):
|
|
113
|
+
export function partials_from_coordinate(coordinate: string, options_json: string): any;
|
|
113
114
|
|
|
114
115
|
/**
|
|
115
116
|
* Toggle template placement. WASM-side counterpart of the native
|
package/oni_wasm.js
CHANGED
|
@@ -254,7 +254,8 @@ exports.noise_node_kinds = noise_node_kinds;
|
|
|
254
254
|
* Partial worldgen: generate only the selected worlds of a cluster.
|
|
255
255
|
* Cluster-level pre-passes (mixing, trait selection) run over every
|
|
256
256
|
* placement; per-world phases run only for the selected slots.
|
|
257
|
-
* Stateless; does not touch `CLUSTER_CACHE`.
|
|
257
|
+
* Stateless; does not touch `CLUSTER_CACHE`. Per-cell grids ship as
|
|
258
|
+
* typed arrays on the returned value, as with `generate_map_data`.
|
|
258
259
|
*
|
|
259
260
|
* Geyser output matches a full generate exactly, and each world
|
|
260
261
|
* carries the digest-format geyser hashes. Verified element-wise by
|
|
@@ -268,23 +269,15 @@ exports.noise_node_kinds = noise_node_kinds;
|
|
|
268
269
|
* settle (use `generate` + `advance` for settled state).
|
|
269
270
|
* @param {string} coordinate
|
|
270
271
|
* @param {string} options_json
|
|
271
|
-
* @returns {
|
|
272
|
+
* @returns {any}
|
|
272
273
|
*/
|
|
273
274
|
function partials_from_coordinate(coordinate, options_json) {
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
const len1 = WASM_VECTOR_LEN;
|
|
281
|
-
const ret = wasm.partials_from_coordinate(ptr0, len0, ptr1, len1);
|
|
282
|
-
deferred3_0 = ret[0];
|
|
283
|
-
deferred3_1 = ret[1];
|
|
284
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
285
|
-
} finally {
|
|
286
|
-
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
287
|
-
}
|
|
275
|
+
const ptr0 = passStringToWasm0(coordinate, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
276
|
+
const len0 = WASM_VECTOR_LEN;
|
|
277
|
+
const ptr1 = passStringToWasm0(options_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
278
|
+
const len1 = WASM_VECTOR_LEN;
|
|
279
|
+
const ret = wasm.partials_from_coordinate(ptr0, len0, ptr1, len1);
|
|
280
|
+
return ret;
|
|
288
281
|
}
|
|
289
282
|
exports.partials_from_coordinate = partials_from_coordinate;
|
|
290
283
|
|
package/oni_wasm_bg.wasm
CHANGED
|
Binary file
|