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 ADDED
@@ -0,0 +1,30 @@
1
+ # Oriverse Artifact Bundle License
2
+
3
+ > PLACEHOLDER — review with legal counsel before the first `npm publish`.
4
+
5
+ Copyright (c) 2026 Oriverse. All rights reserved.
6
+
7
+ This package contains a compiled, proprietary build of the Oriverse engine
8
+ ("the Bundle"). No source code is included or licensed.
9
+
10
+ Permission is hereby granted, free of charge and royalty-free, to any person
11
+ obtaining a copy of the Bundle to:
12
+
13
+ 1. Use the Bundle to run and serve games and applications, commercial or
14
+ non-commercial.
15
+ 2. Redistribute the Bundle **unmodified** (including via CDNs such as unpkg,
16
+ bundlers, or by copying the `dist/` files alongside your game), provided this
17
+ license file accompanies any standalone redistribution of the Bundle.
18
+
19
+ The following are NOT permitted:
20
+
21
+ - Modifying, decompiling, disassembling, or reverse-engineering the Bundle,
22
+ except to the extent such restriction is prohibited by applicable law.
23
+ - Redistributing modified versions of the Bundle.
24
+ - Representing the Bundle as your own work or removing copyright notices.
25
+
26
+ THE BUNDLE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
27
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
28
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
29
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
30
+ LIABILITY ARISING FROM THE USE OF THE BUNDLE.
package/README.md ADDED
@@ -0,0 +1,76 @@
1
+ # oriverse-engine
2
+
3
+ Prebuilt **Oriverse engine** bundle for serverless single-player games: a WebGPU
4
+ wasm engine you use three.js-style from a CDN, with your whole game authored as
5
+ **one `game.html`** containing inline [Weave](https://oriverse.io) source.
6
+
7
+ This package is the **compiled engine bundle only** (js glue + wasm + KTX texture
8
+ transcoder + docs). It contains no engine source code and has zero npm dependencies.
9
+ Everything runs client-side: no server, no SharedArrayBuffer, no workers, no
10
+ COOP/COEP headers, no network calls after the engine files load.
11
+
12
+ ## Quickstart (script-tag flow)
13
+
14
+ Create a single `game.html`:
15
+
16
+ ```html
17
+ <!DOCTYPE html>
18
+ <html lang="en">
19
+ <head><meta charset="UTF-8"><title>my game</title>
20
+ <style>html, body { margin: 0; background: #141313; }</style></head>
21
+ <body>
22
+ <!-- Your game: inline Weave world source (procedural content only) -->
23
+ <script type="text/weave" id="oriverse-weave">
24
+ object Ground { model = "cube" position = (0, 0, -50) size = (4000, 4000, 100) color = (0.35, 0.47, 0.35) }
25
+ object Box { model = "cube" position = (0, 300, 100) size = (100, 100, 100) color = (0.86, 0.47, 0.23) }
26
+ </script>
27
+
28
+ <!-- Pinned engine version: bump @0.1.1 together on new releases -->
29
+ <script src="https://unpkg.com/oriverse-engine@0.1.1/dist/ktx_lib.js"></script>
30
+ <script src="https://unpkg.com/oriverse-engine@0.1.1/dist/ktx_bridge.js"></script>
31
+ <script type="module">
32
+ import initOriverse from "https://unpkg.com/oriverse-engine@0.1.1/dist/oriverse_wgpu.js";
33
+ await initOriverse({ module_or_path: "https://unpkg.com/oriverse-engine@0.1.1/dist/oriverse_wgpu_bg.wasm" });
34
+ </script>
35
+ </body>
36
+ </html>
37
+ ```
38
+
39
+ Serve it with any static file server (`python -m http.server`) or any host — no
40
+ special headers needed — and open it in a WebGPU-capable browser (Chrome/Edge).
41
+ A ready-made version of this file with error reporting is at
42
+ `dist/templates/game_cdn.html`; a fully offline variant (engine files served
43
+ next to the html) is `dist/templates/game.html`.
44
+
45
+ The engine auto-boots from the `#oriverse-weave` tag. To boot programmatically
46
+ instead, omit the tag and call the typed export once after init:
47
+
48
+ ```js
49
+ import initOriverse, { bootOriverseArtifact } from "https://unpkg.com/oriverse-engine@0.1.1/dist/oriverse_wgpu.js";
50
+ await initOriverse({ module_or_path: "https://unpkg.com/oriverse-engine@0.1.1/dist/oriverse_wgpu_bg.wasm" });
51
+ await bootOriverseArtifact(weaveSource);
52
+ ```
53
+
54
+ ## Starter folder (for AI coding agents)
55
+
56
+ `dist/starter/` is a drop-in project folder: a wired-up `game.html` plus `AGENTS.md` /
57
+ `CLAUDE.md` instructions that Codex and Claude Code read automatically. Copy it,
58
+ point an agent at it, and say "make a game".
59
+
60
+ ## Authoring
61
+
62
+ - Game authoring guide with 3 complete engine-tested example games:
63
+ `dist/GAME_AUTHORING.md` (examples also as raw Weave under `dist/examples/`).
64
+ - The game boots straight into play mode; WASD + mouse move the player
65
+ (override by defining your own `#class player`).
66
+ - Content must be fully procedural: primitive models, `#mesh`, `#texture`,
67
+ `#particles`. Market/network assets are unavailable and hard-error.
68
+ - Weave language + API reference: `dist/weave_documentation.txt`
69
+ (also at `https://unpkg.com/oriverse-engine@0.1.1/dist/weave_documentation.txt`).
70
+ - Package/runtime onboarding: `dist/AGENT_ONBOARDING.md`.
71
+ - Copy-paste prompt for AI coding agents: `dist/CODEX_PROMPT.md`.
72
+
73
+ ## License
74
+
75
+ Proprietary; royalty-free use and unmodified redistribution permitted.
76
+ See `LICENSE.md`.
@@ -0,0 +1,74 @@
1
+ # Oriverse artifact package — agent onboarding
2
+
3
+ This folder is a self-contained, offline, single-player build of the Oriverse engine.
4
+ It runs without SharedArrayBuffer, web workers, or any network access, so it can be
5
+ served by any dumb static file server — no COOP/COEP headers needed.
6
+
7
+ ## Quick start
8
+
9
+ 1. Serve this folder:
10
+
11
+ ```bash
12
+ python -m http.server 8000
13
+ ```
14
+
15
+ 2. Open `http://localhost:8000/game.html` in a WebGPU-capable browser (Chrome/Edge,
16
+ or iOS Safari with the WebGPU feature flag enabled).
17
+
18
+ No server at all: `oriverse_single_game.html` is the same engine + world in ONE
19
+ self-contained file (wasm embedded as base64, zero fetches) — double-click it to run
20
+ via `file://` (a secure context in Chrome, so WebGPU works there too).
21
+
22
+ ## Authoring a game
23
+
24
+ Edit `game.html` and replace the Weave source inside:
25
+
26
+ ```html
27
+ <script type="text/weave" id="oriverse-weave"> ...your world... </script>
28
+ ```
29
+
30
+ (Alternatives: set `window.ORIVERSE_ARTIFACT_WEAVE` to a string before the module
31
+ script runs, or omit the tag entirely and call the typed export
32
+ `bootOriverseArtifact(weaveSource)` once after `initOriverse(...)` resolves — with no
33
+ inline Weave present the engine waits for that call instead of auto-booting.)
34
+
35
+ For game-making patterns and three complete engine-tested example games, read
36
+ `GAME_AUTHORING.md` (npm package `dist/`; examples also under `dist/examples/`).
37
+
38
+ Rules for artifact worlds:
39
+
40
+ - Content must be fully procedural. Allowed: primitive models (`"cube"`, `"sphere"`, ...),
41
+ `#mesh` clauses (procedural mesh DSL), `#texture` clauses (procedural texture DSL,
42
+ `baked.*` urls), `#particles` clauses, and triplanar materials.
43
+ - `color = (r, g, b)` channels are 0-1 floats (or `#RRGGBB` hex). Values above 1 clamp
44
+ to 1.0 per channel, so 0-255 style colors silently render as untinted white.
45
+ - The game boots directly into play mode (no editor). WASD moves the player: if your
46
+ world has no `#class player ... #end` block, the engine injects the default
47
+ third-person controller (camera-relative move + Space jump). Define `#class player`
48
+ yourself to override movement/camera (see `weave_documentation.txt`).
49
+ - Market assets (`Ori.model.*`, `Ori.image.*`, fonts from the network, ...) are NOT
50
+ available. Any runtime HTTP request hard-errors with `[artifact][zero-fetch]`.
51
+ - The world is built once at boot from the inline Weave; a load error is fatal and shows
52
+ in the status banner / browser console.
53
+
54
+ The Weave language reference is in `weave_documentation.txt` in this folder.
55
+
56
+ ## Package contents
57
+
58
+ - `game.html` — template page with inline Weave (this is the file you author). The default
59
+ world is injected from `default_world.weave` at packaging time and compile-tested natively.
60
+ - `oriverse_single_game.html` — single-file variant of the same game (edit the same
61
+ `#oriverse-weave` block inside it); runs from `file://` or any static server.
62
+ - `oriverse_wgpu.js` / `oriverse_wgpu_bg.wasm` — engine glue + wasm (single-threaded,
63
+ non-shared memory).
64
+ - `ktx_lib.js` / `ktx_lib.wasm` / `ktx_bridge.js` — KTX2 texture transcoder sidecar
65
+ (loaded as classic scripts; the one non-module exception).
66
+ - `weave_documentation.txt` — Weave language + API reference.
67
+
68
+ ## How it works (for the curious)
69
+
70
+ The engine runs its normal deterministic client simulation, but instead of a network
71
+ relay it talks to an in-process loopback relay: your inputs are packed into real relay
72
+ wire packets, merged one frame per tick, and fed back through the production frame
73
+ reader. The whole sim runs on the browser main thread (fixed-step accumulator inside
74
+ requestAnimationFrame, with a small catch-up cap).
@@ -0,0 +1,108 @@
1
+ # Make a game with Oriverse — prompt for AI coding agents
2
+
3
+ Paste everything below the line into an AI coding agent (Codex / Claude Code / Cursor)
4
+ to have it author an Oriverse game as a single `game.html`. Everything the agent needs
5
+ is inline — it works even if the agent has no network access beyond serving the file.
6
+
7
+ ---
8
+
9
+ Create a playable 3D game as a single `game.html` built on the Oriverse engine
10
+ (WebGPU wasm, loaded from a CDN — nothing to download or bundle).
11
+
12
+ ## Step 1: copy this file EXACTLY as your `game.html`
13
+
14
+ Copy the entire HTML below verbatim. ONLY edit the contents of the
15
+ `<script type="text/weave" id="oriverse-weave">` block — that Weave block IS the game
16
+ (world + logic). Do not touch the loader scripts, the URLs, or anything else.
17
+
18
+ ```html
19
+ <!DOCTYPE html>
20
+ <html lang="en">
21
+ <head>
22
+ <meta charset="UTF-8">
23
+ <meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
24
+ <title>oriverse game</title>
25
+ <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">
26
+ <style>
27
+ html, body { margin: 0; padding: 0; background-color: rgb(20, 19, 19); }
28
+ </style>
29
+ </head>
30
+ <body>
31
+ <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,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>
32
+
33
+ <!-- ==== EDIT ONLY THIS BLOCK: your game, as inline Weave source. ==== -->
34
+ <script type="text/weave" id="oriverse-weave">
35
+ object Ground {
36
+ model = "cube"
37
+ position = (0, 0, -50)
38
+ size = (4000, 4000, 100)
39
+ color = (0.35, 0.47, 0.35)
40
+ }
41
+ object OrangeCube {
42
+ model = "cube"
43
+ position = (0, 300, 100)
44
+ size = (100, 100, 100)
45
+ color = (0.86, 0.47, 0.23)
46
+ }
47
+ object BlueCube {
48
+ model = "cube"
49
+ position = (300, 600, 60)
50
+ size = (120, 120, 120)
51
+ color = (0.31, 0.51, 0.86)
52
+ }
53
+ </script>
54
+ <!-- ==== END OF EDITABLE BLOCK ==== -->
55
+
56
+ <script src="https://unpkg.com/oriverse-engine@0.1.1/dist/ktx_lib.js"></script>
57
+ <script src="https://unpkg.com/oriverse-engine@0.1.1/dist/ktx_bridge.js"></script>
58
+ <script type="module">
59
+ import initOriverse from "https://unpkg.com/oriverse-engine@0.1.1/dist/oriverse_wgpu.js";
60
+ const setBoot = (t) => { const b = document.getElementById('oriverse-status-banner'); if (b) b.textContent = t; };
61
+ (async () => {
62
+ try {
63
+ setBoot('instantiating wasm...');
64
+ await initOriverse({ module_or_path: "https://unpkg.com/oriverse-engine@0.1.1/dist/oriverse_wgpu_bg.wasm" });
65
+ } catch (e) {
66
+ setBoot('WASM init failed:\n' + ((e && e.stack) ? e.stack : String(e)));
67
+ console.error('[wasm_boot] initOriverse failed:', e);
68
+ }
69
+ })();
70
+ </script>
71
+ </body>
72
+ </html>
73
+ ```
74
+
75
+ The engine auto-boots from the `#oriverse-weave` tag. (Programmatic alternative: remove
76
+ the tag and call `bootOriverseArtifact(weaveSource)` — exported by `oriverse_wgpu.js` —
77
+ once after `initOriverse(...)` resolves.)
78
+
79
+ ## Step 2: write the Weave game (replace the demo world in the block)
80
+
81
+ Rules — the engine hard-errors if you break the first two:
82
+
83
+ - ALL content must be procedural. Allowed models: `"cube"`, `"sphere"`, `"cylinder"`,
84
+ `"capsule"`, `"cone"`, `"wedge"`, plus `#mesh` clauses (procedural mesh DSL) and
85
+ `#texture` clauses (procedural material DSL). Market/network assets (`Ori.model.*`,
86
+ image/sound URLs, ...) are NOT available.
87
+ - No network access at runtime: no fetches, no external files, everything inline.
88
+ - Units: 1 unit = 1 cm, Z is up. Player is 180 cm tall. Base cube is 100x100x100 at
89
+ bottom-center pivot (an object at z=0 stands on the ground).
90
+ - `color = (r, g, b)` uses 0-1 floats (or `#RRGGBB`). 0-255 values clamp to WHITE.
91
+ - The game boots straight into play mode. WASD + mouse + Space jump already work via a
92
+ default player controller; define `#class player ... #end` only for custom movement.
93
+ - Give the world a ground object, a HUD (`screenCanvas`), a win or lose condition, and
94
+ `event KeyboardDown[R] { RestartGame() }` to replay.
95
+
96
+ Authoritative references, served next to the engine (fetch if you can — the authoring
97
+ guide contains three complete tested example games to pattern-match from):
98
+
99
+ - https://unpkg.com/oriverse-engine@0.1.1/dist/GAME_AUTHORING.md <- game patterns + 3 full example games
100
+ - https://unpkg.com/oriverse-engine@0.1.1/dist/weave_documentation.txt <- full language + API reference
101
+ - https://unpkg.com/oriverse-engine@0.1.1/dist/examples/coin_collector.weave (also dodge_blocks / target_range)
102
+
103
+ ## Step 3: test
104
+
105
+ Serve the folder containing `game.html` with any static server
106
+ (`python -m http.server 8000`) and open it in a WebGPU browser (Chrome/Edge). Boot
107
+ errors appear in the status banner and the browser console. Weave load errors are shown
108
+ with line numbers; fix and reload.