oriverse-engine 0.1.1 → 0.1.3
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 -30
- package/README.md +76 -76
- package/dist/AGENT_ONBOARDING.md +74 -74
- package/dist/CODEX_PROMPT.md +7 -7
- package/dist/GAME_AUTHORING.md +6 -6
- package/dist/examples/coin_collector.weave +70 -70
- package/dist/examples/dodge_blocks.weave +70 -70
- package/dist/examples/target_range.weave +82 -82
- package/dist/ktx_bridge.js +121 -121
- package/dist/ktx_lib.js +1 -5236
- package/dist/ktx_lib.wasm +0 -0
- package/dist/oriverse_wgpu.d.ts +40 -40
- package/dist/oriverse_wgpu.js +1005 -354
- package/dist/oriverse_wgpu_bg.wasm +0 -0
- package/dist/oriverse_wgpu_bg.wasm.d.ts +40 -40
- package/dist/snippets/oriverse_market_client-0cd3013288f3c49c/inline0.js +6 -0
- package/dist/snippets/oriverse_networking_shared-e43478064e11e46c/inline0.js +4 -1
- package/dist/snippets/oriverse_wgpu-255445ce6d9a0851/inline0.js +20 -58
- package/dist/snippets/oriverse_wgpu-255445ce6d9a0851/inline1.js +58 -19
- package/dist/starter/AGENTS.md +2 -2
- package/dist/starter/CLAUDE.md +2 -2
- package/dist/starter/game.html +5 -5
- package/dist/templates/game_cdn.html +5 -5
- package/dist/weave_documentation.txt +730 -4897
- package/package.json +18 -18
package/LICENSE.md
CHANGED
|
@@ -1,30 +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.
|
|
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
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.
|
|
29
|
-
<script src="https://unpkg.com/oriverse-engine@0.1.
|
|
30
|
-
<script src="https://unpkg.com/oriverse-engine@0.1.
|
|
31
|
-
<script type="module">
|
|
32
|
-
import initOriverse from "https://unpkg.com/oriverse-engine@0.1.
|
|
33
|
-
await initOriverse({ module_or_path: "https://unpkg.com/oriverse-engine@0.1.
|
|
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.
|
|
50
|
-
await initOriverse({ module_or_path: "https://unpkg.com/oriverse-engine@0.1.
|
|
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.
|
|
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`.
|
package/dist/AGENT_ONBOARDING.md
CHANGED
|
@@ -1,74 +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).
|
|
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).
|
package/dist/CODEX_PROMPT.md
CHANGED
|
@@ -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.
|
|
57
|
-
<script src="https://unpkg.com/oriverse-engine@0.1.
|
|
56
|
+
<script src="https://unpkg.com/oriverse-engine@0.1.3/dist/ktx_lib.js"></script>
|
|
57
|
+
<script src="https://unpkg.com/oriverse-engine@0.1.3/dist/ktx_bridge.js"></script>
|
|
58
58
|
<script type="module">
|
|
59
|
-
import initOriverse from "https://unpkg.com/oriverse-engine@0.1.
|
|
59
|
+
import initOriverse from "https://unpkg.com/oriverse-engine@0.1.3/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.
|
|
64
|
+
await initOriverse({ module_or_path: "https://unpkg.com/oriverse-engine@0.1.3/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.
|
|
100
|
-
- https://unpkg.com/oriverse-engine@0.1.
|
|
101
|
-
- https://unpkg.com/oriverse-engine@0.1.
|
|
99
|
+
- https://unpkg.com/oriverse-engine@0.1.3/dist/GAME_AUTHORING.md <- game patterns + 3 full example games
|
|
100
|
+
- https://unpkg.com/oriverse-engine@0.1.3/dist/weave_documentation.txt <- full language + API reference
|
|
101
|
+
- https://unpkg.com/oriverse-engine@0.1.3/dist/examples/coin_collector.weave (also dodge_blocks / target_range)
|
|
102
102
|
|
|
103
103
|
## Step 3: test
|
|
104
104
|
|
package/dist/GAME_AUTHORING.md
CHANGED
|
@@ -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 =
|
|
99
|
+
var Direction = GetMoveVectorCamera()
|
|
100
100
|
MoveInDirectionContinuouslyFacing(Direction, 900)
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
|
-
event
|
|
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);
|
|
114
|
-
|
|
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
|
-
|
|
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
|
|
441
|
+
event ActionDownByThisPlayer[Jump] {
|
|
442
442
|
if IsOnGround() {
|
|
443
443
|
Jump(1000)
|
|
444
444
|
}
|
|
@@ -1,70 +1,70 @@
|
|
|
1
|
-
// Coin Collector — walk into the 10 spinning coins to collect them all. Press R to replay.
|
|
2
|
-
// Demonstrates: saved objects + runtime spawning, tags, proximity pickup, HUD score text,
|
|
3
|
-
// win + restart flow. Movement uses the engine's default player controller (no #class player).
|
|
4
|
-
|
|
5
|
-
#class Coin
|
|
6
|
-
event OnPreSpawn {
|
|
7
|
-
AddTag(Tag.Coin)
|
|
8
|
-
}
|
|
9
|
-
event OnSpawned {
|
|
10
|
-
forever {
|
|
11
|
-
RotateLeftInstantly(4)
|
|
12
|
-
var p = NearestPlayer()
|
|
13
|
-
if p.Exists() and SurfaceGapTo(p) < 70 {
|
|
14
|
-
p.SpawnFloatingText("+1", Vector(1, 0.9, 0.2))
|
|
15
|
-
Destroy()
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
#end
|
|
20
|
-
|
|
21
|
-
#class GameManager
|
|
22
|
-
var TotalCoins = 10
|
|
23
|
-
var SeenCoins = false
|
|
24
|
-
event OnSpawned {
|
|
25
|
-
for i in 0..TotalCoins {
|
|
26
|
-
var pos = Position(RandomNumber(-1400, 1400), RandomNumber(-1400, 1400), 80)
|
|
27
|
-
SpawnObject(SavedObject.coin, pos)
|
|
28
|
-
}
|
|
29
|
-
var scoreLabel = ResolveObjectByNameOnce("ScoreText")
|
|
30
|
-
var midLabel = ResolveObjectByNameOnce("MidText")
|
|
31
|
-
forever {
|
|
32
|
-
// Spawned coins register their tag on the next tick, so wait until the census
|
|
33
|
-
// has seen at least one coin before treating "0 left" as a win.
|
|
34
|
-
var left = GetAllObjectsWithTag(Tag.Coin).Count()
|
|
35
|
-
var collected = TotalCoins - left
|
|
36
|
-
scoreLabel.SetText("Coins: " + collected + " / " + TotalCoins)
|
|
37
|
-
if left == 0 and collected == TotalCoins and SeenCoins {
|
|
38
|
-
midLabel.SetText("YOU WIN! Press R to play again")
|
|
39
|
-
} else {
|
|
40
|
-
midLabel.SetText("")
|
|
41
|
-
}
|
|
42
|
-
if left > 0 {
|
|
43
|
-
SeenCoins = true
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
event KeyboardDown[R] {
|
|
48
|
-
RestartGame()
|
|
49
|
-
}
|
|
50
|
-
#end
|
|
51
|
-
|
|
52
|
-
saved coin {
|
|
53
|
-
display coin : Coin { model = "cylinder" size = (60, 60, 12) rotation = (90, 0, 0) color = (1, 0.85, 0.2) }
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
object Ground {
|
|
57
|
-
model = "cube"
|
|
58
|
-
position = (0, 0, -50)
|
|
59
|
-
size = (4000, 4000, 100)
|
|
60
|
-
color = (0.32, 0.5, 0.34)
|
|
61
|
-
}
|
|
62
|
-
object PillarA { position = (400, 400, 150) size = (100, 100, 300) color = (0.62, 0.58, 0.52) }
|
|
63
|
-
object PillarB { position = (-600, 300, 150) size = (100, 100, 300) color = (0.62, 0.58, 0.52) }
|
|
64
|
-
object PillarC { position = (200, -700, 150) size = (100, 100, 300) color = (0.62, 0.58, 0.52) }
|
|
65
|
-
display manager : GameManager { visible = false }
|
|
66
|
-
|
|
67
|
-
screenCanvas HUD {
|
|
68
|
-
textLabel ScoreText { offset = (20, 20) text = "Coins: 0 / 10" color = (1, 1, 0.85) }
|
|
69
|
-
textLabel MidText { align = (center, center) text = "" color = (1, 1, 0.3) }
|
|
70
|
-
}
|
|
1
|
+
// Coin Collector — walk into the 10 spinning coins to collect them all. Press R to replay.
|
|
2
|
+
// Demonstrates: saved objects + runtime spawning, tags, proximity pickup, HUD score text,
|
|
3
|
+
// win + restart flow. Movement uses the engine's default player controller (no #class player).
|
|
4
|
+
|
|
5
|
+
#class Coin
|
|
6
|
+
event OnPreSpawn {
|
|
7
|
+
AddTag(Tag.Coin)
|
|
8
|
+
}
|
|
9
|
+
event OnSpawned {
|
|
10
|
+
forever {
|
|
11
|
+
RotateLeftInstantly(4)
|
|
12
|
+
var p = NearestPlayer()
|
|
13
|
+
if p.Exists() and SurfaceGapTo(p) < 70 {
|
|
14
|
+
p.SpawnFloatingText("+1", Vector(1, 0.9, 0.2))
|
|
15
|
+
Destroy()
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
#end
|
|
20
|
+
|
|
21
|
+
#class GameManager
|
|
22
|
+
var TotalCoins = 10
|
|
23
|
+
var SeenCoins = false
|
|
24
|
+
event OnSpawned {
|
|
25
|
+
for i in 0..TotalCoins {
|
|
26
|
+
var pos = Position(RandomNumber(-1400, 1400), RandomNumber(-1400, 1400), 80)
|
|
27
|
+
SpawnObject(SavedObject.coin, pos)
|
|
28
|
+
}
|
|
29
|
+
var scoreLabel = ResolveObjectByNameOnce("ScoreText")
|
|
30
|
+
var midLabel = ResolveObjectByNameOnce("MidText")
|
|
31
|
+
forever {
|
|
32
|
+
// Spawned coins register their tag on the next tick, so wait until the census
|
|
33
|
+
// has seen at least one coin before treating "0 left" as a win.
|
|
34
|
+
var left = GetAllObjectsWithTag(Tag.Coin).Count()
|
|
35
|
+
var collected = TotalCoins - left
|
|
36
|
+
scoreLabel.SetText("Coins: " + collected + " / " + TotalCoins)
|
|
37
|
+
if left == 0 and collected == TotalCoins and SeenCoins {
|
|
38
|
+
midLabel.SetText("YOU WIN! Press R to play again")
|
|
39
|
+
} else {
|
|
40
|
+
midLabel.SetText("")
|
|
41
|
+
}
|
|
42
|
+
if left > 0 {
|
|
43
|
+
SeenCoins = true
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
event KeyboardDown[R] {
|
|
48
|
+
RestartGame()
|
|
49
|
+
}
|
|
50
|
+
#end
|
|
51
|
+
|
|
52
|
+
saved coin {
|
|
53
|
+
display coin : Coin { model = "cylinder" size = (60, 60, 12) rotation = (90, 0, 0) color = (1, 0.85, 0.2) }
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
object Ground {
|
|
57
|
+
model = "cube"
|
|
58
|
+
position = (0, 0, -50)
|
|
59
|
+
size = (4000, 4000, 100)
|
|
60
|
+
color = (0.32, 0.5, 0.34)
|
|
61
|
+
}
|
|
62
|
+
object PillarA { position = (400, 400, 150) size = (100, 100, 300) color = (0.62, 0.58, 0.52) }
|
|
63
|
+
object PillarB { position = (-600, 300, 150) size = (100, 100, 300) color = (0.62, 0.58, 0.52) }
|
|
64
|
+
object PillarC { position = (200, -700, 150) size = (100, 100, 300) color = (0.62, 0.58, 0.52) }
|
|
65
|
+
display manager : GameManager { visible = false }
|
|
66
|
+
|
|
67
|
+
screenCanvas HUD {
|
|
68
|
+
textLabel ScoreText { offset = (20, 20) text = "Coins: 0 / 10" color = (1, 1, 0.85) }
|
|
69
|
+
textLabel MidText { align = (center, center) text = "" color = (1, 1, 0.3) }
|
|
70
|
+
}
|