@wildshard/shard-format 0.77.0 → 0.78.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.77.0",
3
+ "version": "0.78.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": {
@@ -12,6 +12,8 @@ const xyz = v.tuple([finite, finite, finite]);
12
12
  export const LightPoolRowSchema: v.GenericSchema<LightPoolRowInput, LightPoolRow> = v.strictObject({ id, at: xyz, colour: xyz, gain, radius: positive, cut: positive, initially: v.optional(v.boolean(), true) });
13
13
 
14
14
  const waves = v.pipe(v.array(xyz), v.maxLength(8));
15
+ /** FORMAT-PRUNE FP49: the scene scalar an emitter's gains follow */
16
+ const followed = v.exactOptional(id);
15
17
  /** Client-only emitters use published scene parts, compiled looks and GPU motion; no shard callbacks. */
16
18
  export const LightEmittersSchema: v.GenericSchema<LightEmittersRowsInput, LightEmittersRows> = v.pipe(v.unknown(), v.check(isJsonData, 'Emitters require plain JSON'), v.strictObject({
17
19
  version: v.literal(1), input: id, clock: id,
@@ -21,6 +23,9 @@ export const LightEmittersSchema: v.GenericSchema<LightEmittersRowsInput, LightE
21
23
  emissive: v.exactOptional(v.strictObject({ collection: id, gain })),
22
24
  light: v.exactOptional(v.strictObject({ at: ScenePointRefSchema, part: v.exactOptional(id), colour: finite, gain, distance: positive, decay: gain,
23
25
  shared: v.optional(v.boolean(), true), waves: v.optional(waves, []) })),
26
+ // FORMAT-PRUNE FP49: a lit emitter's light and emissive gains follow a declared host f64 scene scalar (a `weather.fields`
27
+ // field, clamped to 0..1), so a quest's flags can wake a light step by step instead of only switching it
28
+ field: followed,
24
29
  })), v.maxLength(128)),
25
30
  }), v.check(row => new Set(row.rows.map(entry => entry.id)).size === row.rows.length
26
31
  && new Set(row.rows.flatMap(entry => entry.pool === undefined ? [] : [entry.pool.slot])).size === row.rows.filter(entry => entry.pool !== undefined).length
@@ -86,6 +91,7 @@ interface LightEmittersRowsFields {
86
91
  collection: v.InferOutput<typeof HandleIdSchema>;
87
92
  gain: number;
88
93
  };
94
+ field?: v.InferOutput<typeof HandleIdSchema>;
89
95
  light?: {
90
96
  at: v.InferOutput<typeof ScenePointRefSchema>;
91
97
  part?: v.InferOutput<typeof HandleIdSchema>;