oriverse-engine 0.1.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.
- package/LICENSE.md +30 -0
- package/README.md +76 -0
- package/dist/AGENT_ONBOARDING.md +74 -0
- package/dist/CODEX_PROMPT.md +108 -0
- package/dist/GAME_AUTHORING.md +512 -0
- package/dist/examples/coin_collector.weave +70 -0
- package/dist/examples/dodge_blocks.weave +70 -0
- package/dist/examples/target_range.weave +82 -0
- package/dist/ktx_bridge.js +121 -0
- package/dist/ktx_lib.js +5236 -0
- package/dist/ktx_lib.wasm +0 -0
- package/dist/oriverse_wgpu.d.ts +174 -0
- package/dist/oriverse_wgpu.js +3361 -0
- package/dist/oriverse_wgpu_bg.wasm +0 -0
- package/dist/oriverse_wgpu_bg.wasm.d.ts +73 -0
- package/dist/snippets/oriverse_market_client-0cd3013288f3c49c/inline0.js +30 -0
- package/dist/snippets/oriverse_networking_shared-e43478064e11e46c/inline0.js +18 -0
- package/dist/snippets/oriverse_wgpu-255445ce6d9a0851/inline0.js +60 -0
- package/dist/snippets/oriverse_wgpu-255445ce6d9a0851/inline1.js +21 -0
- package/dist/starter/AGENTS.md +32 -0
- package/dist/starter/CLAUDE.md +32 -0
- package/dist/starter/game.html +64 -0
- package/dist/templates/game.html +63 -0
- package/dist/templates/game_cdn.html +64 -0
- package/dist/weave_documentation.txt +6258 -0
- package/package.json +18 -0
|
Binary file
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
export const memory: WebAssembly.Memory;
|
|
4
|
+
export const bootOriverseArtifact: (a: number, b: number) => any;
|
|
5
|
+
export const sim_worker_init: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number) => void;
|
|
6
|
+
export const sim_worker_start_ticker: (a: number) => [number, number];
|
|
7
|
+
export const start_wasm_oriverse: () => void;
|
|
8
|
+
export const worker_attach_read_dc: (a: any) => void;
|
|
9
|
+
export const worker_attach_write_dc: (a: any, b: any) => void;
|
|
10
|
+
export const worker_init: (a: number, b: number) => void;
|
|
11
|
+
export const worker_init_write: (a: number, b: number, c: number, d: number) => void;
|
|
12
|
+
export const validate_world_entry: (a: number, b: number, c: number) => [number, number];
|
|
13
|
+
export const validate_world_shared_entry: (a: number, b: number, c: number) => [number, number];
|
|
14
|
+
export const init_market_client_message_bridge: (a: any) => [number, number];
|
|
15
|
+
export const __wbg_intounderlyingbytesource_free: (a: number, b: number) => void;
|
|
16
|
+
export const __wbg_intounderlyingsink_free: (a: number, b: number) => void;
|
|
17
|
+
export const __wbg_intounderlyingsource_free: (a: number, b: number) => void;
|
|
18
|
+
export const intounderlyingbytesource_autoAllocateChunkSize: (a: number) => number;
|
|
19
|
+
export const intounderlyingbytesource_cancel: (a: number) => void;
|
|
20
|
+
export const intounderlyingbytesource_pull: (a: number, b: any) => any;
|
|
21
|
+
export const intounderlyingbytesource_start: (a: number, b: any) => void;
|
|
22
|
+
export const intounderlyingbytesource_type: (a: number) => number;
|
|
23
|
+
export const intounderlyingsink_abort: (a: number, b: any) => any;
|
|
24
|
+
export const intounderlyingsink_close: (a: number) => any;
|
|
25
|
+
export const intounderlyingsink_write: (a: number, b: any) => any;
|
|
26
|
+
export const intounderlyingsource_cancel: (a: number) => void;
|
|
27
|
+
export const intounderlyingsource_pull: (a: number, b: any) => any;
|
|
28
|
+
export const wasm_bindgen__closure__destroy__h042ad3005b9d55a6: (a: number, b: number) => void;
|
|
29
|
+
export const wasm_bindgen__closure__destroy__h17a277c51bb51813: (a: number, b: number) => void;
|
|
30
|
+
export const wasm_bindgen__closure__destroy__h925400c2c567eb80: (a: number, b: number) => void;
|
|
31
|
+
export const wasm_bindgen__closure__destroy__h9b3b47830657a8ed: (a: number, b: number) => void;
|
|
32
|
+
export const wasm_bindgen__closure__destroy__h4c6ab0d0852bf9f7: (a: number, b: number) => void;
|
|
33
|
+
export const wasm_bindgen__closure__destroy__h0fed2d1f7635c2f5: (a: number, b: number) => void;
|
|
34
|
+
export const wasm_bindgen__closure__destroy__hf809af396483004d: (a: number, b: number) => void;
|
|
35
|
+
export const wasm_bindgen__closure__destroy__hb5431e947b7a6aec: (a: number, b: number) => void;
|
|
36
|
+
export const wasm_bindgen__closure__destroy__h205759260389ccd0: (a: number, b: number) => void;
|
|
37
|
+
export const wasm_bindgen__closure__destroy__h0cd374b964da0682: (a: number, b: number) => void;
|
|
38
|
+
export const wasm_bindgen__convert__closures_____invoke__h2774a57ff1bf6744: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
39
|
+
export const wasm_bindgen__convert__closures_____invoke__h94cbd1b5f6302697: (a: number, b: number, c: any, d: any) => void;
|
|
40
|
+
export const wasm_bindgen__convert__closures_____invoke__h565d6b66bcb3c25c: (a: number, b: number, c: number, d: number) => void;
|
|
41
|
+
export const wasm_bindgen__convert__closures_____invoke__ha73e5db2c2b6e381: (a: number, b: number, c: any, d: any) => void;
|
|
42
|
+
export const wasm_bindgen__convert__closures_____invoke__hded3ad7bdef546a1: (a: number, b: number, c: any) => [number, number];
|
|
43
|
+
export const wasm_bindgen__convert__closures_____invoke__hc5e85a6ffb556dd3: (a: number, b: number, c: number, d: number) => void;
|
|
44
|
+
export const wasm_bindgen__convert__closures_____invoke__h1723b3b073a90d0a: (a: number, b: number, c: any, d: any) => void;
|
|
45
|
+
export const wasm_bindgen__convert__closures_____invoke__h230801f31144964a: (a: number, b: number, c: any) => void;
|
|
46
|
+
export const wasm_bindgen__convert__closures_____invoke__h230801f31144964a_2: (a: number, b: number, c: any) => void;
|
|
47
|
+
export const wasm_bindgen__convert__closures_____invoke__h230801f31144964a_3: (a: number, b: number, c: any) => void;
|
|
48
|
+
export const wasm_bindgen__convert__closures_____invoke__h230801f31144964a_4: (a: number, b: number, c: any) => void;
|
|
49
|
+
export const wasm_bindgen__convert__closures_____invoke__hfb64fcc207989551: (a: number, b: number, c: any) => void;
|
|
50
|
+
export const wasm_bindgen__convert__closures_____invoke__h719a023b3100fd4c: (a: number, b: number, c: any) => void;
|
|
51
|
+
export const wasm_bindgen__convert__closures_____invoke__h719a023b3100fd4c_9: (a: number, b: number, c: any) => void;
|
|
52
|
+
export const wasm_bindgen__convert__closures_____invoke__h023b53cca5e9d36e: (a: number, b: number, c: any) => void;
|
|
53
|
+
export const wasm_bindgen__convert__closures_____invoke__h023b53cca5e9d36e_12: (a: number, b: number, c: any) => void;
|
|
54
|
+
export const wasm_bindgen__convert__closures_____invoke__h023b53cca5e9d36e_13: (a: number, b: number, c: any) => void;
|
|
55
|
+
export const wasm_bindgen__convert__closures_____invoke__h023b53cca5e9d36e_14: (a: number, b: number, c: any) => void;
|
|
56
|
+
export const wasm_bindgen__convert__closures_____invoke__h023b53cca5e9d36e_15: (a: number, b: number, c: any) => void;
|
|
57
|
+
export const wasm_bindgen__convert__closures_____invoke__h023b53cca5e9d36e_16: (a: number, b: number, c: any) => void;
|
|
58
|
+
export const wasm_bindgen__convert__closures_____invoke__h023b53cca5e9d36e_17: (a: number, b: number, c: any) => void;
|
|
59
|
+
export const wasm_bindgen__convert__closures_____invoke__h023b53cca5e9d36e_18: (a: number, b: number, c: any) => void;
|
|
60
|
+
export const wasm_bindgen__convert__closures_____invoke__hd9c373bc00363316: (a: number, b: number, c: number) => void;
|
|
61
|
+
export const wasm_bindgen__convert__closures_____invoke__h2819dfb01981ad79: (a: number, b: number, c: any) => void;
|
|
62
|
+
export const wasm_bindgen__convert__closures_____invoke__h7f85845aafa30203: (a: number, b: number, c: any) => void;
|
|
63
|
+
export const wasm_bindgen__convert__closures_____invoke__h659f4c721b86f42c: (a: number, b: number) => void;
|
|
64
|
+
export const wasm_bindgen__convert__closures_____invoke__h32f18397ef483a59: (a: number, b: number) => void;
|
|
65
|
+
export const wasm_bindgen__convert__closures_____invoke__h2f9cd05605e4a2db: (a: number, b: number) => void;
|
|
66
|
+
export const __wbindgen_malloc: (a: number, b: number) => number;
|
|
67
|
+
export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
68
|
+
export const __externref_table_alloc: () => number;
|
|
69
|
+
export const __wbindgen_externrefs: WebAssembly.Table;
|
|
70
|
+
export const __wbindgen_exn_store: (a: number) => void;
|
|
71
|
+
export const __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
72
|
+
export const __externref_table_dealloc: (a: number) => void;
|
|
73
|
+
export const __wbindgen_start: () => void;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
|
|
2
|
+
export function marketClientInitMessageBridge(worker) {
|
|
3
|
+
if (!worker || typeof window === 'undefined') throw new Error('Worker and window required');
|
|
4
|
+
if (window.marketClientMessageBridgeInitialized) return;
|
|
5
|
+
window.marketClientMessageBridgeInitialized = true;
|
|
6
|
+
|
|
7
|
+
window.top.marketClientWorker = worker;
|
|
8
|
+
worker.addEventListener('message', (e) => {
|
|
9
|
+
const data = e.data;
|
|
10
|
+
if (data?.type === 'market-client-open-url' && data.value) window.open(data.value, '_blank');
|
|
11
|
+
else if (data?.type?.startsWith('market-client-')) {
|
|
12
|
+
window.top.postMessage(data, '*');
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
export function marketClientInitMessageListener(callback) {
|
|
17
|
+
const target = typeof window !== 'undefined' ? window.top : (typeof self !== 'undefined' ? self : globalThis);
|
|
18
|
+
target.addEventListener('message', (e) => {
|
|
19
|
+
if (e.data?.type) callback(e.data.type);
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
export function marketClientPostMessage(messageType, value) {
|
|
23
|
+
const message = { type: messageType, ...(value != null && { value }) };
|
|
24
|
+
if (typeof window !== 'undefined') {
|
|
25
|
+
window.top.postMessage(message, '*');
|
|
26
|
+
} else {
|
|
27
|
+
const g = typeof self !== 'undefined' ? self : globalThis;
|
|
28
|
+
g.postMessage(message);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
|
|
2
|
+
export function get_selected_candidate_info(stats) {
|
|
3
|
+
const reports = Array.from(stats.values());
|
|
4
|
+
const pair = reports.find(s => s.type === 'candidate-pair' && s.nominated);
|
|
5
|
+
if (!pair) return null;
|
|
6
|
+
const local = reports.find(s => s.type === 'local-candidate' && s.id === pair.localCandidateId);
|
|
7
|
+
const remote = reports.find(s => s.type === 'remote-candidate' && s.id === pair.remoteCandidateId);
|
|
8
|
+
if (!local || !remote) return null;
|
|
9
|
+
return {
|
|
10
|
+
state: pair.state || '',
|
|
11
|
+
localType: local.candidateType || '',
|
|
12
|
+
localAddr: `${local.address || local.ip || 'unknown'}:${local.port || 0}`,
|
|
13
|
+
localProtocol: local.protocol || '',
|
|
14
|
+
remoteType: remote.candidateType || '',
|
|
15
|
+
remoteAddr: `${remote.address || remote.ip || 'unknown'}:${remote.port || 0}`,
|
|
16
|
+
remoteProtocol: remote.protocol || ''
|
|
17
|
+
};
|
|
18
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
|
|
2
|
+
export function observeDevicePixels(canvas, onSize) {
|
|
3
|
+
const hasDPCB = (() => {
|
|
4
|
+
try { return 'devicePixelContentBoxSize' in ResizeObserverEntry.prototype; } catch { return false; }
|
|
5
|
+
})();
|
|
6
|
+
|
|
7
|
+
// Compute current CSS and device-pixel sizes and call onSize(dpW, dpH, effectiveDpr)
|
|
8
|
+
function fireNow() {
|
|
9
|
+
let cssW, cssH, dpW, dpH;
|
|
10
|
+
if (hasDPCB && canvas.__lastROEntry) {
|
|
11
|
+
const e = canvas.__lastROEntry;
|
|
12
|
+
dpW = e.devicePixelContentBoxSize[0].inlineSize;
|
|
13
|
+
dpH = e.devicePixelContentBoxSize[0].blockSize;
|
|
14
|
+
cssW = e.contentBoxSize[0].inlineSize;
|
|
15
|
+
cssH = e.contentBoxSize[0].blockSize;
|
|
16
|
+
} else {
|
|
17
|
+
const rect = canvas.getBoundingClientRect();
|
|
18
|
+
const dpr = window.devicePixelRatio || 1;
|
|
19
|
+
cssW = rect.width; cssH = rect.height;
|
|
20
|
+
dpW = Math.max(1, Math.round(cssW * dpr));
|
|
21
|
+
dpH = Math.max(1, Math.round(cssH * dpr));
|
|
22
|
+
}
|
|
23
|
+
const dprEff = cssW > 0 ? (dpW / cssW) : (window.devicePixelRatio || 1);
|
|
24
|
+
onSize(dpW >>> 0, dpH >>> 0, dprEff);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const ro = new ResizeObserver(entries => {
|
|
28
|
+
// Save the last entry for precise device-pixel info.
|
|
29
|
+
canvas.__lastROEntry = entries[0];
|
|
30
|
+
fireNow();
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
try { ro.observe(canvas, { box: 'device-pixel-content-box' }); }
|
|
34
|
+
catch { ro.observe(canvas); }
|
|
35
|
+
|
|
36
|
+
// DPR changes (zoom / moving across monitors) don't always reflow. Listen explicitly.
|
|
37
|
+
let mq = matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`);
|
|
38
|
+
const onMQ = () => {
|
|
39
|
+
// Force a non-layout-janking "poke" to trigger RO in some browsers.
|
|
40
|
+
const t = canvas.style.transform;
|
|
41
|
+
canvas.style.transform = 'translateZ(0)'; canvas.style.transform = t;
|
|
42
|
+
fireNow();
|
|
43
|
+
// Re-arm listener for the new DPR.
|
|
44
|
+
mq.removeEventListener?.('change', onMQ);
|
|
45
|
+
mq = matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`);
|
|
46
|
+
mq.addEventListener?.('change', onMQ);
|
|
47
|
+
};
|
|
48
|
+
mq.addEventListener?.('change', onMQ);
|
|
49
|
+
window.addEventListener('pageshow', onMQ);
|
|
50
|
+
|
|
51
|
+
// Fire once now so we start sized correctly.
|
|
52
|
+
Promise.resolve().then(fireNow);
|
|
53
|
+
|
|
54
|
+
// Return disposer
|
|
55
|
+
return () => {
|
|
56
|
+
try { ro.disconnect(); } catch {}
|
|
57
|
+
try { mq.removeEventListener?.('change', onMQ); } catch {}
|
|
58
|
+
try { window.removeEventListener('pageshow', onMQ); } catch {}
|
|
59
|
+
};
|
|
60
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
|
|
2
|
+
export function __ori_install_webgpu_error_tap(sink) {
|
|
3
|
+
try {
|
|
4
|
+
if (typeof GPUAdapter === 'undefined' || GPUAdapter.prototype.__ori_err_tap) return;
|
|
5
|
+
GPUAdapter.prototype.__ori_err_tap = true;
|
|
6
|
+
const orig = GPUAdapter.prototype.requestDevice;
|
|
7
|
+
GPUAdapter.prototype.requestDevice = async function(desc) {
|
|
8
|
+
const device = await orig.call(this, desc);
|
|
9
|
+
try {
|
|
10
|
+
device.addEventListener('uncapturederror', function(event) {
|
|
11
|
+
const e = event.error;
|
|
12
|
+
const name = (e && e.constructor && e.constructor.name) || 'GPUError';
|
|
13
|
+
const msg = (e && e.message) || '';
|
|
14
|
+
try { sink(name + ': ' + msg); } catch (_) {}
|
|
15
|
+
try { console.error('[raw_webgpu_uncaptured]', name, msg); } catch (_) {}
|
|
16
|
+
});
|
|
17
|
+
} catch (_) {}
|
|
18
|
+
return device;
|
|
19
|
+
};
|
|
20
|
+
} catch (_) {}
|
|
21
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Oriverse game starter
|
|
2
|
+
|
|
3
|
+
This folder makes Oriverse games (3D, WebGPU). The engine loads from unpkg — it is
|
|
4
|
+
already wired up inside `game.html`. There is nothing to install or build.
|
|
5
|
+
|
|
6
|
+
## The one rule
|
|
7
|
+
|
|
8
|
+
Edit ONLY the Weave source inside the `<script type="text/weave" id="oriverse-weave">`
|
|
9
|
+
block of `game.html`. That block is the entire game (world + logic). Do not change the
|
|
10
|
+
loader scripts or engine URLs.
|
|
11
|
+
|
|
12
|
+
## Before writing Weave, read the guide
|
|
13
|
+
|
|
14
|
+
- https://unpkg.com/oriverse-engine@0.1.1/dist/GAME_AUTHORING.md — authoring patterns + 3 complete tested
|
|
15
|
+
example games (coin collector, dodge blocks, target range) to pattern-match from.
|
|
16
|
+
- https://unpkg.com/oriverse-engine@0.1.1/dist/weave_documentation.txt — full language + API reference.
|
|
17
|
+
|
|
18
|
+
Key constraints: content must be fully procedural (primitive models `"cube"`,
|
|
19
|
+
`"sphere"`, ..., `#mesh`, `#texture` — no market/network assets); units are cm with Z
|
|
20
|
+
up; `color = (r, g, b)` uses 0-1 floats; WASD/Space movement already works without a
|
|
21
|
+
`#class player`.
|
|
22
|
+
|
|
23
|
+
## Test
|
|
24
|
+
|
|
25
|
+
Serve this folder and open the page in a WebGPU browser (Chrome/Edge):
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
python -m http.server 8000
|
|
29
|
+
# then open http://localhost:8000/game.html
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Weave load errors show in the on-page banner and browser console with line numbers.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Oriverse game starter
|
|
2
|
+
|
|
3
|
+
This folder makes Oriverse games (3D, WebGPU). The engine loads from unpkg — it is
|
|
4
|
+
already wired up inside `game.html`. There is nothing to install or build.
|
|
5
|
+
|
|
6
|
+
## The one rule
|
|
7
|
+
|
|
8
|
+
Edit ONLY the Weave source inside the `<script type="text/weave" id="oriverse-weave">`
|
|
9
|
+
block of `game.html`. That block is the entire game (world + logic). Do not change the
|
|
10
|
+
loader scripts or engine URLs.
|
|
11
|
+
|
|
12
|
+
## Before writing Weave, read the guide
|
|
13
|
+
|
|
14
|
+
- https://unpkg.com/oriverse-engine@0.1.1/dist/GAME_AUTHORING.md — authoring patterns + 3 complete tested
|
|
15
|
+
example games (coin collector, dodge blocks, target range) to pattern-match from.
|
|
16
|
+
- https://unpkg.com/oriverse-engine@0.1.1/dist/weave_documentation.txt — full language + API reference.
|
|
17
|
+
|
|
18
|
+
Key constraints: content must be fully procedural (primitive models `"cube"`,
|
|
19
|
+
`"sphere"`, ..., `#mesh`, `#texture` — no market/network assets); units are cm with Z
|
|
20
|
+
up; `color = (r, g, b)` uses 0-1 floats; WASD/Space movement already works without a
|
|
21
|
+
`#class player`.
|
|
22
|
+
|
|
23
|
+
## Test
|
|
24
|
+
|
|
25
|
+
Serve this folder and open the page in a WebGPU browser (Chrome/Edge):
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
python -m http.server 8000
|
|
29
|
+
# then open http://localhost:8000/game.html
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Weave load errors show in the on-page banner and browser console with line numbers.
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
<!-- game_cdn.html — Oriverse artifact game loading the engine from a CDN (three.js-style).
|
|
2
|
+
This single small file IS the whole game: engine js/wasm come from unpkg, your game is
|
|
3
|
+
the inline Weave source below. Serve from any static host (no COOP/COEP headers) or a
|
|
4
|
+
plain `python -m http.server`; open in a WebGPU browser (Chrome/Edge).
|
|
5
|
+
The engine version is pinned in the https://unpkg.com/oriverse-engine@0.1.1/dist urls below (injected from
|
|
6
|
+
npm_package/package.json at packaging time) — bump the @version with engine releases.
|
|
7
|
+
Content must be fully procedural: primitives ("cube", "sphere", ...), #mesh, #texture,
|
|
8
|
+
#particles. Market/network assets are unavailable and will hard-error. -->
|
|
9
|
+
<!DOCTYPE html>
|
|
10
|
+
<html lang="en">
|
|
11
|
+
<head>
|
|
12
|
+
<meta charset="UTF-8">
|
|
13
|
+
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
|
|
14
|
+
<title>oriverse game</title>
|
|
15
|
+
<link rel="icon" href="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2016%2016'%3E%3Crect%20width='16'%20height='16'%20rx='3'%20fill='%23453a6b'/%3E%3C/svg%3E">
|
|
16
|
+
<style>
|
|
17
|
+
html, body { margin: 0; padding: 0; background-color: rgb(20, 19, 19); }
|
|
18
|
+
</style>
|
|
19
|
+
</head>
|
|
20
|
+
<body>
|
|
21
|
+
<div id="oriverse-status-banner" style="position:fixed;left:0;right:0;top:0;z-index:9999;background:rgba(0,0,0,0.85);color:#fff;font-family:system-ui,-apple-system,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;font-size:14px;line-height:1.4;padding:10px 12px;white-space:pre-wrap;pointer-events:none;">Oriverse: fetching engine from CDN...</div>
|
|
22
|
+
|
|
23
|
+
<!-- ==== EDIT YOUR GAME HERE: inline Weave world source (read by the engine at boot). ==== -->
|
|
24
|
+
<script type="text/weave" id="oriverse-weave">
|
|
25
|
+
object Ground {
|
|
26
|
+
model = "cube"
|
|
27
|
+
position = (0, 0, -50)
|
|
28
|
+
size = (4000, 4000, 100)
|
|
29
|
+
color = (0.35, 0.47, 0.35)
|
|
30
|
+
}
|
|
31
|
+
object OrangeCube {
|
|
32
|
+
model = "cube"
|
|
33
|
+
position = (0, 300, 100)
|
|
34
|
+
size = (100, 100, 100)
|
|
35
|
+
color = (0.86, 0.47, 0.23)
|
|
36
|
+
}
|
|
37
|
+
object BlueCube {
|
|
38
|
+
model = "cube"
|
|
39
|
+
position = (300, 600, 60)
|
|
40
|
+
size = (120, 120, 120)
|
|
41
|
+
color = (0.31, 0.51, 0.86)
|
|
42
|
+
}
|
|
43
|
+
</script>
|
|
44
|
+
|
|
45
|
+
<!-- KTX2 texture transcoder sidecar (classic scripts; ktx_lib.wasm resolves relative to the script url). -->
|
|
46
|
+
<script src="https://unpkg.com/oriverse-engine@0.1.1/dist/ktx_lib.js"></script>
|
|
47
|
+
<script src="https://unpkg.com/oriverse-engine@0.1.1/dist/ktx_bridge.js"></script>
|
|
48
|
+
<script type="module">
|
|
49
|
+
import initOriverse from "https://unpkg.com/oriverse-engine@0.1.1/dist/oriverse_wgpu.js";
|
|
50
|
+
const setBoot = (t) => { const b = document.getElementById('oriverse-status-banner'); if (b) b.textContent = t; };
|
|
51
|
+
(async () => {
|
|
52
|
+
try {
|
|
53
|
+
setBoot('instantiating wasm...');
|
|
54
|
+
// Artifact build: wasm-bindgen owns a private (non-shared) memory; no COOP/COEP needed.
|
|
55
|
+
await initOriverse({ module_or_path: "https://unpkg.com/oriverse-engine@0.1.1/dist/oriverse_wgpu_bg.wasm" });
|
|
56
|
+
} catch (e) {
|
|
57
|
+
const msg = (e && e.stack) ? e.stack : String(e);
|
|
58
|
+
setBoot('WASM init failed:\n' + msg);
|
|
59
|
+
console.error('[wasm_boot] initOriverse failed:', e);
|
|
60
|
+
}
|
|
61
|
+
})();
|
|
62
|
+
</script>
|
|
63
|
+
</body>
|
|
64
|
+
</html>
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
<!-- game.html — Oriverse artifact (serverless single-player) template.
|
|
2
|
+
Serve this folder with any static file server, e.g.: python -m http.server 8000
|
|
3
|
+
No COOP/COEP headers are required (no SharedArrayBuffer, no workers, no network).
|
|
4
|
+
Author your game by replacing the Weave source inside the #oriverse-weave script tag.
|
|
5
|
+
Content must be fully procedural: primitives ("cube", "sphere", ...), #mesh, #texture,
|
|
6
|
+
#particles. Market/network assets are unavailable and will hard-error. -->
|
|
7
|
+
<!DOCTYPE html>
|
|
8
|
+
<html lang="en">
|
|
9
|
+
<head>
|
|
10
|
+
<meta charset="UTF-8">
|
|
11
|
+
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
|
|
12
|
+
<title>oriverse game</title>
|
|
13
|
+
<!-- inline favicon: keeps the package strictly zero-fetch (no /favicon.ico probe) -->
|
|
14
|
+
<link rel="icon" href="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2016%2016'%3E%3Crect%20width='16'%20height='16'%20rx='3'%20fill='%23453a6b'/%3E%3C/svg%3E">
|
|
15
|
+
<style>
|
|
16
|
+
html, body { margin: 0; padding: 0; background-color: rgb(20, 19, 19); }
|
|
17
|
+
</style>
|
|
18
|
+
</head>
|
|
19
|
+
<body>
|
|
20
|
+
<div id="oriverse-status-banner" style="position:fixed;left:0;right:0;top:0;z-index:9999;background:rgba(0,0,0,0.85);color:#fff;font-family:system-ui,-apple-system,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;font-size:14px;line-height:1.4;padding:10px 12px;white-space:pre-wrap;pointer-events:none;">Oriverse: instantiating wasm...</div>
|
|
21
|
+
|
|
22
|
+
<!-- Inline Weave world source (read by the engine at boot).
|
|
23
|
+
Injected at packaging time from default_world.weave (single source, compile-tested natively). -->
|
|
24
|
+
<script type="text/weave" id="oriverse-weave">
|
|
25
|
+
object Ground {
|
|
26
|
+
model = "cube"
|
|
27
|
+
position = (0, 0, -50)
|
|
28
|
+
size = (4000, 4000, 100)
|
|
29
|
+
color = (0.35, 0.47, 0.35)
|
|
30
|
+
}
|
|
31
|
+
object OrangeCube {
|
|
32
|
+
model = "cube"
|
|
33
|
+
position = (0, 300, 100)
|
|
34
|
+
size = (100, 100, 100)
|
|
35
|
+
color = (0.86, 0.47, 0.23)
|
|
36
|
+
}
|
|
37
|
+
object BlueCube {
|
|
38
|
+
model = "cube"
|
|
39
|
+
position = (300, 600, 60)
|
|
40
|
+
size = (120, 120, 120)
|
|
41
|
+
color = (0.31, 0.51, 0.86)
|
|
42
|
+
}
|
|
43
|
+
</script>
|
|
44
|
+
|
|
45
|
+
<script src="ktx_lib.js"></script>
|
|
46
|
+
<script src="ktx_bridge.js"></script>
|
|
47
|
+
<script type="module">
|
|
48
|
+
import initOriverse from "./oriverse_wgpu.js";
|
|
49
|
+
const setBoot = (t) => { const b = document.getElementById('oriverse-status-banner'); if (b) b.textContent = t; };
|
|
50
|
+
(async () => {
|
|
51
|
+
try {
|
|
52
|
+
setBoot('instantiating wasm...');
|
|
53
|
+
// Artifact build: wasm-bindgen owns a private (non-shared) memory; no COOP/COEP needed.
|
|
54
|
+
await initOriverse({ module_or_path: './oriverse_wgpu_bg.wasm' });
|
|
55
|
+
} catch (e) {
|
|
56
|
+
const msg = (e && e.stack) ? e.stack : String(e);
|
|
57
|
+
setBoot('WASM init failed:\n' + msg);
|
|
58
|
+
console.error('[wasm_boot] initOriverse failed:', e);
|
|
59
|
+
}
|
|
60
|
+
})();
|
|
61
|
+
</script>
|
|
62
|
+
</body>
|
|
63
|
+
</html>
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
<!-- game_cdn.html — Oriverse artifact game loading the engine from a CDN (three.js-style).
|
|
2
|
+
This single small file IS the whole game: engine js/wasm come from unpkg, your game is
|
|
3
|
+
the inline Weave source below. Serve from any static host (no COOP/COEP headers) or a
|
|
4
|
+
plain `python -m http.server`; open in a WebGPU browser (Chrome/Edge).
|
|
5
|
+
The engine version is pinned in the https://unpkg.com/oriverse-engine@0.1.1/dist urls below (injected from
|
|
6
|
+
npm_package/package.json at packaging time) — bump the @version with engine releases.
|
|
7
|
+
Content must be fully procedural: primitives ("cube", "sphere", ...), #mesh, #texture,
|
|
8
|
+
#particles. Market/network assets are unavailable and will hard-error. -->
|
|
9
|
+
<!DOCTYPE html>
|
|
10
|
+
<html lang="en">
|
|
11
|
+
<head>
|
|
12
|
+
<meta charset="UTF-8">
|
|
13
|
+
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
|
|
14
|
+
<title>oriverse game</title>
|
|
15
|
+
<link rel="icon" href="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2016%2016'%3E%3Crect%20width='16'%20height='16'%20rx='3'%20fill='%23453a6b'/%3E%3C/svg%3E">
|
|
16
|
+
<style>
|
|
17
|
+
html, body { margin: 0; padding: 0; background-color: rgb(20, 19, 19); }
|
|
18
|
+
</style>
|
|
19
|
+
</head>
|
|
20
|
+
<body>
|
|
21
|
+
<div id="oriverse-status-banner" style="position:fixed;left:0;right:0;top:0;z-index:9999;background:rgba(0,0,0,0.85);color:#fff;font-family:system-ui,-apple-system,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;font-size:14px;line-height:1.4;padding:10px 12px;white-space:pre-wrap;pointer-events:none;">Oriverse: fetching engine from CDN...</div>
|
|
22
|
+
|
|
23
|
+
<!-- ==== EDIT YOUR GAME HERE: inline Weave world source (read by the engine at boot). ==== -->
|
|
24
|
+
<script type="text/weave" id="oriverse-weave">
|
|
25
|
+
object Ground {
|
|
26
|
+
model = "cube"
|
|
27
|
+
position = (0, 0, -50)
|
|
28
|
+
size = (4000, 4000, 100)
|
|
29
|
+
color = (0.35, 0.47, 0.35)
|
|
30
|
+
}
|
|
31
|
+
object OrangeCube {
|
|
32
|
+
model = "cube"
|
|
33
|
+
position = (0, 300, 100)
|
|
34
|
+
size = (100, 100, 100)
|
|
35
|
+
color = (0.86, 0.47, 0.23)
|
|
36
|
+
}
|
|
37
|
+
object BlueCube {
|
|
38
|
+
model = "cube"
|
|
39
|
+
position = (300, 600, 60)
|
|
40
|
+
size = (120, 120, 120)
|
|
41
|
+
color = (0.31, 0.51, 0.86)
|
|
42
|
+
}
|
|
43
|
+
</script>
|
|
44
|
+
|
|
45
|
+
<!-- KTX2 texture transcoder sidecar (classic scripts; ktx_lib.wasm resolves relative to the script url). -->
|
|
46
|
+
<script src="https://unpkg.com/oriverse-engine@0.1.1/dist/ktx_lib.js"></script>
|
|
47
|
+
<script src="https://unpkg.com/oriverse-engine@0.1.1/dist/ktx_bridge.js"></script>
|
|
48
|
+
<script type="module">
|
|
49
|
+
import initOriverse from "https://unpkg.com/oriverse-engine@0.1.1/dist/oriverse_wgpu.js";
|
|
50
|
+
const setBoot = (t) => { const b = document.getElementById('oriverse-status-banner'); if (b) b.textContent = t; };
|
|
51
|
+
(async () => {
|
|
52
|
+
try {
|
|
53
|
+
setBoot('instantiating wasm...');
|
|
54
|
+
// Artifact build: wasm-bindgen owns a private (non-shared) memory; no COOP/COEP needed.
|
|
55
|
+
await initOriverse({ module_or_path: "https://unpkg.com/oriverse-engine@0.1.1/dist/oriverse_wgpu_bg.wasm" });
|
|
56
|
+
} catch (e) {
|
|
57
|
+
const msg = (e && e.stack) ? e.stack : String(e);
|
|
58
|
+
setBoot('WASM init failed:\n' + msg);
|
|
59
|
+
console.error('[wasm_boot] initOriverse failed:', e);
|
|
60
|
+
}
|
|
61
|
+
})();
|
|
62
|
+
</script>
|
|
63
|
+
</body>
|
|
64
|
+
</html>
|