oriverse-engine 0.1.1 → 0.1.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 CHANGED
@@ -1,76 +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`.
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.2 together on new releases -->
29
+ <script src="https://unpkg.com/oriverse-engine@0.1.2/dist/ktx_lib.js"></script>
30
+ <script src="https://unpkg.com/oriverse-engine@0.1.2/dist/ktx_bridge.js"></script>
31
+ <script type="module">
32
+ import initOriverse from "https://unpkg.com/oriverse-engine@0.1.2/dist/oriverse_wgpu.js";
33
+ await initOriverse({ module_or_path: "https://unpkg.com/oriverse-engine@0.1.2/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.2/dist/oriverse_wgpu.js";
50
+ await initOriverse({ module_or_path: "https://unpkg.com/oriverse-engine@0.1.2/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.2/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`.
@@ -53,15 +53,15 @@ object BlueCube {
53
53
  </script>
54
54
  <!-- ==== END OF EDITABLE BLOCK ==== -->
55
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>
56
+ <script src="https://unpkg.com/oriverse-engine@0.1.2/dist/ktx_lib.js"></script>
57
+ <script src="https://unpkg.com/oriverse-engine@0.1.2/dist/ktx_bridge.js"></script>
58
58
  <script type="module">
59
- import initOriverse from "https://unpkg.com/oriverse-engine@0.1.1/dist/oriverse_wgpu.js";
59
+ import initOriverse from "https://unpkg.com/oriverse-engine@0.1.2/dist/oriverse_wgpu.js";
60
60
  const setBoot = (t) => { const b = document.getElementById('oriverse-status-banner'); if (b) b.textContent = t; };
61
61
  (async () => {
62
62
  try {
63
63
  setBoot('instantiating wasm...');
64
- await initOriverse({ module_or_path: "https://unpkg.com/oriverse-engine@0.1.1/dist/oriverse_wgpu_bg.wasm" });
64
+ await initOriverse({ module_or_path: "https://unpkg.com/oriverse-engine@0.1.2/dist/oriverse_wgpu_bg.wasm" });
65
65
  } catch (e) {
66
66
  setBoot('WASM init failed:\n' + ((e && e.stack) ? e.stack : String(e)));
67
67
  console.error('[wasm_boot] initOriverse failed:', e);
@@ -96,9 +96,9 @@ Rules — the engine hard-errors if you break the first two:
96
96
  Authoritative references, served next to the engine (fetch if you can — the authoring
97
97
  guide contains three complete tested example games to pattern-match from):
98
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)
99
+ - https://unpkg.com/oriverse-engine@0.1.2/dist/GAME_AUTHORING.md <- game patterns + 3 full example games
100
+ - https://unpkg.com/oriverse-engine@0.1.2/dist/weave_documentation.txt <- full language + API reference
101
+ - https://unpkg.com/oriverse-engine@0.1.2/dist/examples/coin_collector.weave (also dodge_blocks / target_range)
102
102
 
103
103
  ## Step 3: test
104
104
 
@@ -96,11 +96,11 @@ Default (injected when you don't write one):
96
96
  #class player
97
97
  event OnSpawned {
98
98
  forever {
99
- var Direction = GetPlayerInputDirectionCamera(Key.W, Key.S, Key.A, Key.D)
99
+ var Direction = GetMoveVectorCamera()
100
100
  MoveInDirectionContinuouslyFacing(Direction, 900)
101
101
  }
102
102
  }
103
- event KeyboardDownByThisPlayer[Space] {
103
+ event ActionDownByThisPlayer[Jump] {
104
104
  if IsOnGround() {
105
105
  Jump(1000)
106
106
  }
@@ -110,8 +110,8 @@ event KeyboardDownByThisPlayer[Space] {
110
110
 
111
111
  Customization patterns (all inside `#class player`):
112
112
 
113
- - Speed/feel: change `900` (cm/s); prefer `GetMoveVectorCamera()` for gameplay movement
114
- (it also handles mobile thumbsticks). `Jump(1400)` for a higher jump.
113
+ - Speed/feel: change `900` (cm/s); `GetMoveVectorCamera()` also handles mobile thumbsticks.
114
+ `Jump(1400)` for a higher jump.
115
115
  - Actions: `event ActionDownByThisPlayer[Primary]` (left click / tap), `[Secondary]`,
116
116
  `[Interact]` (E), `[Jump]`. `IsActionPressedByThisPlayer(Action.Primary)` for held state.
117
117
  - Aim at the crosshair: `GetMouseTargetObjectWithTag(Tag.Target)` returns the object under
@@ -211,7 +211,7 @@ The manager pattern (used by all three examples):
211
211
  ## 9. Procedural textures and meshes (quickstarts)
212
212
 
213
213
  `#texture` defines a material usable as `material = "Name"` on any object (verbatim
214
- docs example; see `<texture_dsl_examples>` in the docs for concrete/wood/metal/brick):
214
+ example from the `texture_dsl` skill, which also has concrete/wood/metal/brick recipes):
215
215
 
216
216
  ```text
217
217
  #texture StylizedGrass
@@ -438,7 +438,7 @@ event OnSpawned {
438
438
  MoveInDirectionContinuouslyFacing(dir, 900)
439
439
  }
440
440
  }
441
- event KeyboardDownByThisPlayer[Space] {
441
+ event ActionDownByThisPlayer[Jump] {
442
442
  if IsOnGround() {
443
443
  Jump(1000)
444
444
  }
@@ -9,7 +9,7 @@ event OnSpawned {
9
9
  MoveInDirectionContinuouslyFacing(dir, 900)
10
10
  }
11
11
  }
12
- event KeyboardDownByThisPlayer[Space] {
12
+ event ActionDownByThisPlayer[Jump] {
13
13
  if IsOnGround() {
14
14
  Jump(1000)
15
15
  }