@rydr/game-sdk 1.12.0 → 1.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/protocol/version.d.ts +1 -1
- package/dist/protocol/version.js +1 -1
- package/dist/three/index.d.ts +9 -0
- package/dist/three/index.d.ts.map +1 -0
- package/dist/three/index.js +9 -0
- package/dist/three/index.js.map +1 -0
- package/dist/three/world-loader.d.ts +90 -0
- package/dist/three/world-loader.d.ts.map +1 -0
- package/dist/three/world-loader.js +138 -0
- package/dist/three/world-loader.js.map +1 -0
- package/package.json +15 -1
package/README.md
CHANGED
|
@@ -14,11 +14,11 @@ This package is the **public contract** between platform and game:
|
|
|
14
14
|
|
|
15
15
|
## Install
|
|
16
16
|
|
|
17
|
-
Public
|
|
17
|
+
Public npm package (no token needed — the source repo is private, the package is public):
|
|
18
18
|
|
|
19
19
|
```jsonc
|
|
20
20
|
// package.json
|
|
21
|
-
"dependencies": { "@rydr/game-sdk": "
|
|
21
|
+
"dependencies": { "@rydr/game-sdk": "^1.0.0" }
|
|
22
22
|
```
|
|
23
23
|
|
|
24
24
|
**Starting a new game?** Don't wire this by hand — scaffold from
|
|
@@ -8,5 +8,5 @@
|
|
|
8
8
|
*/
|
|
9
9
|
export declare const RYDR_PROTOCOL_VERSION: 5;
|
|
10
10
|
/** Semver of this SDK build. Sent in the handshake for telemetry/debugging. */
|
|
11
|
-
export declare const RYDR_SDK_VERSION = "1.
|
|
11
|
+
export declare const RYDR_SDK_VERSION = "1.14.0";
|
|
12
12
|
//# sourceMappingURL=version.d.ts.map
|
package/dist/protocol/version.js
CHANGED
|
@@ -10,5 +10,5 @@
|
|
|
10
10
|
// shells omit it, the client falls back to its default).
|
|
11
11
|
export const RYDR_PROTOCOL_VERSION = 5;
|
|
12
12
|
/** Semver of this SDK build. Sent in the handshake for telemetry/debugging. */
|
|
13
|
-
export const RYDR_SDK_VERSION = "1.
|
|
13
|
+
export const RYDR_SDK_VERSION = "1.14.0";
|
|
14
14
|
//# sourceMappingURL=version.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@rydr/game-sdk/three` — optional three.js helpers, kept out of the renderer-agnostic core.
|
|
3
|
+
*
|
|
4
|
+
* Importing this entry point requires `three` (declared as a peer dependency). Games that render a
|
|
5
|
+
* platform world should load it through {@link loadWorldGroup} here instead of hand-rolling a
|
|
6
|
+
* `GLTFLoader` + DRACO + caching per game.
|
|
7
|
+
*/
|
|
8
|
+
export * from "./world-loader.js";
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/three/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,cAAc,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@rydr/game-sdk/three` — optional three.js helpers, kept out of the renderer-agnostic core.
|
|
3
|
+
*
|
|
4
|
+
* Importing this entry point requires `three` (declared as a peer dependency). Games that render a
|
|
5
|
+
* platform world should load it through {@link loadWorldGroup} here instead of hand-rolling a
|
|
6
|
+
* `GLTFLoader` + DRACO + caching per game.
|
|
7
|
+
*/
|
|
8
|
+
export * from "./world-loader.js";
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/three/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,cAAc,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* world-loader — opinionated three.js helper for loading a platform {@link CoreWorld} into a scene.
|
|
3
|
+
*
|
|
4
|
+
* The SDK core ({@link applyWorld}) is deliberately renderer-agnostic: it walks a `CoreWorld` and calls
|
|
5
|
+
* back a `loadGlb(url)` you provide, never touching `three`. This module is the **three-aware layer on
|
|
6
|
+
* top** — it owns a `GLTFLoader` + DRACO decoder and the caching every game was otherwise copy-pasting,
|
|
7
|
+
* so it lives behind the optional `@rydr/game-sdk/three` entry point (with `three` as a peer
|
|
8
|
+
* dependency) and never burdens games that don't render 3D.
|
|
9
|
+
*
|
|
10
|
+
* ## A world is loaded once and reused
|
|
11
|
+
*
|
|
12
|
+
* A platform world is a static environment, so it is fetched, DRACO-decoded, uploaded to the GPU and
|
|
13
|
+
* shader-compiled **once** ({@link loadWorld}, cached by {@link CoreWorld.id}) and then reused — a game
|
|
14
|
+
* that tears down and rebuilds gameplay on every restart still gets an instant world. Two caches back
|
|
15
|
+
* this: a per-URL GLB dedup inside {@link createGlbLoader} (repeated props clone shared
|
|
16
|
+
* geometry/material instead of re-downloading), and the per-world {@link LoadedWorld} handle cache.
|
|
17
|
+
*
|
|
18
|
+
* ## The handle owns the GPU resources — disposal is safe
|
|
19
|
+
*
|
|
20
|
+
* {@link loadWorld} returns a {@link LoadedWorld} handle, the single owner of the world's GPU
|
|
21
|
+
* resources. Use `attach`/`detach` for the cheap per-restart show/hide, and `dispose` as the *only*
|
|
22
|
+
* way to free memory (it also evicts the cache). This makes the cache impossible to corrupt: there is
|
|
23
|
+
* no "remember to detach, never dispose the shared group" rule to get wrong.
|
|
24
|
+
*/
|
|
25
|
+
import * as THREE from "three";
|
|
26
|
+
import type { CoreWorld } from "../protocol/worlds.js";
|
|
27
|
+
/** DRACO decoder — pinned to the same version the platform world editor uses. */
|
|
28
|
+
export declare const DRACO_DECODER_PATH = "https://www.gstatic.com/draco/versioned/decoders/1.5.6/";
|
|
29
|
+
export interface GlbLoaderOptions {
|
|
30
|
+
/** Override the DRACO decoder directory (defaults to {@link DRACO_DECODER_PATH}). */
|
|
31
|
+
dracoDecoderPath?: string;
|
|
32
|
+
}
|
|
33
|
+
/** A transform applied to a loaded world group: translate · Y-rotation · uniform scale. */
|
|
34
|
+
export interface WorldPlacement {
|
|
35
|
+
position?: [number, number, number];
|
|
36
|
+
/** Y-axis rotation, radians. */
|
|
37
|
+
rotationY?: number;
|
|
38
|
+
/** Uniform scale. */
|
|
39
|
+
scale?: number;
|
|
40
|
+
}
|
|
41
|
+
export interface LoadWorldOptions extends GlbLoaderOptions {
|
|
42
|
+
/** Optional transform applied to the world group on every `loadWorld` call (incl. cache hits). */
|
|
43
|
+
placement?: WorldPlacement;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* A loaded platform world — the single owner of its GPU resources.
|
|
47
|
+
*
|
|
48
|
+
* Lifecycle: `attach(scene)` to show it, `detach()` to cheaply remove it (the per-restart op — keeps
|
|
49
|
+
* everything on the GPU), and `dispose()` to actually free its geometry/materials and evict it from
|
|
50
|
+
* the cache (real teardown, or switching to a different world). Never call `geometry.dispose()` on
|
|
51
|
+
* `group` yourself — the resources are shared with the cache; use `dispose()`.
|
|
52
|
+
*/
|
|
53
|
+
export interface LoadedWorld {
|
|
54
|
+
/** The {@link CoreWorld.id} this was built from. */
|
|
55
|
+
readonly id: string;
|
|
56
|
+
/** The assembled meshes. Cached/shared — manage its lifetime through this handle, don't dispose it. */
|
|
57
|
+
readonly group: THREE.Group;
|
|
58
|
+
/** Add the world to a scene (or any parent). Idempotent; re-attaching after `detach` is the cheap resume. */
|
|
59
|
+
attach(parent: THREE.Object3D): void;
|
|
60
|
+
/** Remove the world from its parent **without** freeing GPU resources — the cheap per-restart teardown. */
|
|
61
|
+
detach(): void;
|
|
62
|
+
/** Free geometry + materials and evict from the cache. For real teardown or switching worlds. */
|
|
63
|
+
dispose(): void;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* A `loadGlb` callback for {@link applyWorld}: fetches a glb by URL and resolves to its root scene.
|
|
67
|
+
*
|
|
68
|
+
* The returned closure shares one `GLTFLoader` + DRACO decoder across all URLs and fetches +
|
|
69
|
+
* DRACO-decodes each URL **once** — repeated URLs resolve to a lightweight `.clone()` (shared
|
|
70
|
+
* geometry/material) rather than re-downloading and re-decoding. Cloning is also required for
|
|
71
|
+
* correctness: `applyWorld` adds every returned object to the group, and a single Object3D can't be
|
|
72
|
+
* parented twice.
|
|
73
|
+
*/
|
|
74
|
+
export declare function createGlbLoader(opts?: GlbLoaderOptions): (url: string) => Promise<THREE.Object3D>;
|
|
75
|
+
/**
|
|
76
|
+
* Load (and cache by id) a platform world's meshes. Re-calling for the same `coreWorld.id` resolves to
|
|
77
|
+
* the **same** {@link LoadedWorld} handle instantly — no re-fetch / re-decode / re-upload — so games
|
|
78
|
+
* that rebuild gameplay on restart keep an instant world. `placement`, if given, is applied to the
|
|
79
|
+
* group on every call (cheap). Rejects if any glb fails to load.
|
|
80
|
+
*/
|
|
81
|
+
export declare function loadWorld(coreWorld: CoreWorld, opts?: LoadWorldOptions): Promise<LoadedWorld>;
|
|
82
|
+
/** Apply a {@link WorldPlacement} (translate · Y-rotation · uniform scale) to a group. */
|
|
83
|
+
export declare function applyPlacement(group: THREE.Object3D, placement: WorldPlacement): void;
|
|
84
|
+
/**
|
|
85
|
+
* Release cached worlds and dispose their geometry + materials (textures are left alone — they may be
|
|
86
|
+
* shared elsewhere). Pass an `id` to drop a single world, or omit it to clear everything. Equivalent
|
|
87
|
+
* to calling `dispose()` on the matching handle(s); use it when you don't hold the handle.
|
|
88
|
+
*/
|
|
89
|
+
export declare function clearWorldCache(id?: string): void;
|
|
90
|
+
//# sourceMappingURL=world-loader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"world-loader.d.ts","sourceRoot":"","sources":["../../src/three/world-loader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAEvD,iFAAiF;AACjF,eAAO,MAAM,kBAAkB,4DAA4D,CAAC;AAE5F,MAAM,WAAW,gBAAgB;IAC/B,qFAAqF;IACrF,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+
* world-loader — opinionated three.js helper for loading a platform {@link CoreWorld} into a scene.
|
|
3
|
+
*
|
|
4
|
+
* The SDK core ({@link applyWorld}) is deliberately renderer-agnostic: it walks a `CoreWorld` and calls
|
|
5
|
+
* back a `loadGlb(url)` you provide, never touching `three`. This module is the **three-aware layer on
|
|
6
|
+
* top** — it owns a `GLTFLoader` + DRACO decoder and the caching every game was otherwise copy-pasting,
|
|
7
|
+
* so it lives behind the optional `@rydr/game-sdk/three` entry point (with `three` as a peer
|
|
8
|
+
* dependency) and never burdens games that don't render 3D.
|
|
9
|
+
*
|
|
10
|
+
* ## A world is loaded once and reused
|
|
11
|
+
*
|
|
12
|
+
* A platform world is a static environment, so it is fetched, DRACO-decoded, uploaded to the GPU and
|
|
13
|
+
* shader-compiled **once** ({@link loadWorld}, cached by {@link CoreWorld.id}) and then reused — a game
|
|
14
|
+
* that tears down and rebuilds gameplay on every restart still gets an instant world. Two caches back
|
|
15
|
+
* this: a per-URL GLB dedup inside {@link createGlbLoader} (repeated props clone shared
|
|
16
|
+
* geometry/material instead of re-downloading), and the per-world {@link LoadedWorld} handle cache.
|
|
17
|
+
*
|
|
18
|
+
* ## The handle owns the GPU resources — disposal is safe
|
|
19
|
+
*
|
|
20
|
+
* {@link loadWorld} returns a {@link LoadedWorld} handle, the single owner of the world's GPU
|
|
21
|
+
* resources. Use `attach`/`detach` for the cheap per-restart show/hide, and `dispose` as the *only*
|
|
22
|
+
* way to free memory (it also evicts the cache). This makes the cache impossible to corrupt: there is
|
|
23
|
+
* no "remember to detach, never dispose the shared group" rule to get wrong.
|
|
24
|
+
*/
|
|
25
|
+
import * as THREE from "three";
|
|
26
|
+
import { GLTFLoader } from "three/addons/loaders/GLTFLoader.js";
|
|
27
|
+
import { DRACOLoader } from "three/addons/loaders/DRACOLoader.js";
|
|
28
|
+
import { applyWorld } from "../world-runtime.js";
|
|
29
|
+
/** DRACO decoder — pinned to the same version the platform world editor uses. */
|
|
30
|
+
export const DRACO_DECODER_PATH = "https://www.gstatic.com/draco/versioned/decoders/1.5.6/";
|
|
31
|
+
/**
|
|
32
|
+
* A `loadGlb` callback for {@link applyWorld}: fetches a glb by URL and resolves to its root scene.
|
|
33
|
+
*
|
|
34
|
+
* The returned closure shares one `GLTFLoader` + DRACO decoder across all URLs and fetches +
|
|
35
|
+
* DRACO-decodes each URL **once** — repeated URLs resolve to a lightweight `.clone()` (shared
|
|
36
|
+
* geometry/material) rather than re-downloading and re-decoding. Cloning is also required for
|
|
37
|
+
* correctness: `applyWorld` adds every returned object to the group, and a single Object3D can't be
|
|
38
|
+
* parented twice.
|
|
39
|
+
*/
|
|
40
|
+
export function createGlbLoader(opts = {}) {
|
|
41
|
+
const loader = new GLTFLoader();
|
|
42
|
+
const draco = new DRACOLoader();
|
|
43
|
+
draco.setDecoderPath(opts.dracoDecoderPath ?? DRACO_DECODER_PATH);
|
|
44
|
+
loader.setDRACOLoader(draco);
|
|
45
|
+
const decoded = new Map();
|
|
46
|
+
return (url) => {
|
|
47
|
+
let p = decoded.get(url);
|
|
48
|
+
if (!p) {
|
|
49
|
+
p = loader.loadAsync(url).then((g) => g.scene);
|
|
50
|
+
decoded.set(url, p);
|
|
51
|
+
}
|
|
52
|
+
return p.then((scene) => scene.clone());
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
/** Loaded worlds, keyed by {@link CoreWorld.id}. See the module doc for the lifecycle contract. */
|
|
56
|
+
const worldCache = new Map();
|
|
57
|
+
/**
|
|
58
|
+
* Load (and cache by id) a platform world's meshes. Re-calling for the same `coreWorld.id` resolves to
|
|
59
|
+
* the **same** {@link LoadedWorld} handle instantly — no re-fetch / re-decode / re-upload — so games
|
|
60
|
+
* that rebuild gameplay on restart keep an instant world. `placement`, if given, is applied to the
|
|
61
|
+
* group on every call (cheap). Rejects if any glb fails to load.
|
|
62
|
+
*/
|
|
63
|
+
export function loadWorld(coreWorld, opts = {}) {
|
|
64
|
+
let p = worldCache.get(coreWorld.id);
|
|
65
|
+
if (!p) {
|
|
66
|
+
p = buildWorld(coreWorld, opts);
|
|
67
|
+
// Don't cache a rejected build — let the next attempt retry the fetch.
|
|
68
|
+
p.catch(() => {
|
|
69
|
+
if (worldCache.get(coreWorld.id) === p)
|
|
70
|
+
worldCache.delete(coreWorld.id);
|
|
71
|
+
});
|
|
72
|
+
worldCache.set(coreWorld.id, p);
|
|
73
|
+
}
|
|
74
|
+
return p.then((world) => {
|
|
75
|
+
if (opts.placement)
|
|
76
|
+
applyPlacement(world.group, opts.placement);
|
|
77
|
+
return world;
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
async function buildWorld(coreWorld, opts) {
|
|
81
|
+
const group = new THREE.Group();
|
|
82
|
+
group.name = "platform-world";
|
|
83
|
+
await applyWorld(group, coreWorld, { loadGlb: createGlbLoader(opts) });
|
|
84
|
+
const id = coreWorld.id;
|
|
85
|
+
return {
|
|
86
|
+
id,
|
|
87
|
+
group,
|
|
88
|
+
attach: (parent) => void parent.add(group),
|
|
89
|
+
detach: () => void group.removeFromParent(),
|
|
90
|
+
dispose: () => {
|
|
91
|
+
disposeGroup(group);
|
|
92
|
+
if (worldCache.has(id))
|
|
93
|
+
worldCache.delete(id);
|
|
94
|
+
},
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
/** Apply a {@link WorldPlacement} (translate · Y-rotation · uniform scale) to a group. */
|
|
98
|
+
export function applyPlacement(group, placement) {
|
|
99
|
+
if (placement.position)
|
|
100
|
+
group.position.fromArray(placement.position);
|
|
101
|
+
if (placement.rotationY !== undefined)
|
|
102
|
+
group.rotation.y = placement.rotationY;
|
|
103
|
+
if (placement.scale !== undefined)
|
|
104
|
+
group.scale.setScalar(placement.scale);
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Release cached worlds and dispose their geometry + materials (textures are left alone — they may be
|
|
108
|
+
* shared elsewhere). Pass an `id` to drop a single world, or omit it to clear everything. Equivalent
|
|
109
|
+
* to calling `dispose()` on the matching handle(s); use it when you don't hold the handle.
|
|
110
|
+
*/
|
|
111
|
+
export function clearWorldCache(id) {
|
|
112
|
+
const drop = (key, promise) => {
|
|
113
|
+
worldCache.delete(key);
|
|
114
|
+
void promise.then((w) => disposeGroup(w.group)).catch(() => { });
|
|
115
|
+
};
|
|
116
|
+
if (id !== undefined) {
|
|
117
|
+
const p = worldCache.get(id);
|
|
118
|
+
if (p)
|
|
119
|
+
drop(id, p);
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
for (const [key, p] of worldCache)
|
|
123
|
+
drop(key, p);
|
|
124
|
+
}
|
|
125
|
+
/** Remove a group from its parent and dispose its geometry + materials (not textures). */
|
|
126
|
+
function disposeGroup(group) {
|
|
127
|
+
group.removeFromParent();
|
|
128
|
+
group.traverse((o) => {
|
|
129
|
+
const mesh = o;
|
|
130
|
+
if (!mesh.isMesh)
|
|
131
|
+
return;
|
|
132
|
+
mesh.geometry?.dispose();
|
|
133
|
+
for (const m of Array.isArray(mesh.material) ? mesh.material : [mesh.material]) {
|
|
134
|
+
m?.dispose();
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
//# sourceMappingURL=world-loader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"world-loader.js","sourceRoot":"","sources":["../../src/three/world-loader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAGjD,iFAAiF;AACjF,MAAM,CAAC,MAAM,kBAAkB,GAAG,yDAAyD,CAAC;AA0C5F;;;;;;;;GAQG;AACH,MAAM,UAAU,eAAe,CAAC,OAAyB,EAAE;IACzD,MAAM,MAAM,GAAG,IAAI,UAAU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AQ,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC9E,CAAgC,EAAE,OAAO,EAAE,CAAC;QAC/C,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rydr/game-sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.14.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/bdefrenne/rydr-game-sdk.git"
|
|
@@ -15,6 +15,10 @@
|
|
|
15
15
|
".": {
|
|
16
16
|
"types": "./dist/index.d.ts",
|
|
17
17
|
"import": "./dist/index.js"
|
|
18
|
+
},
|
|
19
|
+
"./three": {
|
|
20
|
+
"types": "./dist/three/index.d.ts",
|
|
21
|
+
"import": "./dist/three/index.js"
|
|
18
22
|
}
|
|
19
23
|
},
|
|
20
24
|
"main": "./dist/index.js",
|
|
@@ -32,7 +36,17 @@
|
|
|
32
36
|
"version": "node scripts/sync-version.mjs && node scripts/release-changelog.mjs && git add src/protocol/version.ts CHANGELOG.md",
|
|
33
37
|
"postversion": "git push --follow-tags"
|
|
34
38
|
},
|
|
39
|
+
"peerDependencies": {
|
|
40
|
+
"three": ">=0.160.0"
|
|
41
|
+
},
|
|
42
|
+
"peerDependenciesMeta": {
|
|
43
|
+
"three": {
|
|
44
|
+
"optional": true
|
|
45
|
+
}
|
|
46
|
+
},
|
|
35
47
|
"devDependencies": {
|
|
48
|
+
"@types/three": "^0.184.0",
|
|
49
|
+
"three": "^0.184.0",
|
|
36
50
|
"typescript": "^5.5.0"
|
|
37
51
|
}
|
|
38
52
|
}
|