@adatechnology/game-weather-three 0.5.18 → 0.5.19

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.
@@ -59,6 +59,112 @@ var GameWeatherThree = (() => {
59
59
  weatherVisualTextOf: () => weatherVisualTextOf
60
60
  });
61
61
 
62
+ // ../game-contracts/dist/index.js
63
+ var DEFAULT_BLAST_IMPULSE = { bodyArea: 0.7, lift: 0.15, minSpeed: 0.3, tntPerJoule: 0.24 / 2e5 };
64
+ var DEFAULT_COST_ALLOCATION_BYTES = 1024 * 1024;
65
+ var DEFERRED_QUEUE_ID = {
66
+ DESTRUCTION_EVENTS: "destruction.events",
67
+ BREACH_PAINT: "floorplan.breach-paint",
68
+ BREACH_CUT: "floorplan.breach-cut",
69
+ AUDIO_VOICES: "audio.voices",
70
+ VEHICLE_CREASE: "vehicles.crease",
71
+ AUDIO_OCCLUSION: "audio.occlusion",
72
+ FLUID_FILM: "fluids.film",
73
+ VEHICLE_LOD_BATCH: "vehicles.lod-batch",
74
+ SETTLED_BATCH: "destruction.settled-batch",
75
+ STATIC_BATCH: "render.static-batch",
76
+ ANIMALS_STATIC_BATCH: "animals.static-batch",
77
+ CHARACTERS_STATIC_BATCH: "characters.static-batch",
78
+ HOUSE_SHADOW_BATCH: "floorplan.shadow-batch",
79
+ DESTRUCTION_PREFIT: "destruction.prefit"
80
+ };
81
+ var DEFERRED_PRIORITY = {
82
+ [DEFERRED_QUEUE_ID.DESTRUCTION_EVENTS]: { priority: 300, phase: "present" },
83
+ // every frame: the walls cut since the last frame are painted once each, and a hole must show in the frame of the blast
84
+ [DEFERRED_QUEUE_ID.BREACH_CUT]: { priority: 260, phase: "present", minEveryFrames: 1 },
85
+ [DEFERRED_QUEUE_ID.BREACH_PAINT]: { priority: 250, phase: "present", minEveryFrames: 1 },
86
+ [DEFERRED_QUEUE_ID.AUDIO_VOICES]: { priority: 200, phase: "idle", reserveMs: 1 },
87
+ [DEFERRED_QUEUE_ID.AUDIO_OCCLUSION]: { priority: 190, phase: "idle", minEveryFrames: 8 },
88
+ [DEFERRED_QUEUE_ID.FLUID_FILM]: { priority: 120, phase: "idle", minEveryFrames: 2 },
89
+ [DEFERRED_QUEUE_ID.VEHICLE_CREASE]: { priority: 100, phase: "idle" },
90
+ [DEFERRED_QUEUE_ID.VEHICLE_LOD_BATCH]: { priority: 90, phase: "idle", minEveryFrames: 4 },
91
+ [DEFERRED_QUEUE_ID.SETTLED_BATCH]: { priority: 70, phase: "idle", minEveryFrames: 8 },
92
+ [DEFERRED_QUEUE_ID.STATIC_BATCH]: { priority: 60, phase: "idle", minEveryFrames: 8 },
93
+ [DEFERRED_QUEUE_ID.ANIMALS_STATIC_BATCH]: { priority: 60, phase: "idle", minEveryFrames: 8 },
94
+ [DEFERRED_QUEUE_ID.CHARACTERS_STATIC_BATCH]: { priority: 60, phase: "idle", minEveryFrames: 8 },
95
+ [DEFERRED_QUEUE_ID.HOUSE_SHADOW_BATCH]: { priority: 50, phase: "idle", minEveryFrames: 8 },
96
+ [DEFERRED_QUEUE_ID.DESTRUCTION_PREFIT]: { priority: 40, phase: "idle", minEveryFrames: 30 }
97
+ };
98
+ var MUST_DRAIN_QUEUE_IDS = /* @__PURE__ */ new Set([DEFERRED_QUEUE_ID.DESTRUCTION_EVENTS, DEFERRED_QUEUE_ID.BREACH_CUT]);
99
+ function footprintBlocker(object, footprint) {
100
+ return (x, z, radius) => {
101
+ const o = typeof object === "function" ? object() : object;
102
+ const fp = typeof footprint === "function" ? footprint() : footprint;
103
+ if (!o || !fp || !o.parent) return false;
104
+ o.updateWorldMatrix?.(true, false);
105
+ const e = o.matrixWorld.elements;
106
+ const dx = x - e[12];
107
+ const dz = z - e[14];
108
+ const ax = e[0] ** 2 + e[1] ** 2 + e[2] ** 2;
109
+ const az = e[8] ** 2 + e[9] ** 2 + e[10] ** 2;
110
+ const lx = (dx * e[0] + dz * e[2]) / (ax || 1);
111
+ const lz = (dx * e[8] + dz * e[10]) / (az || 1);
112
+ return lx > fp.minX - radius && lx < fp.maxX + radius && lz > fp.minZ - radius && lz < fp.maxZ + radius;
113
+ };
114
+ }
115
+ var SURFACE_IDS = ["concrete", "asphalt", "wood", "tile", "dirt", "grass", "gravel", "sand", "metal", "water", "glass", "carpet"];
116
+ var GAIT_IDS = ["walk", "run"];
117
+ var LANDING_IDS = ["light", "heavy"];
118
+ var BODY_SOUND_IDS = [
119
+ "jump",
120
+ "cloth_rustle",
121
+ "body_fall",
122
+ "fall_damage",
123
+ "player_hurt",
124
+ "player_breath_run",
125
+ "player_death",
126
+ "bite",
127
+ "grab",
128
+ "punch_swing",
129
+ "punch_hit_body",
130
+ "punch_hit_face",
131
+ "punch_hit_object",
132
+ "kick_swing",
133
+ "kick_hit",
134
+ "kick_hit_object",
135
+ "shove_two_hands",
136
+ "knife_swing",
137
+ "knife_stab",
138
+ "knife_slash",
139
+ "knife_hit_object",
140
+ "blunt_swing",
141
+ "blunt_hit",
142
+ "blunt_hit_object",
143
+ "axe_swing",
144
+ "axe_chop",
145
+ "axe_hit_object"
146
+ ];
147
+ var footstepSoundId = (surface, gait) => `footstep_${surface}_${gait}`;
148
+ var FOOTSTEP_SOUND_IDS = SURFACE_IDS.flatMap((surface) => GAIT_IDS.map((gait) => footstepSoundId(surface, gait)));
149
+ var LAND_SOUND_IDS = SURFACE_IDS.flatMap((surface) => LANDING_IDS.map((landing) => `land_${surface}_${landing}`));
150
+ var BODY_FOLEY_IDS = [...FOOTSTEP_SOUND_IDS, ...LAND_SOUND_IDS, ...BODY_SOUND_IDS];
151
+ var WORKER_KIND_ID = {
152
+ GROUND_TILES: "destruction.ground-tiles",
153
+ CROWD_PHYSICS: "crowd.physics",
154
+ PIECE_BOXES: "destruction.piece-boxes",
155
+ STATIC_COLLIDERS: "destruction.static-colliders",
156
+ SHAPES_GENERATE: "shapes.generate",
157
+ WORLD_REGION: "world.region"
158
+ };
159
+ var WORKER_KIND_DEFAULTS = {
160
+ [WORKER_KIND_ID.GROUND_TILES]: { lane: "sim", priority: 300, latencyFrames: 2, late: "sync" },
161
+ [WORKER_KIND_ID.CROWD_PHYSICS]: { lane: "sim", priority: 250, latencyFrames: 1, late: "sync" },
162
+ [WORKER_KIND_ID.PIECE_BOXES]: { lane: "sim", priority: 200, latencyFrames: 2, late: "sync" },
163
+ [WORKER_KIND_ID.STATIC_COLLIDERS]: { lane: "build", priority: 150, late: "sync" },
164
+ [WORKER_KIND_ID.SHAPES_GENERATE]: { lane: "build", priority: 100, late: "sync" },
165
+ [WORKER_KIND_ID.WORLD_REGION]: { lane: "background", priority: 10, latencyFrames: 10, late: "drop" }
166
+ };
167
+
62
168
  // ../game-render-three/dist/index.js
63
169
  var DEFAULT_ANGLE = Math.PI / 3;
64
170
  var NEUTRAL_FOG_NEAR = 6e4;
@@ -1998,6 +2104,8 @@ var GameWeatherThree = (() => {
1998
2104
  var DEBRIS_EFFECT_FAMILIES = ["wood", "masonry", "glass", "metal", "soft", "soil"];
1999
2105
  var DEBRIS_COLOR_VARIABLE = "debrisColor";
2000
2106
  var DUST_COLOR_VARIABLE = "dustColor";
2107
+ var PIECES_DRAWN_VARIABLE = "piecesDrawn";
2108
+ var standIns = (...steps) => when(not(variable(PIECES_DRAWN_VARIABLE)), steps);
2001
2109
  var FAMILIES = {
2002
2110
  wood: { debris: 8017200, dust: 10127986, piece: [0.015, 0.015, 0.1], spin: 6, cloud: 0.5, sparks: false, glints: false },
2003
2111
  masonry: { debris: 10197652, dust: 11052187, piece: [0.035, 0.028, 0.035], spin: 4, cloud: 1, sparks: false, glints: false },
@@ -2044,7 +2152,7 @@ var GameWeatherThree = (() => {
2044
2152
  ...sparks(look, 14),
2045
2153
  ...glints(look, 20),
2046
2154
  burst("normal", Math.round(30 * look.cloud), { p: ORIGIN, box: [1.4, 0.8, 0.2], sp: [0.3, 1.2], drag: 1.5, life: [1.5, 2.6], size: [0.4, 0.7], grow: 3, c0: dustTone(look), c1: 4867648, a: 0.45 }),
2047
- repeat(scaled(16), debris({ p: ORIGIN, box: [1.3, 0.8, 0.1], sp: [1, 3], size: grow(look.piece, 2.2), k: [0.5, 1.5], spin: look.spin, c: debrisTone(look), life: 20 })),
2155
+ standIns(repeat(scaled(16), debris({ p: ORIGIN, box: [1.3, 0.8, 0.1], sp: [1, 3], size: grow(look.piece, 2.2), k: [0.5, 1.5], spin: look.spin, c: debrisTone(look), life: 20 }))),
2048
2156
  repeat(
2049
2157
  scaled(Math.round(60 * look.cloud)),
2050
2158
  spawn("normal", local("angle", rnd(0, 6.283), {
@@ -2076,8 +2184,10 @@ var GameWeatherThree = (() => {
2076
2184
  timeline: [
2077
2185
  screen({ add: { shake: 0.45 } }),
2078
2186
  ...sparks(look, 20),
2079
- repeat(6, debris({ p: ORIGIN, box: [2, 0.05, 0.6], v: [rnd(-0.5, 0.5), rnd(-0.5, 0), rnd(0, 0.8)], sp: 0, size: [rnd(0.5, 1.1), look.piece[1] > 0.01 ? 0.25 : 0.03, rnd(0.4, 0.8)], c: debrisTone(look), spin: 3, life: 30, bounce: 0.1 })),
2080
- repeat(scaled(20), debris({ p: ORIGIN, box: [2.1, 0.1, 0.7], v: [rnd(-1, 1), rnd(-1, 1), rnd(0, 1.5)], sp: 0, size: grow(look.piece, 3.4), k: [0.5, 1.5], spin: look.spin, c: debrisTone(look), life: 30 })),
2187
+ standIns(
2188
+ repeat(6, debris({ p: ORIGIN, box: [2, 0.05, 0.6], v: [rnd(-0.5, 0.5), rnd(-0.5, 0), rnd(0, 0.8)], sp: 0, size: [rnd(0.5, 1.1), look.piece[1] > 0.01 ? 0.25 : 0.03, rnd(0.4, 0.8)], c: debrisTone(look), spin: 3, life: 30, bounce: 0.1 })),
2189
+ repeat(scaled(20), debris({ p: ORIGIN, box: [2.1, 0.1, 0.7], v: [rnd(-1, 1), rnd(-1, 1), rnd(0, 1.5)], sp: 0, size: grow(look.piece, 3.4), k: [0.5, 1.5], spin: look.spin, c: debrisTone(look), life: 30 }))
2190
+ ),
2081
2191
  repeat(
2082
2192
  scaled(Math.round(70 * look.cloud)),
2083
2193
  spawn("normal", local("angle", rnd(-0.4, 3.5), {
@@ -2520,74 +2630,6 @@ var GameWeatherThree = (() => {
2520
2630
  };
2521
2631
  }
2522
2632
 
2523
- // ../game-contracts/dist/index.js
2524
- var DEFAULT_BLAST_IMPULSE = { bodyArea: 0.7, lift: 0.15, minSpeed: 0.3, tntPerJoule: 0.24 / 2e5 };
2525
- var DEFAULT_COST_ALLOCATION_BYTES = 1024 * 1024;
2526
- var DEFERRED_QUEUE_ID = {
2527
- DESTRUCTION_EVENTS: "destruction.events",
2528
- BREACH_PAINT: "floorplan.breach-paint",
2529
- AUDIO_VOICES: "audio.voices",
2530
- VEHICLE_CREASE: "vehicles.crease"
2531
- };
2532
- var DEFERRED_PRIORITY = {
2533
- [DEFERRED_QUEUE_ID.DESTRUCTION_EVENTS]: { priority: 300, phase: "present" },
2534
- [DEFERRED_QUEUE_ID.BREACH_PAINT]: { priority: 250, phase: "present" },
2535
- [DEFERRED_QUEUE_ID.AUDIO_VOICES]: { priority: 200, phase: "idle", reserveMs: 1 },
2536
- [DEFERRED_QUEUE_ID.VEHICLE_CREASE]: { priority: 100, phase: "idle" }
2537
- };
2538
- function footprintBlocker(object, footprint) {
2539
- return (x, z, radius) => {
2540
- const o = typeof object === "function" ? object() : object;
2541
- const fp = typeof footprint === "function" ? footprint() : footprint;
2542
- if (!o || !fp || !o.parent) return false;
2543
- o.updateWorldMatrix?.(true, false);
2544
- const e = o.matrixWorld.elements;
2545
- const dx = x - e[12];
2546
- const dz = z - e[14];
2547
- const ax = e[0] ** 2 + e[1] ** 2 + e[2] ** 2;
2548
- const az = e[8] ** 2 + e[9] ** 2 + e[10] ** 2;
2549
- const lx = (dx * e[0] + dz * e[2]) / (ax || 1);
2550
- const lz = (dx * e[8] + dz * e[10]) / (az || 1);
2551
- return lx > fp.minX - radius && lx < fp.maxX + radius && lz > fp.minZ - radius && lz < fp.maxZ + radius;
2552
- };
2553
- }
2554
- var SURFACE_IDS = ["concrete", "asphalt", "wood", "tile", "dirt", "grass", "gravel", "sand", "metal", "water", "glass", "carpet"];
2555
- var GAIT_IDS = ["walk", "run"];
2556
- var LANDING_IDS = ["light", "heavy"];
2557
- var BODY_SOUND_IDS = [
2558
- "jump",
2559
- "cloth_rustle",
2560
- "body_fall",
2561
- "fall_damage",
2562
- "player_hurt",
2563
- "player_breath_run",
2564
- "player_death",
2565
- "bite",
2566
- "grab",
2567
- "punch_swing",
2568
- "punch_hit_body",
2569
- "punch_hit_face",
2570
- "punch_hit_object",
2571
- "kick_swing",
2572
- "kick_hit",
2573
- "kick_hit_object",
2574
- "shove_two_hands",
2575
- "knife_swing",
2576
- "knife_stab",
2577
- "knife_slash",
2578
- "knife_hit_object",
2579
- "blunt_swing",
2580
- "blunt_hit",
2581
- "blunt_hit_object",
2582
- "axe_swing",
2583
- "axe_chop",
2584
- "axe_hit_object"
2585
- ];
2586
- var footstepSoundId = (surface, gait) => `footstep_${surface}_${gait}`;
2587
- var FOOTSTEP_SOUND_IDS = SURFACE_IDS.flatMap((surface) => GAIT_IDS.map((gait) => footstepSoundId(surface, gait)));
2588
- var LAND_SOUND_IDS = SURFACE_IDS.flatMap((surface) => LANDING_IDS.map((landing) => `land_${surface}_${landing}`));
2589
- var BODY_FOLEY_IDS = [...FOOTSTEP_SOUND_IDS, ...LAND_SOUND_IDS, ...BODY_SOUND_IDS];
2590
-
2591
2633
  // src/bench/text.ts
2592
2634
  var TEXTS = {
2593
2635
  en: { layers: { far_rain: "Rain curtain", near_rain: "Near rain and splashes", mist: "Mist and ash", sky: "Sky", lightning: "Lightning", headlights: "Headlights", haze: "Heat haze" } },