@jgengine/core 0.18.0 → 0.18.1

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 (174) hide show
  1. package/CHANGELOG.md +114 -2
  2. package/dist/ai/decisionGraph.d.ts +52 -0
  3. package/dist/ai/decisionGraph.js +82 -0
  4. package/dist/ai/mobBrainGraph.d.ts +3 -0
  5. package/dist/ai/mobBrainGraph.js +25 -0
  6. package/dist/ai/tacticalQueries.d.ts +30 -0
  7. package/dist/ai/tacticalQueries.js +45 -0
  8. package/dist/anim/animGraph.d.ts +144 -0
  9. package/dist/anim/animGraph.js +286 -0
  10. package/dist/anim/ikSolver.d.ts +51 -0
  11. package/dist/anim/ikSolver.js +124 -0
  12. package/dist/anim/locomotionGraph.d.ts +26 -0
  13. package/dist/anim/locomotionGraph.js +33 -0
  14. package/dist/assets/spriteAtlas.d.ts +21 -0
  15. package/dist/assets/spriteAtlas.js +103 -0
  16. package/dist/audio/audioFalloff.d.ts +10 -0
  17. package/dist/economy/currency.d.ts +16 -2
  18. package/dist/economy/currency.js +55 -14
  19. package/dist/economy/wallet.d.ts +5 -4
  20. package/dist/economy/wallet.js +8 -4
  21. package/dist/editor/commandApply.js +1 -0
  22. package/dist/editor/commands.d.ts +4 -1
  23. package/dist/editor/document.d.ts +2 -1
  24. package/dist/editor/document.js +89 -0
  25. package/dist/editor/environment.d.ts +3 -0
  26. package/dist/editor/environment.js +16 -0
  27. package/dist/editor/index.d.ts +4 -2
  28. package/dist/editor/index.js +1 -1
  29. package/dist/editor/types.d.ts +16 -0
  30. package/dist/game/cameraConfig.d.ts +8 -0
  31. package/dist/game/chat.d.ts +22 -1
  32. package/dist/game/chat.js +48 -19
  33. package/dist/game/controlGate.d.ts +6 -0
  34. package/dist/game/controlGate.js +30 -1
  35. package/dist/game/defineGame.d.ts +10 -1
  36. package/dist/game/events.d.ts +8 -1
  37. package/dist/game/pixelPerfect.d.ts +25 -0
  38. package/dist/game/pixelPerfect.js +29 -0
  39. package/dist/game/playableGame.d.ts +97 -3
  40. package/dist/game/systemRuntime.js +6 -1
  41. package/dist/input/actionBindings.d.ts +2 -1
  42. package/dist/input/actionBindings.js +10 -8
  43. package/dist/input/actionContexts.d.ts +21 -0
  44. package/dist/input/actionContexts.js +56 -0
  45. package/dist/input/gamepadModel.d.ts +45 -0
  46. package/dist/input/gamepadModel.js +69 -0
  47. package/dist/meta/changelog.d.ts +1 -1
  48. package/dist/meta/changelog.js +85 -1
  49. package/dist/movement/characterController.d.ts +76 -0
  50. package/dist/movement/characterController.js +216 -0
  51. package/dist/movement/freeFlight.d.ts +119 -0
  52. package/dist/movement/freeFlight.js +294 -0
  53. package/dist/movement/playerMovement.d.ts +10 -2
  54. package/dist/movement/playerMovement.js +218 -4
  55. package/dist/movement/serverStep.d.ts +5 -0
  56. package/dist/movement/serverStep.js +6 -0
  57. package/dist/movement/solidObstacles.d.ts +30 -7
  58. package/dist/movement/solidObstacles.js +27 -4
  59. package/dist/multiplayer/poseSyncGate.d.ts +3 -1
  60. package/dist/multiplayer/poseSyncGate.js +9 -1
  61. package/dist/multiplayer/presenceContract.d.ts +6 -0
  62. package/dist/multiplayer/presenceModel.d.ts +2 -0
  63. package/dist/multiplayer/presenceModel.js +11 -0
  64. package/dist/nav/navMesh.d.ts +33 -0
  65. package/dist/nav/navMesh.js +164 -0
  66. package/dist/physics/flightDynamics.d.ts +8 -0
  67. package/dist/physics/kinematicVehicle.d.ts +6 -1
  68. package/dist/physics/physicsBackend.d.ts +191 -0
  69. package/dist/physics/physicsBackend.js +49 -0
  70. package/dist/physics/physicsBackendConformance.d.ts +27 -0
  71. package/dist/physics/physicsBackendConformance.js +117 -0
  72. package/dist/physics/physicsWorldBackend.d.ts +44 -0
  73. package/dist/physics/physicsWorldBackend.js +485 -0
  74. package/dist/physics/worldColliders.d.ts +13 -0
  75. package/dist/physics/worldColliders.js +96 -0
  76. package/dist/random/rng.d.ts +12 -1
  77. package/dist/random/rng.js +20 -3
  78. package/dist/render/environment.d.ts +23 -0
  79. package/dist/render/environment.js +1 -0
  80. package/dist/render/lookPreset.d.ts +11 -5
  81. package/dist/render/lookPreset.js +29 -4
  82. package/dist/render/postProcessing.d.ts +10 -1
  83. package/dist/render/sprite2d.d.ts +38 -0
  84. package/dist/render/sprite2d.js +40 -0
  85. package/dist/runtime/adapter.d.ts +20 -1
  86. package/dist/runtime/adapter.js +8 -1
  87. package/dist/runtime/commandInput.d.ts +15 -0
  88. package/dist/runtime/commandInput.js +13 -0
  89. package/dist/runtime/commandRunner.d.ts +12 -7
  90. package/dist/runtime/commandRunner.js +7 -5
  91. package/dist/runtime/gameContext.js +11 -1
  92. package/dist/runtime/gameContextTypes.d.ts +14 -4
  93. package/dist/runtime/gameRuntime.d.ts +20 -4
  94. package/dist/runtime/gameRuntime.js +17 -4
  95. package/dist/runtime/headlessRunner.d.ts +10 -0
  96. package/dist/runtime/headlessRunner.js +26 -8
  97. package/dist/runtime/hostPolicy.d.ts +3 -2
  98. package/dist/runtime/hostPolicy.js +8 -10
  99. package/dist/runtime/hostedGameRunner.js +34 -6
  100. package/dist/runtime/hostedWorldSession.d.ts +12 -16
  101. package/dist/runtime/hostedWorldSession.js +29 -6
  102. package/dist/runtime/hostedWorldStore.d.ts +20 -0
  103. package/dist/runtime/hostedWorldStore.js +1 -0
  104. package/dist/runtime/inputRecorder.d.ts +30 -0
  105. package/dist/runtime/inputRecorder.js +59 -0
  106. package/dist/runtime/inputSnapshot.d.ts +8 -0
  107. package/dist/runtime/inputSnapshot.js +1 -0
  108. package/dist/runtime/poseInterpolation.d.ts +36 -0
  109. package/dist/runtime/poseInterpolation.js +91 -0
  110. package/dist/runtime/prediction.d.ts +45 -0
  111. package/dist/runtime/prediction.js +62 -0
  112. package/dist/runtime/simContext.d.ts +45 -0
  113. package/dist/runtime/simContext.js +65 -0
  114. package/dist/runtime/simLoop.d.ts +52 -0
  115. package/dist/runtime/simLoop.js +72 -0
  116. package/dist/runtime/simSnapshot.d.ts +32 -0
  117. package/dist/runtime/simSnapshot.js +60 -0
  118. package/dist/runtime/snapshot.d.ts +8 -0
  119. package/dist/runtime/snapshotBuffer.d.ts +33 -0
  120. package/dist/runtime/snapshotBuffer.js +58 -0
  121. package/dist/runtime/transport.d.ts +32 -2
  122. package/dist/runtime/worldChunks.d.ts +2 -0
  123. package/dist/runtime/worldChunks.js +14 -0
  124. package/dist/runtime/worldProjection.d.ts +9 -0
  125. package/dist/runtime/worldProjection.js +17 -1
  126. package/dist/runtime/worldSnapshot.d.ts +6 -0
  127. package/dist/runtime/worldSnapshot.js +3 -0
  128. package/dist/scene/behaviorRuntime.d.ts +19 -1
  129. package/dist/scene/behaviorRuntime.js +55 -4
  130. package/dist/scene/behaviors.d.ts +8 -1
  131. package/dist/scene/builtinSceneKinds.js +10 -0
  132. package/dist/sensor/perception.d.ts +60 -0
  133. package/dist/sensor/perception.js +142 -0
  134. package/dist/settings/graphicsProfile.d.ts +19 -0
  135. package/dist/settings/graphicsProfile.js +36 -0
  136. package/dist/time/accrueSince.d.ts +10 -0
  137. package/dist/time/accrueSince.js +9 -0
  138. package/dist/time/rateWindow.d.ts +16 -0
  139. package/dist/time/rateWindow.js +14 -0
  140. package/dist/time/serverTick.d.ts +21 -3
  141. package/dist/time/serverTick.js +14 -13
  142. package/dist/vfx/particleDirector.d.ts +68 -0
  143. package/dist/vfx/particleDirector.js +81 -0
  144. package/dist/world/buildings.d.ts +12 -0
  145. package/dist/world/buildings.js +43 -3
  146. package/dist/world/cityContent.js +103 -25
  147. package/dist/world/cityKind.d.ts +132 -0
  148. package/dist/world/cityKind.js +315 -15
  149. package/dist/world/features.d.ts +27 -1
  150. package/dist/world/features.js +7 -2
  151. package/dist/world/placement.d.ts +7 -0
  152. package/dist/world/placement.js +2 -0
  153. package/dist/world/placementController.d.ts +1 -1
  154. package/dist/world/placementController.js +7 -0
  155. package/dist/world/raceCircuit.d.ts +168 -0
  156. package/dist/world/raceCircuit.js +797 -0
  157. package/dist/world/terrain.d.ts +5 -1
  158. package/dist/world/terrain.js +5 -0
  159. package/dist/world/territory.d.ts +97 -0
  160. package/dist/world/territory.js +182 -0
  161. package/dist/world.d.ts +5 -3
  162. package/dist/world.js +4 -2
  163. package/package.json +1 -1
  164. package/skills/ce-handoff/SKILL.md +1 -1
  165. package/skills/game-design/SKILL.md +11 -1
  166. package/skills/jgengine/SKILL.md +2 -0
  167. package/skills/jgengine/api.md +94 -19
  168. package/skills/jgengine/capabilities.md +28 -0
  169. package/skills/jgengine-gameplay/SKILL.md +10 -0
  170. package/skills/jgengine-gameplay/api.md +40 -18
  171. package/skills/jgengine-gameplay/capabilities.md +12 -0
  172. package/skills/jgengine-world/SKILL.md +6 -0
  173. package/skills/jgengine-world/api.md +312 -12
  174. package/skills/jgengine-world/capabilities.md +102 -0
@@ -4,6 +4,10 @@
4
4
 
5
5
  Reach for these before hand-rolling. Each row is *the thing you need* → *the primitive that already does it*.
6
6
 
7
+ ## ai-decision-graph — Evaluate serializable selector, sequence, condition, action, and utility AI decisions.
8
+
9
+ - `createDecisionGraphRuntime` (function) · `import { createDecisionGraphRuntime } from "@jgengine/core/ai/decisionGraph"`
10
+
7
11
  ## ai-driver — difficulty-aware chase/route driving step producing throttle/brake/steer for the vehicle sim
8
12
 
9
13
  - `driveStep` (function) · `import { driveStep } from "@jgengine/core/ai/driver"`
@@ -16,6 +20,16 @@ Reach for these before hand-rolling. Each row is *the thing you need* → *the p
16
20
 
17
21
  - `createDriverState` (function) · `import { createDriverState } from "@jgengine/core/ai/driver"`
18
22
 
23
+ ## anim-graph — data-first animation state machine with blend trees, crossfades, layers, and clip events
24
+
25
+ - `createAnimGraphRuntime` (function) · `import { createAnimGraphRuntime } from "@jgengine/core/anim/animGraph"`
26
+
27
+ ## animation — inverse kinematics orient a bone toward a target with constrained yaw and pitch
28
+
29
+ - `lookAt` (function) · `import { lookAt } from "@jgengine/core/anim/ikSolver"`
30
+ - `solveFabrik` (function) · `import { solveFabrik } from "@jgengine/core/anim/ikSolver"`
31
+ - `solveTwoBone` (function) · `import { solveTwoBone } from "@jgengine/core/anim/ikSolver"`
32
+
19
33
  ## area-effect-field — source-following area membership with enter/refresh/leave edges, stacking, and cleanup
20
34
 
21
35
  - `createAreaEffectField` (function) · `import { createAreaEffectField } from "@jgengine/core/world"`
@@ -102,6 +116,10 @@ Reach for these before hand-rolling. Each row is *the thing you need* → *the p
102
116
  - `registerBuiltinTriggerActions` (function) · `import { registerBuiltinTriggerActions } from "@jgengine/core/scene/authoredTriggers"`
103
117
  - `registerTriggerAction` (function) · `import { registerTriggerAction } from "@jgengine/core/world"`
104
118
 
119
+ ## behavior-actions — register named callbacks for decision graph behavior descriptors
120
+
121
+ - `registerBehaviorActions` (function) · `import { registerBehaviorActions } from "@jgengine/core/world"`
122
+
105
123
  ## behavior-control — pause/disable/resume/seek/inspect behavior instances per entity
106
124
 
107
125
  - `behaviorControl` (function) · `import { behaviorControl } from "@jgengine/core/world"`
@@ -142,6 +160,10 @@ Reach for these before hand-rolling. Each row is *the thing you need* → *the p
142
160
 
143
161
  - `createCameraShake` (function) · `import { createCameraShake } from "@jgengine/core/world"`
144
162
 
163
+ ## character-controller — capsule walk over the physics backend — slide, step-up, slopes, crouch, platforms
164
+
165
+ - `createCharacterController` (function) · `import { createCharacterController } from "@jgengine/core/movement/characterController"`
166
+
145
167
  ## city-district — polygon math for road-derived blocks, parcels, and buildable footprints
146
168
 
147
169
  - `Vec2` (type) · `import { Vec2 } from "@jgengine/core/world/cityGeometry"`
@@ -279,6 +301,14 @@ Reach for these before hand-rolling. Each row is *the thing you need* → *the p
279
301
 
280
302
  - `DEFAULT_FORWARD` (const) · `import { DEFAULT_FORWARD } from "@jgengine/core/world"`
281
303
 
304
+ ## free-flight — camera-relative creative/spectator/noclip/hover flight with correct strafe, sprint, and optional gravity
305
+
306
+ - `createFreeFlightController` (function) · `import { createFreeFlightController } from "@jgengine/core/world"`
307
+
308
+ ## gamepad-input — Resolve sampled gamepad input into actions with deadzones and response curves.
309
+
310
+ - `resolveGamepadFrame` (function) · `import { resolveGamepadFrame } from "@jgengine/core/input/gamepadModel"`
311
+
282
312
  ## glide — gliding/wingsuit descent control from a launch
283
313
 
284
314
  - `createGlideModel` (function) · `import { createGlideModel } from "@jgengine/core/world"`
@@ -337,6 +367,10 @@ Reach for these before hand-rolling. Each row is *the thing you need* → *the p
337
367
 
338
368
  - `generateLock` (function) · `import { generateLock } from "@jgengine/core/world"`
339
369
 
370
+ ## locomotion-graph — build the default idle/walk/run plus one-shot graph from clip names
371
+
372
+ - `locomotionGraph` (function) · `import { locomotionGraph } from "@jgengine/core/anim/locomotionGraph"`
373
+
340
374
  ## map-annotations — player-drawn map annotation layer — freehand strokes, area shapes, and pinned notes, projected into the map's routes/zones props and serializable
341
375
 
342
376
  - `createAnnotationLayer` (function) · `import { createAnnotationLayer } from "@jgengine/core/world"`
@@ -378,6 +412,10 @@ Reach for these before hand-rolling. Each row is *the thing you need* → *the p
378
412
 
379
413
  - `createOrderRegistry` (function) · `import { createOrderRegistry } from "@jgengine/core/world"`
380
414
 
415
+ ## particle-director — game-reachable VFX seam: queue one-shot particle bursts and keyed follow-capable standing emitters as serializable data for the shell to render
416
+
417
+ - `createParticleDirector` (function) · `import { createParticleDirector } from "@jgengine/core/vfx/particleDirector"`
418
+
381
419
  ## particle-system — deterministic pooled particle emitter with SoA render buffers, burst/continuous emission, gravity/drag, size/color/alpha-over-life, and serializable state
382
420
 
383
421
  - `createParticleSystem` (function) · `import { createParticleSystem } from "@jgengine/core/world"`
@@ -403,6 +441,22 @@ Reach for these before hand-rolling. Each row is *the thing you need* → *the p
403
441
 
404
442
  - `definePatrolOrder` (function) · `import { definePatrolOrder } from "@jgengine/core/world"`
405
443
 
444
+ ## perception-service — retain sight, sound, and damage observations with range, cone, occlusion, and decay policy
445
+
446
+ - `createPerception` (function) · `import { createPerception } from "@jgengine/core/sensor/perception"`
447
+
448
+ ## physics-backend — one interface over interchangeable rigid-body solvers — bodies, joints, raycast, shapecast, snapshot
449
+
450
+ - `PhysicsBackend` (interface) · `import { PhysicsBackend } from "@jgengine/core/physics/physicsBackend"`
451
+
452
+ ## physics-backend-conformance — the shared test contract a physics adapter runs to prove it matches the seam
453
+
454
+ - `runPhysicsBackendConformance` (function) · `import { runPhysicsBackendConformance } from "@jgengine/core/physics/physicsBackendConformance"`
455
+
456
+ ## physics-world-backend — the zero-dependency PhysicsWorld solver exposed through the PhysicsBackend seam
457
+
458
+ - `createPhysicsWorldBackend` (function) · `import { createPhysicsWorldBackend } from "@jgengine/core/physics/physicsWorldBackend"`
459
+
406
460
  ## piece-sockets-from-model — derive build-piece snap sockets from a model's named attach points
407
461
 
408
462
  - `pieceSocketsFromModel` (function) · `import { pieceSocketsFromModel } from "@jgengine/core/world/buildSockets"`
@@ -451,6 +505,14 @@ Reach for these before hand-rolling. Each row is *the thing you need* → *the p
451
505
 
452
506
  - `evaluateQteSequence` (function) · `import { evaluateQteSequence } from "@jgengine/core/world"`
453
507
 
508
+ ## rapier-physics-backend — native capsules, shapecasts, rotation, CCD, joints, and collision queries
509
+
510
+ - `createRapierBackend` (function) · `import { createRapierBackend } from "@jgengine/rapier"`
511
+
512
+ ## rate-window-policy — Evaluate deterministic request windows with retry timing.
513
+
514
+ - `decideRateWindow` (function) · `import { decideRateWindow } from "@jgengine/core/time/rateWindow"`
515
+
454
516
  ## reputation — faction standing that crosses named reputation tiers
455
517
 
456
518
  - `tierForStanding` (function) · `import { tierForStanding } from "@jgengine/core/world"`
@@ -560,6 +622,14 @@ Reach for these before hand-rolling. Each row is *the thing you need* → *the p
560
622
 
561
623
  - `surfaceRing` (function) · `import { surfaceRing } from "@jgengine/core/world"`
562
624
 
625
+ ## tactical-cover-points — derive cover candidates from navigation-mesh boundaries
626
+
627
+ - `coverPoints` (function) · `import { coverPoints } from "@jgengine/core/ai/tacticalQueries"`
628
+
629
+ ## tactical-position-score — rank bounded tactical positions with caller-defined weights
630
+
631
+ - `scorePositions` (function) · `import { scorePositions } from "@jgengine/core/ai/tacticalQueries"`
632
+
563
633
  ## target-acquirer — stateful held-target wrapper over an acquisition policy with retention
564
634
 
565
635
  - `createTargetAcquirer` (function) · `import { createTargetAcquirer } from "@jgengine/core/world"`
@@ -584,6 +654,30 @@ Reach for these before hand-rolling. Each row is *the thing you need* → *the p
584
654
 
585
655
  - `raycastHeightField` (function) · `import { raycastHeightField } from "@jgengine/core/world/terrain"`
586
656
 
657
+ ## territory-cell-chunk — Map ownership cells to persisted world chunks.
658
+
659
+ - `territoryChunkKey` (function) · `import { territoryChunkKey } from "@jgengine/core/world/territory"`
660
+
661
+ ## territory-footprint — Resolve exactly the ownership cells touched by a placement footprint.
662
+
663
+ - `territoryFootprintCells` (function) · `import { territoryFootprintCells } from "@jgengine/core/world/territory"`
664
+
665
+ ## territory-owner-query — Read a loaded land cell owner for authoritative placement checks.
666
+
667
+ - `territoryOwnerOf` (function) · `import { territoryOwnerOf } from "@jgengine/core/world/territory"`
668
+
669
+ ## territory-ownership — Claim, release and query land through host-owned snapshot storage.
670
+
671
+ - `createTerritory` (function) · `import { createTerritory } from "@jgengine/core/world/territory"`
672
+
673
+ ## territory-placement — Purchase footprint cells atomically with object placement.
674
+
675
+ - `placeWithTerritory` (function) · `import { placeWithTerritory } from "@jgengine/core/world/territory"`
676
+
677
+ ## territory-read-scope — Load the footprint and foreign-owner gap without scanning the world.
678
+
679
+ - `territoryChunkKeys` (function) · `import { territoryChunkKeys } from "@jgengine/core/world/territory"`
680
+
587
681
  ## touch-controls — switch the on-screen touch control set when gameplay context changes (enter/exit vehicle, mount, build mode)
588
682
 
589
683
  - `setTouchControlsMode` (function) · `import { setTouchControlsMode } from "@jgengine/core/input/touchControlsMode"`
@@ -601,6 +695,10 @@ Reach for these before hand-rolling. Each row is *the thing you need* → *the p
601
695
 
602
696
  - `resolveWalkerStep` (function) · `import { resolveWalkerStep } from "@jgengine/core/movement/solidObstacles"`
603
697
 
698
+ ## walker-solid-step-source — slide a step against solid geometry from a pure rules package
699
+
700
+ - `resolveSourceWalkerStep` (function) · `import { resolveSourceWalkerStep } from "@jgengine/core/movement/solidObstacles"`
701
+
604
702
  ## wave-runner — observable serializable wave/spawn runner over the seeded spawn director — WAVE N, wave progress, budget/alert readout, onSpawn sink, snapshot/restore
605
703
 
606
704
  - `createWaveRunner` (function) · `import { createWaveRunner } from "@jgengine/core/world"`
@@ -620,6 +718,10 @@ Reach for these before hand-rolling. Each row is *the thing you need* → *the p
620
718
  - `buildTrimmedIntersections` (function) · `import { buildTrimmedIntersections } from "@jgengine/core/world"`
621
719
  - `trimBandAtJunctions` (function) · `import { trimBandAtJunctions } from "@jgengine/core/world"`
622
720
 
721
+ ## world-physics-colliders — Synchronize terrain and authored static colliders with a physics backend.
722
+
723
+ - `syncWorldColliders` (function) · `import { syncWorldColliders } from "@jgengine/core/physics/worldColliders"`
724
+
623
725
  ## world-place — declare the place a game happens in — flat/round/voxel/board ground, surface laws, per-place physics
624
726
 
625
727
  - `world` (function) · `import { world } from "@jgengine/core/world"`