@series-inc/rundot-syncplay 5.28.0-beta.4 → 6.0.0-rc.2
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/README.md +56 -13
- package/core/baker.d.ts +14 -0
- package/core/build-native.d.ts +3 -0
- package/core/build-wasm-physics.d.ts +6 -0
- package/core/compiler.d.ts +4 -0
- package/core/deterministic-math.d.ts +2 -0
- package/core/envelope.d.ts +8 -0
- package/core/f64-bits.d.ts +4 -0
- package/core/index.d.ts +1 -52
- package/core/native/kinetix-native-main.cpp +8 -11
- package/core/native/physics/abi.cpp +634 -2
- package/core/native/physics/abi.hpp +9 -0
- package/core/native/physics/constraint_rows.cpp +564 -0
- package/core/native/physics/constraint_rows.hpp +151 -0
- package/core/native/physics/physics.cpp +4415 -1222
- package/core/native/physics/physics.hpp +263 -5
- package/core/native/physics/topology.cpp +1107 -0
- package/core/native/physics/topology.hpp +237 -0
- package/core/native/physics/world.cpp +2722 -0
- package/core/native/physics/world.hpp +283 -0
- package/core/native/physics/world_abi.cpp +1354 -0
- package/core/native/physics/world_abi.hpp +252 -0
- package/core/native/physics2d/buoyancy.cpp +885 -0
- package/core/native/physics2d/buoyancy.hpp +119 -0
- package/core/native/physics2d/commands.cpp +1058 -0
- package/core/native/physics2d/commands.hpp +163 -0
- package/core/native/physics2d/fluid.cpp +878 -0
- package/core/native/physics2d/fluid.hpp +260 -0
- package/core/native/physics2d/joints.cpp +2534 -0
- package/core/native/physics2d/joints.hpp +669 -0
- package/core/native/physics2d/owned_abi.cpp +1327 -0
- package/core/native/physics2d/owned_abi.hpp +487 -0
- package/core/native/physics2d/physics2d.cpp +3046 -0
- package/core/native/physics2d/physics2d.hpp +489 -0
- package/core/native/physics2d/queries.cpp +2343 -0
- package/core/native/physics2d/queries.hpp +337 -0
- package/core/native/physics2d/world.cpp +2150 -0
- package/core/native/physics2d/world.hpp +230 -0
- package/core/native/wasm_runtime.cpp +4 -0
- package/core/native-product.d.ts +4 -0
- package/core/physics2d-owned.d.ts +417 -0
- package/core/render-projection.d.ts +3 -0
- package/core/render-records.d.ts +8 -0
- package/core/runtime.d.ts +39 -0
- package/core/scripts/build-native.mjs +40 -5
- package/core/scripts/build-wasm-physics.mjs +331 -104
- package/core/src/index.mjs +0 -32
- package/core/src/kinetix-product-contract.mjs +2 -0
- package/core/src/kinetix-runtime-adapter-utils.mjs +325 -47
- package/core/src/physics/abi-constants.mjs +10 -0
- package/core/src/physics/box3d-probe.mjs +41 -26
- package/core/src/physics/index.mjs +365 -532
- package/core/src/physics/mass-properties.mjs +18 -1
- package/core/src/physics/physics-wasm-module.generated.mjs +8 -6
- package/core/src/physics/wasm-instance.mjs +103 -0
- package/core/src/physics/world.d.mts +15 -0
- package/core/src/physics/world.mjs +1166 -0
- package/core/src/physics2d/body-state.mjs +249 -0
- package/core/src/physics2d/joint-output-state.mjs +295 -0
- package/core/src/physics2d/joint-state.mjs +1032 -0
- package/core/src/physics2d/owned-queries.mjs +54 -0
- package/core/src/physics2d/owned-transport.mjs +1338 -0
- package/core/src/physics2d/owned-world.d.mts +9 -0
- package/core/src/physics2d/owned-world.mjs +1047 -0
- package/core/src/physics2d/physics2d-wasm-module.generated.mjs +53 -0
- package/core/src/physics2d/query-codec.mjs +305 -0
- package/core/src/physics2d/wasm-instance.mjs +52 -0
- package/core/src/runtime.mjs +5 -1
- package/core/world-kernel.d.ts +3 -0
- package/core/world.d.ts +209 -0
- package/dist/api-deprecations.generated.d.ts +38 -0
- package/dist/api-deprecations.generated.js +39 -0
- package/dist/api-diagnostics.d.ts +11 -0
- package/dist/api-diagnostics.js +25 -0
- package/dist/browser.d.ts +2 -16
- package/dist/browser.js +0 -7
- package/dist/creator.d.ts +1 -10
- package/dist/creator.js +1 -9
- package/dist/errors.d.ts +7 -0
- package/dist/errors.js +4 -4
- package/dist/index.d.ts +3 -21
- package/dist/index.js +0 -9
- package/dist/lag-compensation3d.d.ts +22 -11
- package/dist/lag-compensation3d.js +70 -48
- package/dist/modules/combat.d.ts +7 -5
- package/dist/modules/combat.js +19 -12
- package/dist/modules/entity-registry.d.ts +1 -0
- package/dist/movement3d.d.ts +13 -13
- package/dist/movement3d.js +223 -221
- package/dist/networked-client.d.ts +13 -6
- package/dist/networked-client.js +228 -99
- package/dist/node.d.ts +0 -2
- package/dist/node.js +0 -1
- package/dist/physics/2d.d.ts +79 -0
- package/dist/physics/2d.js +219 -0
- package/dist/physics/3d.d.ts +282 -0
- package/dist/physics/3d.js +574 -0
- package/dist/runner.d.ts +41 -2
- package/dist/runner.js +341 -33
- package/dist/runtime-lease.d.ts +16 -0
- package/dist/runtime-lease.js +77 -0
- package/dist/state-digest.d.ts +28 -0
- package/dist/state-digest.js +83 -0
- package/package.json +89 -36
- package/core/native/mobile/syncplay_native_probe.cpp +0 -114
- package/core/native/mobile/syncplay_native_probe_abi.h +0 -46
- package/core/physics.d.ts +0 -422
- package/core/scripts/build-mobile-native.mjs +0 -101
- package/dist/collider-cooking.d.ts +0 -141
- package/dist/collider-cooking.js +0 -829
- package/dist/cosmetic-physics3d.d.ts +0 -41
- package/dist/cosmetic-physics3d.js +0 -196
- package/dist/debug-wireframe.d.ts +0 -22
- package/dist/debug-wireframe.js +0 -226
- package/dist/engine-core-proof.d.ts +0 -26
- package/dist/engine-core-proof.js +0 -66
- package/dist/physics-cert.d.ts +0 -40
- package/dist/physics-cert.js +0 -535
- package/dist/physics2d.d.ts +0 -142
- package/dist/physics2d.js +0 -747
- package/dist/physics3d-destruction-cert.d.ts +0 -35
- package/dist/physics3d-destruction-cert.js +0 -283
- package/dist/physics3d-heightfield.d.ts +0 -27
- package/dist/physics3d-heightfield.js +0 -80
- package/dist/physics3d-hull.d.ts +0 -67
- package/dist/physics3d-hull.js +0 -421
- package/dist/physics3d-joints.d.ts +0 -115
- package/dist/physics3d-joints.js +0 -1005
- package/dist/physics3d-mass.d.ts +0 -11
- package/dist/physics3d-mass.js +0 -126
- package/dist/physics3d-recipes.d.ts +0 -29
- package/dist/physics3d-recipes.js +0 -193
- package/dist/physics3d-solver.d.ts +0 -326
- package/dist/physics3d-solver.js +0 -2499
- package/dist/physics3d-stacking.d.ts +0 -26
- package/dist/physics3d-stacking.js +0 -147
- package/dist/physics3d-toi.d.ts +0 -79
- package/dist/physics3d-toi.js +0 -267
- package/dist/physics3d-vehicle.d.ts +0 -84
- package/dist/physics3d-vehicle.js +0 -488
- package/dist/physics3d-voxel.d.ts +0 -131
- package/dist/physics3d-voxel.js +0 -819
- package/dist/physics3d.d.ts +0 -544
- package/dist/physics3d.js +0 -4078
- package/dist/sample-scenes.d.ts +0 -86
- package/dist/sample-scenes.js +0 -732
package/README.md
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
# RUN Syncplay
|
|
2
2
|
|
|
3
|
-
Syncplay is the orchestration layer over a signed deterministic runtime.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
late join, secrets, and transport.
|
|
3
|
+
Syncplay is the orchestration layer over a signed deterministic runtime. Public
|
|
4
|
+
runtime utilities use the `/core` subpaths. Public physics uses `/physics/2d`
|
|
5
|
+
and `/physics/3d`. Both physics APIs use the canonical C++ core compiled to
|
|
6
|
+
WASM. Syncplay owns inputs, prediction, confirmation, rollback policy, replay
|
|
7
|
+
logs, late join, secrets, and transport.
|
|
9
8
|
|
|
10
9
|
## Installation
|
|
11
10
|
|
|
@@ -134,7 +133,8 @@ The published JavaScript graph has a committed exhaustive side-effect audit.
|
|
|
134
133
|
effects and are preserved through the package's precise `sideEffects` allowlist.
|
|
135
134
|
|
|
136
135
|
> **Upgrading an existing game?** See
|
|
137
|
-
> [
|
|
136
|
+
> [the RC1 migration guide](https://github.com/series-ai/venus/blob/develop/packages/sdk-docs/rundot-developer-platform/api/SYNCPLAY-RC1-MIGRATION.md)
|
|
137
|
+
> and [the session primitive guide](https://github.com/series-ai/venus/blob/develop/packages/syncplay/MIGRATING-SESSION-PRIMITIVES.md). Two
|
|
138
138
|
> changes are not additive: the runner now rejects an unsafe input codec at
|
|
139
139
|
> construction, and the effects adapter now dedupes on your event `dedupeKey`.
|
|
140
140
|
|
|
@@ -158,8 +158,9 @@ dependency float cannot keep the same engine hash.
|
|
|
158
158
|
| Subpath | Role |
|
|
159
159
|
|---------|------|
|
|
160
160
|
| `/core/runtime` | `createInstalledRuntimeAdapter`, identity helpers |
|
|
161
|
-
| `/
|
|
162
|
-
|
|
|
161
|
+
| `/physics/2d` | Canonical TypeScript 2D API over the C++/WASM core |
|
|
162
|
+
| `/physics/3d` | Canonical TypeScript 3D API over the C++/WASM core |
|
|
163
|
+
| `/` or `/browser` | Runner, session, and 3D character movement |
|
|
163
164
|
| `/testing` | Simulated multi-peer / synctest |
|
|
164
165
|
| `/node` | Authority room helpers (not for browser bundles) |
|
|
165
166
|
|
|
@@ -298,14 +299,22 @@ const runner = createSyncplayRunner({
|
|
|
298
299
|
events: (frame) => frame.events,
|
|
299
300
|
},
|
|
300
301
|
})
|
|
301
|
-
runner.
|
|
302
|
-
|
|
302
|
+
await runner.start({
|
|
303
|
+
mode: 'offline', identity, sessionConfigBytes, playerCount: 2, botInputForTick,
|
|
304
|
+
})
|
|
303
305
|
runner.applyInput(readInput())
|
|
304
306
|
runner.update(deltaMs)
|
|
305
307
|
render(runner.getRenderState(), runner.renderAlpha)
|
|
308
|
+
runner.stop()
|
|
309
|
+
await runner.start({
|
|
310
|
+
mode: 'networked',
|
|
311
|
+
connect: (signal) => createSyncplayRoom(api.realtime, roomOptions, signal),
|
|
312
|
+
})
|
|
313
|
+
runner.dispose()
|
|
306
314
|
```
|
|
307
315
|
|
|
308
|
-
|
|
316
|
+
`runner.lifecycle` reports `idle | starting | running | stopped | failed |
|
|
317
|
+
disposed`. The existing `status` field remains available for display state:
|
|
309
318
|
|
|
310
319
|
- `connecting` covers the room-open promise.
|
|
311
320
|
- `syncing` covers session-descriptor/asset preparation, reconnect, and catch-up.
|
|
@@ -314,7 +323,13 @@ render(runner.getRenderState(), runner.renderAlpha)
|
|
|
314
323
|
- `error` carries connection, preparation, and offline-construction failures on
|
|
315
324
|
the runner snapshot (and the throw is rethrown to the caller).
|
|
316
325
|
- `stop` aborts preparation, closes the transport, and disposes the active
|
|
317
|
-
client/session
|
|
326
|
+
client/session. `stop` and `dispose` are idempotent. `dispose` is terminal.
|
|
327
|
+
|
|
328
|
+
The runtime factory can return a runtime or a promise. A direct runtime is
|
|
329
|
+
borrowed. The runner does not dispose it. Return `{ runtime, dispose }` to give
|
|
330
|
+
the runner an owned lease. Cleanup releases session checkpoints before the
|
|
331
|
+
lease. Cancellation also cleans a late owned lease or transport. The old
|
|
332
|
+
`startOffline` and `startNetworked` methods remain as compatibility methods.
|
|
318
333
|
|
|
319
334
|
Presentation stays **predicted** for render motion, while side-effect events are
|
|
320
335
|
delivered only from authority-confirmed frames received after the first live
|
|
@@ -432,3 +447,31 @@ over a deterministic simulated network (`createSimulatedSyncplayMatch`,
|
|
|
432
447
|
and `assertPresentationParity` cover the runner seam — a real runner driven on
|
|
433
448
|
a fully controlled clock against the simulated match. Failures name the phase,
|
|
434
449
|
frame, and disagreeing checksums.
|
|
450
|
+
|
|
451
|
+
## Physics API v1
|
|
452
|
+
|
|
453
|
+
Syncplay RC1 has one public TypeScript API for each physics dimension. Import
|
|
454
|
+
2D physics from `@series-inc/rundot-syncplay/physics/2d`. Import 3D physics from
|
|
455
|
+
`@series-inc/rundot-syncplay/physics/3d`. Do not import a raw physics adapter
|
|
456
|
+
from `/core`.
|
|
457
|
+
|
|
458
|
+
Call `initPhysics2D()` or `initPhysics3D()` before world creation. Create an
|
|
459
|
+
owned world with `createPhysicsWorld2D()` or `createPhysicsWorld3D()`. Each
|
|
460
|
+
world provides fixed stepping, atomic edits, retained queries, opaque native
|
|
461
|
+
checkpoints, portable checkpoint bytes, a state digest, and explicit disposal.
|
|
462
|
+
|
|
463
|
+
The TypeScript facade does not contain a second solver. Both dimensions run in
|
|
464
|
+
the canonical C++ core compiled to WASM. The internal solver algorithm, state
|
|
465
|
+
layout, WASM boundary, schedule, and checkpoint representation can change when
|
|
466
|
+
a complete benchmark proves a faster design. Each replacement must keep the
|
|
467
|
+
public contract, deterministic results, rollback controls, and bounded memory.
|
|
468
|
+
|
|
469
|
+
RC1 starts a new physics numeric epoch. Do not load a beta physics checkpoint
|
|
470
|
+
or replay into an RC1 world. Change the game deterministic version. Start new
|
|
471
|
+
rollback, replay, and late-join history.
|
|
472
|
+
|
|
473
|
+
Read the [2D guide](https://github.com/series-ai/venus/blob/develop/packages/sdk-docs/rundot-developer-platform/api/SYNCPLAY-PHYSICS-2D.md),
|
|
474
|
+
the [3D guide](https://github.com/series-ai/venus/blob/develop/packages/sdk-docs/rundot-developer-platform/api/SYNCPLAY-PHYSICS.md), and
|
|
475
|
+
the [RC1 migration helper](https://github.com/series-ai/venus/blob/develop/packages/sdk-docs/rundot-developer-platform/api/SYNCPLAY-RC1-MIGRATION.md).
|
|
476
|
+
Physical-phone performance remains a release gate. Do not infer phone results
|
|
477
|
+
from desktop measurements.
|
package/core/baker.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Generated. Declares the runtime exports of ./core/baker.
|
|
2
|
+
|
|
3
|
+
export declare function assertKinetixProductContract(products: any): any;
|
|
4
|
+
export declare function assertKinetixRuntimeIdentityMatchesProducts(products: any, identity: any): any;
|
|
5
|
+
export declare function bakeKinetixEnvelope(envelope: any, installedProfiles: any): any;
|
|
6
|
+
export declare function deriveCustomRuntimeIdentity(options: any): any;
|
|
7
|
+
export declare function deriveKinetixRuntimeIdentity(products: any, runtimeContract?: any): any;
|
|
8
|
+
export declare const kinetixBakerVersion: "rundot.kinetix-baker.v1";
|
|
9
|
+
export declare const kinetixPhases: readonly ["initialization", "fixed-simulation", "post-simulation", "presentation-projection", "presentation"];
|
|
10
|
+
export declare function kinetixRuntimeModuleManifest(sourceRoot: any, relativePaths: any): any;
|
|
11
|
+
export declare function scanKinetixPayloadTree(value: any): any;
|
|
12
|
+
export declare function stableKinetixProductBytes(products: any): any;
|
|
13
|
+
export declare function stableKinetixSourceBytes(envelope: any): any;
|
|
14
|
+
export declare function validateInstalledKinetixProfile(profileId: any, profile: any): any;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// Generated. Declares the runtime exports of ./core/build-wasm-physics.
|
|
2
|
+
|
|
3
|
+
export declare function buildWasmPhysics(options?: any): any;
|
|
4
|
+
export declare function buildWasmPhysics2D(options?: any): any;
|
|
5
|
+
export declare function getWasmNumericProfile(arg0?: any): any;
|
|
6
|
+
export declare function getWasmPhysicsSourceHashes(): any;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// Generated. Declares the runtime exports of ./core/envelope.
|
|
2
|
+
|
|
3
|
+
export declare const kinetixDomains: readonly ["simulation", "presentation", "binding"];
|
|
4
|
+
export declare function kinetixEnvelopeDigest(envelope: any): any;
|
|
5
|
+
export declare const kinetixEnvelopeVersion: "rundot.kinetix-envelope.v1";
|
|
6
|
+
export declare const kinetixReferenceKinds: readonly ["entity", "component", "prefab", "prefab-local-entity", "prefab-local-component", "asset", "scene"];
|
|
7
|
+
export declare function stableKinetixEnvelopeBytes(envelope: any): any;
|
|
8
|
+
export declare function validateKinetixEnvelope(envelope: any): any;
|
package/core/index.d.ts
CHANGED
|
@@ -31,58 +31,6 @@ export {
|
|
|
31
31
|
createDeterministicMath,
|
|
32
32
|
DeterministicRandom,
|
|
33
33
|
} from './deterministic-stdlib';
|
|
34
|
-
export {
|
|
35
|
-
applyDeterministicImpulse3D,
|
|
36
|
-
applyDeterministicImpulses3D,
|
|
37
|
-
applyDeterministicWorldEdit3D,
|
|
38
|
-
applyPhysicsImpulse,
|
|
39
|
-
applyPhysicsImpulses,
|
|
40
|
-
applyPhysicsWorldEdit,
|
|
41
|
-
createPhysicsWorld,
|
|
42
|
-
createDeterministicPhysicsWorld3D,
|
|
43
|
-
createTrustedDeterministicPhysicsWorld3D,
|
|
44
|
-
cookPhysicsCollider,
|
|
45
|
-
contactDetailsDeterministicPhysics3D,
|
|
46
|
-
contactDetailsPhysics,
|
|
47
|
-
initPhysics,
|
|
48
|
-
initPhysics3D,
|
|
49
|
-
overlapDeterministicPhysics3D,
|
|
50
|
-
overlapPhysics,
|
|
51
|
-
physicsReady,
|
|
52
|
-
physics3DReady,
|
|
53
|
-
physicsWasmMetadata,
|
|
54
|
-
raycastDeterministicPhysics3D,
|
|
55
|
-
raycastDeterministicPhysics3DDetailed,
|
|
56
|
-
raycastPhysics,
|
|
57
|
-
raycastPhysicsDetailed,
|
|
58
|
-
resetPhysics3DCache,
|
|
59
|
-
setDeterministicBodyVelocity3D,
|
|
60
|
-
setPhysicsBodyVelocity,
|
|
61
|
-
shapeCastDeterministicPhysics3D,
|
|
62
|
-
shapeCastPhysics,
|
|
63
|
-
stepPhysicsWorld,
|
|
64
|
-
stepDeterministicPhysicsWorld3D,
|
|
65
|
-
} from './physics';
|
|
66
|
-
export type {
|
|
67
|
-
KinetixPhysicsActivePair,
|
|
68
|
-
KinetixPhysicsBody,
|
|
69
|
-
KinetixPhysicsContactCacheEntry,
|
|
70
|
-
KinetixPhysicsContactDetail,
|
|
71
|
-
KinetixPhysicsContactEvent,
|
|
72
|
-
KinetixPhysicsHit,
|
|
73
|
-
KinetixPhysicsJointCacheEntry,
|
|
74
|
-
KinetixPhysicsOverlapQuery,
|
|
75
|
-
KinetixPhysicsQuaternion,
|
|
76
|
-
KinetixPhysicsQueryOptions,
|
|
77
|
-
KinetixPhysicsRaycastQuery,
|
|
78
|
-
KinetixPhysicsScheduledQuery,
|
|
79
|
-
KinetixPhysicsShape,
|
|
80
|
-
KinetixPhysicsShapeCastQuery,
|
|
81
|
-
KinetixPhysicsStepOptions,
|
|
82
|
-
KinetixPhysicsStepResult,
|
|
83
|
-
KinetixPhysicsVec3,
|
|
84
|
-
KinetixPhysicsWorld,
|
|
85
|
-
} from './physics';
|
|
86
34
|
export type {
|
|
87
35
|
DeterministicMathApi,
|
|
88
36
|
DeterministicQuaternion,
|
|
@@ -277,6 +225,7 @@ export function deriveCustomRuntimeIdentity(
|
|
|
277
225
|
): import('./runtime').KinetixRuntimeIdentity;
|
|
278
226
|
export const kinetixBakerVersion: string;
|
|
279
227
|
export const kinetixPhases: readonly string[];
|
|
228
|
+
export const kinetixProductKinds: readonly ['simulation', 'presentation', 'binding'];
|
|
280
229
|
|
|
281
230
|
export function createKinetixWorld(options: {
|
|
282
231
|
worldId: string;
|
|
@@ -273,17 +273,14 @@ int runPhysicsSession() {
|
|
|
273
273
|
<< " status=" << status << '\n';
|
|
274
274
|
return 2;
|
|
275
275
|
}
|
|
276
|
-
const std::uint32_t
|
|
277
|
-
const double*
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
for (std::uint32_t field = 0; field < rundot::kinetix::physics::kContactCacheStride; field += 1) {
|
|
285
|
-
target[field] = source[field];
|
|
286
|
-
}
|
|
276
|
+
const std::uint32_t contactCount = rundot::kinetix::physics::contactCacheCount();
|
|
277
|
+
const double* cacheData = rundot::kinetix::physics::contactCacheData();
|
|
278
|
+
if (contactCount == 0) {
|
|
279
|
+
contactCache.clear();
|
|
280
|
+
} else {
|
|
281
|
+
contactCache.assign(cacheData, cacheData
|
|
282
|
+
+ static_cast<std::size_t>(contactCount)
|
|
283
|
+
* rundot::kinetix::physics::kContactCacheStride);
|
|
287
284
|
}
|
|
288
285
|
for (std::uint32_t bodyIndex = 0; bodyIndex < bodyCount; bodyIndex += 1) {
|
|
289
286
|
const std::size_t offset = static_cast<std::size_t>(bodyIndex) * stride;
|