pelican-engine 0.3.3 → 0.3.6
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/AGENTS.md +23 -9
- package/CONTRIBUTING.md +35 -0
- package/README.md +72 -117
- package/distribution.json +20 -16
- package/docs/DECISIONS.md +1 -0
- package/docs/GETTING-STARTED.md +80 -0
- package/docs/{M3-USAGE.md → GRAPHICS-GUIDE.md} +17 -17
- package/docs/PELICAN-MIGRATION.md +5 -5
- package/docs/PHYSICS-LIFECYCLE-ISSUE.md +19 -0
- package/docs/RENDER-BACKENDS.md +6 -4
- package/docs/STATUS.md +1 -1
- package/docs/api/REFERENCE.md +2 -2
- package/docs/api/index.json +2 -2
- package/docs/assets/pelican-mark.svg +29 -0
- package/docs/npm/DISTRIBUTION.md +72 -117
- package/docs/npm/GAME-AUTHOR.md +23 -9
- package/engine.manifest.json +1 -1
- package/lib/sdk/index.d.ts +1 -1
- package/lib/sdk/index.js +1 -1
- package/package.json +2 -1
package/AGENTS.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Pelican Engine Game Author
|
|
2
2
|
|
|
3
|
+
For an installed game, start in an empty directory with `npm --prefix . install
|
|
4
|
+
--save-dev --save-exact pelican-engine`, then run `npx pelican dev`. The CLI
|
|
5
|
+
generates the minimal starter when the directory is eligible and preserves existing
|
|
6
|
+
game files. See `docs/GETTING-STARTED.md` in the package for npm and source
|
|
7
|
+
workflows. Commands use common Node/npm syntax; the currently supported development
|
|
8
|
+
environment is Windows, while player support depends on actual browser capabilities.
|
|
9
|
+
|
|
3
10
|
Your workspace is the game project. Use the public `pelican-engine` API and local
|
|
4
11
|
game modules. Do not modify engine internals or `node_modules`, import Three.js,
|
|
5
12
|
TSL, GPU devices, physics-library objects, compiler internals or Node APIs into
|
|
@@ -15,9 +22,10 @@ lists the JSON CLI protocol. `docs/CAPABILITIES.md` records implemented scope an
|
|
|
15
22
|
limitations. The longer `docs/AI-WORKFLOW.md` is shared design context, not an
|
|
16
23
|
instruction to run source-only engine acceptance tasks.
|
|
17
24
|
|
|
18
|
-
The
|
|
19
|
-
|
|
20
|
-
|
|
25
|
+
The installed package includes `docs/GRAPHICS-GUIDE.md` and
|
|
26
|
+
`docs/RENDER-BACKENDS.md`. The source checkout's `docs/STATUS.md` summarizes
|
|
27
|
+
current engine capabilities and gaps. Its `examples/`, engine `packages/`, and
|
|
28
|
+
`npm run probe:*` references are maintainer references available only in a source checkout; the npm package
|
|
21
29
|
intentionally contains no example projects, game assets, or engine source. Use
|
|
22
30
|
the same public declarations in your own game project and validate them with the
|
|
23
31
|
installed `pelican` commands. Do not try to import an internal compiled module.
|
|
@@ -107,20 +115,26 @@ Keyboard bindings use the browser's `KeyboardEvent.key` values, not physical
|
|
|
107
115
|
`KeyboardEvent.code` values. For example, use `input: { up: ["w", "W", "ArrowUp"],
|
|
108
116
|
restart: ["r", "R"] }`, not `"KeyW"` or `"KeyR"`. Letter case depends on the
|
|
109
117
|
actual keyboard event; Space is `" "`. Actions are read inside systems through
|
|
110
|
-
`ctx.input.held`, `pressed`, `released`, or `axis`.
|
|
111
|
-
|
|
118
|
+
`ctx.input.held`, `pressed`, `released`, or `axis`. A mocked system test does not
|
|
119
|
+
establish browser bindings; real input requires separate verification when permitted.
|
|
112
120
|
|
|
113
121
|
## Work Loop
|
|
114
122
|
|
|
115
123
|
1. Inspect `pelican.project.json`, `game.ts`, asset declarations and the public API.
|
|
116
124
|
2. Make small game-only edits. Keep the exact engine version lock.
|
|
117
|
-
3.
|
|
125
|
+
3. Follow the active project policy for running the game or checking gameplay.
|
|
118
126
|
4. Use `inspect`, `input`, `step`, `pause`, `resume`, `snapshot`, `restore`,
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
127
|
+
`record`, `replay`, `status`, `cancel` and `reset-session` against the dev port
|
|
128
|
+
when verification is permitted.
|
|
129
|
+
5. When verification is permitted, use capture and inspect results; preserve
|
|
130
|
+
explicit failures rather than claiming success.
|
|
122
131
|
6. Run `build` and serve `dist/` over HTTP(S). Keep notices and license files.
|
|
123
132
|
|
|
133
|
+
The current engine project decision permits compilation and builds only, not
|
|
134
|
+
tests, browser/GPU runs, smoke or other validation. Historical instructions and
|
|
135
|
+
reports do not authorize those activities or establish that they passed for the
|
|
136
|
+
current source.
|
|
137
|
+
|
|
124
138
|
Installed package commands use `npx --no-install pelican <command>` from the game
|
|
125
139
|
directory. Repository commands use `node --import tsx <engine>/tools/cli.ts
|
|
126
140
|
<command> --project <game-directory>` with the same operations and protocol.
|
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# 参与开发
|
|
2
|
+
|
|
3
|
+
感谢关注 Pelican Engine!本项目使用 MIT 许可证。游戏作者可以只安装 npm 包;本指南面向需要阅读、修改或维护引擎源码的贡献者。
|
|
4
|
+
|
|
5
|
+
## 开发前
|
|
6
|
+
|
|
7
|
+
请先阅读 [当前研发状态](docs/STATUS.md)、[架构](docs/ARCHITECTURE.md) 和与你的改动有关的文档。确认改动范围、现有工作区状态和已知限制,不覆盖他人的未提交文件。公开 API 由 SDK 源码定义;改动接口时应同时维护相关类型、文档和示例。
|
|
8
|
+
|
|
9
|
+
当前支持的引擎开发环境为 Windows,使用 Node.js 24.x 和 npm。以下是通用 Node/npm 命令的写法,不代表其他开发系统已经受支持。玩家端按实际浏览器与图形能力判断,不设置平台白名单。
|
|
10
|
+
|
|
11
|
+
## 从源码运行
|
|
12
|
+
|
|
13
|
+
```sh
|
|
14
|
+
git clone https://github.com/danchar12138/pelican-engine.git
|
|
15
|
+
cd pelican-engine
|
|
16
|
+
npm ci
|
|
17
|
+
npm run dev
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
`npm run dev` 使用仓库当前默认示例;`npm run build` 将示例静态构建输出到根目录 `dist/`。源码 ZIP 和已有目录也可以使用这些命令,不依赖 Git 元数据。若只是创建游戏,请优先阅读 [快速入门](docs/GETTING-STARTED.md)。
|
|
21
|
+
|
|
22
|
+
## 单线、单主题提交
|
|
23
|
+
|
|
24
|
+
- 在 `main` 主工作树按依赖串行工作,不建立额外工作树或开发分支。
|
|
25
|
+
- 一次提交围绕一个功能、修复或版本;不要把无关工作和历史证据混在一起。提交消息使用中文 Conventional Commits,例如 `fix(renderer): 修复资源释放`。
|
|
26
|
+
- 需要发布时在仓库中显式维护统一的标准版本号。推送 `main` 会触发 npm OIDC 发布;版本已存在时不会覆盖。GitHub Release 用于标记里程碑。详见 [发布说明](docs/RELEASING.md)。
|
|
27
|
+
- 用户要求当前只允许编译和构建;不要运行测试、浏览器、GPU、性能、smoke 或其他验证,也不要声称未执行的步骤通过。以前的测试文件和证据保留其历史属性。
|
|
28
|
+
- 不要为整理目录而删除未经确认的用户数据、历史报告或未合并候选;不能递归跟随目录链接或 junction。
|
|
29
|
+
|
|
30
|
+
## 提交问题或改动
|
|
31
|
+
|
|
32
|
+
描述目标、涉及的公开接口、实际运行的编译或构建命令、结果与已知缺口。运行或硬件行为未经验证时明确说明。涉及第三方代码或资产时记录来源与许可证;不要提交凭据、开发缓存或构建输出。
|
|
33
|
+
|
|
34
|
+
- [问题反馈](https://github.com/danchar12138/pelican-engine/issues)
|
|
35
|
+
- [公开 API](docs/api/REFERENCE.md) · [能力说明](docs/CAPABILITIES.md) · [开发状态](docs/STATUS.md)
|
package/README.md
CHANGED
|
@@ -1,130 +1,85 @@
|
|
|
1
|
-
|
|
1
|
+
<div align="center">
|
|
2
|
+
<img src="https://raw.githubusercontent.com/danchar12138/pelican-engine/main/docs/assets/pelican-mark.svg" alt="Pelican Engine" width="110" height="110">
|
|
3
|
+
<h1>Pelican Engine</h1>
|
|
4
|
+
<p><strong>Build games for the web with TypeScript.</strong></p>
|
|
5
|
+
<p>Code-first · WebGPU-first · Designed for human and external AI workflows</p>
|
|
6
|
+
<p>
|
|
7
|
+
<a href="https://www.npmjs.com/package/pelican-engine"><img src="https://img.shields.io/npm/v/pelican-engine?label=npm&color=168b80" alt="npm version"></a>
|
|
8
|
+
<img src="https://img.shields.io/badge/license-MIT-24536b" alt="MIT license">
|
|
9
|
+
<img src="https://img.shields.io/badge/TypeScript-SDK-3178c6" alt="TypeScript SDK">
|
|
10
|
+
</p>
|
|
11
|
+
</div>
|
|
12
|
+
|
|
13
|
+
Pelican Engine provides a TypeScript SDK, compiler, runtime, renderer and CLI in one package. Define game content and behavior in code, run a local development server and build a static web distribution. AI tools may assist development, but the game runtime does not include an LLM or AI agent.
|
|
14
|
+
|
|
15
|
+
> **Development status:** this is an evolving engine, not a complete first release. Current source behavior, hardware compatibility, performance and the full feature set have not been fully validated. A normal version number is not an acceptance claim. See the [development status](https://github.com/danchar12138/pelican-engine/blob/main/docs/STATUS.md) for known gaps.
|
|
16
|
+
|
|
17
|
+
## Quick start
|
|
18
|
+
|
|
19
|
+
Install Node.js **24.x** and npm, then create a new empty game directory:
|
|
20
|
+
|
|
21
|
+
```sh
|
|
22
|
+
mkdir my-pelican-game
|
|
23
|
+
cd my-pelican-game
|
|
24
|
+
npm --prefix . install --save-dev --save-exact pelican-engine
|
|
25
|
+
npx pelican dev
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
The first `dev` creates `game.ts`, `pelican.project.json` and `AGENTS.md` in an eligible empty project. Existing game files and author instructions are not overwritten. The explicit `--prefix .` prevents npm from choosing a parent project; `--save-exact` pins the installed version. Stop the development server before building:
|
|
29
|
+
|
|
30
|
+
```sh
|
|
31
|
+
npx --no-install pelican build
|
|
32
|
+
```
|
|
2
33
|
|
|
3
|
-
|
|
4
|
-
public SDK used by repository games, not a wrapper or a separate SDK. The package
|
|
5
|
-
also provides the `pelican` executable. This is an M3 development distribution,
|
|
6
|
-
not accepted M3 hardware evidence or a complete engine release.
|
|
34
|
+
Deploy the resulting `dist/` directory, including its generated assets and notices, to an HTTP(S) static host. For a nested deployment, use `npx --no-install pelican build --base /game/`.
|
|
7
35
|
|
|
8
|
-
|
|
36
|
+
Commands use common Node/npm syntax rather than a particular shell. **Engine and game development currently support Windows only**; Linux and macOS development workflows have not been promised or validated. Player platforms are not restricted by brand or OS: actual rendering availability depends on browser and graphics capabilities.
|
|
9
37
|
|
|
10
|
-
|
|
11
|
-
in this directory even when a parent directory is also an npm project:
|
|
38
|
+
## Your game
|
|
12
39
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
40
|
+
The generated starter defines a scene and a rotating box. Game code imports only the public package, for example:
|
|
41
|
+
|
|
42
|
+
```ts
|
|
43
|
+
import { defineGame, defineMaterial, defineScene } from "pelican-engine";
|
|
44
|
+
|
|
45
|
+
const material = defineMaterial({ id: "paint", color: "#38b8a4", roughness: 0.45 });
|
|
46
|
+
const scene = defineScene({
|
|
47
|
+
id: "main",
|
|
48
|
+
camera: { position: [4, 3, 6], target: [0, 0, 0], fov: 50 },
|
|
49
|
+
entities: [
|
|
50
|
+
{ id: "box", mesh: { geometry: { kind: "box" }, material } },
|
|
51
|
+
{ id: "light", light: { kind: "directional", intensity: 4 },
|
|
52
|
+
transform: { position: [3, 6, 4] } },
|
|
53
|
+
],
|
|
54
|
+
});
|
|
55
|
+
export default defineGame({ id: "my-game", scene });
|
|
16
56
|
```
|
|
17
57
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
project files or author instructions prevent automatic scaffolding. Files are
|
|
22
|
-
never overwritten. Stop dev with Ctrl+C, then use the same local CLI:
|
|
58
|
+
Save it as `game.ts` in a project created by the CLI. The exact engine version is recorded in `pelican.project.json`: migrate the game and update its lock explicitly when changing engine versions. Do not edit `node_modules` or import engine internals.
|
|
59
|
+
|
|
60
|
+
Useful commands:
|
|
23
61
|
|
|
24
|
-
```
|
|
62
|
+
```sh
|
|
63
|
+
npx --no-install pelican help
|
|
25
64
|
npx --no-install pelican api
|
|
26
|
-
npx --no-install pelican
|
|
27
|
-
npx --no-install pelican check
|
|
65
|
+
npx --no-install pelican api --symbol defineGame
|
|
28
66
|
npx --no-install pelican dev --port 4173
|
|
29
|
-
npx --no-install pelican capture --port 4174 --output capture.png
|
|
30
67
|
npx --no-install pelican build
|
|
31
68
|
```
|
|
32
69
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
`
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
`create` writes `game.ts`, `AGENTS.md` and an exact `pelican.project.json` lock in the current
|
|
49
|
-
directory. Existing project files are never overwritten. Author TypeScript with
|
|
50
|
-
named imports from `pelican-engine` and project-local imports only. The compiler
|
|
51
|
-
reports `TC_PUBLIC_API` for renderer, Three.js, TSL, physics, Node and internal
|
|
52
|
-
package imports, including type-only and unused imports. Package subpaths are not
|
|
53
|
-
public exports. Project lock mismatches report `TC_ENGINE_VERSION_MISMATCH`;
|
|
54
|
-
mixed package/API versions report `TC_ENGINE_SDK_VERSION`. Reinstall a matching
|
|
55
|
-
exact version, or migrate through the public API before explicitly changing a lock.
|
|
56
|
-
|
|
57
|
-
After npm dependencies and Playwright Chromium have been installed, authoring,
|
|
58
|
-
API inspection, checks, builds, dev/control commands and capture need no network
|
|
59
|
-
service. `setup --offline` never installs dependencies or downloads a browser in
|
|
60
|
-
an installed package. Keep the game package-lock for repeatable future installs;
|
|
61
|
-
an offline _reinstall_ additionally requires the npm cache or a dependency mirror.
|
|
62
|
-
`TC_DISTRIBUTION_DEPENDENCY_MISSING` and
|
|
63
|
-
`TC_DISTRIBUTION_DEPENDENCY_VERSION` identify broken tool dependencies.
|
|
64
|
-
|
|
65
|
-
Serve the generated `dist/` directory over HTTP(S), including its `generated/`
|
|
66
|
-
files, license files, notices and compression manifests. No Node process, engine
|
|
67
|
-
repository, SDK installation, external AI service or development control server
|
|
68
|
-
is needed by players. Use `build --base /game/` for a nested deployment URL.
|
|
69
|
-
Capture requires installed Chromium and actual supported graphics capability.
|
|
70
|
-
No software renderer result establishes hardware acceptance.
|
|
71
|
-
|
|
72
|
-
## AI entry points
|
|
73
|
-
|
|
74
|
-
Read the game-author `AGENTS.md`, `docs/npm/GAME-AUTHOR.md`, `docs/CAPABILITIES.md` and
|
|
75
|
-
`docs/api/REFERENCE.md` inside `node_modules/pelican-engine`. The machine-readable
|
|
76
|
-
API is `docs/api/index.json`, also discoverable through `pelican api`.
|
|
77
|
-
`lib/sdk/index.d.ts` is the authoritative installed declaration surface.
|
|
78
|
-
`docs/PELICAN-MIGRATION.md` explains current names and historical provenance.
|
|
79
|
-
Repository paths and release instructions in copied documents are historical
|
|
80
|
-
context; the installed workflow above replaces source-checkout commands.
|
|
81
|
-
The JSON CLI protocol and dev control operations are shared with the repository.
|
|
82
|
-
|
|
83
|
-
## Maintainer validation and publishing
|
|
84
|
-
|
|
85
|
-
```powershell
|
|
86
|
-
npm run distribution:test
|
|
87
|
-
npm run distribution:pack
|
|
88
|
-
npm run distribution:smoke
|
|
89
|
-
npm run distribution:smoke -- --gpu
|
|
90
|
-
```
|
|
70
|
+
The renderer prioritizes WebGPU and can use Three.js's built-in WebGL2 raster fallback. Compute-dependent hybrid/path tracing and compute features are not available on WebGL2; unsupported requests return diagnostics rather than silently claiming equivalent rendering. See the [backend guide](https://github.com/danchar12138/pelican-engine/blob/main/docs/RENDER-BACKENDS.md).
|
|
71
|
+
|
|
72
|
+
## Documentation
|
|
73
|
+
|
|
74
|
+
- [Getting started: npm and source checkout](https://github.com/danchar12138/pelican-engine/blob/main/docs/GETTING-STARTED.md)
|
|
75
|
+
- [Game author guide](https://github.com/danchar12138/pelican-engine/blob/main/docs/npm/GAME-AUTHOR.md)
|
|
76
|
+
- [API reference](https://github.com/danchar12138/pelican-engine/blob/main/docs/api/REFERENCE.md) and [capabilities](https://github.com/danchar12138/pelican-engine/blob/main/docs/CAPABILITIES.md)
|
|
77
|
+
- [Source repository and contribution guide](https://github.com/danchar12138/pelican-engine)
|
|
78
|
+
|
|
79
|
+
The installed package also includes `docs/npm/GAME-AUTHOR.md`, `docs/api/REFERENCE.md`, `docs/api/index.json` and `lib/sdk/index.d.ts`. The installed declarations and `pelican api` describe the API of the actual installed version. Repository examples and assets are not shipped in the npm package.
|
|
80
|
+
|
|
81
|
+
Playwright Chromium is optional for capture and browser automation. If needed, prepare it while online with `npx --no-install pelican setup --install-browser`. With required dependencies and assets already available, everyday operations need no engine account or hosted development service. An offline reinstall additionally requires cached packages.
|
|
82
|
+
|
|
83
|
+
## License
|
|
91
84
|
|
|
92
|
-
|
|
93
|
-
`.pelican/npm/package/`; tarballs and smoke reports go in `.pelican/npm/artifacts/`.
|
|
94
|
-
Neither staging nor tarballs are inside the deployable game `dist/`.
|
|
95
|
-
Pack that staging directory, not the private repository root. Compiled relative
|
|
96
|
-
imports use `lib/` modules and `.js`, never the TypeScript source layout. The
|
|
97
|
-
tarball allowlist excludes source maps, evidence, examples and game assets;
|
|
98
|
-
SDK declarations, engine runtime code, MIT, copied AI docs, and dependency
|
|
99
|
-
license texts are included. `distribution.json` records version and file hashes.
|
|
100
|
-
Dependencies are normal pinned npm dependencies, not vendored engine sources.
|
|
101
|
-
|
|
102
|
-
The npm workflow runs only for a published GitHub milestone release. Its gate
|
|
103
|
-
requires tag/version/SDK/manifest identity and the existing milestone acceptance
|
|
104
|
-
and source-fingerprint checks. An ordinary push or CPU-green build cannot publish.
|
|
105
|
-
M3 is deliberately blocked until its release profile and real acceptance exist.
|
|
106
|
-
The default smoke install uses npm cache only; `--online-install` allows network
|
|
107
|
-
for initial dependency installation, then runs every operation offline with a
|
|
108
|
-
disabled registry. CI uses this flag because `npm ci` alone need not populate
|
|
109
|
-
registry metadata for a fresh external install. `--gpu` additionally measures
|
|
110
|
-
the installed WebGPU backend, renders path/hybrid/raster, checks a nonblank canvas,
|
|
111
|
-
captures through both CLI routes, verifies WebGL2 fallback rejection, and loads
|
|
112
|
-
the nested-base static build without a development hook. It is not M3 acceptance.
|
|
113
|
-
|
|
114
|
-
The single unscoped package is `pelican-engine`, its only public import is
|
|
115
|
-
`pelican-engine`, and its executable is `pelican`. The GitHub target is
|
|
116
|
-
`danchar12138/pelican-engine`; main completed the public repository rename and
|
|
117
|
-
verified the updated origin. No new organization is required. The authorized
|
|
118
|
-
npm Automation Token was authenticated as `danchar12138`, and main confirmed
|
|
119
|
-
the repository Actions secret `NPM_TOKEN` is configured. `npm view pelican-engine`
|
|
120
|
-
returned `E404` before publication. The package remains unpublished pending
|
|
121
|
-
genuine M3 acceptance; this is not an authentication or organization blocker.
|
|
122
|
-
`setup-node` configures the registry;
|
|
123
|
-
only the final publication step receives `NODE_AUTH_TOKEN`. A missing secret
|
|
124
|
-
fails with `TC_NPM_AUTH_MISSING`, without printing the value. The token must have
|
|
125
|
-
permission to publish the fixed unscoped package. No OIDC/trusted-publisher setup
|
|
126
|
-
or provenance flag is required by this workflow. Prereleases use `next`; stable
|
|
127
|
-
versions use `latest`. These credentials do not bypass milestone acceptance.
|
|
128
|
-
No token value is stored in source, documentation, or probe output. No publication
|
|
129
|
-
is performed by this packaging task. See
|
|
130
|
-
`tools/npm/publish-gate.ts` in the source distribution.
|
|
85
|
+
Pelican Engine's own code is MIT licensed. Dependency licenses and third-party notices are included in the package under `licenses/` and in the [repository notices](https://github.com/danchar12138/pelican-engine/blob/main/docs/THIRD-PARTY-NOTICES.md).
|
package/distribution.json
CHANGED
|
@@ -1,23 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"format": "pelican.npm-distribution",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.6",
|
|
4
4
|
"files": {
|
|
5
|
-
"AGENTS.md": "
|
|
5
|
+
"AGENTS.md": "80067dae6407a09cf62758fae5502f5d0efa4dac3a85698477bf2b09bdacc78e",
|
|
6
|
+
"CONTRIBUTING.md": "0ffad5d841d90f319fc50a75b81d3c0ad6dab8d5d9bec2846c65c7f8358d5a50",
|
|
6
7
|
"docs/AI-WORKFLOW.md": "aa992686df93f791795f6f3fce01713d812eea6a1b9556f07411ac5847278efa",
|
|
7
|
-
"docs/api/index.json": "
|
|
8
|
-
"docs/api/REFERENCE.md": "
|
|
8
|
+
"docs/api/index.json": "1dad6c0a65c59bf72271d14a671c4f1f0f18d8239725fc32d429ed015cbbf229",
|
|
9
|
+
"docs/api/REFERENCE.md": "4052d6de1fede807746f950c055d136da43069f51c45df47eba88c72941994f6",
|
|
9
10
|
"docs/ARCHITECTURE.md": "3184b73592d466390e7793b1cf39bbb80d6052b523fba7e7cb377b5207074627",
|
|
11
|
+
"docs/assets/pelican-mark.svg": "407b10cd7e292ea83cf5dba4046fb2f01c7d566a14014c55deda3a2984562b4d",
|
|
10
12
|
"docs/CAPABILITIES.md": "92950817497d8c63db07830db96dc93c877befa8d038320feed1ae1f1a053cb1",
|
|
11
|
-
"docs/DECISIONS.md": "
|
|
12
|
-
"docs/
|
|
13
|
-
"docs/
|
|
14
|
-
"docs/npm/
|
|
15
|
-
"docs/
|
|
16
|
-
"docs/
|
|
13
|
+
"docs/DECISIONS.md": "47d3a1de8ecc8c5b06ddd867536831b9d3573fb0fefa9de6d4d9e87615daead8",
|
|
14
|
+
"docs/GETTING-STARTED.md": "5519ebe4e513e8ae4517c04948ee9dc70bcb1e3d04a65d468a6537c838502663",
|
|
15
|
+
"docs/GRAPHICS-GUIDE.md": "e3d0f7df6189ca3f88d81af5ffaf393f5d6bf39b9e66167bb2f64b39194b514c",
|
|
16
|
+
"docs/npm/DISTRIBUTION.md": "ff25e039921a85ba253c27608c77ed614a036117d7a04f908a78d1e3ed3f19ef",
|
|
17
|
+
"docs/npm/GAME-AUTHOR.md": "80067dae6407a09cf62758fae5502f5d0efa4dac3a85698477bf2b09bdacc78e",
|
|
18
|
+
"docs/PELICAN-MIGRATION.md": "c5d6ab8e5186f4d36720a0a01d1a7e4157a5d386c5400e2db99571a7d10a1e49",
|
|
19
|
+
"docs/PHYSICS-LIFECYCLE-ISSUE.md": "cc78917462de4e7e9b68e77c742192ce213b4be5b516d2ba943251fff46977ac",
|
|
20
|
+
"docs/RENDER-BACKENDS.md": "d981ea94742a835d028db37d536fb7fba05102e37bc6274a37baf74f5034b954",
|
|
17
21
|
"docs/ROADMAP.md": "29ac1c54f36064e23c17cfe7f549d6860889257a57d1227e322958aa9c281568",
|
|
18
|
-
"docs/STATUS.md": "
|
|
22
|
+
"docs/STATUS.md": "403ca876bb0d1497a09bd394a97f78baffb2cb42313214854483c4a3795aedac",
|
|
19
23
|
"docs/THIRD-PARTY-NOTICES.md": "58f9b72e2b4dfaaaf2a4c08b9bde9ecef3d2b7e7d65fccd782ed54f39fa76fdc",
|
|
20
|
-
"engine.manifest.json": "
|
|
24
|
+
"engine.manifest.json": "58f2de1e59af10e313c06cdf8d83ca66b903fbce8dc8317777628fcf25241b3c",
|
|
21
25
|
"lib/assets/audio.js": "6facdce4e053afd172af5b9407569b035169844ea17b49f93f8b67f72b78895f",
|
|
22
26
|
"lib/assets/errors.js": "70572678655c6e53179d31920d71f29882d373a0e12d560220bb0fc2cd74f2cc",
|
|
23
27
|
"lib/assets/glb.js": "b808479a36299c154db97f50c16863a3b5a2c61f725e66bf01d01a5f62a288a5",
|
|
@@ -119,8 +123,8 @@
|
|
|
119
123
|
"lib/runtime/world.js": "c43621fbaca8bd2b0d6477a96e60e895312f0f7b1eb97614b6e4f9b716129ea1",
|
|
120
124
|
"lib/schema/index.js": "594429eecb4494c4af2f3d04537be3211f2c9297a1fc555bbba5d028d8627965",
|
|
121
125
|
"lib/sdk/graph-values.js": "a58c00f127cb82aba5fd2824981942844e06d9a59a88a05e35d1d3df2fc7ed2f",
|
|
122
|
-
"lib/sdk/index.d.ts": "
|
|
123
|
-
"lib/sdk/index.js": "
|
|
126
|
+
"lib/sdk/index.d.ts": "68e44b160c00e56d3478f6ebe45a87b1a997641b138f6623a8b53097bb498298",
|
|
127
|
+
"lib/sdk/index.js": "396466f9eb0ddf14e6849749e725a214d4fd6003c185329f09decf804025711f",
|
|
124
128
|
"lib/tools/api-index.js": "6aedc153a0ce8eaf18239b0368a76a8ae8e4397bd8e6cdf571889bc39265be5d",
|
|
125
129
|
"lib/tools/browser-session.js": "1fa7f78d4752d8a59a55dc2283b4d42cd1df230f0d5a5dc80c6d78ade45b4cdb",
|
|
126
130
|
"lib/tools/cli.js": "ad5e915f046cc2e6bf612edd1a88cc33758b1d2b0ce2f057be50e0a2c4770062",
|
|
@@ -191,8 +195,8 @@
|
|
|
191
195
|
"licenses/undici-types/LICENSE": "a6db8096b2707bc0102d256917d4d33f298ba36d8c3f25de067a2b5bb379db27",
|
|
192
196
|
"licenses/uniq/LICENSE": "e67aed7df22dc8031e4fcf5338fe91cb33e3817e5c58a99a2a2802eea9069791",
|
|
193
197
|
"licenses/vite/LICENSE.md": "a22152baa1aef74402443008e767e7c689a524c0909d19b0431d97f5ab066a13",
|
|
194
|
-
"package.json": "
|
|
195
|
-
"README.md": "
|
|
198
|
+
"package.json": "2fc01717d186fde1c36264fe6a4bd2a523b7a8e26a12efc532f8708ea1a63260",
|
|
199
|
+
"README.md": "ff25e039921a85ba253c27608c77ed614a036117d7a04f908a78d1e3ed3f19ef",
|
|
196
200
|
"web/index.html": "d89d6a5b5be3beae3627a8ed506ac308b165d264fb8696be3afd79fcca2f26ee"
|
|
197
201
|
}
|
|
198
202
|
}
|
package/docs/DECISIONS.md
CHANGED
|
@@ -69,6 +69,7 @@
|
|
|
69
69
|
| D53 | 用户要求每次推送主线自动以无预发布后缀的正式版本发布到 npm `latest`,使用 OIDC,不再人工审批 | 覆盖 D48、D52 的 token/staged/next 方案。GitHub Actions 使用 npm 可信发布,不传长期发布令牌;每次运行生成唯一正式版本,更新 `latest`。发布失败、队列延迟和不可覆盖版本须如实记录。正式版本命名不表示行为、硬件或完整里程碑已验证,D50 仍有效。 |
|
|
70
70
|
| D54 | 用户要求推送主线即尝试发布 npm,GitHub Release 仅标记里程碑;仓库和 npm 使用相同的简洁版本,移除 `next` | 覆盖 D53 的运行 ID 自动版本方案。版本由仓库显式维护,CI 不自动改号;每次推送使用该版本以 OIDC 发布到 `latest`,版本重复则失败并等待后续版本,不覆盖既有包。移除 `next` 别名但保留历史版本;已有长版本不可重用或抹除。D50 仍有效。 |
|
|
71
71
|
| D55 | 用户要求单线开发时不再堆积变更,提交和推送不等待里程碑 | 工作区只保留下一功能或版本的改动;每次提交围绕一个可说明的功能、修复或版本,完成后及时提交推送。推送前按 D54 明确递增版本,npm 发布失败如实记录。保留历史证据和未确认成果,不将无关内容混入提交;D50 和 D51 继续有效。 |
|
|
72
|
+
| D56 | 用户要求仓库首页、npm 与源码使用指南按常见开源引擎结构组织,美观且实用,命令不绑定特定 shell | 提供清晰的功能概览、状态、快速入门、文档导航与源码贡献入口;仓库和 npm 指引保持一致。通用命令写法不改变 D15 的 Windows 开发支持范围,也不暗示其他系统已受支持或验证;D50 的验证禁令继续有效。 |
|
|
72
73
|
|
|
73
74
|
## 本次变更实施顺序
|
|
74
75
|
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# 快速入门
|
|
2
|
+
|
|
3
|
+
本指南介绍两种使用方式:**用 npm 制作游戏**,或**从源码仓库运行引擎和游戏**。两者使用同一个 `pelican-engine` 公开 SDK;一般游戏项目不需要引擎源码。已有功能及未完成项请先阅读 [当前研发状态](STATUS.md)。
|
|
4
|
+
|
|
5
|
+
## 环境
|
|
6
|
+
|
|
7
|
+
- Node.js 24.x 和 npm;仓库及 npm 包当前声明的 Node 版本范围为 `>=24 <25`。
|
|
8
|
+
- 当前支持的引擎与游戏开发环境为 Windows。本指南中的命令使用通用 Node/npm 形式,不要求特定 shell;**不代表 Linux 或 macOS 开发流程已经受支持或完成验证**。
|
|
9
|
+
- 玩家端无操作系统或浏览器品牌白名单,实际可用的 WebGPU、WebGL2 和图形能力取决于设备、浏览器和运行环境。
|
|
10
|
+
- 首次安装依赖需要网络。浏览器截图等自动化功能还需要按需安装 Playwright Chromium;普通启动与构建不要求先安装它。
|
|
11
|
+
|
|
12
|
+
## 方式一:使用 npm 开始游戏
|
|
13
|
+
|
|
14
|
+
在空目录中安装引擎并启动开发服务:
|
|
15
|
+
|
|
16
|
+
```sh
|
|
17
|
+
mkdir my-pelican-game
|
|
18
|
+
cd my-pelican-game
|
|
19
|
+
npm --prefix . install --save-dev --save-exact pelican-engine
|
|
20
|
+
npx pelican dev
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
`--prefix .` 将安装目标明确指定为当前目录,避免 npm 选中父级项目;`--save-exact` 将安装版本锁定在游戏项目中。首次 `dev` 在允许的空目录里生成:
|
|
24
|
+
|
|
25
|
+
```text
|
|
26
|
+
my-pelican-game/
|
|
27
|
+
├── game.ts # 游戏入口
|
|
28
|
+
├── pelican.project.json # 入口及引擎版本锁
|
|
29
|
+
├── AGENTS.md # 外部 AI 的游戏开发入口
|
|
30
|
+
├── package.json
|
|
31
|
+
└── package-lock.json
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
默认示例创建一个方块、相机、灯光和旋转系统。编辑 `game.ts` 以修改它;游戏侧从 `pelican-engine` 导入公开接口。CLI 不覆盖已有项目:如果目录已有其他文件而无法自动生成,请使用空目录,或显式创建项目。
|
|
35
|
+
|
|
36
|
+
停止开发服务后构建:
|
|
37
|
+
|
|
38
|
+
```sh
|
|
39
|
+
npx --no-install pelican build
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
产物位于游戏目录的 `dist/`。将整个目录部署到支持静态文件的 HTTP(S) 服务器,并保留其中的资源和许可文件。部署到子路径时,可使用 `npx --no-install pelican build --base /game/`。
|
|
43
|
+
|
|
44
|
+
查看命令与 API:
|
|
45
|
+
|
|
46
|
+
```sh
|
|
47
|
+
npx --no-install pelican help
|
|
48
|
+
npx --no-install pelican api
|
|
49
|
+
npx --no-install pelican api --symbol defineGame
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
项目锁与安装版本不一致时,应先迁移项目,再明确更新 `pelican.project.json` 中的版本;不要通过修改 `node_modules` 绕过诊断。更多使用细节见 [npm 分发指南](npm/DISTRIBUTION.md) 和 [Game Author 指南](npm/GAME-AUTHOR.md)。
|
|
53
|
+
|
|
54
|
+
## 方式二:从仓库使用引擎
|
|
55
|
+
|
|
56
|
+
需要研究引擎源码、尝试仓库示例或参与维护时,可以检出仓库:
|
|
57
|
+
|
|
58
|
+
```sh
|
|
59
|
+
git clone https://github.com/danchar12138/pelican-engine.git
|
|
60
|
+
cd pelican-engine
|
|
61
|
+
npm ci
|
|
62
|
+
npm run dev
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
这会启动当前仓库配置的示例。源码 ZIP 或已有目录也可以使用,不要求 `.git` 存在。使用源码为另一个目录创建最小游戏:
|
|
66
|
+
|
|
67
|
+
```sh
|
|
68
|
+
node --import tsx tools/cli.ts create --project ../my-source-game --template minimal
|
|
69
|
+
node --import tsx tools/cli.ts dev --project ../my-source-game
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
这些命令从**引擎目录**执行;新游戏在相邻的 `my-source-game` 目录中。CLI 会写入相对引擎路径和版本锁,游戏仍使用公开的 `pelican-engine` API。已有目标文件不会被覆盖。更多引擎开发说明见 [参与开发](../CONTRIBUTING.md)。
|
|
73
|
+
|
|
74
|
+
## 选择渲染模式
|
|
75
|
+
|
|
76
|
+
引擎优先尝试 WebGPU,必要时通过 Three.js 内置回退尝试 WebGL2 光栅。WebGL2 不提供依赖 compute 的混合光追、路径追踪或受控计算;能力不足时应读取诊断,不应把光栅结果当成光追。能力查询和错误码见 [渲染后端](RENDER-BACKENDS.md)。
|
|
77
|
+
|
|
78
|
+
## 已知边界
|
|
79
|
+
|
|
80
|
+
当前版本仍在研发;构建成功不证明画质、性能、硬件兼容或所有功能已经验收。当前用户约束禁止项目验证活动,因此仓库中的历史测试命令不是本次执行或通过的声明。实际局限、已知物理缺陷和历史证据入口见 [当前研发状态](STATUS.md)。
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
#
|
|
1
|
+
# 图形与运行时使用指引
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
本文说明当前源码中的图形与运行时接口,不宣称完整高级渲染已完成或验收。实际版本见项目清单,当前状态见 [研发状态](STATUS.md)。历史阶段名称、实验结果和旧标签仅适用于各自记录的源码,不代表当前版本通过。按当前 D50,仅允许编译/构建;下文历史探针、浏览器或测试命令在恢复授权之前不得运行。
|
|
4
4
|
|
|
5
5
|
## 模型材质槽
|
|
6
6
|
|
|
@@ -12,11 +12,11 @@
|
|
|
12
12
|
|
|
13
13
|
`defineMaterial({ id, ior, transmission: 0, ... })` 可为不透射的物理材质指定有限正数折射率,默认值为 1.5。介质法线入射反射率由 `((ior - 1) / (ior + 1))²` 决定;光栅、hybrid 和 path 共享该输入,路径采样与 PDF 也使用对应反射率。金属部分仍使用 baseColor 的 F0。`attenuationColor` 和 `attenuationDistance` 仍要求正的 transmission,不能用不透射 IOR 伪装体积吸收。
|
|
14
14
|
|
|
15
|
-
仓库中的 `examples/opaque-ior`
|
|
15
|
+
仓库中的 `examples/opaque-ior` 以三个黑色平面展示差异;相关 probe 是历史开发验证入口。该例不代表完整物理材质扩展或当前版本验收;npm 渠道使用同一公开接口。
|
|
16
16
|
|
|
17
17
|
不透射物理材质还可设置 `specularIntensity`(0 到 1,默认 1)和 `specularColor`(sRGB `#rgb`、`#rrggbb` 或颜色名称,默认白色)。这两个因子参与介质高光、掠射和 path/hybrid 采样;金属部分仍由 baseColor 决定。非默认高光与正 `transmission` 的组合目前返回 `TC_MATERIAL_SPECULAR_TRANSMISSION`,不会悄悄使用默认值。
|
|
18
18
|
|
|
19
|
-
自包含 GLB 可使用 `KHR_materials_specular`/`KHR_materials_ior` 的常数材质因子;不透射材质还支持 specular 强度纹理 alpha 与 sRGB 颜色纹理 RGB,资产仅接受 TEXCOORD_0,`optimize` 保留并复核因子、图像和采样配置。高光颜色 PNG 支持 1/2/4-bit 灰度和调色板 Adam7、无色彩元数据的 16-bit,以及 gAMA 45455/100000、标准 sRGB cHRM、sRGB intent 0、cICP [1,13,0,1];其他 16-bit 色彩块值和 ICC 仍明确拒绝。正透射结合高光纹理及其他未实现扩展仍不支持。示例 `examples/specular-material`、`examples/specular-textures` 和 `examples/specular-textures-16`
|
|
19
|
+
自包含 GLB 可使用 `KHR_materials_specular`/`KHR_materials_ior` 的常数材质因子;不透射材质还支持 specular 强度纹理 alpha 与 sRGB 颜色纹理 RGB,资产仅接受 TEXCOORD_0,`optimize` 保留并复核因子、图像和采样配置。高光颜色 PNG 支持 1/2/4-bit 灰度和调色板 Adam7、无色彩元数据的 16-bit,以及 gAMA 45455/100000、标准 sRGB cHRM、sRGB intent 0、cICP [1,13,0,1];其他 16-bit 色彩块值和 ICC 仍明确拒绝。正透射结合高光纹理及其他未实现扩展仍不支持。示例 `examples/specular-material`、`examples/specular-textures` 和 `examples/specular-textures-16` 对照导入材质;探针属于历史开发记录。完整材质矩阵和公开注册表安装验收尚未完成。
|
|
20
20
|
|
|
21
21
|
## 计算到渲染的缓冲绑定
|
|
22
22
|
|
|
@@ -42,9 +42,9 @@ path/hybrid 将常驻 GPU 数据复制进原生材料表的附加 vec4 区域;
|
|
|
42
42
|
|
|
43
43
|
使用 `model: { asset, material }` 可显式整模替换导入材质,把顶点图用于带骨骼/morph 的模型;不传 material 保留原资产材质。覆盖材质由游戏内容所有者持有,模型实例与模板不会销毁借用材质。当前是整模替换,不是按源材质槽合并。
|
|
44
44
|
|
|
45
|
-
引擎从同一变形几何维护对象包围体和渲染射线查询,剔除保持开启,路径/混合 BVH 会更新或 refit。Transform 和显式物理 collider 不被 shader 改写;本功能不等于自动 Rapier
|
|
45
|
+
引擎从同一变形几何维护对象包围体和渲染射线查询,剔除保持开启,路径/混合 BVH 会更新或 refit。Transform 和显式物理 collider 不被 shader 改写;本功能不等于自动 Rapier 形变或物理系统耦合。
|
|
46
46
|
|
|
47
|
-
最小例子:`npm run dev -- --project examples/vertex`。数据纹理和小型带骨骼/morph GLB 是可离线重建的 MIT 夹具;`node --import tsx tools/prepare-vertex-assets.ts`
|
|
47
|
+
最小例子:`npm run dev -- --project examples/vertex`。数据纹理和小型带骨骼/morph GLB 是可离线重建的 MIT 夹具;`node --import tsx tools/prepare-vertex-assets.ts` 可重新生成。历史开发入口为 `npm run probe:vertex` 和 `npm run probe:postprocess:occlusion`;它们不构成当前版本完整验收。
|
|
48
48
|
|
|
49
49
|
## 受控 HDR 后处理
|
|
50
50
|
|
|
@@ -56,7 +56,7 @@ pass 输出为全尺寸 rgba16float,捕获保持场景原 MSAA,最终曝光/
|
|
|
56
56
|
|
|
57
57
|
效果开关及参数参与 CPU 检查点;反馈纹理不序列化,恢复/内容/模式/设备变化明确重置历史。开关变化会防御性重置所有历史;关闭的 pass 不再推进历史,当前帧输出为上游直通。参数改变默认保留历史,需要时显式 `resetHistory(id?)`。反馈按呈现帧推进,不是游戏物理时间或存档状态。
|
|
58
58
|
|
|
59
|
-
最小三段例子在 `examples/postprocess`:`npm run dev -- --project examples/postprocess
|
|
59
|
+
最小三段例子在 `examples/postprocess`:`npm run dev -- --project examples/postprocess`。`npm run probe:postprocess` 是历史开发验证入口;它不构成当前版本完整画质或性能验收。
|
|
60
60
|
|
|
61
61
|
## 受管理计算
|
|
62
62
|
|
|
@@ -64,7 +64,7 @@ pass 输出为全尺寸 rgba16float,捕获保持场景原 MSAA,最终曝光/
|
|
|
64
64
|
|
|
65
65
|
引擎在每个固定 tick 后等待 GPU 任务结算;`readBuffer` 返回上次完整成功结果的 CPU 镜像,失败或取消不覆盖输出。输出可同时作为输入,读取的是派发前快照。枚举 `tasks()` 并释放终态任务,避免无限保留历史;恢复后按缓冲名称 `resolve()`,不复用旧句柄。快照/回放/设备重建已接入,WebGL2 不执行计算。
|
|
66
66
|
|
|
67
|
-
仓库最小反馈游戏:`npm run dev -- --project examples/compute
|
|
67
|
+
仓库最小反馈游戏:`npm run dev -- --project examples/compute`。`npm run probe:compute:numeric` 和 `npm run probe:compute` 是历史 GPU 开发验证入口,不构成当前源码的完整能力验收。
|
|
68
68
|
|
|
69
69
|
显式依赖使用 `bindings: { name: { task: predecessor } }`:读取该任务的确切成功输出,即使同一源缓冲已经被后续任务覆盖。`after: [predecessor]` 只约束执行顺序,普通缓冲句柄绑定仍读取派发时快照;参数与 time 也在派发时固定。只能引用同一运行时已有的未释放任务,不支持前向/跨 owner 引用。
|
|
70
70
|
|
|
@@ -72,7 +72,7 @@ pass 输出为全尺寸 rgba16float,捕获保持场景原 MSAA,最终曝光/
|
|
|
72
72
|
|
|
73
73
|
任务不序列化进快照。游戏不要把临时任务句柄作为持久状态:恢复或设备重建后重新派发链路;源缓冲按名称 resolve。公开示例 `examples/compute-dependencies` 演示分支、覆盖、纯顺序依赖及失败隔离;小型串行硬件验证为 `npm run probe:compute-dependencies`。
|
|
74
74
|
|
|
75
|
-
当前任务仍顺序执行且每节点读回 CPU 镜像,不是一次批量 GPU-only DAG。GPU 常驻顶点/片元/后处理的缓冲和纹理绑定、顶点图、HDR
|
|
75
|
+
当前任务仍顺序执行且每节点读回 CPU 镜像,不是一次批量 GPU-only DAG。GPU 常驻顶点/片元/后处理的缓冲和纹理绑定、顶点图、HDR 后处理及计算纹理核心已接入;完整高级图形矩阵仍待完成。现有链路不等于完整能力已验收。
|
|
76
76
|
|
|
77
77
|
## 计算纹理
|
|
78
78
|
|
|
@@ -100,7 +100,7 @@ Three 路径将常驻纹理以 GPU→GPU 复制到自身资源;path/hybrid 将
|
|
|
100
100
|
|
|
101
101
|
## 场景与公开设置
|
|
102
102
|
|
|
103
|
-
```
|
|
103
|
+
```sh
|
|
104
104
|
npm run dev
|
|
105
105
|
```
|
|
106
106
|
|
|
@@ -149,11 +149,11 @@ const glass = defineMaterial({
|
|
|
149
149
|
|
|
150
150
|
path/hybrid 将正透射对象的闭合几何边界编入介质目录,支持平滑/粗糙折射、反射、嵌套介质和相机内部初始状态。每个对象或实例必须是单个闭合、连续、非自交壳体;相交/接触体积、开口和部分不透明边界有明确诊断。目录不是通用自交证明;复杂重叠介质、空腔、多壳体、光谱色散尚未实现。完整规则见 `packages/renderer/MEDIUM.md`。
|
|
151
151
|
|
|
152
|
-
```
|
|
152
|
+
```sh
|
|
153
153
|
npm run dev -- --project examples/refraction
|
|
154
154
|
```
|
|
155
155
|
|
|
156
|
-
该项目仅使用公开 SDK,包含吸收平板、内外相机、嵌套边界、折射/粗糙度、尺度/平移和介质内点光源对照。线性图像、边界错误计数与解析 Beer
|
|
156
|
+
该项目仅使用公开 SDK,包含吸收平板、内外相机、嵌套边界、折射/粗糙度、尺度/平移和介质内点光源对照。线性图像、边界错误计数与解析 Beer 断言由历史开发探针检查;不能把可见玻璃球当成完整画质验收。光栅使用物理材质实现,但其屏幕空间透射/厚度与路径体积的一致性仍需补验。
|
|
157
157
|
|
|
158
158
|
## 已有链路
|
|
159
159
|
|
|
@@ -173,20 +173,20 @@ npm run dev -- --project examples/refraction
|
|
|
173
173
|
|
|
174
174
|
## 开发复验
|
|
175
175
|
|
|
176
|
-
###
|
|
176
|
+
### 刚体角运动
|
|
177
177
|
|
|
178
178
|
`ctx.physics.angularVelocity(entity)` 查询世界坐标弧度/秒;`setAngularVelocity(entity, vec3)` 设置动态刚体角速度,`torqueImpulse(entity, vec3)` 施加世界空间力矩冲量,`impulseAtPoint(entity, impulse, worldPoint)` 在指定世界坐标施加冲量,同时影响平动和转动。后三者只支持动态刚体;固定、运动学或角色体返回 `TC_PHYSICS_BODY_TYPE`。写操作参与物理历史、快照和回放,旧快照仍兼容。
|
|
179
179
|
|
|
180
|
-
示例 `examples/angular-physics` 只使用公开 SDK;源码渠道运行 `npm run dev -- --project examples/angular-physics
|
|
180
|
+
示例 `examples/angular-physics` 只使用公开 SDK;源码渠道运行 `npm run dev -- --project examples/angular-physics`。首次正常物理步前移除刚体存在已知生命周期缺陷,详见[物理生命周期缺陷记录](PHYSICS-LIFECYCLE-ISSUE.md);完整模拟交互仍需后续实现和验证。npm 渠道使用相同 SDK。
|
|
181
181
|
|
|
182
|
-
```
|
|
182
|
+
```sh
|
|
183
183
|
npm run typecheck
|
|
184
184
|
npm run probe:m3
|
|
185
185
|
npm run build
|
|
186
186
|
```
|
|
187
187
|
|
|
188
|
-
|
|
188
|
+
历史开发 probe 会生成带源码指纹的记录和图像;失败不覆盖成成功。当前 D50 禁止运行这些 probe,也不能把旧记录当作当前源码验证。
|
|
189
189
|
|
|
190
190
|
构建仍为 `dist/`,可在普通静态服务器子路径部署;默认生产不暴露开发控制 hook。`tools/m3-static-probe.ts` 使用真实按键测试模式切换和冷启动。直接浏览器自动化是外部测试职责,游戏源码不得调用内部开发 hook。
|
|
191
191
|
|
|
192
|
-
|
|
192
|
+
当前公开图语言仍是有限子集。后处理、多通道、变形和计算接口的完整表达矩阵、完整物理材质图像矩阵、时域重建、性能及独立使用验收仍有缺口。普通版本发布不代表这些能力已验证或完整首发已完成。
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Pelican Engine 命名与迁移
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
产品名称为 **Pelican Engine(鹈鹕游戏引擎)**。本文件保留更名与迁移背景;当前版本、能力缺口及发布状态见 [研发状态](STATUS.md),历史开发探针不是当前源码的正式验收。
|
|
4
4
|
|
|
5
5
|
| 对象 | 唯一正式名称 |
|
|
6
6
|
| --- | --- |
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
| npm 单包 | `pelican-engine` |
|
|
10
10
|
| 命令 / bin | `pelican` |
|
|
11
11
|
| 游戏侧公开导入 | `pelican-engine` |
|
|
12
|
-
|
|
|
12
|
+
| 源码命令入口 | `npm run dev` 或 `node --import tsx tools/cli.ts` |
|
|
13
13
|
| 项目清单 | `pelican.project.json` |
|
|
14
14
|
| 本地缓存 / 开发控制路由 | `.pelican/` / `/__pelican/` |
|
|
15
15
|
| 部署版本清单 | `pelican-build.json` |
|
|
@@ -18,8 +18,8 @@ SDK、runtime、renderer、编译器和 CLI 位于同一个 npm 包中。内部
|
|
|
18
18
|
|
|
19
19
|
目标最短使用流程为:
|
|
20
20
|
|
|
21
|
-
```
|
|
22
|
-
npm
|
|
21
|
+
```sh
|
|
22
|
+
npm --prefix . install --save-dev --save-exact pelican-engine
|
|
23
23
|
npx pelican dev
|
|
24
24
|
```
|
|
25
25
|
|
|
@@ -35,4 +35,4 @@ M0–M2 的原名称、标签、提交、Release 附件与 `evidence/` 是历史
|
|
|
35
35
|
|
|
36
36
|
## 远端实际状态
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
GitHub 仓库为 `danchar12138/pelican-engine`,所有者保持不变。npm 使用 Trusted Publisher OIDC;当前稳定版本见 `package.json` 与 [npm package](https://www.npmjs.com/package/pelican-engine)。历史标签和历史发布记录保留原样,不更名、不重写。
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Physics Lifecycle Issue
|
|
2
|
+
|
|
3
|
+
**Status: open; not fixed or validated in the current package.**
|
|
4
|
+
|
|
5
|
+
Removing certain rigid bodies before the physics world has completed its first normal time step can make the locked Rapier runtime trap during the first later step. The exact reproduction depends on body types and initial island/contact topology. Existing reports include process termination, not only a catchable application error.
|
|
6
|
+
|
|
7
|
+
## Required behavior
|
|
8
|
+
|
|
9
|
+
- Body removal remains immediate for public queries and raycasts.
|
|
10
|
+
- A later simulation step does not trap or silently skip collision, impulse, sleep, or event processing.
|
|
11
|
+
- Snapshot/history recovery preserves existing version-3 snapshot semantics; existing fixtures must not be rewritten to make a candidate pass.
|
|
12
|
+
- Untrusted history must not be replayed optimistically in the active WASM instance.
|
|
13
|
+
- Creation, removal, same-ID respawn, characters, joints, contacts, rollback, and disposal must preserve their established contracts.
|
|
14
|
+
|
|
15
|
+
## Investigation boundary
|
|
16
|
+
|
|
17
|
+
Historical reproductions and candidate experiments are retained in the original issue records and local archived work. Some candidates alter native world reconstruction or snapshot bytes and have known compatibility gaps. They are not fixes and must not be merged wholesale. The production Rapier dependency has not been replaced.
|
|
18
|
+
|
|
19
|
+
Project policy currently permits compilation/build only and prohibits runtime, browser, GPU, test, performance, and other verification. Therefore this issue remains open until implementation and the required verification are authorized and completed.
|
package/docs/RENDER-BACKENDS.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# 渲染后端与能力诊断
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
适用:当前源码及由相同版本生成的 npm 包。历史标签保留当时的行为与证据;本文件不改写旧验收。当前源码的后端兼容性尚未完成完整验收。
|
|
4
4
|
|
|
5
5
|
## 同一公开接口
|
|
6
6
|
|
|
@@ -35,11 +35,13 @@ const capabilities = ctx.render.capabilities();
|
|
|
35
35
|
|
|
36
36
|
配置和检查点恢复先校验能力再提交;被拒绝的配置不改变当前模式或设置。运行态开发控制命令返回结构化 `failed` 与稳定错误码,不因正常的不支持请求把游戏置为崩溃状态。
|
|
37
37
|
|
|
38
|
-
##
|
|
38
|
+
## 历史实测入口
|
|
39
|
+
|
|
40
|
+
以下是历史开发命令;当前 D50 禁止测试、浏览器、GPU 和其他验证,恢复授权前不要运行。
|
|
39
41
|
|
|
40
42
|
在 Windows、已安装依赖与 Playwright Chromium、真实硬件加速环境中:
|
|
41
43
|
|
|
42
|
-
```
|
|
44
|
+
```sh
|
|
43
45
|
npm run probe:backends
|
|
44
46
|
# 仅运行独立 WebGL2 回退矩阵:
|
|
45
47
|
npm run probe:backends -- --webgl-only
|
|
@@ -47,4 +49,4 @@ npm run probe:backends -- --webgl-only
|
|
|
47
49
|
|
|
48
50
|
输出 `.pelican/backend-probes/<run>/report.json` 与截图,包括源码指纹、实际 ANGLE/GPU 身份、画面像素检查、三类初始化失败、不可用模式/降噪/计算错误码、两次上下文恢复、重复内容重载,以及两后端都不可用的诊断。默认还复测真实 WebGPU 三模式设备重建。
|
|
49
51
|
|
|
50
|
-
|
|
52
|
+
这些是历史开发专项记录,不构成当前版本的完整图形或硬件验收。WebGPU 与 WebGL2 应分别记录,不用一种后端或软件渲染器代替另一种后端的证据。当前授权只允许编译和构建,历史测量不自动适用于当前源码。
|
package/docs/STATUS.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## 版本与发布
|
|
4
4
|
|
|
5
|
-
-
|
|
5
|
+
- 当前版本为 `0.3.6`,包、锁文件、引擎、SDK、编译器和示例中的版本保持一致。下一项功能完成后统一递增并推送;相同版本不能重复发布。
|
|
6
6
|
- 推送主线会通过 GitHub Actions 和 npm 可信发布更新 `latest`;GitHub Release 用于记录里程碑。历史版本和旧标签保持原样,不代表当前源码通过。
|
|
7
7
|
- 当前按用户要求仅允许编译和构建,不运行测试、浏览器、GPU、性能或其他验证。普通版本号不意味着运行行为、硬件或完整引擎已验收。
|
|
8
8
|
|
package/docs/api/REFERENCE.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# pelican 0.3.
|
|
1
|
+
# pelican 0.3.6 API 索引
|
|
2
2
|
|
|
3
3
|
Installed declarations: `lib/sdk/index.d.ts` (relative to the package root).
|
|
4
4
|
The signatures below come from the same public SDK source as repository games.
|
|
@@ -11,7 +11,7 @@ Source-file paths and line numbers are build-time provenance only; TypeScript so
|
|
|
11
11
|
来源:`packages/sdk/src/index.ts:2`
|
|
12
12
|
|
|
13
13
|
```ts
|
|
14
|
-
SDK_VERSION = "0.3.
|
|
14
|
+
SDK_VERSION = "0.3.6"
|
|
15
15
|
```
|
|
16
16
|
|
|
17
17
|
## Vec2
|
package/docs/api/index.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"format": "pelican.api-index",
|
|
3
3
|
"version": 1,
|
|
4
|
-
"engineVersion": "0.3.
|
|
4
|
+
"engineVersion": "0.3.6",
|
|
5
5
|
"entry": "pelican-engine",
|
|
6
6
|
"source": "packages/sdk/src/index.ts",
|
|
7
7
|
"symbols": [
|
|
8
8
|
{
|
|
9
9
|
"name": "SDK_VERSION",
|
|
10
10
|
"kind": "constant",
|
|
11
|
-
"signature": "SDK_VERSION = \"0.3.
|
|
11
|
+
"signature": "SDK_VERSION = \"0.3.6\"",
|
|
12
12
|
"line": 2
|
|
13
13
|
},
|
|
14
14
|
{
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="1024" height="1024" viewBox="0 0 1024 1024" fill="none" role="img" aria-labelledby="pe-Dr-title pe-Dr-desc">
|
|
2
|
+
<title id="pe-Dr-title">Pelican Engine</title>
|
|
3
|
+
<desc id="pe-Dr-desc">A refinement of the original D bold sculpture emblem. The original fierce eye, long bill, crest and gold accents are retained. A closed black eye mask frames the eye, while the continuous white neck broadens into a fuller upper chest. Transparent background.</desc>
|
|
4
|
+
<defs>
|
|
5
|
+
<path id="pe-Dr-contour" d="M428 270C432 183 478 118 545 84C600 56 660 53 710 66C750 52 796 54 833 64C799 72 773 89 752 106C805 82 864 78 912 94C875 101 839 120 811 143C861 123 912 124 954 143C918 151 882 169 852 193C897 182 941 188 974 211C934 211 900 222 874 245C916 246 952 267 974 298C937 288 908 287 889 293C929 313 955 349 965 389C935 366 913 353 893 349C923 397 933 451 921 500C914 536 896 562 879 583C885 626 912 661 951 693C916 684 890 670 866 650C912 699 939 753 949 809C922 787 893 770 867 761C912 803 940 853 954 907C915 881 877 869 842 868C863 888 884 916 899 947C857 922 813 911 774 912C799 928 821 946 839 970C789 958 745 938 708 912C719 932 728 953 732 976C684 949 648 918 620 883C621 908 622 929 618 951C579 913 549 865 532 815C521 837 512 857 497 875C475 811 467 749 479 687C490 628 517 581 542 539C563 505 575 469 568 434C561 396 533 365 493 331C464 307 443 289 428 270Z"/>
|
|
6
|
+
<clipPath id="pe-Dr-clip"><use href="#pe-Dr-contour"/></clipPath>
|
|
7
|
+
<clipPath id="pe-Dr-eye-clip"><path d="M509 248C532 225 561 220 587 248C569 270 536 275 514 263C507 259 505 253 509 248Z"/></clipPath>
|
|
8
|
+
</defs>
|
|
9
|
+
<use href="#pe-Dr-contour" fill="#171B20" stroke="#171B20" stroke-width="10" stroke-linejoin="round"/>
|
|
10
|
+
<g clip-path="url(#pe-Dr-clip)">
|
|
11
|
+
<path fill="#F6F7F6" stroke="#171B20" stroke-width="5" stroke-linejoin="round" d="M441 254C449 175 497 116 567 91C620 71 674 75 727 89C696 94 674 108 654 125C708 104 758 105 800 117C773 121 750 135 727 151C775 137 823 142 854 159C827 160 805 168 784 181C831 176 872 195 897 221C868 211 840 209 815 216C858 227 894 254 915 286C884 270 859 263 837 263C872 286 895 321 906 356C881 333 858 319 835 313C858 344 873 383 876 422C861 398 845 382 827 371C854 441 835 497 807 540C786 571 775 596 778 624C781 661 801 693 826 721C805 712 787 699 772 682C792 731 819 768 844 805C816 794 789 776 763 754C789 801 815 835 834 852C801 841 773 826 746 800C769 843 785 874 790 906C748 889 710 859 682 827C692 855 699 879 698 893C642 866 594 825 568 778C551 733 575 681 617 636C663 590 706 555 724 512C742 466 711 422 681 389C650 353 630 334 622 312C612 288 617 275 631 261C611 272 600 268 591 260C592 252 588 245 583 239C573 225 566 216 552 214C540 209 529 210 520 215C495 224 482 247 465 258C454 265 446 263 441 254Z"/>
|
|
12
|
+
</g>
|
|
13
|
+
<g id="pe-Dr-eye">
|
|
14
|
+
<path fill="#171B20" d="M493 238C517 199 559 186 603 198C614 195 624 188 634 181C624 196 619 205 615 212C574 198 541 204 514 231C507 233 500 235 493 238Z"/>
|
|
15
|
+
<path fill="#F6F7F6" d="M509 248C532 225 561 220 587 248C569 270 536 275 514 263C507 259 505 253 509 248Z"/>
|
|
16
|
+
<g clip-path="url(#pe-Dr-eye-clip)">
|
|
17
|
+
<circle cx="552" cy="250" r="15" fill="#B89E67"/>
|
|
18
|
+
<ellipse cx="552" cy="250" rx="6.5" ry="10" fill="#171B20"/>
|
|
19
|
+
<circle cx="549" cy="245" r="2.5" fill="#F6F7F6"/>
|
|
20
|
+
</g>
|
|
21
|
+
</g>
|
|
22
|
+
<g id="pe-Dr-bill">
|
|
23
|
+
<path fill="#171B20" stroke="#171B20" stroke-width="8" stroke-linejoin="round" d="M487 316C528 285 579 270 617 281C661 292 682 328 671 373C655 439 607 504 544 567C422 689 264 794 103 839C91 843 80 839 83 828C218 661 350 485 487 316Z"/>
|
|
24
|
+
<path fill="#F6F7F6" d="M499 332C532 309 571 293 596 300C614 306 607 325 593 342C477 474 296 659 112 816C269 655 421 459 499 332Z"/>
|
|
25
|
+
<path fill="#B89E67" d="M617 281C661 292 682 328 671 373C655 439 607 504 544 567C608 496 649 432 659 373C670 334 653 303 617 281Z"/>
|
|
26
|
+
<path fill="#F6F7F6" stroke="#171B20" stroke-width="10" stroke-linejoin="round" d="M464 269C474 258 488 266 493 283C499 298 493 316 484 328C359 490 234 653 111 816C101 828 94 833 87 830C72 826 76 816 81 808C202 634 324 461 445 289C451 278 457 270 464 269Z"/>
|
|
27
|
+
<path fill="#171B20" d="M78 801C57 811 46 834 50 855C53 872 64 886 81 891C89 893 92 888 87 882C76 870 72 859 77 847C82 837 90 824 90 812C90 801 85 797 78 801Z"/>
|
|
28
|
+
</g>
|
|
29
|
+
</svg>
|
package/docs/npm/DISTRIBUTION.md
CHANGED
|
@@ -1,130 +1,85 @@
|
|
|
1
|
-
|
|
1
|
+
<div align="center">
|
|
2
|
+
<img src="https://raw.githubusercontent.com/danchar12138/pelican-engine/main/docs/assets/pelican-mark.svg" alt="Pelican Engine" width="110" height="110">
|
|
3
|
+
<h1>Pelican Engine</h1>
|
|
4
|
+
<p><strong>Build games for the web with TypeScript.</strong></p>
|
|
5
|
+
<p>Code-first · WebGPU-first · Designed for human and external AI workflows</p>
|
|
6
|
+
<p>
|
|
7
|
+
<a href="https://www.npmjs.com/package/pelican-engine"><img src="https://img.shields.io/npm/v/pelican-engine?label=npm&color=168b80" alt="npm version"></a>
|
|
8
|
+
<img src="https://img.shields.io/badge/license-MIT-24536b" alt="MIT license">
|
|
9
|
+
<img src="https://img.shields.io/badge/TypeScript-SDK-3178c6" alt="TypeScript SDK">
|
|
10
|
+
</p>
|
|
11
|
+
</div>
|
|
12
|
+
|
|
13
|
+
Pelican Engine provides a TypeScript SDK, compiler, runtime, renderer and CLI in one package. Define game content and behavior in code, run a local development server and build a static web distribution. AI tools may assist development, but the game runtime does not include an LLM or AI agent.
|
|
14
|
+
|
|
15
|
+
> **Development status:** this is an evolving engine, not a complete first release. Current source behavior, hardware compatibility, performance and the full feature set have not been fully validated. A normal version number is not an acceptance claim. See the [development status](https://github.com/danchar12138/pelican-engine/blob/main/docs/STATUS.md) for known gaps.
|
|
16
|
+
|
|
17
|
+
## Quick start
|
|
18
|
+
|
|
19
|
+
Install Node.js **24.x** and npm, then create a new empty game directory:
|
|
20
|
+
|
|
21
|
+
```sh
|
|
22
|
+
mkdir my-pelican-game
|
|
23
|
+
cd my-pelican-game
|
|
24
|
+
npm --prefix . install --save-dev --save-exact pelican-engine
|
|
25
|
+
npx pelican dev
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
The first `dev` creates `game.ts`, `pelican.project.json` and `AGENTS.md` in an eligible empty project. Existing game files and author instructions are not overwritten. The explicit `--prefix .` prevents npm from choosing a parent project; `--save-exact` pins the installed version. Stop the development server before building:
|
|
29
|
+
|
|
30
|
+
```sh
|
|
31
|
+
npx --no-install pelican build
|
|
32
|
+
```
|
|
2
33
|
|
|
3
|
-
|
|
4
|
-
public SDK used by repository games, not a wrapper or a separate SDK. The package
|
|
5
|
-
also provides the `pelican` executable. This is an M3 development distribution,
|
|
6
|
-
not accepted M3 hardware evidence or a complete engine release.
|
|
34
|
+
Deploy the resulting `dist/` directory, including its generated assets and notices, to an HTTP(S) static host. For a nested deployment, use `npx --no-install pelican build --base /game/`.
|
|
7
35
|
|
|
8
|
-
|
|
36
|
+
Commands use common Node/npm syntax rather than a particular shell. **Engine and game development currently support Windows only**; Linux and macOS development workflows have not been promised or validated. Player platforms are not restricted by brand or OS: actual rendering availability depends on browser and graphics capabilities.
|
|
9
37
|
|
|
10
|
-
|
|
11
|
-
in this directory even when a parent directory is also an npm project:
|
|
38
|
+
## Your game
|
|
12
39
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
40
|
+
The generated starter defines a scene and a rotating box. Game code imports only the public package, for example:
|
|
41
|
+
|
|
42
|
+
```ts
|
|
43
|
+
import { defineGame, defineMaterial, defineScene } from "pelican-engine";
|
|
44
|
+
|
|
45
|
+
const material = defineMaterial({ id: "paint", color: "#38b8a4", roughness: 0.45 });
|
|
46
|
+
const scene = defineScene({
|
|
47
|
+
id: "main",
|
|
48
|
+
camera: { position: [4, 3, 6], target: [0, 0, 0], fov: 50 },
|
|
49
|
+
entities: [
|
|
50
|
+
{ id: "box", mesh: { geometry: { kind: "box" }, material } },
|
|
51
|
+
{ id: "light", light: { kind: "directional", intensity: 4 },
|
|
52
|
+
transform: { position: [3, 6, 4] } },
|
|
53
|
+
],
|
|
54
|
+
});
|
|
55
|
+
export default defineGame({ id: "my-game", scene });
|
|
16
56
|
```
|
|
17
57
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
project files or author instructions prevent automatic scaffolding. Files are
|
|
22
|
-
never overwritten. Stop dev with Ctrl+C, then use the same local CLI:
|
|
58
|
+
Save it as `game.ts` in a project created by the CLI. The exact engine version is recorded in `pelican.project.json`: migrate the game and update its lock explicitly when changing engine versions. Do not edit `node_modules` or import engine internals.
|
|
59
|
+
|
|
60
|
+
Useful commands:
|
|
23
61
|
|
|
24
|
-
```
|
|
62
|
+
```sh
|
|
63
|
+
npx --no-install pelican help
|
|
25
64
|
npx --no-install pelican api
|
|
26
|
-
npx --no-install pelican
|
|
27
|
-
npx --no-install pelican check
|
|
65
|
+
npx --no-install pelican api --symbol defineGame
|
|
28
66
|
npx --no-install pelican dev --port 4173
|
|
29
|
-
npx --no-install pelican capture --port 4174 --output capture.png
|
|
30
67
|
npx --no-install pelican build
|
|
31
68
|
```
|
|
32
69
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
`
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
`create` writes `game.ts`, `AGENTS.md` and an exact `pelican.project.json` lock in the current
|
|
49
|
-
directory. Existing project files are never overwritten. Author TypeScript with
|
|
50
|
-
named imports from `pelican-engine` and project-local imports only. The compiler
|
|
51
|
-
reports `TC_PUBLIC_API` for renderer, Three.js, TSL, physics, Node and internal
|
|
52
|
-
package imports, including type-only and unused imports. Package subpaths are not
|
|
53
|
-
public exports. Project lock mismatches report `TC_ENGINE_VERSION_MISMATCH`;
|
|
54
|
-
mixed package/API versions report `TC_ENGINE_SDK_VERSION`. Reinstall a matching
|
|
55
|
-
exact version, or migrate through the public API before explicitly changing a lock.
|
|
56
|
-
|
|
57
|
-
After npm dependencies and Playwright Chromium have been installed, authoring,
|
|
58
|
-
API inspection, checks, builds, dev/control commands and capture need no network
|
|
59
|
-
service. `setup --offline` never installs dependencies or downloads a browser in
|
|
60
|
-
an installed package. Keep the game package-lock for repeatable future installs;
|
|
61
|
-
an offline _reinstall_ additionally requires the npm cache or a dependency mirror.
|
|
62
|
-
`TC_DISTRIBUTION_DEPENDENCY_MISSING` and
|
|
63
|
-
`TC_DISTRIBUTION_DEPENDENCY_VERSION` identify broken tool dependencies.
|
|
64
|
-
|
|
65
|
-
Serve the generated `dist/` directory over HTTP(S), including its `generated/`
|
|
66
|
-
files, license files, notices and compression manifests. No Node process, engine
|
|
67
|
-
repository, SDK installation, external AI service or development control server
|
|
68
|
-
is needed by players. Use `build --base /game/` for a nested deployment URL.
|
|
69
|
-
Capture requires installed Chromium and actual supported graphics capability.
|
|
70
|
-
No software renderer result establishes hardware acceptance.
|
|
71
|
-
|
|
72
|
-
## AI entry points
|
|
73
|
-
|
|
74
|
-
Read the game-author `AGENTS.md`, `docs/npm/GAME-AUTHOR.md`, `docs/CAPABILITIES.md` and
|
|
75
|
-
`docs/api/REFERENCE.md` inside `node_modules/pelican-engine`. The machine-readable
|
|
76
|
-
API is `docs/api/index.json`, also discoverable through `pelican api`.
|
|
77
|
-
`lib/sdk/index.d.ts` is the authoritative installed declaration surface.
|
|
78
|
-
`docs/PELICAN-MIGRATION.md` explains current names and historical provenance.
|
|
79
|
-
Repository paths and release instructions in copied documents are historical
|
|
80
|
-
context; the installed workflow above replaces source-checkout commands.
|
|
81
|
-
The JSON CLI protocol and dev control operations are shared with the repository.
|
|
82
|
-
|
|
83
|
-
## Maintainer validation and publishing
|
|
84
|
-
|
|
85
|
-
```powershell
|
|
86
|
-
npm run distribution:test
|
|
87
|
-
npm run distribution:pack
|
|
88
|
-
npm run distribution:smoke
|
|
89
|
-
npm run distribution:smoke -- --gpu
|
|
90
|
-
```
|
|
70
|
+
The renderer prioritizes WebGPU and can use Three.js's built-in WebGL2 raster fallback. Compute-dependent hybrid/path tracing and compute features are not available on WebGL2; unsupported requests return diagnostics rather than silently claiming equivalent rendering. See the [backend guide](https://github.com/danchar12138/pelican-engine/blob/main/docs/RENDER-BACKENDS.md).
|
|
71
|
+
|
|
72
|
+
## Documentation
|
|
73
|
+
|
|
74
|
+
- [Getting started: npm and source checkout](https://github.com/danchar12138/pelican-engine/blob/main/docs/GETTING-STARTED.md)
|
|
75
|
+
- [Game author guide](https://github.com/danchar12138/pelican-engine/blob/main/docs/npm/GAME-AUTHOR.md)
|
|
76
|
+
- [API reference](https://github.com/danchar12138/pelican-engine/blob/main/docs/api/REFERENCE.md) and [capabilities](https://github.com/danchar12138/pelican-engine/blob/main/docs/CAPABILITIES.md)
|
|
77
|
+
- [Source repository and contribution guide](https://github.com/danchar12138/pelican-engine)
|
|
78
|
+
|
|
79
|
+
The installed package also includes `docs/npm/GAME-AUTHOR.md`, `docs/api/REFERENCE.md`, `docs/api/index.json` and `lib/sdk/index.d.ts`. The installed declarations and `pelican api` describe the API of the actual installed version. Repository examples and assets are not shipped in the npm package.
|
|
80
|
+
|
|
81
|
+
Playwright Chromium is optional for capture and browser automation. If needed, prepare it while online with `npx --no-install pelican setup --install-browser`. With required dependencies and assets already available, everyday operations need no engine account or hosted development service. An offline reinstall additionally requires cached packages.
|
|
82
|
+
|
|
83
|
+
## License
|
|
91
84
|
|
|
92
|
-
|
|
93
|
-
`.pelican/npm/package/`; tarballs and smoke reports go in `.pelican/npm/artifacts/`.
|
|
94
|
-
Neither staging nor tarballs are inside the deployable game `dist/`.
|
|
95
|
-
Pack that staging directory, not the private repository root. Compiled relative
|
|
96
|
-
imports use `lib/` modules and `.js`, never the TypeScript source layout. The
|
|
97
|
-
tarball allowlist excludes source maps, evidence, examples and game assets;
|
|
98
|
-
SDK declarations, engine runtime code, MIT, copied AI docs, and dependency
|
|
99
|
-
license texts are included. `distribution.json` records version and file hashes.
|
|
100
|
-
Dependencies are normal pinned npm dependencies, not vendored engine sources.
|
|
101
|
-
|
|
102
|
-
The npm workflow runs only for a published GitHub milestone release. Its gate
|
|
103
|
-
requires tag/version/SDK/manifest identity and the existing milestone acceptance
|
|
104
|
-
and source-fingerprint checks. An ordinary push or CPU-green build cannot publish.
|
|
105
|
-
M3 is deliberately blocked until its release profile and real acceptance exist.
|
|
106
|
-
The default smoke install uses npm cache only; `--online-install` allows network
|
|
107
|
-
for initial dependency installation, then runs every operation offline with a
|
|
108
|
-
disabled registry. CI uses this flag because `npm ci` alone need not populate
|
|
109
|
-
registry metadata for a fresh external install. `--gpu` additionally measures
|
|
110
|
-
the installed WebGPU backend, renders path/hybrid/raster, checks a nonblank canvas,
|
|
111
|
-
captures through both CLI routes, verifies WebGL2 fallback rejection, and loads
|
|
112
|
-
the nested-base static build without a development hook. It is not M3 acceptance.
|
|
113
|
-
|
|
114
|
-
The single unscoped package is `pelican-engine`, its only public import is
|
|
115
|
-
`pelican-engine`, and its executable is `pelican`. The GitHub target is
|
|
116
|
-
`danchar12138/pelican-engine`; main completed the public repository rename and
|
|
117
|
-
verified the updated origin. No new organization is required. The authorized
|
|
118
|
-
npm Automation Token was authenticated as `danchar12138`, and main confirmed
|
|
119
|
-
the repository Actions secret `NPM_TOKEN` is configured. `npm view pelican-engine`
|
|
120
|
-
returned `E404` before publication. The package remains unpublished pending
|
|
121
|
-
genuine M3 acceptance; this is not an authentication or organization blocker.
|
|
122
|
-
`setup-node` configures the registry;
|
|
123
|
-
only the final publication step receives `NODE_AUTH_TOKEN`. A missing secret
|
|
124
|
-
fails with `TC_NPM_AUTH_MISSING`, without printing the value. The token must have
|
|
125
|
-
permission to publish the fixed unscoped package. No OIDC/trusted-publisher setup
|
|
126
|
-
or provenance flag is required by this workflow. Prereleases use `next`; stable
|
|
127
|
-
versions use `latest`. These credentials do not bypass milestone acceptance.
|
|
128
|
-
No token value is stored in source, documentation, or probe output. No publication
|
|
129
|
-
is performed by this packaging task. See
|
|
130
|
-
`tools/npm/publish-gate.ts` in the source distribution.
|
|
85
|
+
Pelican Engine's own code is MIT licensed. Dependency licenses and third-party notices are included in the package under `licenses/` and in the [repository notices](https://github.com/danchar12138/pelican-engine/blob/main/docs/THIRD-PARTY-NOTICES.md).
|
package/docs/npm/GAME-AUTHOR.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Pelican Engine Game Author
|
|
2
2
|
|
|
3
|
+
For an installed game, start in an empty directory with `npm --prefix . install
|
|
4
|
+
--save-dev --save-exact pelican-engine`, then run `npx pelican dev`. The CLI
|
|
5
|
+
generates the minimal starter when the directory is eligible and preserves existing
|
|
6
|
+
game files. See `docs/GETTING-STARTED.md` in the package for npm and source
|
|
7
|
+
workflows. Commands use common Node/npm syntax; the currently supported development
|
|
8
|
+
environment is Windows, while player support depends on actual browser capabilities.
|
|
9
|
+
|
|
3
10
|
Your workspace is the game project. Use the public `pelican-engine` API and local
|
|
4
11
|
game modules. Do not modify engine internals or `node_modules`, import Three.js,
|
|
5
12
|
TSL, GPU devices, physics-library objects, compiler internals or Node APIs into
|
|
@@ -15,9 +22,10 @@ lists the JSON CLI protocol. `docs/CAPABILITIES.md` records implemented scope an
|
|
|
15
22
|
limitations. The longer `docs/AI-WORKFLOW.md` is shared design context, not an
|
|
16
23
|
instruction to run source-only engine acceptance tasks.
|
|
17
24
|
|
|
18
|
-
The
|
|
19
|
-
|
|
20
|
-
|
|
25
|
+
The installed package includes `docs/GRAPHICS-GUIDE.md` and
|
|
26
|
+
`docs/RENDER-BACKENDS.md`. The source checkout's `docs/STATUS.md` summarizes
|
|
27
|
+
current engine capabilities and gaps. Its `examples/`, engine `packages/`, and
|
|
28
|
+
`npm run probe:*` references are maintainer references available only in a source checkout; the npm package
|
|
21
29
|
intentionally contains no example projects, game assets, or engine source. Use
|
|
22
30
|
the same public declarations in your own game project and validate them with the
|
|
23
31
|
installed `pelican` commands. Do not try to import an internal compiled module.
|
|
@@ -107,20 +115,26 @@ Keyboard bindings use the browser's `KeyboardEvent.key` values, not physical
|
|
|
107
115
|
`KeyboardEvent.code` values. For example, use `input: { up: ["w", "W", "ArrowUp"],
|
|
108
116
|
restart: ["r", "R"] }`, not `"KeyW"` or `"KeyR"`. Letter case depends on the
|
|
109
117
|
actual keyboard event; Space is `" "`. Actions are read inside systems through
|
|
110
|
-
`ctx.input.held`, `pressed`, `released`, or `axis`.
|
|
111
|
-
|
|
118
|
+
`ctx.input.held`, `pressed`, `released`, or `axis`. A mocked system test does not
|
|
119
|
+
establish browser bindings; real input requires separate verification when permitted.
|
|
112
120
|
|
|
113
121
|
## Work Loop
|
|
114
122
|
|
|
115
123
|
1. Inspect `pelican.project.json`, `game.ts`, asset declarations and the public API.
|
|
116
124
|
2. Make small game-only edits. Keep the exact engine version lock.
|
|
117
|
-
3.
|
|
125
|
+
3. Follow the active project policy for running the game or checking gameplay.
|
|
118
126
|
4. Use `inspect`, `input`, `step`, `pause`, `resume`, `snapshot`, `restore`,
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
127
|
+
`record`, `replay`, `status`, `cancel` and `reset-session` against the dev port
|
|
128
|
+
when verification is permitted.
|
|
129
|
+
5. When verification is permitted, use capture and inspect results; preserve
|
|
130
|
+
explicit failures rather than claiming success.
|
|
122
131
|
6. Run `build` and serve `dist/` over HTTP(S). Keep notices and license files.
|
|
123
132
|
|
|
133
|
+
The current engine project decision permits compilation and builds only, not
|
|
134
|
+
tests, browser/GPU runs, smoke or other validation. Historical instructions and
|
|
135
|
+
reports do not authorize those activities or establish that they passed for the
|
|
136
|
+
current source.
|
|
137
|
+
|
|
124
138
|
Installed package commands use `npx --no-install pelican <command>` from the game
|
|
125
139
|
directory. Repository commands use `node --import tsx <engine>/tools/cli.ts
|
|
126
140
|
<command> --project <game-directory>` with the same operations and protocol.
|
package/engine.manifest.json
CHANGED
package/lib/sdk/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Pelican Engine public API. No renderer or GPU implementation types escape this module. */
|
|
2
|
-
export declare const SDK_VERSION = "0.3.
|
|
2
|
+
export declare const SDK_VERSION = "0.3.6";
|
|
3
3
|
export type Vec2 = readonly [number, number];
|
|
4
4
|
export type Vec3 = readonly [number, number, number];
|
|
5
5
|
export type Vec4 = readonly [number, number, number, number];
|
package/lib/sdk/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pelican-engine",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.6",
|
|
4
4
|
"description": "Pelican Engine public SDK and offline development CLI",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
"docs",
|
|
28
28
|
"licenses",
|
|
29
29
|
"AGENTS.md",
|
|
30
|
+
"CONTRIBUTING.md",
|
|
30
31
|
"README.md",
|
|
31
32
|
"LICENSE",
|
|
32
33
|
"engine.manifest.json",
|