@wildshard/shard-format 0.64.0 → 0.65.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wildshard/shard-format",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.65.0",
|
|
4
4
|
"description": "The raw shardfile format: the spec, the validator and a validate CLI. The public, versioned contract every other repo builds on.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"repository": {
|
|
@@ -401,6 +401,7 @@
|
|
|
401
401
|
"./viewProgram": "./src/format/viewProgram.ts",
|
|
402
402
|
"./voicePatches": "./src/format/voicePatches.ts",
|
|
403
403
|
"./water": "./src/format/water.ts",
|
|
404
|
+
"./waterField": "./src/format/water-field.ts",
|
|
404
405
|
"./waterWaves": "./src/format/waterWaves.ts",
|
|
405
406
|
"./waterWorld": "./src/format/waterWorld.ts",
|
|
406
407
|
"./weaponProfiles": "./src/format/weaponProfiles.ts",
|
|
@@ -81,6 +81,7 @@ const DATA_SECTION_NAMES: Readonly<Record<keyof PlatformDataSections, true>> = {
|
|
|
81
81
|
"world/scenes": true,
|
|
82
82
|
"world/trees": true,
|
|
83
83
|
"world/vehicles": true,
|
|
84
|
+
'world/field': true,
|
|
84
85
|
};
|
|
85
86
|
/** Exact public platform names; schema implementations stay on the checked side. */
|
|
86
87
|
export function isPlatformDataSection(name: string): name is keyof PlatformDataSections {
|
|
@@ -33,6 +33,8 @@ import { ReturnModulesSchema, type ReturnModuleRow, ViewModulesSchema, type View
|
|
|
33
33
|
import { NativeRuntimePlanSchema, type NativeRuntimePlanData } from './nativeRuntimePlan.ts';
|
|
34
34
|
import { TreeSetSchema, type TreeSetRows } from './treeSetRows.ts';
|
|
35
35
|
import { VehiclesSchema } from './vehicles.ts';
|
|
36
|
+
import { WaterFieldSchema } from './water-field.ts';
|
|
37
|
+
import type { WaterFieldRows } from './water-field.ts';
|
|
36
38
|
import type { Vehicles } from './vehicles.ts';
|
|
37
39
|
|
|
38
40
|
/** New plain-value sections supplement the unchanged v1 model assembled from the older section envelopes. */
|
|
@@ -70,6 +72,8 @@ export interface PlatformDataSections {
|
|
|
70
72
|
'world/scenes': WorldScenesSection;
|
|
71
73
|
'world/trees': TreeSetRows;
|
|
72
74
|
'world/vehicles': Vehicles;
|
|
75
|
+
/** ONE-FORMAT OF40b: the field water (a pond raster at a level). */
|
|
76
|
+
'world/field': WaterFieldRows;
|
|
73
77
|
}
|
|
74
78
|
|
|
75
79
|
/** Defining parsers for the first independently authored platform sections. */
|
|
@@ -107,6 +111,7 @@ export const PLATFORM_DATA_SECTIONS: Readonly<{ [Name in keyof PlatformDataSecti
|
|
|
107
111
|
'world/scenes': { schema: WorldScenesSchema },
|
|
108
112
|
'world/trees': { schema: TreeSetSchema },
|
|
109
113
|
'world/vehicles': { schema: VehiclesSchema },
|
|
114
|
+
'world/field': { schema: WaterFieldSchema },
|
|
110
115
|
} as const;
|
|
111
116
|
|
|
112
117
|
/** Client feature inputs that remain legacy root envelopes. These defining
|
|
@@ -197,7 +197,12 @@ const TABLE: readonly Primitive[] = [
|
|
|
197
197
|
},
|
|
198
198
|
hosts: ['water.sea', 'world.water'],
|
|
199
199
|
},
|
|
200
|
-
{
|
|
200
|
+
{
|
|
201
|
+
name: 'water.field',
|
|
202
|
+
row: 'OF40',
|
|
203
|
+
on: { section: 'world/field', path: [] },
|
|
204
|
+
hosts: ['water.field'],
|
|
205
|
+
},
|
|
201
206
|
{
|
|
202
207
|
name: 'grapple',
|
|
203
208
|
row: 'OF41',
|
package/src/format/sections.ts
CHANGED
|
@@ -15,6 +15,7 @@ import type { ReturnModuleRow, ViewModuleRow } from './scriptContract.ts';
|
|
|
15
15
|
import type { WorldScenesSection } from './worldScenes.ts';
|
|
16
16
|
import type { TreeSetRows } from './treeSetRows.ts';
|
|
17
17
|
import type { Vehicles } from './vehicles.ts';
|
|
18
|
+
import type { WaterFieldRows } from './water-field.ts';
|
|
18
19
|
import type { HeldArmsRows } from './heldArms.ts';
|
|
19
20
|
import type { HeldGearRows } from './heldGear.ts';
|
|
20
21
|
import type { HeldFinishesRows } from './heldFinishes.ts';
|
|
@@ -91,6 +92,7 @@ export interface PlatformSections {
|
|
|
91
92
|
'world/trees': TreeSetRows;
|
|
92
93
|
/** MIRROR-SALT-ZONE MSZ1: vehicle kinds (seats, hull, handling, sounds) and the docks they stand at. */
|
|
93
94
|
'world/vehicles': Vehicles;
|
|
95
|
+
'world/field': WaterFieldRows;
|
|
94
96
|
'world/days': { readonly rows: Pick<Rows, 'days'> };
|
|
95
97
|
'world/weather': { readonly rows: Pick<Rows, 'weather'> };
|
|
96
98
|
'look/look': Pick<Shardfile, 'look' | 'presentation'>;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import {
|
|
2
|
+
finite,
|
|
3
|
+
integer,
|
|
4
|
+
maxValue,
|
|
5
|
+
minValue,
|
|
6
|
+
number,
|
|
7
|
+
pipe,
|
|
8
|
+
strictObject,
|
|
9
|
+
} from 'valibot'
|
|
10
|
+
|
|
11
|
+
import { ShardHashSchema } from './shardSections.ts'
|
|
12
|
+
|
|
13
|
+
import type { GenericSchema } from 'valibot'
|
|
14
|
+
|
|
15
|
+
const LIMIT = 250
|
|
16
|
+
const MIN_RES = 2
|
|
17
|
+
const MAX_RES = 2048
|
|
18
|
+
const MAX_SIZE = 1000
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* ONE-FORMAT OF40b: the `water.field` primitive from a plain upload. A square f32 pond raster (`pond`: the hash of its
|
|
22
|
+
* zlib block, `res` samples a side over `size` metres, centred on the cell) whose positive samples are water standing at
|
|
23
|
+
* `level`, as Nalati's grass field's pond is. The bilinear sampling is the baked-terrain law.
|
|
24
|
+
*/
|
|
25
|
+
interface WaterFieldRows {
|
|
26
|
+
level: number
|
|
27
|
+
res: number
|
|
28
|
+
size: number
|
|
29
|
+
pond: string
|
|
30
|
+
}
|
|
31
|
+
const WaterFieldSchema: GenericSchema<WaterFieldRows, WaterFieldRows> =
|
|
32
|
+
strictObject({
|
|
33
|
+
level: pipe(number(), finite(), minValue(-LIMIT), maxValue(LIMIT)),
|
|
34
|
+
res: pipe(number(), integer(), minValue(MIN_RES), maxValue(MAX_RES)),
|
|
35
|
+
size: pipe(
|
|
36
|
+
number(),
|
|
37
|
+
finite(),
|
|
38
|
+
minValue(Number.MIN_VALUE),
|
|
39
|
+
maxValue(MAX_SIZE),
|
|
40
|
+
),
|
|
41
|
+
pond: ShardHashSchema,
|
|
42
|
+
})
|
|
43
|
+
|
|
44
|
+
export { WaterFieldSchema }
|
|
45
|
+
export type { WaterFieldRows }
|
|
@@ -229,6 +229,10 @@
|
|
|
229
229
|
"world/trees": {
|
|
230
230
|
"hosts": ["page productTreeSet", "page placeForestPageModels"]
|
|
231
231
|
},
|
|
232
|
+
"world/field": {
|
|
233
|
+
"hosts": ["server bindShardfileSim"],
|
|
234
|
+
"note": "ONE-FORMAT OF40b: the field water a plain upload's server host stands the player in (engine `fieldWater`)."
|
|
235
|
+
},
|
|
232
236
|
"world/vehicles": {
|
|
233
237
|
"hosts": [],
|
|
234
238
|
"note": "Read by the vehicle runtime (meta MIRROR-SALT-ZONE MSZ6 to MSZ9); until then the engine runs each dock as its steer carry (`vehicleCarryMovers`)."
|