@woosh/meep-engine 3.45.0 → 3.47.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.
Files changed (435) hide show
  1. package/build/bundle-worker-terrain.js +1 -1
  2. package/editor/actions/concrete/TransformModifyAction.d.ts.map +1 -1
  3. package/editor/actions/concrete/TransformModifyAction.js +10 -2
  4. package/editor/ecs/component/FieldDescriptor.js +15 -0
  5. package/editor/ecs/component/createObjectEditor.js +41 -12
  6. package/editor/ecs/component/editors/ecs/Transform64Editor.d.ts.map +1 -1
  7. package/editor/ecs/component/editors/ecs/Transform64Editor.js +77 -70
  8. package/editor/tools/TransformToolV2.d.ts.map +1 -1
  9. package/editor/tools/TransformToolV2.js +4 -0
  10. package/editor/tools/v2/TransformControls.d.ts.map +1 -1
  11. package/editor/tools/v2/TransformControls.js +7 -0
  12. package/editor/view/ecs/EntityEditor.d.ts.map +1 -1
  13. package/editor/view/ecs/EntityEditor.js +4 -2
  14. package/package.json +1 -1
  15. package/src/core/assert.d.ts.map +1 -1
  16. package/src/core/assert.js +5 -1
  17. package/src/core/binary/hash/XXH128Hash.d.ts +1 -37
  18. package/src/core/binary/hash/XXH128Hash.d.ts.map +1 -1
  19. package/src/core/binary/hash/XXH128Hash.js +4 -55
  20. package/src/core/binary/hash/XXH3_SECRET.d.ts +1 -12
  21. package/src/core/binary/hash/XXH3_SECRET.d.ts.map +1 -1
  22. package/src/core/binary/hash/XXH3_SECRET.js +4 -25
  23. package/src/core/binary/hash/crc32.d.ts +1 -15
  24. package/src/core/binary/hash/crc32.d.ts.map +1 -1
  25. package/src/core/binary/hash/crc32.js +4 -96
  26. package/src/core/binary/hash/xxh3_128.d.ts +1 -9
  27. package/src/core/binary/hash/xxh3_128.d.ts.map +1 -1
  28. package/src/core/binary/hash/xxh3_128.js +4 -341
  29. package/src/core/binary/hash/xxh3_64.d.ts +1 -8
  30. package/src/core/binary/hash/xxh3_64.d.ts.map +1 -1
  31. package/src/core/binary/hash/xxh3_64.js +4 -241
  32. package/src/core/binary/hash/xxh3_common.d.ts +1 -223
  33. package/src/core/binary/hash/xxh3_common.d.ts.map +1 -1
  34. package/src/core/binary/hash/xxh3_common.js +90 -476
  35. package/src/core/collection/array/array_insert_at.d.ts +16 -0
  36. package/src/core/collection/array/array_insert_at.d.ts.map +1 -0
  37. package/src/core/collection/array/array_insert_at.js +32 -0
  38. package/src/core/collection/array/array_remove_at.d.ts +15 -0
  39. package/src/core/collection/array/array_remove_at.d.ts.map +1 -0
  40. package/src/core/collection/array/array_remove_at.js +30 -0
  41. package/src/core/collection/array/combine_hash.d.ts +6 -0
  42. package/src/core/collection/array/combine_hash.d.ts.map +1 -1
  43. package/src/core/collection/array/combine_hash.js +6 -0
  44. package/src/core/function/FunctionCompiler.js +2 -2
  45. package/src/core/geom/3d/mat4/m4_multiply.d.ts +3 -0
  46. package/src/core/geom/3d/mat4/m4_multiply.d.ts.map +1 -1
  47. package/src/core/geom/3d/mat4/m4_multiply.js +3 -0
  48. package/src/core/geom/3d/mat4/m4_multiply_f64.d.ts +30 -0
  49. package/src/core/geom/3d/mat4/m4_multiply_f64.d.ts.map +1 -0
  50. package/src/core/geom/3d/mat4/m4_multiply_f64.js +106 -0
  51. package/src/core/geom/3d/quaternion/quat3_look_rotation.d.ts +37 -0
  52. package/src/core/geom/3d/quaternion/quat3_look_rotation.d.ts.map +1 -0
  53. package/src/core/geom/3d/quaternion/quat3_look_rotation.js +172 -0
  54. package/src/core/geom/ConicRay.js +2 -2
  55. package/src/core/geom/Quaternion.d.ts +1 -0
  56. package/src/core/geom/Quaternion.d.ts.map +1 -1
  57. package/src/core/geom/Quaternion.js +12 -48
  58. package/src/core/geom/Vector4.d.ts.map +1 -1
  59. package/src/core/geom/Vector4.js +8 -5
  60. package/src/core/math/hash/XXH128Hash.d.ts +38 -0
  61. package/src/core/math/hash/XXH128Hash.d.ts.map +1 -0
  62. package/src/core/math/hash/XXH128Hash.js +55 -0
  63. package/src/core/math/hash/XXH3_SECRET.d.ts +13 -0
  64. package/src/core/math/hash/XXH3_SECRET.d.ts.map +1 -0
  65. package/src/core/math/hash/XXH3_SECRET.js +25 -0
  66. package/src/core/math/hash/crc32.d.ts +16 -0
  67. package/src/core/math/hash/crc32.d.ts.map +1 -0
  68. package/src/core/math/hash/crc32.js +96 -0
  69. package/src/core/math/hash/xxh3_128.d.ts +10 -0
  70. package/src/core/math/hash/xxh3_128.d.ts.map +1 -0
  71. package/src/core/math/hash/xxh3_128.js +341 -0
  72. package/src/core/math/hash/xxh3_64.d.ts +9 -0
  73. package/src/core/math/hash/xxh3_64.d.ts.map +1 -0
  74. package/src/core/math/hash/xxh3_64.js +241 -0
  75. package/src/core/math/hash/xxh3_common.d.ts +224 -0
  76. package/src/core/math/hash/xxh3_common.d.ts.map +1 -0
  77. package/src/core/math/hash/xxh3_common.js +476 -0
  78. package/src/core/math/lookup/ParameterLookupTable.js +2 -2
  79. package/src/core/model/node-graph/node/NodeInstancePortReference.js +2 -2
  80. package/src/core/model/reactive/model/ReactiveBinaryExpression.js +2 -2
  81. package/src/core/model/reactive/model/terminal/ReactiveReference.js +2 -2
  82. package/src/engine/Engine.d.ts.map +1 -1
  83. package/src/engine/Engine.js +9 -4
  84. package/src/engine/asset/AssetDescription.js +2 -2
  85. package/src/engine/ecs/animation/Animation.js +2 -2
  86. package/src/engine/ecs/animation/AnimationClip.d.ts.map +1 -1
  87. package/src/engine/ecs/animation/AnimationClip.js +7 -5
  88. package/src/engine/ecs/gui/GUIElement.d.ts.map +1 -1
  89. package/src/engine/ecs/gui/GUIElement.js +7 -5
  90. package/src/engine/ecs/gui/hud/HeadsUpDisplay.js +2 -2
  91. package/src/engine/ecs/gui/position/ViewportPosition.d.ts.map +1 -1
  92. package/src/engine/ecs/gui/position/ViewportPosition.js +11 -7
  93. package/src/engine/ecs/storage/populateEngineSerializationRegistry.d.ts.map +1 -1
  94. package/src/engine/ecs/storage/populateEngineSerializationRegistry.js +10 -0
  95. package/src/engine/ecs/transform/Transform64.d.ts +1 -1
  96. package/src/engine/ecs/transform/Transform64.d.ts.map +1 -1
  97. package/src/engine/ecs/transform/Transform64.js +5 -4
  98. package/src/engine/ecs/transform/t64_look_rotation.d.ts +4 -4
  99. package/src/engine/ecs/transform/t64_look_rotation.d.ts.map +1 -1
  100. package/src/engine/ecs/transform/t64_look_rotation.js +7 -18
  101. package/src/engine/graphics/ecs/animation/animator/AnimationClip.d.ts.map +1 -1
  102. package/src/engine/graphics/ecs/animation/animator/AnimationClip.js +8 -5
  103. package/src/engine/graphics/ecs/animation/animator/AnimationClipDefinition.js +2 -2
  104. package/src/engine/graphics/ecs/animation/animator/AnimationNotification.js +2 -2
  105. package/src/engine/graphics/ecs/animation/animator/AnimationNotificationDefinition.js +2 -2
  106. package/src/engine/graphics/ecs/animation/animator/graph/definition/AnimationGraphDefinition.js +2 -2
  107. package/src/engine/graphics/ecs/animation/animator/graph/definition/AnimationStateDefinition.js +2 -2
  108. package/src/engine/graphics/ecs/animation/animator/graph/definition/AnimationTransitionDefinition.d.ts.map +1 -1
  109. package/src/engine/graphics/ecs/animation/animator/graph/definition/AnimationTransitionDefinition.js +8 -5
  110. package/src/engine/graphics/ecs/camera/topdown/TopDownCameraControllerSystem.d.ts.map +1 -1
  111. package/src/engine/graphics/ecs/camera/topdown/TopDownCameraControllerSystem.js +30 -1
  112. package/src/engine/graphics/ecs/decal/v2/Decal.d.ts.map +1 -1
  113. package/src/engine/graphics/ecs/decal/v2/Decal.js +9 -8
  114. package/src/engine/graphics/render/frame_graph/resource/TextureResourceDescriptor.d.ts.map +1 -1
  115. package/src/engine/graphics/render/frame_graph/resource/TextureResourceDescriptor.js +9 -6
  116. package/src/engine/graphics3/GPUParticleEmitterSystem.d.ts +6 -0
  117. package/src/engine/graphics3/GPUParticleEmitterSystem.d.ts.map +1 -1
  118. package/src/engine/graphics3/GPUParticleEmitterSystem.js +72 -29
  119. package/src/engine/graphics3/ParticipatingMedia.js +204 -204
  120. package/src/engine/graphics3/animation/AnimationClips.d.ts +5 -0
  121. package/src/engine/graphics3/animation/AnimationClips.d.ts.map +1 -1
  122. package/src/engine/graphics3/animation/AnimationClips.js +5 -0
  123. package/src/engine/grid/obstacle/GridObstacle.js +2 -2
  124. package/src/engine/input/devices/KeyboardDevice.d.ts +1 -0
  125. package/src/engine/input/devices/KeyboardDevice.d.ts.map +1 -1
  126. package/src/engine/input/devices/KeyboardDevice.js +7 -6
  127. package/src/engine/intelligence/behavior/selector/WeightedElement.js +2 -2
  128. package/src/engine/interpolation/Interpolated.js +2 -2
  129. package/src/engine/navigation/ecs/path_following/PathFollowingSystem.d.ts.map +1 -1
  130. package/src/engine/navigation/ecs/path_following/PathFollowingSystem.js +15 -2
  131. package/src/engine/network/CONGESTION_CONTROL.md +9 -9
  132. package/src/engine/network/MESSAGE_TRANSPORT.md +364 -0
  133. package/src/engine/network/NetworkSession.d.ts +31 -11
  134. package/src/engine/network/NetworkSession.d.ts.map +1 -1
  135. package/src/engine/network/NetworkSession.js +453 -286
  136. package/src/engine/network/README.md +77 -27
  137. package/src/engine/network/SMOOTHNESS_DESIGN.md +13 -5
  138. package/src/engine/network/diagnostics/BandwidthMeter.d.ts +1 -1
  139. package/src/engine/network/diagnostics/BandwidthMeter.js +1 -1
  140. package/src/engine/network/orchestrator/HostJoin.d.ts +111 -0
  141. package/src/engine/network/orchestrator/HostJoin.d.ts.map +1 -0
  142. package/src/engine/network/orchestrator/HostJoin.js +271 -0
  143. package/src/engine/network/orchestrator/NetworkPeer.d.ts +151 -112
  144. package/src/engine/network/orchestrator/NetworkPeer.d.ts.map +1 -1
  145. package/src/engine/network/orchestrator/NetworkPeer.js +450 -499
  146. package/src/engine/network/orchestrator/PendingSlices.d.ts +30 -0
  147. package/src/engine/network/orchestrator/PendingSlices.d.ts.map +1 -0
  148. package/src/engine/network/orchestrator/PendingSlices.js +83 -0
  149. package/src/engine/network/orchestrator/ReliableFrames.d.ts +34 -0
  150. package/src/engine/network/orchestrator/ReliableFrames.d.ts.map +1 -0
  151. package/src/engine/network/orchestrator/ReliableFrames.js +96 -0
  152. package/src/engine/network/orchestrator/ServerAuthoritativeClient.d.ts +77 -10
  153. package/src/engine/network/orchestrator/ServerAuthoritativeClient.d.ts.map +1 -1
  154. package/src/engine/network/orchestrator/ServerAuthoritativeClient.js +236 -61
  155. package/src/engine/network/orchestrator/ServerAuthoritativeServer.d.ts +20 -6
  156. package/src/engine/network/orchestrator/ServerAuthoritativeServer.d.ts.map +1 -1
  157. package/src/engine/network/orchestrator/ServerAuthoritativeServer.js +33 -8
  158. package/src/engine/network/replication/Replicator.d.ts.map +1 -1
  159. package/src/engine/network/replication/Replicator.js +7 -1
  160. package/src/engine/network/sim/ActionLog.d.ts +32 -5
  161. package/src/engine/network/sim/ActionLog.d.ts.map +1 -1
  162. package/src/engine/network/sim/ActionLog.js +47 -5
  163. package/src/engine/network/sim/SimActionExecutor.d.ts +42 -2
  164. package/src/engine/network/sim/SimActionExecutor.d.ts.map +1 -1
  165. package/src/engine/network/sim/SimActionExecutor.js +100 -4
  166. package/src/engine/network/sim/Snapshotter.d.ts +12 -0
  167. package/src/engine/network/sim/Snapshotter.d.ts.map +1 -1
  168. package/src/engine/network/sim/Snapshotter.js +43 -0
  169. package/src/engine/network/state/Baseline.d.ts +1 -1
  170. package/src/engine/network/state/Baseline.js +1 -1
  171. package/src/engine/network/state/FrameBufferRing.d.ts +25 -6
  172. package/src/engine/network/state/FrameBufferRing.d.ts.map +1 -1
  173. package/src/engine/network/state/FrameBufferRing.js +51 -6
  174. package/src/engine/network/state/InputRing.d.ts +4 -0
  175. package/src/engine/network/state/InputRing.d.ts.map +1 -1
  176. package/src/engine/network/state/InputRing.js +7 -0
  177. package/src/engine/network/transport/DeferredTransport.d.ts.map +1 -1
  178. package/src/engine/network/transport/DeferredTransport.js +1 -0
  179. package/src/engine/network/transport/LoopbackTransport.d.ts.map +1 -1
  180. package/src/engine/network/transport/LoopbackTransport.js +4 -2
  181. package/src/engine/network/transport/Transport.d.ts +7 -0
  182. package/src/engine/network/transport/Transport.d.ts.map +1 -1
  183. package/src/engine/network/transport/Transport.js +8 -0
  184. package/src/engine/network/transport/adapters/NodeUDPTransport.d.ts.map +1 -1
  185. package/src/engine/network/transport/adapters/NodeUDPTransport.js +20 -5
  186. package/src/engine/network/transport/adapters/WebRTCDataChannelTransport.d.ts.map +1 -1
  187. package/src/engine/network/transport/adapters/WebRTCDataChannelTransport.js +8 -0
  188. package/src/engine/network/transport/adapters/WebTransportTransport.d.ts.map +1 -1
  189. package/src/engine/network/transport/adapters/WebTransportTransport.js +6 -0
  190. package/src/engine/network/transport/connection/Connection.d.ts +191 -0
  191. package/src/engine/network/transport/connection/Connection.d.ts.map +1 -0
  192. package/src/engine/network/transport/connection/Connection.js +1262 -0
  193. package/src/engine/network/transport/connection/RangeSet.d.ts +94 -0
  194. package/src/engine/network/transport/connection/RangeSet.d.ts.map +1 -0
  195. package/src/engine/network/transport/connection/RangeSet.js +260 -0
  196. package/src/engine/network/transport/connection/RxStream.d.ts +48 -0
  197. package/src/engine/network/transport/connection/RxStream.d.ts.map +1 -0
  198. package/src/engine/network/transport/connection/RxStream.js +211 -0
  199. package/src/engine/network/transport/connection/TxStream.d.ts +90 -0
  200. package/src/engine/network/transport/connection/TxStream.d.ts.map +1 -0
  201. package/src/engine/network/transport/connection/TxStream.js +243 -0
  202. package/src/engine/network/transport/connection/bytes_copy.d.ts +17 -0
  203. package/src/engine/network/transport/connection/bytes_copy.d.ts.map +1 -0
  204. package/src/engine/network/transport/connection/bytes_copy.js +34 -0
  205. package/src/engine/network/transport/connection/varint.d.ts +46 -0
  206. package/src/engine/network/transport/connection/varint.d.ts.map +1 -0
  207. package/src/engine/network/transport/connection/varint.js +107 -0
  208. package/src/engine/physics/cloth/ecs/Cloth.d.ts.map +1 -1
  209. package/src/engine/physics/cloth/ecs/Cloth.js +7 -5
  210. package/src/engine/physics/cloth/ecs/ClothCollider.d.ts.map +1 -1
  211. package/src/engine/physics/cloth/ecs/ClothCollider.js +7 -5
  212. package/src/engine/physics/cloth/ecs/ClothDynamics.d.ts.map +1 -1
  213. package/src/engine/physics/cloth/ecs/ClothDynamics.js +20 -11
  214. package/src/engine/physics/fluid/FluidField.d.ts.map +1 -1
  215. package/src/engine/physics/fluid/FluidField.js +7 -5
  216. package/src/engine/physics/fluid/ecs/FluidComponent.d.ts.map +1 -1
  217. package/src/engine/physics/fluid/ecs/FluidComponent.js +19 -11
  218. package/src/engine/physics/fluid/ecs/FluidObstacleSystem.d.ts +4 -4
  219. package/src/engine/physics/fluid/effector/AbstractFluidEffector.d.ts +2 -2
  220. package/src/engine/physics/fluid/effector/AbstractFluidEffector.js +2 -2
  221. package/src/engine/physics/fluid/effector/GlobalFluidEffector.d.ts.map +1 -1
  222. package/src/engine/physics/fluid/effector/GlobalFluidEffector.js +11 -7
  223. package/src/engine/physics/fluid/effector/ImpulseFluidEffector.d.ts.map +1 -1
  224. package/src/engine/physics/fluid/effector/ImpulseFluidEffector.js +11 -7
  225. package/src/engine/physics/fluid/effector/WakeFluidEffector.d.ts.map +1 -1
  226. package/src/engine/physics/fluid/effector/WakeFluidEffector.js +16 -9
  227. package/src/engine/sound/ecs/audio/AudioEmitter.d.ts +38 -7
  228. package/src/engine/sound/ecs/audio/AudioEmitter.d.ts.map +1 -1
  229. package/src/engine/sound/ecs/audio/AudioEmitter.js +47 -14
  230. package/src/engine/sound/ecs/audio/AudioEmitterSerializationAdapter.d.ts.map +1 -1
  231. package/src/engine/sound/ecs/audio/AudioEmitterSerializationAdapter.js +5 -1
  232. package/src/engine/sound/ecs/audio/AudioEmitterSerializationUpgrader_0_1.d.ts +18 -0
  233. package/src/engine/sound/ecs/audio/AudioEmitterSerializationUpgrader_0_1.d.ts.map +1 -0
  234. package/src/engine/sound/ecs/audio/AudioEmitterSerializationUpgrader_0_1.js +48 -0
  235. package/src/engine/sound/ecs/audio/AudioEmitterSystem.d.ts +12 -2
  236. package/src/engine/sound/ecs/audio/AudioEmitterSystem.d.ts.map +1 -1
  237. package/src/engine/sound/ecs/audio/AudioEmitterSystem.js +173 -9
  238. package/src/engine/sound/ecs/audio/LiveEmitterSet.d.ts +9 -3
  239. package/src/engine/sound/ecs/audio/LiveEmitterSet.d.ts.map +1 -1
  240. package/src/engine/sound/ecs/audio/LiveEmitterSet.js +28 -8
  241. package/src/engine/sound/ecs/trigger/AudioEventTrigger.d.ts +8 -0
  242. package/src/engine/sound/ecs/trigger/AudioEventTrigger.d.ts.map +1 -1
  243. package/src/engine/sound/ecs/trigger/AudioEventTrigger.js +192 -191
  244. package/src/engine/sound/ecs/trigger/AudioEventTriggerSerializationAdapter.d.ts.map +1 -1
  245. package/src/engine/sound/ecs/trigger/AudioEventTriggerSerializationAdapter.js +5 -1
  246. package/src/engine/sound/ecs/trigger/AudioEventTriggerSerializationUpgrader_0_1.d.ts +18 -0
  247. package/src/engine/sound/ecs/trigger/AudioEventTriggerSerializationUpgrader_0_1.d.ts.map +1 -0
  248. package/src/engine/sound/ecs/trigger/AudioEventTriggerSerializationUpgrader_0_1.js +51 -0
  249. package/src/engine/sound/ecs/trigger/AudioEventTriggerSystem.d.ts.map +1 -1
  250. package/src/engine/sound/ecs/trigger/AudioEventTriggerSystem.js +15 -1
  251. package/src/engine/sound/simulation/core/AcousticMedium.js +2 -2
  252. package/src/engine/sound/simulation/definition/AcousticDirectivity.js +2 -2
  253. package/src/engine/sound/simulation/definition/AcousticMaterial.d.ts.map +1 -1
  254. package/src/engine/sound/simulation/definition/AcousticMaterial.js +11 -7
  255. package/src/engine/sound/sopra/README.md +768 -644
  256. package/src/engine/sound/sopra/SopraEngine.d.ts +104 -8
  257. package/src/engine/sound/sopra/SopraEngine.d.ts.map +1 -1
  258. package/src/engine/sound/sopra/SopraEngine.js +327 -12
  259. package/src/engine/sound/sopra/definition/BusDefinition.d.ts.map +1 -1
  260. package/src/engine/sound/sopra/definition/BusDefinition.js +5 -4
  261. package/src/engine/sound/sopra/definition/DuckingRule.d.ts.map +1 -1
  262. package/src/engine/sound/sopra/definition/DuckingRule.js +7 -5
  263. package/src/engine/sound/sopra/definition/EventDescription.d.ts +28 -2
  264. package/src/engine/sound/sopra/definition/EventDescription.d.ts.map +1 -1
  265. package/src/engine/sound/sopra/definition/EventDescription.js +77 -17
  266. package/src/engine/sound/sopra/definition/EventDescriptionSerializationAdapter.d.ts +10 -0
  267. package/src/engine/sound/sopra/definition/EventDescriptionSerializationAdapter.d.ts.map +1 -1
  268. package/src/engine/sound/sopra/definition/EventDescriptionSerializationAdapter.js +77 -55
  269. package/src/engine/sound/sopra/definition/EventDescriptionSerializationUpgrader_0_1.d.ts +31 -0
  270. package/src/engine/sound/sopra/definition/EventDescriptionSerializationUpgrader_0_1.d.ts.map +1 -0
  271. package/src/engine/sound/sopra/definition/EventDescriptionSerializationUpgrader_0_1.js +75 -0
  272. package/src/engine/sound/sopra/definition/MixerSnapshot.js +2 -2
  273. package/src/engine/sound/sopra/definition/ParameterDefinition.d.ts.map +1 -1
  274. package/src/engine/sound/sopra/definition/ParameterDefinition.js +7 -5
  275. package/src/engine/sound/sopra/definition/clip/AbstractAudioClip.js +2 -2
  276. package/src/engine/sound/sopra/definition/clip/BlendContainerAudioClip.d.ts.map +1 -1
  277. package/src/engine/sound/sopra/definition/clip/BlendContainerAudioClip.js +4 -3
  278. package/src/engine/sound/sopra/definition/clip/ContainerAudioClip.js +2 -2
  279. package/src/engine/sound/sopra/definition/clip/RandomContainerAudioClip.js +3 -3
  280. package/src/engine/sound/sopra/definition/clip/SampleAudioClip.d.ts.map +1 -1
  281. package/src/engine/sound/sopra/definition/clip/SampleAudioClip.js +16 -9
  282. package/src/engine/sound/sopra/definition/clip/SilenceAudioClip.js +2 -2
  283. package/src/engine/sound/sopra/definition/clip/SwitchContainerAudioClip.d.ts +1 -1
  284. package/src/engine/sound/sopra/definition/clip/SwitchContainerAudioClip.d.ts.map +1 -1
  285. package/src/engine/sound/sopra/definition/clip/SwitchContainerAudioClip.js +2 -2
  286. package/src/engine/sound/sopra/definition/effect/AbstractAudioEffect.d.ts +38 -9
  287. package/src/engine/sound/sopra/definition/effect/AbstractAudioEffect.d.ts.map +1 -1
  288. package/src/engine/sound/sopra/definition/effect/AbstractAudioEffect.js +34 -5
  289. package/src/engine/sound/sopra/definition/effect/CompressorEffect.d.ts +7 -2
  290. package/src/engine/sound/sopra/definition/effect/CompressorEffect.d.ts.map +1 -1
  291. package/src/engine/sound/sopra/definition/effect/CompressorEffect.js +137 -120
  292. package/src/engine/sound/sopra/definition/effect/EqEffect.d.ts +3 -1
  293. package/src/engine/sound/sopra/definition/effect/EqEffect.d.ts.map +1 -1
  294. package/src/engine/sound/sopra/definition/effect/EqEffect.js +146 -128
  295. package/src/engine/sound/sopra/definition/effect/ReverbEffect.d.ts +1 -0
  296. package/src/engine/sound/sopra/definition/effect/ReverbEffect.d.ts.map +1 -1
  297. package/src/engine/sound/sopra/definition/effect/ReverbEffect.js +8 -3
  298. package/src/engine/sound/sopra/legacy/SoundEmitter.d.ts.map +1 -1
  299. package/src/engine/sound/sopra/legacy/SoundEmitter.js +357 -352
  300. package/src/engine/sound/sopra/legacy/SoundTrack.d.ts.map +1 -1
  301. package/src/engine/sound/sopra/legacy/SoundTrack.js +281 -278
  302. package/src/engine/sound/sopra/runtime/BusGraph.d.ts +44 -2
  303. package/src/engine/sound/sopra/runtime/BusGraph.d.ts.map +1 -1
  304. package/src/engine/sound/sopra/runtime/BusGraph.js +83 -43
  305. package/src/engine/sound/sopra/runtime/EffectChain.d.ts +96 -0
  306. package/src/engine/sound/sopra/runtime/EffectChain.d.ts.map +1 -0
  307. package/src/engine/sound/sopra/runtime/EffectChain.js +286 -0
  308. package/src/engine/sound/sopra/runtime/EffectParamOverrides.d.ts +123 -0
  309. package/src/engine/sound/sopra/runtime/EffectParamOverrides.d.ts.map +1 -0
  310. package/src/engine/sound/sopra/runtime/EffectParamOverrides.js +320 -0
  311. package/src/engine/sound/sopra/runtime/EventInstance.d.ts +55 -5
  312. package/src/engine/sound/sopra/runtime/EventInstance.d.ts.map +1 -1
  313. package/src/engine/sound/sopra/runtime/EventInstance.js +201 -26
  314. package/src/engine/sound/sopra/serialization/populateSopraSerializationRegistry.d.ts +2 -1
  315. package/src/engine/sound/sopra/serialization/populateSopraSerializationRegistry.d.ts.map +1 -1
  316. package/src/engine/sound/sopra/serialization/populateSopraSerializationRegistry.js +6 -1
  317. package/src/engine/sound/sopra/serialization/sopraSerializationHarness.d.ts +15 -0
  318. package/src/engine/sound/sopra/serialization/sopraSerializationHarness.d.ts.map +1 -1
  319. package/src/engine/sound/sopra/serialization/sopraSerializationHarness.js +32 -0
  320. package/src/engine/sound/sopra/util/MockAudioContext.d.ts.map +1 -1
  321. package/src/engine/sound/sopra/util/MockAudioContext.js +3 -0
  322. package/src/engine/sound/sopra/util/fadeOutAndStop.d.ts +13 -3
  323. package/src/engine/sound/sopra/util/fadeOutAndStop.d.ts.map +1 -1
  324. package/src/engine/sound/sopra/util/fadeOutAndStop.js +25 -13
  325. package/src/format/image/png/PNGReader.js +644 -644
  326. package/src/format/image/png/crc32.d.ts +1 -1
  327. package/src/format/image/png/crc32.js +7 -8
  328. package/src/shade/RENDERER_CONTRACT.md +6 -3
  329. package/src/shade/descriptor/binding/BindGroupLayoutDescriptor.js +2 -2
  330. package/src/shade/descriptor/binding/BindGroupLayoutEntry.d.ts.map +1 -1
  331. package/src/shade/descriptor/binding/BindGroupLayoutEntry.js +12 -8
  332. package/src/shade/descriptor/binding/StorageTextureBindingLayout.js +2 -2
  333. package/src/shade/descriptor/binding/TextureBindingLayout.js +2 -2
  334. package/src/shade/descriptor/blend/BlendComponent.js +2 -2
  335. package/src/shade/descriptor/pipeline/PipelineDescriptorBase.js +2 -2
  336. package/src/shade/descriptor/pipeline/PipelineLayoutDescriptor.js +2 -2
  337. package/src/shade/descriptor/pipeline/ProgrammableStage.js +2 -2
  338. package/src/shade/descriptor/pipeline/compute/ComputePipelineDescriptor.js +2 -2
  339. package/src/shade/descriptor/pipeline/render/ColorTargetState.js +2 -2
  340. package/src/shade/descriptor/pipeline/render/FragmentState.js +2 -2
  341. package/src/shade/descriptor/pipeline/render/PrimitiveState.js +2 -2
  342. package/src/shade/descriptor/pipeline/render/RenderPipelineDescriptor.d.ts.map +1 -1
  343. package/src/shade/descriptor/pipeline/render/RenderPipelineDescriptor.js +8 -5
  344. package/src/shade/descriptor/pipeline/render/VertexAttribute.js +2 -2
  345. package/src/shade/descriptor/texture/SamplerDescriptor.d.ts.map +1 -1
  346. package/src/shade/descriptor/texture/SamplerDescriptor.js +20 -12
  347. package/src/shade/descriptor/texture/TextureDescriptor.d.ts.map +1 -1
  348. package/src/shade/descriptor/texture/TextureDescriptor.js +11 -7
  349. package/src/shade/device/SHADE_DEVICE_FLOOR.d.ts +24 -0
  350. package/src/shade/device/SHADE_DEVICE_FLOOR.d.ts.map +1 -0
  351. package/src/shade/device/SHADE_DEVICE_FLOOR.js +34 -0
  352. package/src/shade/device/ShadeDeviceFailure.d.ts +12 -5
  353. package/src/shade/device/ShadeDeviceFailure.d.ts.map +1 -1
  354. package/src/shade/device/ShadeDeviceFailure.js +17 -8
  355. package/src/shade/device/ShadeDeviceFailureReason.d.ts +1 -1
  356. package/src/shade/device/ShadeDeviceFailureReason.js +2 -2
  357. package/src/shade/device/graph/BufferResourceDescriptor.d.ts.map +1 -1
  358. package/src/shade/device/graph/BufferResourceDescriptor.js +196 -193
  359. package/src/shade/device/graph/TextureResourceDescriptor.d.ts.map +1 -1
  360. package/src/shade/device/graph/TextureResourceDescriptor.js +178 -173
  361. package/src/shade/device/shade_device_floor_unmet.d.ts +13 -0
  362. package/src/shade/device/shade_device_floor_unmet.d.ts.map +1 -0
  363. package/src/shade/device/shade_device_floor_unmet.js +32 -0
  364. package/src/shade/device/timing/profile/sgpt_read_header.js +1 -1
  365. package/src/shade/device/timing/profile/sgpt_read_records.js +1 -1
  366. package/src/shade/device/timing/profile/sgpt_write_header.js +1 -1
  367. package/src/shade/device/timing/profile/sgpt_write_record.js +1 -1
  368. package/src/shade/renderer/Renderer.d.ts +2 -0
  369. package/src/shade/renderer/Renderer.d.ts.map +1 -1
  370. package/src/shade/renderer/Renderer.js +29 -55
  371. package/src/shade/renderer/binding/BufferBinding.js +2 -2
  372. package/src/shade/renderer/buffer/GPUBufferAllocator.d.ts.map +1 -1
  373. package/src/shade/renderer/buffer/GPUBufferAllocator.js +9 -0
  374. package/src/shade/renderer/buffer/buffer_pool_ops.d.ts +21 -12
  375. package/src/shade/renderer/buffer/buffer_pool_ops.d.ts.map +1 -1
  376. package/src/shade/renderer/buffer/buffer_pool_ops.js +18 -19
  377. package/src/shade/renderer/camera/Camera.js +2 -2
  378. package/src/shade/renderer/geometry/Attribute.js +2 -2
  379. package/src/shade/renderer/geometry/Geometry.js +2 -2
  380. package/src/shade/renderer/geometry/geometry_deduplicate_vertices.js +2 -2
  381. package/src/shade/renderer/geometry/meshlet/MeshletBatch.js +2 -2
  382. package/src/shade/renderer/geometry/virtual/format/checksum/vgeo_compute_asset_id.js +13 -13
  383. package/src/shade/renderer/geometry/virtual/format/checksum/vgeo_compute_directory_block_checksum.js +41 -41
  384. package/src/shade/renderer/geometry/virtual/format/checksum/vgeo_compute_frame_checksum.js +41 -41
  385. package/src/shade/renderer/geometry/virtual/format/checksum/vgeo_compute_header_checksum.js +25 -25
  386. package/src/shade/renderer/gpu_primitive/test/gpu_test.d.ts.map +1 -1
  387. package/src/shade/renderer/gpu_primitive/test/gpu_test.js +8 -11
  388. package/src/shade/renderer/loader/gltf/tiny-gltf.d.ts +1 -1
  389. package/src/shade/renderer/material/StandardShadeMaterial.d.ts.map +1 -1
  390. package/src/shade/renderer/material/StandardShadeMaterial.js +13 -8
  391. package/src/shade/renderer/pool/TransientResourcePool.d.ts +24 -0
  392. package/src/shade/renderer/pool/TransientResourcePool.d.ts.map +1 -1
  393. package/src/shade/renderer/pool/TransientResourcePool.js +41 -10
  394. package/src/shade/renderer/scene/optimization/geometry/internal/triangle_fingerprint_stream.d.ts.map +1 -1
  395. package/src/shade/renderer/scene/optimization/geometry/internal/triangle_fingerprint_stream.js +14 -5
  396. package/src/shade/renderer/scene/optimization/sampler2d_from_image_bitmap.js +1 -1
  397. package/src/shade/renderer/shader/ComputeShader.d.ts.map +1 -1
  398. package/src/shade/renderer/shader/ComputeShader.js +18 -2
  399. package/src/shade/renderer/shader/ImageShader.d.ts.map +1 -1
  400. package/src/shade/renderer/shader/ImageShader.js +230 -218
  401. package/src/shade/renderer/shader/type/WGSLStructField.js +2 -2
  402. package/src/shade/renderer/shader/type/WebGPUArray.js +2 -2
  403. package/src/shade/renderer/shader/type/WebGPUStruct.d.ts.map +1 -1
  404. package/src/shade/renderer/shader/type/WebGPUStruct.js +9 -6
  405. package/src/shade/renderer/texture/ShadeTexture.d.ts.map +1 -1
  406. package/src/shade/renderer/texture/ShadeTexture.js +17 -10
  407. package/src/shade/renderer/texture/mipmaps/WebGPUMipmapGenerator.js +2 -2
  408. package/src/shade/renderer/water/surface/chunk_water_surface_sample.d.ts +4 -4
  409. package/src/shade/renderer/water/surface/chunk_water_surface_sample.js +6 -6
  410. package/src/shade/renderer/water/surface/particles/GPUWaterParticles.d.ts.map +1 -1
  411. package/src/shade/renderer/water/surface/particles/GPUWaterParticles.js +46 -55
  412. package/src/shade/renderer/water/surface/particles/WATER_PARTICLE_STRUCT.d.ts +3 -3
  413. package/src/shade/renderer/water/surface/particles/WATER_PARTICLE_STRUCT.d.ts.map +1 -1
  414. package/src/shade/renderer/water/surface/particles/WATER_PARTICLE_STRUCT.js +14 -4
  415. package/src/shade/renderer/water/surface/particles/chunk_water_particle.d.ts +10 -1
  416. package/src/shade/renderer/water/surface/particles/chunk_water_particle.d.ts.map +1 -1
  417. package/src/shade/renderer/water/surface/particles/chunk_water_particle.js +82 -40
  418. package/src/shade/renderer/water/surface/particles/chunk_water_particle_step.d.ts +4 -1
  419. package/src/shade/renderer/water/surface/particles/chunk_water_particle_step.d.ts.map +1 -1
  420. package/src/shade/renderer/water/surface/particles/chunk_water_particle_step.js +8 -4
  421. package/src/shade/renderer/water/surface/particles/shader_water_particles.d.ts +98 -86
  422. package/src/shade/renderer/water/surface/particles/shader_water_particles.d.ts.map +1 -1
  423. package/src/shade/renderer/water/surface/particles/shader_water_particles.js +440 -298
  424. package/src/view/common/HTMLElementCacheKey.d.ts.map +1 -1
  425. package/src/view/common/HTMLElementCacheKey.js +4 -3
  426. package/src/view/graphics/GraphicsContextFailureView.d.ts +1 -2
  427. package/src/view/graphics/GraphicsContextFailureView.d.ts.map +1 -1
  428. package/src/view/graphics/GraphicsContextFailureView.js +1 -2
  429. package/src/view/minimap/MinimapMarker.js +2 -2
  430. package/src/engine/network/transport/Channel.js +0 -336
  431. package/src/engine/network/transport/ReliableCommandPipeline.js +0 -335
  432. package/src/engine/network/transport/fragments/FragmentAssembler.js +0 -350
  433. package/src/engine/network/transport/fragments/FragmentRetention.js +0 -191
  434. package/src/engine/network/transport/fragments/fragment_send.js +0 -157
  435. package/src/engine/network/transport/fragments/packet_size.js +0 -107
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Action-stream slices sent to one peer and not yet resolved, keyed by a small integer token: the
3
+ * token the connection hands back with the slice's acknowledgement or loss.
4
+ *
5
+ * Typed arrays and a free list, so a tick's sends allocate nothing once the pool has grown to the
6
+ * peer's high-watermark.
7
+ *
8
+ * @author Alex Goldring
9
+ * @copyright Company Named Limited (c) 2026
10
+ */
11
+ export class PendingSlices {
12
+ /** Slices awaiting their outcome. */
13
+ get size(): number;
14
+ /**
15
+ * @param {number} frame_start first frame the slice covers
16
+ * @param {number} frame_end last frame the slice covers
17
+ * @param {boolean} head the slice began at the pack start
18
+ * @returns {number} token
19
+ */
20
+ acquire(frame_start: number, frame_end: number, head: boolean): number;
21
+ /**
22
+ * @param {number} token
23
+ */
24
+ release(token: number): void;
25
+ frame_start(token: any): number;
26
+ frame_end(token: any): number;
27
+ head(token: any): boolean;
28
+ #private;
29
+ }
30
+ //# sourceMappingURL=PendingSlices.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PendingSlices.d.ts","sourceRoot":"","sources":["../../../../../src/engine/network/orchestrator/PendingSlices.js"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH;IAWI,qCAAqC;IACrC,mBAEC;IAED;;;;;OAKG;IACH,qBALW,MAAM,aACN,MAAM,QACN,OAAO,GACL,MAAM,CAelB;IAED;;OAEG;IACH,eAFW,MAAM,QAKhB;IAED,gCAEC;IAED,8BAEC;IAED,0BAEC;;CAiBJ"}
@@ -0,0 +1,83 @@
1
+ /**
2
+ * Action-stream slices sent to one peer and not yet resolved, keyed by a small integer token: the
3
+ * token the connection hands back with the slice's acknowledgement or loss.
4
+ *
5
+ * Typed arrays and a free list, so a tick's sends allocate nothing once the pool has grown to the
6
+ * peer's high-watermark.
7
+ *
8
+ * @author Alex Goldring
9
+ * @copyright Company Named Limited (c) 2026
10
+ */
11
+ export class PendingSlices {
12
+ #frame_start = new Float64Array(16);
13
+ #frame_end = new Float64Array(16);
14
+ #head = new Uint8Array(16);
15
+ /** free tokens, a stack */
16
+ #free = new Int32Array(16);
17
+ #free_count = 0;
18
+ /** tokens ever handed out; the next new one */
19
+ #high = 0;
20
+ #in_use = 0;
21
+
22
+ /** Slices awaiting their outcome. */
23
+ get size() {
24
+ return this.#in_use;
25
+ }
26
+
27
+ /**
28
+ * @param {number} frame_start first frame the slice covers
29
+ * @param {number} frame_end last frame the slice covers
30
+ * @param {boolean} head the slice began at the pack start
31
+ * @returns {number} token
32
+ */
33
+ acquire(frame_start, frame_end, head) {
34
+ let token;
35
+ if (this.#free_count > 0) {
36
+ token = this.#free[--this.#free_count];
37
+ } else {
38
+ token = this.#high++;
39
+ if (token === this.#frame_start.length) this.#grow();
40
+ }
41
+ this.#frame_start[token] = frame_start;
42
+ this.#frame_end[token] = frame_end;
43
+ this.#head[token] = head ? 1 : 0;
44
+ this.#in_use++;
45
+ return token;
46
+ }
47
+
48
+ /**
49
+ * @param {number} token
50
+ */
51
+ release(token) {
52
+ this.#free[this.#free_count++] = token;
53
+ this.#in_use--;
54
+ }
55
+
56
+ frame_start(token) {
57
+ return this.#frame_start[token];
58
+ }
59
+
60
+ frame_end(token) {
61
+ return this.#frame_end[token];
62
+ }
63
+
64
+ head(token) {
65
+ return this.#head[token] === 1;
66
+ }
67
+
68
+ #grow() {
69
+ const capacity = this.#frame_start.length * 2;
70
+ const start = new Float64Array(capacity);
71
+ const end = new Float64Array(capacity);
72
+ const head = new Uint8Array(capacity);
73
+ const free = new Int32Array(capacity);
74
+ start.set(this.#frame_start);
75
+ end.set(this.#frame_end);
76
+ head.set(this.#head);
77
+ free.set(this.#free);
78
+ this.#frame_start = start;
79
+ this.#frame_end = end;
80
+ this.#head = head;
81
+ this.#free = free;
82
+ }
83
+ }
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Action-stream frames too large for a datagram, sent to one peer on the connection's FRAMES lane
3
+ * and not yet delivered: oldest first, as the lane delivers them.
4
+ *
5
+ * Each is sent once. The pack skips the frames one covers while it is in flight, and it is credited
6
+ * like any slice when the lane says it has arrived. Typed arrays grown to a high-watermark; a few
7
+ * entries at most in practice.
8
+ *
9
+ * @author Alex Goldring
10
+ * @copyright Company Named Limited (c) 2026
11
+ */
12
+ export class ReliableFrames {
13
+ get count(): number;
14
+ /**
15
+ * @param {number} frame_start
16
+ * @param {number} frame_end
17
+ * @param {boolean} head the slice began at the pack start
18
+ * @param {number} mark the lane's delivery mark
19
+ */
20
+ push(frame_start: number, frame_end: number, head: boolean, mark: number): void;
21
+ front_start(): number;
22
+ front_end(): number;
23
+ front_head(): boolean;
24
+ front_mark(): number;
25
+ shift(): void;
26
+ /**
27
+ * Last frame of the entry covering `frame`, or -1 when none does.
28
+ * @param {number} frame
29
+ * @returns {number}
30
+ */
31
+ covering_end(frame: number): number;
32
+ #private;
33
+ }
34
+ //# sourceMappingURL=ReliableFrames.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ReliableFrames.d.ts","sourceRoot":"","sources":["../../../../../src/engine/network/orchestrator/ReliableFrames.js"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH;IASI,oBAEC;IAED;;;;;OAKG;IACH,kBALW,MAAM,aACN,MAAM,QACN,OAAO,QACP,MAAM,QAUhB;IAED,sBAEC;IAED,oBAEC;IAED,sBAEC;IAED,qBAEC;IAED,cAGC;IAED;;;;OAIG;IACH,oBAHW,MAAM,GACJ,MAAM,CASlB;;CAsBJ"}
@@ -0,0 +1,96 @@
1
+ /**
2
+ * Action-stream frames too large for a datagram, sent to one peer on the connection's FRAMES lane
3
+ * and not yet delivered: oldest first, as the lane delivers them.
4
+ *
5
+ * Each is sent once. The pack skips the frames one covers while it is in flight, and it is credited
6
+ * like any slice when the lane says it has arrived. Typed arrays grown to a high-watermark; a few
7
+ * entries at most in practice.
8
+ *
9
+ * @author Alex Goldring
10
+ * @copyright Company Named Limited (c) 2026
11
+ */
12
+ export class ReliableFrames {
13
+ #start = new Float64Array(8);
14
+ #end = new Float64Array(8);
15
+ #mark = new Float64Array(8);
16
+ #head = new Uint8Array(8);
17
+ /** index of the oldest entry */
18
+ #first = 0;
19
+ #count = 0;
20
+
21
+ get count() {
22
+ return this.#count;
23
+ }
24
+
25
+ /**
26
+ * @param {number} frame_start
27
+ * @param {number} frame_end
28
+ * @param {boolean} head the slice began at the pack start
29
+ * @param {number} mark the lane's delivery mark
30
+ */
31
+ push(frame_start, frame_end, head, mark) {
32
+ if (this.#count === this.#start.length) this.#grow();
33
+ const i = (this.#first + this.#count) % this.#start.length;
34
+ this.#start[i] = frame_start;
35
+ this.#end[i] = frame_end;
36
+ this.#head[i] = head ? 1 : 0;
37
+ this.#mark[i] = mark;
38
+ this.#count++;
39
+ }
40
+
41
+ front_start() {
42
+ return this.#start[this.#first];
43
+ }
44
+
45
+ front_end() {
46
+ return this.#end[this.#first];
47
+ }
48
+
49
+ front_head() {
50
+ return this.#head[this.#first] === 1;
51
+ }
52
+
53
+ front_mark() {
54
+ return this.#mark[this.#first];
55
+ }
56
+
57
+ shift() {
58
+ this.#first = (this.#first + 1) % this.#start.length;
59
+ this.#count--;
60
+ }
61
+
62
+ /**
63
+ * Last frame of the entry covering `frame`, or -1 when none does.
64
+ * @param {number} frame
65
+ * @returns {number}
66
+ */
67
+ covering_end(frame) {
68
+ const capacity = this.#start.length;
69
+ for (let k = 0; k < this.#count; k++) {
70
+ const i = (this.#first + k) % capacity;
71
+ if (frame >= this.#start[i] && frame <= this.#end[i]) return this.#end[i];
72
+ }
73
+ return -1;
74
+ }
75
+
76
+ #grow() {
77
+ const capacity = this.#start.length;
78
+ const next = capacity * 2;
79
+ const start = new Float64Array(next);
80
+ const end = new Float64Array(next);
81
+ const mark = new Float64Array(next);
82
+ const head = new Uint8Array(next);
83
+ for (let k = 0; k < this.#count; k++) {
84
+ const i = (this.#first + k) % capacity;
85
+ start[k] = this.#start[i];
86
+ end[k] = this.#end[i];
87
+ mark[k] = this.#mark[i];
88
+ head[k] = this.#head[i];
89
+ }
90
+ this.#start = start;
91
+ this.#end = end;
92
+ this.#mark = mark;
93
+ this.#head = head;
94
+ this.#first = 0;
95
+ }
96
+ }
@@ -10,14 +10,37 @@
10
10
  * action_log via the executor (capturing prior-state for later rewind),
11
11
  * and goes out over the action stream when `peer.end_tick` flushes it.
12
12
  *
13
- * - On AUTH_STATE arrival: rewind the world to end-of-(server_frame - 1)
14
- * via the {@link RewindEngine}, deserialize the server's authoritative
15
- * state bytes via {@link onApplyAuthState}, then replay forward by
16
- * firing {@link onReplay} for every frame in the InputRing between
17
- * `server_frame + 1` and the client's current frame. The user's
13
+ * - On AUTH_STATE arrival: rewind the world to the end of `server_frame`
14
+ * via the {@link RewindEngine}, overwrite it there with the server's
15
+ * authoritative state bytes via {@link onApplyAuthState}, then replay
16
+ * forward by firing {@link onReplay} for every frame in the InputRing
17
+ * between `server_frame + 1` and the client's current frame. The user's
18
18
  * {@link onReplay} handler re-executes the same SimActions the original
19
19
  * predict path produced.
20
20
  *
21
+ * An AUTH_STATE is the server's state at the END of `server_frame`, and it
22
+ * is put back at exactly that point. It covers one `network_id`; the rest of
23
+ * the world at that point is this client's own prediction of it, which
24
+ * already holds the frame's input — so frame `server_frame` itself is never
25
+ * undone, and nothing in it is lost or applied twice. (Undoing it and then
26
+ * skipping it, which this did, took the frame's input back off every
27
+ * predicted entity the bytes do not describe.)
28
+ *
29
+ * - An applied AUTH_STATE stays on the timeline as a correction: a
30
+ * `SENDER_CORRECTED` record at the end of `server_frame` in the action log,
31
+ * holding the entity's state from before it and the bytes
32
+ * {@link onApplyAuthState} read. A rewind across the frame undoes it like any
33
+ * record, and the replay applies it again, last in its frame. Both halves
34
+ * matter when one entity's AUTH_STATE arrives after another's newer one,
35
+ * which a lossy link does routinely. Without the replay half the older
36
+ * rewind replayed the prediction underneath the newer correction and left
37
+ * that entity on its misprediction until its next AUTH_STATE. Without the
38
+ * undo half the newer correction stayed in the world while the older frames
39
+ * replayed, so an action there that read the entity read the server's value
40
+ * from a later frame. The record is never packed for a peer — this log is
41
+ * also the outbound stream, and the host would take a client-owned entity's
42
+ * old state from it.
43
+ *
21
44
  * - A replay also reapplies the records in the rewound window that ARRIVED
22
45
  * from a peer, which {@link onReplay} cannot: it re-executes this client's
23
46
  * own input, and the AUTH_STATE that precedes it carries one `network_id`.
@@ -60,8 +83,16 @@ export class ServerAuthoritativeClient {
60
83
  * time_dilation?: TimeDilation,
61
84
  * max_packets_per_tick?: number,
62
85
  * auto_reconcile?: boolean,
86
+ * clock: function(): number,
87
+ * tick_period_ms: number,
88
+ * send_rate_bytes_per_second?: number,
89
+ * max_message_bytes?: number,
90
+ * receive_window_bytes?: number,
91
+ * max_queued_bytes?: number,
63
92
  * }} options
64
93
  *
94
+ * `clock`, `tick_period_ms` and the connection options: forwarded to {@link NetworkPeer}.
95
+ *
65
96
  * `time_dilation`: optional pre-configured {@link TimeDilation}.
66
97
  * On TIME_DILATION feedback the client recomputes
67
98
  * {@link dilation_factor} for the caller to scale its tick cadence.
@@ -77,7 +108,7 @@ export class ServerAuthoritativeClient {
77
108
  * turns it off and listens to `peer.onAuthState` itself; {@link reconcile}
78
109
  * remains available to it.
79
110
  */
80
- constructor({ world, binary_registry, replicated_components, action_classes, scope_filter, frame_capacity, initial_buffer_size, input_ring_capacity, input_byte_size, reconcile_epsilon, time_dilation, max_packets_per_tick, auto_reconcile, }: {
111
+ constructor({ world, binary_registry, replicated_components, action_classes, scope_filter, frame_capacity, initial_buffer_size, input_ring_capacity, input_byte_size, reconcile_epsilon, time_dilation, max_packets_per_tick, auto_reconcile, clock, tick_period_ms, send_rate_bytes_per_second, max_message_bytes, receive_window_bytes, max_queued_bytes, }: {
81
112
  world: EntityComponentDataset;
82
113
  binary_registry: BinarySerializationRegistry;
83
114
  replicated_components: Function[];
@@ -91,6 +122,12 @@ export class ServerAuthoritativeClient {
91
122
  time_dilation?: TimeDilation;
92
123
  max_packets_per_tick?: number;
93
124
  auto_reconcile?: boolean;
125
+ clock: () => number;
126
+ tick_period_ms: number;
127
+ send_rate_bytes_per_second?: number;
128
+ max_message_bytes?: number;
129
+ receive_window_bytes?: number;
130
+ max_queued_bytes?: number;
94
131
  });
95
132
  /** @type {number} */
96
133
  reconcile_count: number;
@@ -225,6 +262,14 @@ export class ServerAuthoritativeClient {
225
262
  * payload bytes. The handler should deserialize the bytes into
226
263
  * the world (the rewind has already happened; the buffer's bytes
227
264
  * ARE the new authoritative state at server_frame).
265
+ *
266
+ * The handler must leave `buffer.position` past what it read: those
267
+ * bytes are what this client keeps as the correction, and a later
268
+ * replay that crosses `server_frame` fires this again, at the end of
269
+ * that frame, with a buffer positioned at them.
270
+ *
271
+ * Write only the entity's replicated components: the correction's
272
+ * prior state, which a rewind puts back, is captured for those.
228
273
  * @type {Signal}
229
274
  */
230
275
  onApplyAuthState: Signal;
@@ -265,9 +310,11 @@ export class ServerAuthoritativeClient {
265
310
  * @param {number} peer_id
266
311
  */
267
312
  disconnect_from_server(peer_id: number): void;
268
- /** Channel accessor for manual packet plumbing.
269
- * @param {number} peer_id */
270
- channel_for(peer_id: number): import("../transport/Channel.js").Channel;
313
+ /**
314
+ * The server's connection, for diagnostics. See {@link NetworkPeer#connection_for}.
315
+ * @param {number} peer_id
316
+ */
317
+ connection_for(peer_id: number): import("../transport/connection/Connection.js").Connection;
271
318
  /**
272
319
  * Run one client-side prediction tick: {@link begin_tick} followed immediately by
273
320
  * {@link end_tick}.
@@ -290,7 +337,8 @@ export class ServerAuthoritativeClient {
290
337
  */
291
338
  begin_tick(current_frame: number): void;
292
339
  /**
293
- * Second half of a tick: close the frame and flush the action stream to the server.
340
+ * Second half of a tick: close the frame and send the action stream, with everything else
341
+ * queued, to the server.
294
342
  */
295
343
  end_tick(): void;
296
344
  /**
@@ -325,6 +373,25 @@ export class ServerAuthoritativeClient {
325
373
  * @param {BinaryBuffer} buffer positioned at the authoritative payload
326
374
  */
327
375
  reconcile(server_frame: number, network_id: number, buffer: BinaryBuffer): void;
376
+ /**
377
+ * Forget everything this client holds about the frames it has run: the
378
+ * action log's records — the kept corrections among them — the sampled
379
+ * input, and the newest reconciled frame per network id.
380
+ *
381
+ * For when the frame numbering they were kept under is replaced — a resync
382
+ * that brings a new world and seeks the clock, possibly backwards. Kept, a
383
+ * correction from the old numbering would be written into the new one by
384
+ * the first replay that crosses its frame number, and the old watermark
385
+ * would refuse the new AUTH_STATEs that should overwrite it. The log and the
386
+ * input matter where the seek leaves frames the new world never runs: a
387
+ * sync at host frame F seeks past F by the input lead, and a rewind to F
388
+ * crosses the frames in between — it would put back the old world's prior
389
+ * state from the records there, and the replay would hand the old input
390
+ * to {@link onReplay}.
391
+ *
392
+ * Must be called with no frame open.
393
+ */
394
+ forget_timeline(): void;
328
395
  /**
329
396
  * Helper for the {@link onComputeExpected} handler: stash the
330
397
  * computed scalar so the orchestrator can read it. Called inside the
@@ -1 +1 @@
1
- {"version":3,"file":"ServerAuthoritativeClient.d.ts","sourceRoot":"","sources":["../../../../../src/engine/network/orchestrator/ServerAuthoritativ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;;;;OASG;IACH,WAFU,MAAM,CAEa;IAE7B;;;;;;;;;OASG;IACH,UAFU,MAAM,CAEY;IAE5B;;;;;;;;;;;;;;;;;;OAkBG;IACH,mBAFU,MAAM,CAEqB;IAErC;;;;;OAKG;IACH,kBAFU,MAAM,CAEoB;IAEpC;;;;;;;OAOG;IACH,mBAFU,MAAM,CAEqB;IAErC;;;;;;;;OAQG;IACH,kBAFU,MAAM,CAEoB;IAEpC;;;;OAIG;IACH,qBAFU,MAAM,CAEuB;IAEvC;;;;;;;;;;;;;;;;;;OAkBG;IACH,sBAFU,MAAM,CAEwB;IAa5C;;;;OAIG;IACH,2BAHW,MAAM,aACN,MAAM,QAIhB;IAED;;;OAGG;IACH,gCAFW,MAAM,QAIhB;IAED;iCAC6B;IAC7B,qBADW,MAAM,6CAGhB;IAED;;;;;;;;;;;OAWG;IACH,oBAFW,MAAM,QAKhB;IAED;;;;;;OAMG;IACH,0BAFW,MAAM,QAUhB;IAED;;OAEG;IACH,iBAEC;IAED;;;OAGG;IACH,4BAEC;IAED;;;;;;;OAOG;IACH,qBAHW,MAAM,GACJ,OAAO,CAInB;IAED;;;;;;OAMG;IACH,iBAHW,MAAM,GACJ,YAAY,CAIxB;IAED;;;;;;;;OAQG;IACH,wBAJW,MAAM,cACN,MAAM,UACN,YAAY,QAItB;IA6OD;;;;;OAKG;IACH,oBAFW,MAAM,QAIhB;IAED;;;;OAIG;IACH,oBAFW,MAAM,QAIhB;;CACJ;4BA9sB2B,kBAAkB;0BAFpB,uBAAuB;6BADpB,wBAAwB;6BAExB,yBAAyB;mBALnC,uCAAuC;6BAF7B,sCAAsC"}
1
+ {"version":3,"file":"ServerAuthoritativeClient.d.ts","sourceRoot":"","sources":["../../../../../src/engine/network/orchestrator/ServerAuthoritativeClient.js"],"names":[],"mappings":"AAoBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoEG;AACH;IA0EI;;;;;;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