@onimaxxing/worldgen 0.22.0 → 0.23.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.d.ts +12 -13
- package/index.js +1 -3
- package/package.json +1 -1
- package/parallel/oni_wasm.d.ts +4 -3
- package/parallel/oni_wasm.js +9 -16
- package/parallel/oni_wasm_bg.wasm +0 -0
- package/parallel/oni_wasm_bg.wasm.d.ts +1 -1
- package/serial/oni_wasm.d.ts +4 -3
- package/serial/oni_wasm.js +9 -16
- package/serial/oni_wasm_bg.wasm +0 -0
- package/serial/oni_wasm_bg.wasm.d.ts +1 -1
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). */
|
|
@@ -498,17 +497,17 @@ export interface PartialWorld {
|
|
|
498
497
|
geyser_spawns_count: number;
|
|
499
498
|
geyser_stats_sha: string;
|
|
500
499
|
geyser_stats_count: number;
|
|
501
|
-
element_idx:
|
|
502
|
-
mass:
|
|
503
|
-
temperature:
|
|
504
|
-
disease_idx:
|
|
505
|
-
disease_count:
|
|
506
|
-
backwall_element_idx:
|
|
507
|
-
backwall_mass:
|
|
508
|
-
backwall_temperature:
|
|
509
|
-
zone_idx:
|
|
500
|
+
element_idx: Uint16Array;
|
|
501
|
+
mass: Float32Array;
|
|
502
|
+
temperature: Float32Array;
|
|
503
|
+
disease_idx: Uint8Array;
|
|
504
|
+
disease_count: Int32Array;
|
|
505
|
+
backwall_element_idx: Uint16Array;
|
|
506
|
+
backwall_mass: Float32Array;
|
|
507
|
+
backwall_temperature: Float32Array;
|
|
508
|
+
zone_idx: Uint16Array;
|
|
510
509
|
zone_table: string[];
|
|
511
|
-
subworld_idx:
|
|
510
|
+
subworld_idx: Uint16Array;
|
|
512
511
|
subworld_table: string[];
|
|
513
512
|
biome_cells: BiomeCell[];
|
|
514
513
|
buildings: EntitySpawn[];
|
package/index.js
CHANGED
|
@@ -172,9 +172,7 @@ export const worldgen = {
|
|
|
172
172
|
// See PartialsOptions/PartialsResult in index.d.ts and the README.
|
|
173
173
|
// Stateless; does not populate the cache used by advance()/entities().
|
|
174
174
|
partials(coord, opts) {
|
|
175
|
-
return JSON.
|
|
176
|
-
_requireInit('partials').partials_from_coordinate(coord, JSON.stringify(opts ?? {}))
|
|
177
|
-
);
|
|
175
|
+
return _requireInit('partials').partials_from_coordinate(coord, JSON.stringify(opts ?? {}));
|
|
178
176
|
},
|
|
179
177
|
clear() {
|
|
180
178
|
_requireInit('clear').clear_cluster_cache();
|
package/package.json
CHANGED
package/parallel/oni_wasm.d.ts
CHANGED
|
@@ -98,7 +98,8 @@ export function noise_node_kinds(): string;
|
|
|
98
98
|
* Partial worldgen: generate only the selected worlds of a cluster.
|
|
99
99
|
* Cluster-level pre-passes (mixing, trait selection) run over every
|
|
100
100
|
* placement; per-world phases run only for the selected slots.
|
|
101
|
-
* Stateless; does not touch `CLUSTER_CACHE`.
|
|
101
|
+
* Stateless; does not touch `CLUSTER_CACHE`. Per-cell grids ship as
|
|
102
|
+
* typed arrays on the returned value, as with `generate_map_data`.
|
|
102
103
|
*
|
|
103
104
|
* Geyser output matches a full generate exactly, and each world
|
|
104
105
|
* carries the digest-format geyser hashes. Verified element-wise by
|
|
@@ -111,7 +112,7 @@ export function noise_node_kinds(): string;
|
|
|
111
112
|
* grids are pre-settle, as with `generate`; there is no partial
|
|
112
113
|
* settle (use `generate` + `advance` for settled state).
|
|
113
114
|
*/
|
|
114
|
-
export function partials_from_coordinate(coordinate: string, options_json: string):
|
|
115
|
+
export function partials_from_coordinate(coordinate: string, options_json: string): any;
|
|
115
116
|
|
|
116
117
|
/**
|
|
117
118
|
* Toggle template placement. WASM-side counterpart of the native
|
|
@@ -318,7 +319,7 @@ export interface InitOutput {
|
|
|
318
319
|
readonly generate_map_data: (a: number, b: number) => any;
|
|
319
320
|
readonly get_entity_spawners: () => [number, number];
|
|
320
321
|
readonly noise_node_kinds: () => [number, number];
|
|
321
|
-
readonly partials_from_coordinate: (a: number, b: number, c: number, d: number) =>
|
|
322
|
+
readonly partials_from_coordinate: (a: number, b: number, c: number, d: number) => any;
|
|
322
323
|
readonly set_skip_templates: (a: number) => void;
|
|
323
324
|
readonly settings_reset: () => void;
|
|
324
325
|
readonly settle_cluster_advance: (a: number) => [number, number];
|
package/parallel/oni_wasm.js
CHANGED
|
@@ -253,7 +253,8 @@ export function noise_node_kinds() {
|
|
|
253
253
|
* Partial worldgen: generate only the selected worlds of a cluster.
|
|
254
254
|
* Cluster-level pre-passes (mixing, trait selection) run over every
|
|
255
255
|
* placement; per-world phases run only for the selected slots.
|
|
256
|
-
* Stateless; does not touch `CLUSTER_CACHE`.
|
|
256
|
+
* Stateless; does not touch `CLUSTER_CACHE`. Per-cell grids ship as
|
|
257
|
+
* typed arrays on the returned value, as with `generate_map_data`.
|
|
257
258
|
*
|
|
258
259
|
* Geyser output matches a full generate exactly, and each world
|
|
259
260
|
* carries the digest-format geyser hashes. Verified element-wise by
|
|
@@ -267,23 +268,15 @@ export function noise_node_kinds() {
|
|
|
267
268
|
* settle (use `generate` + `advance` for settled state).
|
|
268
269
|
* @param {string} coordinate
|
|
269
270
|
* @param {string} options_json
|
|
270
|
-
* @returns {
|
|
271
|
+
* @returns {any}
|
|
271
272
|
*/
|
|
272
273
|
export function partials_from_coordinate(coordinate, options_json) {
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
const len1 = WASM_VECTOR_LEN;
|
|
280
|
-
const ret = wasm.partials_from_coordinate(ptr0, len0, ptr1, len1);
|
|
281
|
-
deferred3_0 = ret[0];
|
|
282
|
-
deferred3_1 = ret[1];
|
|
283
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
284
|
-
} finally {
|
|
285
|
-
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
286
|
-
}
|
|
274
|
+
const ptr0 = passStringToWasm0(coordinate, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
275
|
+
const len0 = WASM_VECTOR_LEN;
|
|
276
|
+
const ptr1 = passStringToWasm0(options_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
277
|
+
const len1 = WASM_VECTOR_LEN;
|
|
278
|
+
const ret = wasm.partials_from_coordinate(ptr0, len0, ptr1, len1);
|
|
279
|
+
return ret;
|
|
287
280
|
}
|
|
288
281
|
|
|
289
282
|
/**
|
|
Binary file
|
|
@@ -10,7 +10,7 @@ export const generate_layout_cells: (a: number, b: number, c: number) => [number
|
|
|
10
10
|
export const generate_map_data: (a: number, b: number) => any;
|
|
11
11
|
export const get_entity_spawners: () => [number, number];
|
|
12
12
|
export const noise_node_kinds: () => [number, number];
|
|
13
|
-
export const partials_from_coordinate: (a: number, b: number, c: number, d: number) =>
|
|
13
|
+
export const partials_from_coordinate: (a: number, b: number, c: number, d: number) => any;
|
|
14
14
|
export const set_skip_templates: (a: number) => void;
|
|
15
15
|
export const settings_reset: () => void;
|
|
16
16
|
export const settle_cluster_advance: (a: number) => [number, number];
|
package/serial/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
|
|
@@ -306,7 +307,7 @@ export interface InitOutput {
|
|
|
306
307
|
readonly generate_map_data: (a: number, b: number) => any;
|
|
307
308
|
readonly get_entity_spawners: () => [number, number];
|
|
308
309
|
readonly noise_node_kinds: () => [number, number];
|
|
309
|
-
readonly partials_from_coordinate: (a: number, b: number, c: number, d: number) =>
|
|
310
|
+
readonly partials_from_coordinate: (a: number, b: number, c: number, d: number) => any;
|
|
310
311
|
readonly set_skip_templates: (a: number) => void;
|
|
311
312
|
readonly settings_reset: () => void;
|
|
312
313
|
readonly settle_cluster_advance: (a: number) => [number, number];
|
package/serial/oni_wasm.js
CHANGED
|
@@ -243,7 +243,8 @@ export function noise_node_kinds() {
|
|
|
243
243
|
* Partial worldgen: generate only the selected worlds of a cluster.
|
|
244
244
|
* Cluster-level pre-passes (mixing, trait selection) run over every
|
|
245
245
|
* placement; per-world phases run only for the selected slots.
|
|
246
|
-
* Stateless; does not touch `CLUSTER_CACHE`.
|
|
246
|
+
* Stateless; does not touch `CLUSTER_CACHE`. Per-cell grids ship as
|
|
247
|
+
* typed arrays on the returned value, as with `generate_map_data`.
|
|
247
248
|
*
|
|
248
249
|
* Geyser output matches a full generate exactly, and each world
|
|
249
250
|
* carries the digest-format geyser hashes. Verified element-wise by
|
|
@@ -257,23 +258,15 @@ export function noise_node_kinds() {
|
|
|
257
258
|
* settle (use `generate` + `advance` for settled state).
|
|
258
259
|
* @param {string} coordinate
|
|
259
260
|
* @param {string} options_json
|
|
260
|
-
* @returns {
|
|
261
|
+
* @returns {any}
|
|
261
262
|
*/
|
|
262
263
|
export function partials_from_coordinate(coordinate, options_json) {
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
const len1 = WASM_VECTOR_LEN;
|
|
270
|
-
const ret = wasm.partials_from_coordinate(ptr0, len0, ptr1, len1);
|
|
271
|
-
deferred3_0 = ret[0];
|
|
272
|
-
deferred3_1 = ret[1];
|
|
273
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
274
|
-
} finally {
|
|
275
|
-
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
276
|
-
}
|
|
264
|
+
const ptr0 = passStringToWasm0(coordinate, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
265
|
+
const len0 = WASM_VECTOR_LEN;
|
|
266
|
+
const ptr1 = passStringToWasm0(options_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
267
|
+
const len1 = WASM_VECTOR_LEN;
|
|
268
|
+
const ret = wasm.partials_from_coordinate(ptr0, len0, ptr1, len1);
|
|
269
|
+
return ret;
|
|
277
270
|
}
|
|
278
271
|
|
|
279
272
|
/**
|
package/serial/oni_wasm_bg.wasm
CHANGED
|
Binary file
|
|
@@ -11,7 +11,7 @@ export const generate_layout_cells: (a: number, b: number, c: number) => [number
|
|
|
11
11
|
export const generate_map_data: (a: number, b: number) => any;
|
|
12
12
|
export const get_entity_spawners: () => [number, number];
|
|
13
13
|
export const noise_node_kinds: () => [number, number];
|
|
14
|
-
export const partials_from_coordinate: (a: number, b: number, c: number, d: number) =>
|
|
14
|
+
export const partials_from_coordinate: (a: number, b: number, c: number, d: number) => any;
|
|
15
15
|
export const set_skip_templates: (a: number) => void;
|
|
16
16
|
export const settings_reset: () => void;
|
|
17
17
|
export const settle_cluster_advance: (a: number) => [number, number];
|