A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.
TypeScript 2d-game-engine3d3d-game-engineandroidcppecsgame-editorgame-enginegamedeviostypescriptwebassemblywebglwebgpuwechat-minigame
docs: one structural rule, and a gate that holds it
yhh8492bf8417fd
diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.ymlindex 5c28d1746..a6004007d 100644--- a/.github/workflows/docs.yml+++ b/.github/workflows/docs.yml@@ -54,6 +54,12 @@ jobs:working-directory: docs/astrorun: npm run verify:imports+ # Reads source, so it runs before the build: a page in no sidebar group, or+ # one that exists in only one language, fails here rather than shipping.+ - name: Verify the sidebar, the filesystem and both locales agree+ working-directory: docs/astro+ run: npm run verify:structure+- name: Build Astro Siteworking-directory: docs/astrorun: npm run builddiff --git a/docs/SITE.md b/docs/SITE.mdindex 1a367dd05..62bcc6275 100644--- a/docs/SITE.md+++ b/docs/SITE.md@@ -83,16 +83,25 @@ This will:## Writing Documentation+### The one structural rule++**A page's directory path is its sidebar path is its URL.** A sidebar group is a+directory (`editor/`, `scripting/`, `graphics/`, …); a subgroup inside one is a+directory inside it (`gameplay/ai/`); and a group's general page is+`<dir>/overview.mdx`, labelled **Overview** in the sidebar because the group+header already says the topic — its `title` stays descriptive, since that is the+page's own heading. Nothing else decides where a file goes.++Depth is free: images are referenced through the `@/` alias+(``), not by counting `../`, so a page can move+between levels without its pictures going dark.+### Adding a New Guide-1. Create a new `.mdx` file under the section it belongs to —- `astro/src/content/docs/<section>/`, where `<section>` is one of+1. Create the `.mdx` under the group it belongs to — sections today are`getting-started`, `editor`, `core-concepts`, `scripting`, `graphics`,`animation`, `gameplay`, `ui`, `world`, `assets`, `publishing`,- `performance` or `extending`. A page's directory IS its sidebar group and- its URL: keep them the same, and keep every page exactly one level deep- (`<section>/<page>.mdx`) so the relative `../../../../assets/` image paths- resolve.+ `performance`, `extending` and `reference`.2. Add frontmatter:```mdx---@@ -102,14 +111,23 @@ This will:Your content here...```-3. Add to the matching sidebar group in `astro/astro.config.mjs`, and write the- Simplified Chinese page at `astro/src/content/docs/zh-cn/<section>/<page>.mdx`-4. If you rename or move a page, add its old path to `redirects` in- `astro/astro.config.mjs` — published URLs must keep working-4. Keep code samples accurate: every symbol a guide imports from the main `esengine`- barrel must be a real SDK export. `npm run verify:imports` (from `docs/astro/`)- checks this against the exports declared in `sdk/src` and runs in CI before the- site build, so a renamed or fabricated API fails the docs deploy.+3. Add it to the matching sidebar group in `astro/astro.config.mjs`, and write the+ Simplified Chinese page at `astro/src/content/docs/zh-cn/<same path>.mdx`.+4. If you move or rename a page, append its old path to `MOVED` in+ `astro/astro.config.mjs`. That map is append-only — a URL published once keeps+ resolving.++### The gates++Three checks keep the site honest; all three run in CI, and all three are worth+running locally before a docs PR.++| Check | Run from | Catches |+|---|---|---|+| `npm run verify:imports` | `docs/astro` | A guide importing a symbol the SDK does not export — a renamed or invented API. Runs before the build. |+| `npm run verify:structure` | `docs/astro` | The rule above going soft: a page in no sidebar group, a sidebar entry with no page, a group page not labelled Overview, or a page that exists in only one language. Runs before the build. |+| `npm run verify:links` | `docs/astro` | Any in-site link or `#anchor` that does not resolve against the pages the build emitted, including a root-relative link that forgot the `/docs` base. Runs **after** the build. |+| `node tools/component-reference.mjs --check` | repo root | The component reference disagreeing with the engine's component registry, or a component with no entry in `src/data/componentDocs.ts`. Part of `pnpm run verify`, so pre-push catches it. Refresh with `--update` after building the SDK. |### Available Componentsdiff --git a/docs/astro/astro.config.mjs b/docs/astro/astro.config.mjsindex b1fe4e20d..af7b62b8e 100644--- a/docs/astro/astro.config.mjs+++ b/docs/astro/astro.config.mjs@@ -1,16 +1,29 @@// @ts-check+import { fileURLToPath } from 'node:url';import { defineConfig } from 'astro/config';import starlight from '@astrojs/starlight';import starlightTypeDoc, { typeDocSidebarGroup } from 'starlight-typedoc';const SITE = 'https://estellaengine.com';-// Pages that used to live in one flat `guides/` folder, and now live in the-// section the sidebar shows them under — a page's directory is its URL. Every-// old address stays reachable: Astro emits a redirect page for each entry, in-// both locales. Never delete a line from here; moving a page again means adding-// one, so a URL published once keeps resolving.-const MOVED_GUIDES = {+// Every address this site has published that is not where its page lives now.+// A page's directory path IS its sidebar path IS its URL — that is the rule the+// structure follows, and this map is the cost of having changed it. Append-only:+// moving a page again means adding lines here, never editing or deleting them,+// so a URL published once keeps resolving. Astro emits a redirect page per entry+// in both locales.+const MOVED = {+ // The AI guide grew into a chapter of its own.+ 'gameplay/ai': 'gameplay/ai/overview',+ 'gameplay/ai-perception': 'gameplay/ai/perception',+ 'gameplay/ai-navigation': 'gameplay/ai/navigation',+ 'gameplay/ai-state-machines': 'gameplay/ai/state-machines',+ 'gameplay/ai-behavior-trees': 'gameplay/ai/behavior-trees',+ 'gameplay/ai-blackboard': 'gameplay/ai/blackboard',+ 'gameplay/ai-authoring': 'gameplay/ai/authoring',+ 'gameplay/ai-advanced': 'gameplay/ai/advanced',++ // One flat `guides/` folder became one directory per sidebar group.'guides/editor': 'editor/overview','guides/scripting': 'scripting/overview','guides/input': 'scripting/input',@@ -31,7 +44,7 @@ const MOVED_GUIDES = {'guides/dragonbones': 'animation/dragonbones','guides/physics': 'gameplay/physics','guides/markers': 'gameplay/markers',- 'guides/ai': 'gameplay/ai',+ 'guides/ai': 'gameplay/ai/overview','guides/ui': 'ui/overview','guides/ui-layout': 'ui/layout','guides/ui-text': 'ui/text',@@ -66,11 +79,21 @@ export default defineConfig({site: SITE,base: '/docs',outDir: './dist',+ // `@/` is src, the same alias the editor uses. An image referenced as+ // `../../../assets/…` encodes how deep its page sits, so a page could not move+ // between directory levels without every picture on it going dark — which is+ // why the guides were pinned one level deep. The alias is what lets the+ // structure be chosen for the reader instead of for the asset paths.+ vite: {+ resolve: {+ alias: { '@': fileURLToPath(new URL('./src', import.meta.url)) },+ },+ },// Astro prepends `base` to a redirect's SOURCE but not to its destination, so// the destination carries /docs itself — without it every old URL lands on a// 404 at the site root.redirects: Object.fromEntries(- Object.entries(MOVED_GUIDES).flatMap(([from, to]) => [+ Object.entries(MOVED).flatMap(([from, to]) => [[`/${from}`, `/docs/${to}/`],[`/zh-cn/${from}`, `/docs/zh-cn/${to}/`],]),@@ -166,7 +189,7 @@ export default defineConfig({translations: { 'zh-CN': '脚本' },collapsed: true,items: [- { label: 'Scripting', translations: { 'zh-CN': '脚本' }, slug: 'scripting/overview' },+ { label: 'Overview', translations: { 'zh-CN': '总览' }, slug: 'scripting/overview' },{ label: 'Input', translations: { 'zh-CN': '输入' }, slug: 'scripting/input' },{ label: 'Event Binding', translations: { 'zh-CN': '事件绑定' }, slug: 'scripting/events' },{ label: 'Saving & Loading', translations: { 'zh-CN': '存档与读档' }, slug: 'scripting/save' },@@ -193,7 +216,7 @@ export default defineConfig({translations: { 'zh-CN': '动画' },collapsed: true,items: [- { label: 'Animation', translations: { 'zh-CN': '动画' }, slug: 'animation/overview' },+ { label: 'Overview', translations: { 'zh-CN': '总览' }, slug: 'animation/overview' },{ label: 'Timeline', translations: { 'zh-CN': '时间轴' }, slug: 'animation/timeline' },{ label: 'Spine Animation', translations: { 'zh-CN': 'Spine 动画' }, slug: 'animation/spine' },{ label: 'DragonBones Animation', translations: { 'zh-CN': 'DragonBones 动画' }, slug: 'animation/dragonbones' },@@ -211,14 +234,14 @@ export default defineConfig({translations: { 'zh-CN': '游戏 AI' },collapsed: true,items: [- { label: 'Overview', translations: { 'zh-CN': '总览' }, slug: 'gameplay/ai' },- { label: 'Perception', translations: { 'zh-CN': '感知' }, slug: 'gameplay/ai-perception' },- { label: 'Navigation', translations: { 'zh-CN': '导航' }, slug: 'gameplay/ai-navigation' },- { label: 'State Machines', translations: { 'zh-CN': '状态机' }, slug: 'gameplay/ai-state-machines' },- { label: 'Behavior Trees', translations: { 'zh-CN': '行为树' }, slug: 'gameplay/ai-behavior-trees' },- { label: 'The Blackboard', translations: { 'zh-CN': '黑板' }, slug: 'gameplay/ai-blackboard' },- { label: 'Authoring in the Editor', translations: { 'zh-CN': '在编辑器里编排' }, slug: 'gameplay/ai-authoring' },- { label: 'Below the Components', translations: { 'zh-CN': '组件层之下' }, slug: 'gameplay/ai-advanced' },+ { label: 'Overview', translations: { 'zh-CN': '总览' }, slug: 'gameplay/ai/overview' },+ { label: 'Perception', translations: { 'zh-CN': '感知' }, slug: 'gameplay/ai/perception' },+ { label: 'Navigation', translations: { 'zh-CN': '导航' }, slug: 'gameplay/ai/navigation' },+ { label: 'State Machines', translations: { 'zh-CN': '状态机' }, slug: 'gameplay/ai/state-machines' },+ { label: 'Behavior Trees', translations: { 'zh-CN': '行为树' }, slug: 'gameplay/ai/behavior-trees' },+ { label: 'The Blackboard', translations: { 'zh-CN': '黑板' }, slug: 'gameplay/ai/blackboard' },+ { label: 'Authoring in the Editor', translations: { 'zh-CN': '在编辑器里编排' }, slug: 'gameplay/ai/authoring' },+ { label: 'Below the Components', translations: { 'zh-CN': '组件层之下' }, slug: 'gameplay/ai/advanced' },],},],@@ -255,7 +278,7 @@ export default defineConfig({translations: { 'zh-CN': '资源' },collapsed: true,items: [- { label: 'Assets', translations: { 'zh-CN': '资源' }, slug: 'assets/overview' },+ { label: 'Overview', translations: { 'zh-CN': '总览' }, slug: 'assets/overview' },{ label: 'Audio', translations: { 'zh-CN': '音频' }, slug: 'assets/audio' },{ label: 'Localization', translations: { 'zh-CN': '本地化' }, slug: 'assets/localization' },],@@ -265,7 +288,7 @@ export default defineConfig({translations: { 'zh-CN': '发布' },collapsed: true,items: [- { label: 'Building & Exporting', translations: { 'zh-CN': '构建与导出' }, slug: 'publishing/overview' },+ { label: 'Overview', translations: { 'zh-CN': '总览' }, slug: 'publishing/overview' },{ label: 'Android & iOS', translations: { 'zh-CN': 'Android 与 iOS' }, slug: 'publishing/android-ios' },{ label: 'WeChat MiniGame', translations: { 'zh-CN': '微信小游戏' }, slug: 'publishing/wechat' },{ label: 'Mini-Game Platforms', translations: { 'zh-CN': '小游戏平台' }, slug: 'publishing/minigame-platforms' },diff --git a/docs/astro/package.json b/docs/astro/package.jsonindex 6b15c14a5..29e4cb02b 100644--- a/docs/astro/package.json+++ b/docs/astro/package.json@@ -9,6 +9,7 @@"preview": "astro preview","check": "astro check","verify:imports": "node scripts/verify-doc-imports.mjs",+ "verify:structure": "node scripts/verify-doc-structure.mjs","verify:links": "node scripts/verify-doc-links.mjs"},"dependencies": {diff --git a/docs/astro/scripts/verify-doc-structure.mjs b/docs/astro/scripts/verify-doc-structure.mjsnew file mode 100644index 000000000..5ec633a4b--- /dev/null+++ b/docs/astro/scripts/verify-doc-structure.mjs@@ -0,0 +1,88 @@+// SPDX-License-Identifier: Apache-2.0+// SPDX-FileCopyrightText: Copyright (c) 2024-present ESEngine Team+/**+ * @file verify-doc-structure.mjs+ * @brief Enforce the site's one structural rule.+ *+ * A page's directory path is its sidebar path is its URL. That rule is what+ * makes a URL say where a page lives, and it only holds while three things+ * agree: the sidebar in `astro.config.mjs`, the files on disk, and the two+ * locales. Nothing else notices when they drift — Astro fails on a sidebar entry+ * naming a page that does not exist, but a page in no sidebar group builds+ * happily and is reachable only by search, and an English page with no Chinese+ * translation silently serves English to a Chinese reader.+ *+ * Run from `docs/astro/`, before or after the build — it reads source, not dist:+ *+ * node scripts/verify-doc-structure.mjs+ */+import { readFileSync, readdirSync, existsSync } from 'node:fs';+import { fileURLToPath } from 'node:url';+import { dirname, join, relative, sep } from 'node:path';++const here = dirname(fileURLToPath(import.meta.url));+const ROOT = join(here, '..');+const DOCS = join(ROOT, 'src', 'content', 'docs');+const CONFIG = join(ROOT, 'astro.config.mjs');++/** Generated by TypeDoc, and not ours to organise. */+const GENERATED = 'api-ts';+/** The splash page, which is the site root rather than a sidebar entry. */+const ROOT_PAGE = 'index';++/** Every .mdx under `dir`, as slugs relative to it. */+function pages(dir) {+ const out = [];+ const walk = (d) => {+ for (const e of readdirSync(d, { withFileTypes: true })) {+ const p = join(d, e.name);+ if (e.isDirectory()) {+ if (e.name !== GENERATED && e.name !== 'zh-cn') walk(p);+ } else if (e.name.endsWith('.mdx')) {+ out.push(relative(dir, p).split(sep).join('/').replace(/\.mdx$/, ''));+ }+ }+ };+ walk(dir);+ return out;+}++const config = readFileSync(CONFIG, 'utf8');+const slugs = [...config.matchAll(/slug: '([a-z0-9/-]+)'/g)].map((m) => m[1]);+const problems = [];++// The sidebar names pages that exist, in both locales.+for (const slug of slugs) {+ for (const [label, prefix] of [['English', ''], ['Chinese', 'zh-cn/']]) {+ if (!existsSync(join(DOCS, `${prefix}${slug}.mdx`))) {+ problems.push(`the sidebar lists "${slug}", which has no ${label} page`);+ }+ }+}++// Every page is somewhere in the sidebar. A page reachable only by search is a+// page nobody browsing the manual will find.+const seen = new Set(slugs);+for (const p of pages(DOCS)) {+ if (p !== ROOT_PAGE && !seen.has(p)) problems.push(`page "${p}" is in no sidebar group`);+}++// A group's general page is `<dir>/overview` and is labelled Overview — the+// group header already says the topic. (Its `title` stays descriptive.)+for (const m of config.matchAll(/\{ label: '([^']+)',[^}]*slug: '([a-z0-9/-]+\/overview)'/g)) {+ if (m[1] !== 'Overview') problems.push(`"${m[2]}" is labelled "${m[1]}" in the sidebar, not Overview`);+}++// The locales are mirrors: same tree, same names.+const en = new Set(pages(DOCS));+const zh = new Set(pages(join(DOCS, 'zh-cn')));+for (const p of en) if (!zh.has(p)) problems.push(`no Chinese page for "${p}"`);+for (const p of zh) if (!en.has(p)) problems.push(`no English page for "${p}"`);++if (problems.length) {+ console.error(`doc structure: ${problems.length} problem(s)`);+ for (const p of problems) console.error(` ${p}`);+ console.error('\n The rule: a page\'s directory path is its sidebar path is its URL (docs/SITE.md).');+ process.exit(1);+}+console.log(`doc structure: ${en.size} pages × 2 locales — sidebar, filesystem and translations agree.`);diff --git a/docs/astro/src/components/ComponentReference.astro b/docs/astro/src/components/ComponentReference.astroindex 60f1da836..0e7a96b7c 100644--- a/docs/astro/src/components/ComponentReference.astro+++ b/docs/astro/src/components/ComponentReference.astro@@ -3,8 +3,8 @@// its fields, types and authoring defaults. The field data is derived from the// engine's own registry (tools/component-reference.mjs), so it cannot drift from// the code; the summary and the link to the guide come from the curated table.-import { COMPONENT_DOCS, CATEGORY_LABELS, type ComponentCategory } from '../data/componentDocs';-import snapshot from '../data/components.generated.json';+import { COMPONENT_DOCS, CATEGORY_LABELS, type ComponentCategory } from '@/data/componentDocs';+import snapshot from '@/data/components.generated.json';interface Props {category: ComponentCategory;diff --git a/docs/astro/src/content/docs/animation/dragonbones.mdx b/docs/astro/src/content/docs/animation/dragonbones.mdxindex 50e74388e..d2b42c136 100644--- a/docs/astro/src/content/docs/animation/dragonbones.mdx+++ b/docs/astro/src/content/docs/animation/dragonbones.mdx@@ -44,7 +44,7 @@ You do not need to reference it anywhere.Add it with **Create → DragonBones**, or add the component to an existing entity.It lives in the main `esengine` package.-+| Property | Type | Default | Description ||---|---|---|---|@@ -164,7 +164,7 @@ Nothing is required to opt in — it follows from the pair the components referePer-entity properties stay per entity, so a shared skeleton can still be scaled,flipped and tinted independently:-+## What ships in a builddiff --git a/docs/astro/src/content/docs/animation/overview.mdx b/docs/astro/src/content/docs/animation/overview.mdxindex 048127f08..95dc5425c 100644--- a/docs/astro/src/content/docs/animation/overview.mdx+++ b/docs/astro/src/content/docs/animation/overview.mdx@@ -16,7 +16,7 @@ element while a sprite loops.## Sprite animation-+*The flipbook editor: a 4-frame walk clip, per-frame durations, and a live preview with FPS / loop / onion-skin.*@@ -187,7 +187,7 @@ const registerRun = defineSystem([Res(Assets), Res(SpriteAnimation)], async (ass### Driving clips from a state machine — no code-The [FSM/BT built-ins](/docs/gameplay/ai/) drive flipbooks as data. An action's+The [FSM/BT built-ins](/docs/gameplay/ai/overview/) drive flipbooks as data. An action'soptional **argument** carries the clip, so idle/run/attack switching is pure`.esfsm` on the existing state-machine canvas:@@ -243,7 +243,7 @@ const animate = defineSystem([Res(Tween)], (tween) => {(`EaseIn*` / `EaseOut*` / `EaseInOut*`), `EaseOutBounce`, `Step`, and `CubicBezier`— use a custom bezier with the handle's `.bezier(p1x, p1y, p2x, p2y)`.-+*Each easing plotted (progress `t` left→right, eased value bottom→top) — these are the engine's exact curves. `Back` and `Elastic` overshoot past the 0–1 band; `Step` holds until the end.*@@ -314,7 +314,7 @@ storing a handle to pause, cancel, or observe the composition later.## Animator state machine-+*The animator: states (Idle / Move / Hop), transitions with conditions (`speed>20`, the `hop` trigger), and the **Parameters** panel that drives them.*@@ -370,7 +370,7 @@ parameter and `eq` / `neq`.### Blend trees-+*A 1D blend: a float parameter picks the clip whose threshold is the highest one at or below it — here `idle` / `walk` / `run` as `speed` rises, with no transitions between them.*diff --git a/docs/astro/src/content/docs/animation/timeline.mdx b/docs/astro/src/content/docs/animation/timeline.mdxindex 5bfc4ad9a..ccfb37a75 100644--- a/docs/astro/src/content/docs/animation/timeline.mdx+++ b/docs/astro/src/content/docs/animation/timeline.mdx@@ -39,7 +39,7 @@ const attach = defineSystem([Commands()], (cmds) => {The component flags **are** the playback control: the engine reconciles them intoits internal clock every frame, so anything that flips `playing` — your code, the-inspector, an [AI action](/docs/gameplay/ai/#built-in-names) — drives the+inspector, an [AI action](/docs/gameplay/ai/overview/#built-in-names) — drives theclip through the same channel.## Control playback@@ -77,7 +77,7 @@ These methods write through to the `TimelinePlayer` flags — `timeline.play(e)`For a **code-free cutscene**, pair the component with a state machine: thebuilt-in `timeline.play` action and `timeline.finished` condition make an FSMstate that plays a clip on enter and transitions out when it completes. See- [AI — built-in names](/docs/gameplay/ai/#built-in-names).+ [AI — built-in names](/docs/gameplay/ai/overview/#built-in-names).</Aside>## Track types@@ -119,14 +119,14 @@ it in the **Sequencer** — the editor for keyframe animation. The **dope sheet*every track and its keys along a shared, scrubbable playhead; add tracks, drag keys,then **Save**.-+*The dope sheet: one row per track (here a Transform's `position.x` / `position.y` plus two letterbox activation tracks), keyframes as diamonds, a scrubbable playhead, and the transport up top.*Switch to the **Curves** tab to shape the interpolation between keys — drag the valuecurves and their tangent handles for eases the dope sheet can't express:-+*The curve editor: each keyframed channel becomes an editable curve (here `position.x` easing in, `position.y` bobbing), with per-key tangent handles.*diff --git a/docs/astro/src/content/docs/assets/localization.mdx b/docs/astro/src/content/docs/assets/localization.mdxindex fef9ff96c..eef580ccc 100644--- a/docs/astro/src/content/docs/assets/localization.mdx+++ b/docs/astro/src/content/docs/assets/localization.mdx@@ -71,7 +71,7 @@ i18n.t('apples', { count: 3 }); // "3 apples"## String tables (`.eslocale`)-+*A `.eslocale` table in the inspector: each key's value for this locale, with the other locale shown beneath as a translation hint.*diff --git a/docs/astro/src/content/docs/assets/overview.mdx b/docs/astro/src/content/docs/assets/overview.mdxindex 8f57d0437..c66e95e94 100644--- a/docs/astro/src/content/docs/assets/overview.mdx+++ b/docs/astro/src/content/docs/assets/overview.mdx@@ -161,7 +161,7 @@ way it can:them into atlas pages (with the frame UVs written into the manifest), so manysmall sprites ship as one texture and batch in one draw call.-+*A texture's **Platform Overrides**: each target gets its own tab, and a platform that overrides nothing follows the Default settings above it.*@@ -177,7 +177,7 @@ Declare the folder instead. In the **Content Browser**, right-click it and pick**Delivery → Always include in builds** — the same menu that sets local /subpackage / remote delivery, writing to the same `.esengine/asset-groups.json`:-+*Right-click a folder → **Delivery**. The three modes decide where an asset ships from; **Always include in builds** decides whether it ships at all.*diff --git a/docs/astro/src/content/docs/core-concepts/plugins-resources.mdx b/docs/astro/src/content/docs/core-concepts/plugins-resources.mdxindex 4018e711c..6f9ecdb9b 100644--- a/docs/astro/src/content/docs/core-concepts/plugins-resources.mdx+++ b/docs/astro/src/content/docs/core-concepts/plugins-resources.mdx@@ -37,7 +37,7 @@ Every subsystem's imperative API is reached the same way:| Timers | `Res(TimerRes)` | [Scripting](/docs/scripting/overview/) || Timeline | `Res(Timeline)` | [Timeline](/docs/animation/timeline/) || Prefabs | `Res(Prefabs)` | [Prefabs](/docs/world/prefabs/) |-| Navigation / AI | `Res(Nav)` | [Gameplay AI](/docs/gameplay/ai/) |+| Navigation / AI | `Res(Nav)` | [Gameplay AI](/docs/gameplay/ai/overview/) || Localization | `Res(Localization)` | [Localization](/docs/assets/localization/) || Camera view | `Res(CameraView)` | [Camera](/docs/graphics/camera/) || UI events | `Res(UIEvents)` | [UI](/docs/ui/overview/) |diff --git a/docs/astro/src/content/docs/core-concepts/screen.mdx b/docs/astro/src/content/docs/core-concepts/screen.mdxindex 79c6c2d65..c165b5759 100644--- a/docs/astro/src/content/docs/core-concepts/screen.mdx+++ b/docs/astro/src/content/docs/core-concepts/screen.mdx@@ -66,7 +66,7 @@ const readCanvas = defineSystem([GetWorld()], (world) => {## Scale modes-+The fit math is one pure function, exported as `computeEffectiveOrthoSize`. Giventhe design box and the actual screen aspect it produces the **effective orthodiff --git a/docs/astro/src/content/docs/editor/asset-editors.mdx b/docs/astro/src/content/docs/editor/asset-editors.mdxindex b024252bb..4c112811b 100644--- a/docs/astro/src/content/docs/editor/asset-editors.mdx+++ b/docs/astro/src/content/docs/editor/asset-editors.mdx@@ -22,7 +22,7 @@ Double-click an asset in the Content Browser to open its editor in a document taframe thumbnails to **reorder**, or set the whole loop to **one uniform duration**, witha live preview.- **State Machine** (`.esfsm`) and **Behavior Tree** (`.esbt`) editors — visual graphs- for AI. See [Gameplay AI](/docs/gameplay/ai/).+ for AI. See [Gameplay AI](/docs/gameplay/ai/overview/).- **Material Graph** (`.esmatgraph`) — a node editor that compiles to a shader. See[Materials & Shaders](/docs/graphics/materials/).diff --git a/docs/astro/src/content/docs/editor/overview.mdx b/docs/astro/src/content/docs/editor/overview.mdxindex 0eaac832b..ce5720935 100644--- a/docs/astro/src/content/docs/editor/overview.mdx+++ b/docs/astro/src/content/docs/editor/overview.mdx@@ -36,7 +36,7 @@ renaming a file doesn't break references.## The workspace-+*The default workspace: the viewport in the centre, the World Outliner and Details on the right, the Content Browser along the bottom, and the Play controls up top.*diff --git a/docs/astro/src/content/docs/editor/scenes.mdx b/docs/astro/src/content/docs/editor/scenes.mdxindex aea8b65ea..c507ddb43 100644--- a/docs/astro/src/content/docs/editor/scenes.mdx+++ b/docs/astro/src/content/docs/editor/scenes.mdx@@ -64,7 +64,7 @@ widget** — most of them for UI nodes:a project `.esshader` — see[Materials & Shaders](/docs/graphics/materials/#choosing--sharing-shaders-in-the-editor).-+*A UI node's inspector: the **In Layout / Absolute** toggle, the clickable **3×3 anchor grid** (with per-axis Stretch), and `Display: Flex` — visual controls in place of raw numbers.*@@ -81,4 +81,4 @@ reach every place the texture is drawn: the edit viewport, Play (in the viewportthe Game panel), and a packaged build. A frame that slices correctly while you author itslices correctly in the shipped game.-+diff --git a/docs/astro/src/content/docs/editor/viewport.mdx b/docs/astro/src/content/docs/editor/viewport.mdxindex 3c8c3972d..a1437351f 100644--- a/docs/astro/src/content/docs/editor/viewport.mdx+++ b/docs/astro/src/content/docs/editor/viewport.mdx@@ -85,7 +85,7 @@ real device and both the edit overlay and the running game commit to its shapeproject authored for a phone is never only ever *run* at whatever aspect the dockhappened to be dragged to.-+### Project screen presets@@ -102,7 +102,7 @@ portrait size, and it joins the dropdown for everyone who opens the project.pixels. Leave them at zero and nothing is written to the project file — the viewport's*Safe area* overlay then has nothing to draw for that screen.-+Presets live in `project.esproject`, so they are shared through version control:diff --git a/docs/astro/src/content/docs/extending/built-in-agent.mdx b/docs/astro/src/content/docs/extending/built-in-agent.mdxindex 19441135f..520ac3124 100644--- a/docs/astro/src/content/docs/extending/built-in-agent.mdx+++ b/docs/astro/src/content/docs/extending/built-in-agent.mdx@@ -21,7 +21,7 @@ your Undo takes them back, and you can take the mouse at any moment.The editor ships no key and calls nothing on its own. Open **Settings ▸ AI Agents**and configure one provider — that is the whole setup.-+<Steps>@@ -48,7 +48,7 @@ Open the command palette (`Ctrl/Cmd+Shift+P`) and run **Agent: Open**. Or skip ttype your question straight into the palette. Anything that reads as a sentencerather than a command offers **Hand to Agent**, and `Enter` sends it.-+A run reads top to bottom:@@ -88,7 +88,7 @@ One undoable tool still stops to ask, and not for safety: `apply_scene_ops` autha whole subtree in a single call, and a hundred-node edit is worth seeing before itlands rather than reading back afterwards.-+Every line is one change. Click one to **strike it out** — striking a new entity alsostrikes whatever refers to it — then **Apply** the rest. **Allow for this run** stopsdiff --git a/docs/astro/src/content/docs/gameplay/ai/advanced.mdx b/docs/astro/src/content/docs/gameplay/ai/advanced.mdxindex 07c3726a9..3e7392771 100644--- a/docs/astro/src/content/docs/gameplay/ai/advanced.mdx+++ b/docs/astro/src/content/docs/gameplay/ai/advanced.mdx@@ -58,7 +58,7 @@ const grid = navGridFromTiles((x, y) => level.tiles[y][x], {| `BuildNavGridOptions` field | Description ||---|---|-| `width` / `height` / `cellSize` / `origin?` | Same as the `NavGrid` options (see [Building a grid](/docs/gameplay/ai-navigation/#building-a-grid)). |+| `width` / `height` / `cellSize` / `origin?` | Same as the `NavGrid` options (see [Building a grid](/docs/gameplay/ai/navigation/#building-a-grid)). || `blockedTileIds?` | Exact set of tile ids that block movement. || `isBlocked?` | Custom predicate over the tile id (`0` = empty); overrides `blockedTileIds`. With neither given, any non-empty tile blocks. |diff --git a/docs/astro/src/content/docs/gameplay/ai/behavior-trees.mdx b/docs/astro/src/content/docs/gameplay/ai/behavior-trees.mdxindex f0283b99a..7c2ced7c1 100644--- a/docs/astro/src/content/docs/gameplay/ai/behavior-trees.mdx+++ b/docs/astro/src/content/docs/gameplay/ai/behavior-trees.mdx@@ -3,7 +3,7 @@ title: Behavior treesdescription: "Running an .esbt graph: selectors, sequences, decorators and leaves, and how a tick resolves."----+*The behavior-tree editor: a **Selector** root over a **Sequence** (Condition `seesPlayer` → Action `chase`) with a fallback `patrol` action.*diff --git a/docs/astro/src/content/docs/gameplay/ai/overview.mdx b/docs/astro/src/content/docs/gameplay/ai/overview.mdxindex 7e8ea8a9f..19eca71b2 100644--- a/docs/astro/src/content/docs/gameplay/ai/overview.mdx+++ b/docs/astro/src/content/docs/gameplay/ai/overview.mdx@@ -36,7 +36,7 @@ editor, not hardcoded. Perception feeds the decision; the decision drives navigaEverything here is pure TypeScript in the `esengine` core (no WebAssemblyside-module). All four plugins — perception, FSM, BT, and navigation — are addedautomatically by the editor and the web runtime. You only wire plugins yourself in- a bare `new App()` (see [Custom app setup](/docs/gameplay/ai-advanced/#custom-app-setup)).+ a bare `new App()` (see [Custom app setup](/docs/gameplay/ai/advanced/#custom-app-setup)).</Aside>## The shared registry@@ -68,7 +68,7 @@ is the same programming model as a [`defineBehavior`](/docs/scripting/overview/)| `ctx.dt` | `number` | Frame delta in seconds. || `ctx.world` | `World` | Full world access for cross-entity reads. || `ctx.commands` | `Commands` | Deferred spawn/despawn, safe mid-tick. |-| `ctx.blackboard` | `Blackboard` | This agent's AI data plane (see [Blackboard](/docs/gameplay/ai-blackboard/)). |+| `ctx.blackboard` | `Blackboard` | This agent's AI data plane (see [Blackboard](/docs/gameplay/ai/blackboard/)). || `ctx.get(Comp)` | `ComponentData` | Read another component on **this** entity. || `ctx.set(Comp, data)` | `void` | Write a component on **this** entity. || `ctx.has(Comp)` | `boolean` | Whether this entity has `Comp`. |@@ -152,13 +152,13 @@ unlocks when it completes, and R replays it — with zero registered actions.## The four pieces<CardGrid>- <LinkCard title="Perception" href="/docs/gameplay/ai-perception/" description="Sight cones, and what an agent currently sees." />- <LinkCard title="Navigation" href="/docs/gameplay/ai-navigation/" description="A navigation grid, A* paths, and moving an agent along one." />- <LinkCard title="State machines" href="/docs/gameplay/ai-state-machines/" description="States, guarded transitions, and one-shot triggers." />- <LinkCard title="Behavior trees" href="/docs/gameplay/ai-behavior-trees/" description="Selectors, sequences, decorators and leaves." />- <LinkCard title="The blackboard" href="/docs/gameplay/ai-blackboard/" description="The per-agent data plane both paradigms read and write." />- <LinkCard title="Authoring in the editor" href="/docs/gameplay/ai-authoring/" description="Register the leaves in code, build the graphs visually." />- <LinkCard title="Below the components" href="/docs/gameplay/ai-advanced/" description="Pathfinding by hand, perception internals, and bare-App wiring." />+ <LinkCard title="Perception" href="/docs/gameplay/ai/perception/" description="Sight cones, and what an agent currently sees." />+ <LinkCard title="Navigation" href="/docs/gameplay/ai/navigation/" description="A navigation grid, A* paths, and moving an agent along one." />+ <LinkCard title="State machines" href="/docs/gameplay/ai/state-machines/" description="States, guarded transitions, and one-shot triggers." />+ <LinkCard title="Behavior trees" href="/docs/gameplay/ai/behavior-trees/" description="Selectors, sequences, decorators and leaves." />+ <LinkCard title="The blackboard" href="/docs/gameplay/ai/blackboard/" description="The per-agent data plane both paradigms read and write." />+ <LinkCard title="Authoring in the editor" href="/docs/gameplay/ai/authoring/" description="Register the leaves in code, build the graphs visually." />+ <LinkCard title="Below the components" href="/docs/gameplay/ai/advanced/" description="Pathfinding by hand, perception internals, and bare-App wiring." /></CardGrid>## Putting it togetherdiff --git a/docs/astro/src/content/docs/gameplay/ai/state-machines.mdx b/docs/astro/src/content/docs/gameplay/ai/state-machines.mdxindex c1f6195c2..73e96d8f9 100644--- a/docs/astro/src/content/docs/gameplay/ai/state-machines.mdx+++ b/docs/astro/src/content/docs/gameplay/ai/state-machines.mdx@@ -3,7 +3,7 @@ title: State machinesdescription: "Running an .esfsm graph: states with enter/update/exit hooks, guarded transitions, and one-shot triggers."----+*The state-machine editor: states (Patrol / Chase) linked by guarded transitions (`?seesPlayer`, `?lostPlayer`).*@@ -27,7 +27,7 @@ cmds.spawn()| `current` | Active state name, written each tick (read-only; visible in the inspector). |The recommended path is to **author the graph in the editor** as an `.esfsm` asset-(see [Authoring in the editor](/docs/gameplay/ai-authoring/)). The states reference your+(see [Authoring in the editor](/docs/gameplay/ai/authoring/)). The states reference yourregistered action/condition names by string. You can also build a machine in code:```typescriptdiff --git a/docs/astro/src/content/docs/gameplay/markers.mdx b/docs/astro/src/content/docs/gameplay/markers.mdxindex 60fddb1a9..447dcd0b9 100644--- a/docs/astro/src/content/docs/gameplay/markers.mdx+++ b/docs/astro/src/content/docs/gameplay/markers.mdx@@ -57,7 +57,7 @@ In the Inspector, set the marker's **Type** and add any number of custom**properties** (a key→value map — `targetScene: "level2"`, `team: "red"`, and so on).Both survive save/load and travel into the build.-+*A `spawn` marker in the Inspector: the **Type** drives `Query(Marker)`, and each**Properties** row is one entry of the free-form string→string map.*diff --git a/docs/astro/src/content/docs/gameplay/physics.mdx b/docs/astro/src/content/docs/gameplay/physics.mdxindex efbe2600a..af9e292c0 100644--- a/docs/astro/src/content/docs/gameplay/physics.mdx+++ b/docs/astro/src/content/docs/gameplay/physics.mdx@@ -57,7 +57,7 @@ queries and the character controller = pixels.**## Bodies & colliders-+*Collider gizmos in the viewport: the selected **Ground**'s box outline (amber) plus the walls and ramp. Toggle them with the viewport's Physics show-flag.*@@ -120,7 +120,7 @@ are in meters.## Collision filtering-+*Project Settings → Physics: name your 16 collision layers, then toggle which pairs collide in the matrix (alongside the solver tuning below).*@@ -242,7 +242,7 @@ const onHit = defineSystem([Res(PhysicsEvents)], (events) => {## Joints-+*What each joint constrains: a **Revolute** hinge (rotate about a pin), a **Distance** spring/rod, a **Prismatic** slider (one axis), a rigid **Weld**, a **Wheel** (suspension + free spin), and a **Motor** (driven toward a target velocity).*@@ -320,7 +320,7 @@ means "solid top". Set `enabled: false` to turn the platform back into a normalIn the editor, a one-way platform's collider gizmo grows an arrow along the solid-sidenormal, so which way it carries is visible at a glance.-+## Mouse / drag jointdiff --git a/docs/astro/src/content/docs/graphics/camera.mdx b/docs/astro/src/content/docs/graphics/camera.mdxindex 98f0a8c68..1e53a6ab3 100644--- a/docs/astro/src/content/docs/graphics/camera.mdx+++ b/docs/astro/src/content/docs/graphics/camera.mdx@@ -110,7 +110,7 @@ Add a `FollowTarget` to the camera and point it at an entity. The follow is aframe-rate-independent damped move with a dead zone, so the camera drifts smoothlyand ignores tiny movements:-+```typescriptimport { defineSystem, Query, Commands, Camera, FollowTarget } from 'esengine';diff --git a/docs/astro/src/content/docs/graphics/lighting.mdx b/docs/astro/src/content/docs/graphics/lighting.mdxindex bf734fbd5..fbe33b2a2 100644--- a/docs/astro/src/content/docs/graphics/lighting.mdx+++ b/docs/astro/src/content/docs/graphics/lighting.mdx@@ -199,7 +199,7 @@ const app = createWebApp(module, { colorSpace: 'linear' });## In the editor-+*A `Light2D` previewed in the editor — its reach pool and the shadows the pillars cast (turn on **Preview FX** to light the scene in edit mode).*diff --git a/docs/astro/src/content/docs/graphics/materials.mdx b/docs/astro/src/content/docs/graphics/materials.mdxindex c89ec506e..79d573e78 100644--- a/docs/astro/src/content/docs/graphics/materials.mdx+++ b/docs/astro/src/content/docs/graphics/materials.mdx@@ -47,7 +47,7 @@ Select a material in the Content Browser and the Details panel opens its inspectbuilt-in template (as *Built-in · Unlit*, *Built-in · Lit*, …) alongside every `.esshader`in your project — pick one to rebind the material.-+*The material inspector: the **Shader** section with its picker (here `dissolve.esshader`), above the **Parameters** reflected from that shader's `#pragma param`s.*diff --git a/docs/astro/src/content/docs/graphics/sprites.mdx b/docs/astro/src/content/docs/graphics/sprites.mdxindex 271602225..ce16b7d1f 100644--- a/docs/astro/src/content/docs/graphics/sprites.mdx+++ b/docs/astro/src/content/docs/graphics/sprites.mdx@@ -70,7 +70,7 @@ Scale on the `Transform` multiplies on top of it. `pivot` is the normalized anchbottom-left corner, `{0.5, 0}` pins the bottom-center (handy for characters standing onthe ground).-+## Units & coordinates@@ -96,7 +96,7 @@ layer** (`sprite.layer`) — a named layer list you define in **Project SettingsRendering**, so the inspector shows a dropdown of *Background*, *Default*, *Foreground*,etc. instead of a raw number. Lower layers draw first (behind).-+Naming is a readability feature, not a limit: name up to thirty-two slots (a slot'sindex *is* its z-order). The names are suggestions — type a number the list doesn't@@ -189,7 +189,7 @@ so a sprite at z = -400 is grabbable where it is drawn.How a texture is sampled is set **per texture handle**, not per sprite:-+*The same tiny texture magnified ~15×. **Nearest** keeps texel edges hard (pixelart); **Linear** interpolates between texels for a smooth look (the default).*@@ -215,7 +215,7 @@ setTextureParams(tex.handle, TextureFilter.Nearest, TextureFilter.Nearest,surface — separate minification/magnification filters and per-axis wrap. `Repeat`is what makes `tileSize` tiling and UV-scroll effects seamless.-+*What each wrap mode does with UVs outside the 0–1 range (centre tile = thetexture): **Repeat** tiles it, **Clamp to edge** stretches the border pixel, anddiff --git a/docs/astro/src/content/docs/index.mdx b/docs/astro/src/content/docs/index.mdxindex 4b6397e90..052e004c0 100644--- a/docs/astro/src/content/docs/index.mdx+++ b/docs/astro/src/content/docs/index.mdx@@ -52,6 +52,6 @@ import { Card, CardGrid, LinkCard } from '@astrojs/starlight/components';<LinkCard title="The Editor" href="/docs/editor/overview/" description="A tour of the visual editor and its panels." /><LinkCard title="Sprites & Rendering" href="/docs/graphics/sprites/" description="Draw images — tint, size, sort, and layer them." /><LinkCard title="Physics" href="/docs/gameplay/physics/" description="Rigid bodies, colliders, joints, and spatial queries." />- <LinkCard title="Gameplay AI" href="/docs/gameplay/ai/" description="Navigation, perception, state machines, behavior trees." />+ <LinkCard title="Gameplay AI" href="/docs/gameplay/ai/overview/" description="Navigation, perception, state machines, behavior trees." /><LinkCard title="Building & Exporting" href="/docs/publishing/overview/" description="Ship to web, desktop, WeChat, playable ads, Android and iOS." /></CardGrid>diff --git a/docs/astro/src/content/docs/publishing/hot-update.mdx b/docs/astro/src/content/docs/publishing/hot-update.mdxindex 0a40e7204..1273df2f2 100644--- a/docs/astro/src/content/docs/publishing/hot-update.mdx+++ b/docs/astro/src/content/docs/publishing/hot-update.mdx@@ -65,7 +65,7 @@ In the **Content Browser**, right-click any folder and pick **Delivery → Remot(CDN / hot-update)**. That's the whole authoring step — the folder's every asset(recursively) now ships from the CDN instead of the package.-+*Content Browser → right-click a folder → **Delivery** → **Local / Subpackage / Remote (CDN / hot-update)**. The choice is written to `.esengine/asset-groups.json`.*@@ -77,7 +77,7 @@ A folder assigned to a Subpackage or Remote group carries a corner **badge** soyou can see the delivery layout at a glance — `CDN` (blue) for remote, `PKG`(purple) for subpackage.-+*The `cdn` folder wears a blue **CDN** badge — its assets are delivered remotely and can be hot-updated.*@@ -93,7 +93,7 @@ profile** setting, so `dev` and `prod` can point at different CDNs, and theexport bakes the active profile's root into the shipped game. Set it in the**Package Project** dialog (**File → Build…**), under **Advanced**:-+*The **CDN root** field writes the active profile's `remoteRoot` to `asset-groups.json`. Leave it empty to load remote assets same-origin (e.g. for local testing).*diff --git a/docs/astro/src/content/docs/publishing/overview.mdx b/docs/astro/src/content/docs/publishing/overview.mdxindex 387c48f3f..6eb9b314f 100644--- a/docs/astro/src/content/docs/publishing/overview.mdx+++ b/docs/astro/src/content/docs/publishing/overview.mdx@@ -12,7 +12,7 @@ so what you shipped is what you tested (*play == ship*).## Exporting from the editor-+*The Package Project dialog: pick a **target** from the categorized list, a configuration, the output folder, and the [cook options](#asset-cook-options) — then Package.*diff --git a/docs/astro/src/content/docs/reference/components/animation.mdx b/docs/astro/src/content/docs/reference/components/animation.mdxindex a76715e8b..4b1ff14f2 100644--- a/docs/astro/src/content/docs/reference/components/animation.mdx+++ b/docs/astro/src/content/docs/reference/components/animation.mdx@@ -4,7 +4,7 @@ description: "Flipbook clips, animator controllers, timelines and skeletal runtitableOfContents: false----import ComponentReference from '../../../../components/ComponentReference.astro';+import ComponentReference from '@/components/ComponentReference.astro';Every field below is derived from the engine's own component registry — the sameone the editor's **Details** panel reads — so the types and defaults here are thediff --git a/docs/astro/src/content/docs/reference/components/core.mdx b/docs/astro/src/content/docs/reference/components/core.mdxindex d13df5f77..912fd9772 100644--- a/docs/astro/src/content/docs/reference/components/core.mdx+++ b/docs/astro/src/content/docs/reference/components/core.mdx@@ -4,7 +4,7 @@ description: "Transforms, hierarchy, naming and the tags the engine itself readstableOfContents: false----import ComponentReference from '../../../../components/ComponentReference.astro';+import ComponentReference from '@/components/ComponentReference.astro';Every field below is derived from the engine's own component registry — the sameone the editor's **Details** panel reads — so the types and defaults here are thediff --git a/docs/astro/src/content/docs/reference/components/gameplay.mdx b/docs/astro/src/content/docs/reference/components/gameplay.mdxindex d9ff913be..a0871b0c1 100644--- a/docs/astro/src/content/docs/reference/components/gameplay.mdx+++ b/docs/astro/src/content/docs/reference/components/gameplay.mdx@@ -4,7 +4,7 @@ description: "AI agents, event wiring, audio emitters and network replication."tableOfContents: false----import ComponentReference from '../../../../components/ComponentReference.astro';+import ComponentReference from '@/components/ComponentReference.astro';Every field below is derived from the engine's own component registry — the sameone the editor's **Details** panel reads — so the types and defaults here are thediff --git a/docs/astro/src/content/docs/reference/components/graphics.mdx b/docs/astro/src/content/docs/reference/components/graphics.mdxindex c45a0bd56..c7a52f91f 100644--- a/docs/astro/src/content/docs/reference/components/graphics.mdx+++ b/docs/astro/src/content/docs/reference/components/graphics.mdx@@ -4,7 +4,7 @@ description: "Everything that draws: sprites, shapes, meshes, cameras, lights antableOfContents: false----import ComponentReference from '../../../../components/ComponentReference.astro';+import ComponentReference from '@/components/ComponentReference.astro';Every field below is derived from the engine's own component registry — the sameone the editor's **Details** panel reads — so the types and defaults here are thediff --git a/docs/astro/src/content/docs/reference/components/physics.mdx b/docs/astro/src/content/docs/reference/components/physics.mdxindex a7fb48b7e..13af89199 100644--- a/docs/astro/src/content/docs/reference/components/physics.mdx+++ b/docs/astro/src/content/docs/reference/components/physics.mdx@@ -4,7 +4,7 @@ description: "Bodies, collider shapes, the character controller and every joint.tableOfContents: false----import ComponentReference from '../../../../components/ComponentReference.astro';+import ComponentReference from '@/components/ComponentReference.astro';Every field below is derived from the engine's own component registry — the sameone the editor's **Details** panel reads — so the types and defaults here are thediff --git a/docs/astro/src/content/docs/reference/components/ui.mdx b/docs/astro/src/content/docs/reference/components/ui.mdxindex 20ba4c88a..78838fd0c 100644--- a/docs/astro/src/content/docs/reference/components/ui.mdx+++ b/docs/astro/src/content/docs/reference/components/ui.mdx@@ -4,7 +4,7 @@ description: "The UI box model, its visuals, and the widgets built on top of thetableOfContents: false----import ComponentReference from '../../../../components/ComponentReference.astro';+import ComponentReference from '@/components/ComponentReference.astro';Every field below is derived from the engine's own component registry — the sameone the editor's **Details** panel reads — so the types and defaults here are thediff --git a/docs/astro/src/content/docs/reference/components/world.mdx b/docs/astro/src/content/docs/reference/components/world.mdxindex 38051e03e..01246dd45 100644--- a/docs/astro/src/content/docs/reference/components/world.mdx+++ b/docs/astro/src/content/docs/reference/components/world.mdx@@ -4,7 +4,7 @@ description: "Tilemaps, particles and the markers you place in a scene."tableOfContents: false----import ComponentReference from '../../../../components/ComponentReference.astro';+import ComponentReference from '@/components/ComponentReference.astro';Every field below is derived from the engine's own component registry — the sameone the editor's **Details** panel reads — so the types and defaults here are thediff --git a/docs/astro/src/content/docs/scripting/events.mdx b/docs/astro/src/content/docs/scripting/events.mdxindex 032b3e4e1..824e3125e 100644--- a/docs/astro/src/content/docs/scripting/events.mdx+++ b/docs/astro/src/content/docs/scripting/events.mdx@@ -16,11 +16,11 @@ click ─▶ ui.setPage(badge, on) on "Card"Wires are deliberately **not** a visual programming language. A row has no branches and noexpressions; when something genuinely needs logic, the row names an action that hands off to-[a state machine](/docs/gameplay/ai/) — the editor Estella already has for graphs.+[a state machine](/docs/gameplay/ai/overview/) — the editor Estella already has for graphs.## A wire in the inspector-+*Two wires on a button: both fire on `click`, one switches a controller on the button's ownancestor chain, the other targets the `Card` entity by name.*@@ -81,7 +81,7 @@ runtime instead of failing silently.An action is a named function in the shared registry — the same one `.esfsm` state hooks and`.esbt` leaves resolve against. Register once, and the name shows up in all three palettes.-+*The palette groups by `namespace.`, and the engine's own actions carry a one-linedescription.*@@ -166,14 +166,14 @@ app.getResource(EntityEvents).emit(chest, 'looted', { gold: 12 });A row runs one action; it has no "if" and no sequence. That is a deliberate ceiling, and`fsm.fire` is the way through it — the click fires a trigger, and the entity's-[state machine](/docs/gameplay/ai/) decides what it means:+[state machine](/docs/gameplay/ai/overview/) decides what it means:```click ─▶ fsm.fire(start) on "Hint" → Idle ──start──▶ RunningonEnter: property.set(…)```-+*The same parameter controls, in the state-machine editor: `property.set` declares `path`and `value`, so the hook shows two fields instead of one opaque string.*diff --git a/docs/astro/src/content/docs/scripting/input.mdx b/docs/astro/src/content/docs/scripting/input.mdxindex a67f62f24..c026b4122 100644--- a/docs/astro/src/content/docs/scripting/input.mdx+++ b/docs/astro/src/content/docs/scripting/input.mdx@@ -81,7 +81,7 @@ buttons; gamepad edges are frame-granular.</Aside>## Input actions (`InputMap`)-+*The Input Map editor: named actions (Move / Jump / Fire), each with as many keyboard, mouse, and gamepad bindings as you like.*diff --git a/docs/astro/src/content/docs/scripting/overview.mdx b/docs/astro/src/content/docs/scripting/overview.mdxindex 1fa8eaa17..08b0e9e1c 100644--- a/docs/astro/src/content/docs/scripting/overview.mdx+++ b/docs/astro/src/content/docs/scripting/overview.mdx@@ -356,7 +356,7 @@ one `defineSystem`. Reach for `defineBehavior` when your logic is naturallycoordinating across entities.The hook signature — `entity`, `world`, `commands`, plus `self` — is also the same-programming model used by the [Gameplay AI](/docs/gameplay/ai/) layer's actions and+programming model used by the [Gameplay AI](/docs/gameplay/ai/overview/) layer's actions andbehavior-tree leaves, so moving logic between a behavior and an AI action isstraightforward.diff --git a/docs/astro/src/content/docs/ui/controllers.mdx b/docs/astro/src/content/docs/ui/controllers.mdxindex 1ee136cdc..f36f270c3 100644--- a/docs/astro/src/content/docs/ui/controllers.mdx+++ b/docs/astro/src/content/docs/ui/controllers.mdx@@ -120,7 +120,7 @@ label — all four states, one mechanism.## Authoring in the editor-+*The Controllers strip: the active controller (here `theme`, inherited from the Canvas), its **pages** as chips (`sky` / `rose`), and **Gears on this entity** — every field bound to a controller.*@@ -172,7 +172,7 @@ runs `ui.setPage` when it is clicked, targeting the entity that owns the control```**From a state machine** — the `ui.setPage` action lets a data-driven-[FSM / behavior tree](/docs/gameplay/ai/) (`.esfsm` / `.esbt`) switch a page with no code.+[FSM / behavior tree](/docs/gameplay/ai/overview/) (`.esfsm` / `.esbt`) switch a page with no code.Its argument is `"controller:page"`:```json@@ -200,5 +200,5 @@ controller state → gear presentation.- [UI](/docs/ui/overview/) — the flexbox component model gears drive.- [UI Components](/docs/ui/widgets/) — the widget factories.- [Timeline](/docs/animation/timeline/) — keyframed transitions; gears use the same field addressing.-- [Gameplay AI](/docs/gameplay/ai/) — the `.esfsm` / `.esbt` that can call `ui.setPage`.+- [Gameplay AI](/docs/gameplay/ai/overview/) — the `.esfsm` / `.esbt` that can call `ui.setPage`.- [Event Binding](/docs/scripting/events/) — wire a click straight to `ui.setPage`, no code.diff --git a/docs/astro/src/content/docs/ui/layout.mdx b/docs/astro/src/content/docs/ui/layout.mdxindex f1ca99735..75e30400e 100644--- a/docs/astro/src/content/docs/ui/layout.mdx+++ b/docs/astro/src/content/docs/ui/layout.mdx@@ -25,7 +25,7 @@ interface. See [Screen & Resolution](/docs/core-concepts/screen/) and## Dimensions: `px`, `percent`, `auto`-+*The three length units: `px` is a fixed design-pixel size, `percent` is a fraction of the parent's axis, and `auto` shrinks to content (or is stretched by the container).*@@ -111,27 +111,27 @@ CSS-flexbox namesake — the engine runs Yoga, so if you know flexbox, you know**`direction`** — the main axis, and the order children flow in:-+-+*The same four boxes rendered live in the editor — a `Row` container and a `Column` one. The diagrams here aren't an approximation: they're exactly what the engine draws.***`justifyContent`** — how children pack along the **main axis**, and how any leftoverspace is shared out:-+**`alignItems`** — how children line up across the **cross axis**. `Stretch` (thedefault) grows only the items whose cross-size is `auto`; items with a fixed size keep it:-+**`wrap`** — when the children don't fit the main axis, `NoWrap` shrinks them onto oneline (via `flexShrink`); `Wrap` keeps their size and flows the overflow onto new lines(those lines are then distributed by `alignContent`):-+```typescriptimport { FlexContainer, FlexDirection, JustifyContent, AlignItems } from 'esengine';@@ -147,7 +147,7 @@ world.insert(panel, FlexContainer, {## Absolute positioning-+*`Relative` nodes flow in the layout and share the space with their siblings; an `Absolute` node is lifted out of the flow and pinned by its insets, floating over the rest.*@@ -199,7 +199,7 @@ const panel = spawnUIEntity({## Anchor presets in code-+*The anchor picker's nine point anchors — each pins the box to a corner, an edge midpoint, or the centre of its parent — plus a per-axis **Stretch** that makes the box fill that axis.*diff --git a/docs/astro/src/content/docs/ui/overview.mdx b/docs/astro/src/content/docs/ui/overview.mdxindex 879797862..0061cc2e4 100644--- a/docs/astro/src/content/docs/ui/overview.mdx+++ b/docs/astro/src/content/docs/ui/overview.mdx@@ -123,7 +123,7 @@ cannot fix it by drawing a second image for every button size in the game.9-slice cuts the image into a 3×3 grid and scales each piece differently:-+`sliceBorder` is those four numbers: how far in from each edge the "do not stretch" bandreaches. Corners keep their exact pixels at any size, so one 100×112 texture serves a tiny@@ -143,7 +143,7 @@ the node's **box** — a rectangle. That is enough for a list viewport, but it icircular avatar frame used to still cut a square: the mask graphic was round, the clipwas not. `alphaCutoff` above 0 switches the clip to the shape the mask actually draws.-+`UIVisual.enabled` hides this entity's visual only; `UINode.display = None`removes the node **and its whole subtree** from layout, rendering, and@@ -155,7 +155,7 @@ until the whole image fits (the box keeps its layout size); `Cover` keeps the bocrops the UV instead. Neither ever distorts the artwork. `NineSlice` and `Tiled` ignoreit — adapting to the box is their whole job.-+**`UIMask.alphaCutoff` — clip to the shape, not the box.** A stencil mask clips to themask's *rectangle*, so a circular avatar frame still cut a square. Above `0` it clips to@@ -220,7 +220,7 @@ parts — the clipped box, the oversized child — without the one fact that it## Editor or code-+*A UI Canvas in the editor — laid out against the design frame, with the selected node's gizmo. The same widgets author from code or the editor.*diff --git a/docs/astro/src/content/docs/ui/text.mdx b/docs/astro/src/content/docs/ui/text.mdxindex 670c931d0..6261aed32 100644--- a/docs/astro/src/content/docs/ui/text.mdx+++ b/docs/astro/src/content/docs/ui/text.mdx@@ -101,7 +101,7 @@ Defaults below are the component defaults (what the inspector shows).## Alignment — with and without a box-+*`align` (Left / Center / Right) and `verticalAlign` (Top / Middle / Bottom) place the text block within its box — the nine combinations.*diff --git a/docs/astro/src/content/docs/ui/widgets.mdx b/docs/astro/src/content/docs/ui/widgets.mdxindex 349b4f0d8..33e5a71f0 100644--- a/docs/astro/src/content/docs/ui/widgets.mdx+++ b/docs/astro/src/content/docs/ui/widgets.mdx@@ -32,7 +32,7 @@ with `focusable: false`.per-page field bindings, authorable in the editor.</Aside>-+*The built-in widgets (from the `ui-controls` example): a **Button**, a **Toggle**, a**Slider**, a **Progress** bar, and buttons that open a **Dialog** and cycle an accentdiff --git a/docs/astro/src/content/docs/world/particles.mdx b/docs/astro/src/content/docs/world/particles.mdxindex 28d52e579..beb08bd4d 100644--- a/docs/astro/src/content/docs/world/particles.mdx+++ b/docs/astro/src/content/docs/world/particles.mdx@@ -208,7 +208,7 @@ See [Per-particle trails](#per-particle-trails) below.## Emitter shapes-+*Emitter shape gizmos in the viewport — a cone, a circle, and a rectangle, each drawn where its particles spawn (turn on **Preview FX** to see them run in edit mode).*diff --git a/docs/astro/src/content/docs/world/prefabs.mdx b/docs/astro/src/content/docs/world/prefabs.mdxindex 6170e37f3..7002e69d1 100644--- a/docs/astro/src/content/docs/world/prefabs.mdx+++ b/docs/astro/src/content/docs/world/prefabs.mdx@@ -47,7 +47,7 @@ never reaches the saved asset.Not yet supported in Prefab Mode: editing a **nested** prefab in place, or a variant whosebase isn't flat. Play and *Save As* are disabled while you're editing a prefab.-+*Prefab Mode: the **Editing Prefab** banner with **Save Prefab** / **Back to scene**, the prefab opened as its own entity tree — every instance updates when you save.*diff --git a/docs/astro/src/content/docs/world/tilemaps.mdx b/docs/astro/src/content/docs/world/tilemaps.mdxindex 96069f27d..c807f0502 100644--- a/docs/astro/src/content/docs/world/tilemaps.mdx+++ b/docs/astro/src/content/docs/world/tilemaps.mdx@@ -24,7 +24,7 @@ natively in the editor, or import it from a Tiled file with no extra setup.## Paint in the editor-+*Select a `TilemapLayer` and the **Tilemap painter** opens on the left — tools on top, the tileset palette below. Paint straight into the viewport.*@@ -47,7 +47,7 @@ viewport — a stamp ghost previews every stroke:While a paint tool is active, `H` / `V` flip the stamp and `R` rotates it 90°.`Q`, `W`, or `Esc` leave paint mode and hand the keys back to the transform tools.-+*The painter panel up close: the tool row (brush, erase, rectangle, ellipse, line, bucket, select, eyedropper, terrain), the active tileset tab, and the tile palette you stamp from.*@@ -76,17 +76,17 @@ same fields afterwards. The viewport follows the layer: the grid overlay,brush ghost, hover/selection highlights, and every paint tool work on thediamond or hex grid exactly as they do on squares.-+*The **New Tilemap** dialog picks the orientation and the tileset up front.*The same map painted on a hexagonal and a staggered grid:-+*Hexagonal — the grid, brush ghost, and every tool follow the hex layout.*-+*Staggered isometric — alternate rows shift by half a cell.*@@ -201,7 +201,7 @@ tiles carry a ▶ mark in the atlas. The frames are saved into the `.estileset`,every layer that uses the tileset plays them automatically — in the editor viewportand at runtime, no code required.-+*Animation mode: pick a tile (here #34), click atlas tiles to append frames, and set each frame's duration in ms. The strip loops as a live preview.*@@ -227,7 +227,7 @@ tilemap.setChunkTiles(layer, chunkX, chunkY, tiles, 32, 32);## Terrain autotiling-+*Terrain mode with a **corner-Wang** set: define terrain colors (Grass / Sand / Water), then paint each tile's corners — the `T` brush later resolves the right tile from the neighbours.*@@ -260,7 +260,7 @@ The engine's first-class tileset asset is **`.estileset`** — it references antexture and carries per-tile collision, animation, terrain/auto-tile data, andcustom key/value properties.-+*The **Tileset editor**'s Collision mode: pick a shape (**Box / Polygon / Circle**), toggle **one-way / sensor** and set friction / bounce / density, drop **slope** presets — the green overlay marks each tile's collider.*@@ -312,7 +312,7 @@ colliders, exactly like per-tile collision.seeds a 32 px grid, and opens the painter with the collision palette instead of atileset.-+*The **collision palette** replaces the tileset: pick **Solid**, a **ramp** or**half-tile**, **One-way ↑**, or **Trigger**, then paint over your background. Thediff --git a/docs/astro/src/content/docs/zh-cn/animation/dragonbones.mdx b/docs/astro/src/content/docs/zh-cn/animation/dragonbones.mdxindex e459e47dc..9b3aff244 100644--- a/docs/astro/src/content/docs/zh-cn/animation/dragonbones.mdx+++ b/docs/astro/src/content/docs/zh-cn/animation/dragonbones.mdx@@ -37,7 +37,7 @@ DragonBones 导出的是三个文件,Estella 把它们作为同一种资源类用 **创建 → DragonBones** 添加,或者给已有实体加这个组件。组件本身在主 `esengine` 包里。-+| 属性 | 类型 | 默认 | 说明 ||---|---|---|---|@@ -143,7 +143,7 @@ const bounds = dragonBones.getBounds(entity); // { x, y, width, height } |这不需要你做任何开关——它由组件引用的那一对文件自然决定。每实体的属性仍然是每实体的,所以共用骨架照样可以各自缩放、翻转、着色:-+## 打包时会带上什么diff --git a/docs/astro/src/content/docs/zh-cn/animation/overview.mdx b/docs/astro/src/content/docs/zh-cn/animation/overview.mdxindex 715b0716f..d6f5282d5 100644--- a/docs/astro/src/content/docs/zh-cn/animation/overview.mdx+++ b/docs/astro/src/content/docs/zh-cn/animation/overview.mdx@@ -15,7 +15,7 @@ Estella 有三套动画系统,各司其职:## 精灵动画-+*翻页书编辑器:一个 4 帧行走片段、逐帧时长,以及带 FPS / 循环 / 洋葱皮的实时预览。*@@ -173,7 +173,7 @@ const registerRun = defineSystem([Res(Assets), Res(SpriteAnimation)], async (ass### 用状态机驱动剪辑——零代码-[FSM/BT 内置](/docs/zh-cn/gameplay/ai/)以数据驱动翻页动画。动作的可选**参数**+[FSM/BT 内置](/docs/zh-cn/gameplay/ai/overview/)以数据驱动翻页动画。动作的可选**参数**携带剪辑,所以 idle/run/attack 切换是纯 `.esfsm` 数据,画在现有状态机画布上:| 名称 | 类型 | 说明 |@@ -228,7 +228,7 @@ const animate = defineSystem([Res(Tween)], (tween) => {`EaseInOut*`)、`EaseOutBounce`、`Step` 和 `CubicBezier`——自定义贝塞尔用句柄的`.bezier(p1x, p1y, p2x, p2y)`。-+*每条缓动曲线(进度 `t` 从左到右,缓动后的值从下到上)——这就是引擎的精确曲线。`Back` 和 `Elastic` 会冲出 0–1 区间;`Step` 一直保持到末尾才跳变。*@@ -295,7 +295,7 @@ tween.sequence([## 动画状态机-+*动画控制器:状态(Idle / Move / Hop)、带条件的转移(`speed>20`、`hop` 触发器),以及驱动它们的**参数**面板。*@@ -345,7 +345,7 @@ const drive = defineSystem([Query(Animator), Res(AnimatorController)], (q, anim)### 混合树-+*一维 blend:float 参数挑出「阈值 ≤ 它」中最高的那个片段——这里随 `speed` 上升在 `idle` / `walk` / `run` 之间切换,彼此不做过渡。*diff --git a/docs/astro/src/content/docs/zh-cn/animation/timeline.mdx b/docs/astro/src/content/docs/zh-cn/animation/timeline.mdxindex 6d6bb1637..0b0fa7d41 100644--- a/docs/astro/src/content/docs/zh-cn/animation/timeline.mdx+++ b/docs/astro/src/content/docs/zh-cn/animation/timeline.mdx@@ -36,7 +36,7 @@ const attach = defineSystem([Commands()], (cmds) => {| `finished` | boolean | `false` | `'once'` 片段播完时闩为 true;下次播放时清除。运行时只读。 |组件旗标**就是**播放控制本身:引擎每帧把它们调和进内部时钟,所以任何翻动-`playing` 的一方——你的代码、检视器、[AI 动作](/docs/zh-cn/gameplay/ai/#内建名字)——+`playing` 的一方——你的代码、检视器、[AI 动作](/docs/zh-cn/gameplay/ai/overview/#内建名字)——都经同一条通道驱动片段。## 控制播放@@ -73,7 +73,7 @@ const control = defineSystem([Query(TimelinePlayer), Res(Timeline)], (q, timelin<Aside type="tip">想做**零代码过场**,把组件和状态机配对:内建的 `timeline.play` 动作 +`timeline.finished` 条件就是一个"进入即播放、播完即转出"的 FSM 状态。见- [AI——内建名字](/docs/zh-cn/gameplay/ai/#内建名字)。+ [AI——内建名字](/docs/zh-cn/gameplay/ai/overview/#内建名字)。</Aside>## 轨道类型@@ -111,13 +111,13 @@ const control = defineSystem([Query(TimelinePlayer), Res(Timeline)], (q, timelin创作它。**摊开表(dope sheet)**把每条轨道及其关键帧沿一条共享、可拖动的播放头排开;加轨道、拖关键帧,然后 **Save**。-+*摊开表:一轨一行(这里是某 Transform 的 `position.x` / `position.y`,加两条黑边激活轨道),关键帧是菱形,播放头可拖动,顶部是走带控制。*切到 **Curves** 标签可塑形关键帧之间的插值——拖动值曲线及其切线手柄,做出摊开表表达不了的缓动:-+*曲线编辑器:每个关键帧通道变成一条可编辑曲线(这里 `position.x` 缓入、`position.y` 起伏),每个关键帧带切线手柄。*diff --git a/docs/astro/src/content/docs/zh-cn/assets/localization.mdx b/docs/astro/src/content/docs/zh-cn/assets/localization.mdxindex 887d6efa3..62fc6b36a 100644--- a/docs/astro/src/content/docs/zh-cn/assets/localization.mdx+++ b/docs/astro/src/content/docs/zh-cn/assets/localization.mdx@@ -66,7 +66,7 @@ i18n.t('apples', { count: 3 }); // "3 apples"## 字符串表(`.eslocale`)-+*检视器里的 `.eslocale` 表:每个 key 在当前语言下的值,下方以另一种语言作为翻译提示。*diff --git a/docs/astro/src/content/docs/zh-cn/assets/overview.mdx b/docs/astro/src/content/docs/zh-cn/assets/overview.mdxindex cc664c268..29121d80a 100644--- a/docs/astro/src/content/docs/zh-cn/assets/overview.mdx+++ b/docs/astro/src/content/docs/zh-cn/assets/overview.mdx@@ -139,7 +139,7 @@ const { failed } = await assets.preload(- **自动图集** —— 把零散的 PNG 放进 `<name>.atlas/` 文件夹,烘焙时会把它们打包成图集页(帧 UV 写进清单),于是许多小精灵作为一张纹理发布、在一次绘制里合批。-+*一张纹理的**平台覆盖**:每个目标各有页签;没有覆盖任何东西的平台,沿用上方的默认设置。*@@ -153,7 +153,7 @@ const { failed } = await assets.preload(就是那个设置本地 / 分包 / 远端交付的同一个菜单,写进同一份`.esengine/asset-groups.json`:-+*右键文件夹 → **交付方式**。三种模式决定资产从哪里发布;**总是打进构建**决定它到底发不发。*diff --git a/docs/astro/src/content/docs/zh-cn/core-concepts/plugins-resources.mdx b/docs/astro/src/content/docs/zh-cn/core-concepts/plugins-resources.mdxindex 78aa8515b..ffb0fd4e8 100644--- a/docs/astro/src/content/docs/zh-cn/core-concepts/plugins-resources.mdx+++ b/docs/astro/src/content/docs/zh-cn/core-concepts/plugins-resources.mdx@@ -35,7 +35,7 @@ defineSystem([Res(Audio)], (audio) => {| 计时器 | `Res(TimerRes)` | [脚本](/docs/zh-cn/scripting/overview/) || 时间轴 | `Res(Timeline)` | [时间轴](/docs/zh-cn/animation/timeline/) || 预制体 | `Res(Prefabs)` | [预制体](/docs/zh-cn/world/prefabs/) |-| 导航 / AI | `Res(Nav)` | [游戏 AI](/docs/zh-cn/gameplay/ai/) |+| 导航 / AI | `Res(Nav)` | [游戏 AI](/docs/zh-cn/gameplay/ai/overview/) || 本地化 | `Res(Localization)` | [本地化](/docs/zh-cn/assets/localization/) || 相机视图 | `Res(CameraView)` | [相机](/docs/zh-cn/graphics/camera/) || UI 事件 | `Res(UIEvents)` | [UI](/docs/zh-cn/ui/overview/) |diff --git a/docs/astro/src/content/docs/zh-cn/core-concepts/screen.mdx b/docs/astro/src/content/docs/zh-cn/core-concepts/screen.mdxindex a76612e0b..db3bbd419 100644--- a/docs/astro/src/content/docs/zh-cn/core-concepts/screen.mdx+++ b/docs/astro/src/content/docs/zh-cn/core-concepts/screen.mdx@@ -60,7 +60,7 @@ const readCanvas = defineSystem([GetWorld()], (world) => {## 缩放模式-+适配数学是一个纯函数,导出为 `computeEffectiveOrthoSize`。给定设计盒与实际屏幕宽高比,它产出**有效正交半高**——相机将显示的世界盒高度的一半,单位是世界单位(设计像素)。diff --git a/docs/astro/src/content/docs/zh-cn/editor/asset-editors.mdx b/docs/astro/src/content/docs/zh-cn/editor/asset-editors.mdxindex c614adefe..25a100ba9 100644--- a/docs/astro/src/content/docs/zh-cn/editor/asset-editors.mdx+++ b/docs/astro/src/content/docs/zh-cn/editor/asset-editors.mdx@@ -16,7 +16,7 @@ description: "双击资产打开的各个文档编辑器:Sequencer、瓦片画**角 Wang**)、逐瓦片**概率**权重与属性,以及**动画瓦片**——拖动帧缩略图**重排**,或把整段循环设成**一个统一时长**,带实时预览。- **状态机**(`.esfsm`)和**行为树**(`.esbt`)编辑器 — AI 的可视化图。见- [游戏 AI](/docs/zh-cn/gameplay/ai/)。+ [游戏 AI](/docs/zh-cn/gameplay/ai/overview/)。- **材质图**(`.esmatgraph`) — 编译成着色器的节点编辑器。见[材质与着色器](/docs/zh-cn/graphics/materials/)。diff --git a/docs/astro/src/content/docs/zh-cn/editor/overview.mdx b/docs/astro/src/content/docs/zh-cn/editor/overview.mdxindex 84403ce7c..eeaf47239 100644--- a/docs/astro/src/content/docs/zh-cn/editor/overview.mdx+++ b/docs/astro/src/content/docs/zh-cn/editor/overview.mdx@@ -33,7 +33,7 @@ Estella 编辑器是一个桌面应用(Electron + React),带 UE5 风格的**可## 工作区-+*默认工作区:视口居中,世界大纲与细节在右侧,内容浏览器在底部,运行控制在顶部。*diff --git a/docs/astro/src/content/docs/zh-cn/editor/scenes.mdx b/docs/astro/src/content/docs/zh-cn/editor/scenes.mdxindex 36a13624e..a5e0f6d89 100644--- a/docs/astro/src/content/docs/zh-cn/editor/scenes.mdx+++ b/docs/astro/src/content/docs/zh-cn/editor/scenes.mdx@@ -48,7 +48,7 @@ Details 是选中项的检视器。它列出实体上的每个组件及其字段- 对**材质**,一个 **Shader** 选择器,用于切换绑定的着色器——内置模板或项目里的 `.esshader`——见[材质与着色器](/docs/zh-cn/graphics/materials/#在编辑器里选取与共享着色器)。-+*一个 UI 节点的检视器:**布局内 / 绝对**切换、可点击的 **3×3 锚点网格**(每轴带 Stretch),以及 `Display: Flex`——用可视化控件取代裸数字。*@@ -63,4 +63,4 @@ Details 同时是**资产检视器**:在内容浏览器里选中一个资产,即编辑视口、运行时(视口内运行与游戏面板)、以及打包后的构建。创作时切片正确的框,在发布的游戏里同样正确。-+diff --git a/docs/astro/src/content/docs/zh-cn/editor/viewport.mdx b/docs/astro/src/content/docs/zh-cn/editor/viewport.mdxindex e195224fd..66c4f5499 100644--- a/docs/astro/src/content/docs/zh-cn/editor/viewport.mdx+++ b/docs/astro/src/content/docs/zh-cn/editor/viewport.mdx@@ -67,7 +67,7 @@ UI Canvas 也能在真机上预览。场景里有 Canvas 时,UI 会额外按其桌面创作时想要的。选中任何真实设备,编辑时的叠加层和运行中的游戏都会遵守它的形状——于是一个为手机创作的项目,不会只能在"面板恰好被拖成的比例"下运行。-+### 项目屏幕预设@@ -80,7 +80,7 @@ UI Canvas 也能在真机上预览。场景里有 Canvas 时,UI 会额外按其- **安全区域**(行尾的 ▸ 展开)以设备像素设置刘海 / Home 条的内缩。全部留空则不会写入项目文件——视口的 *安全区域* 叠加层对该屏幕也就没有东西可画。-+预设保存在 `project.esproject` 中,因此可以随版本控制共享:diff --git a/docs/astro/src/content/docs/zh-cn/extending/built-in-agent.mdx b/docs/astro/src/content/docs/zh-cn/extending/built-in-agent.mdxindex 382686fe3..e8894af7b 100644--- a/docs/astro/src/content/docs/zh-cn/extending/built-in-agent.mdx+++ b/docs/astro/src/content/docs/zh-cn/extending/built-in-agent.mdx@@ -20,7 +20,7 @@ import { Aside, Steps } from '@astrojs/starlight/components';编辑器不附带任何密钥,也不会自己发起任何调用。打开**设置 ▸ AI 代理**,配好一个提供方,配置就算做完了。-+<Steps>@@ -46,7 +46,7 @@ import { Aside, Steps } from '@astrojs/starlight/components';直接把问题打进命令面板。凡是读起来像一句话而不像命令的输入,面板都会给出**交给 Agent**,按 `Enter` 就发出去了。-+一轮对话从上往下读:@@ -81,7 +81,7 @@ import { Aside, Steps } from '@astrojs/starlight/components';一次调用就能搭出一整棵子树,上百个节点的改动值得在落地**之前**看一眼,而不是事后再读回来。-+每一行就是一项改动。点一行可以**划掉**它——划掉一个新建实体时,引用它的行会一并划掉——然后应用剩下的。**本轮都允许**会让它在这一轮里diff --git a/docs/astro/src/content/docs/zh-cn/gameplay/ai/advanced.mdx b/docs/astro/src/content/docs/zh-cn/gameplay/ai/advanced.mdxindex 99797594d..00cb09e4c 100644--- a/docs/astro/src/content/docs/zh-cn/gameplay/ai/advanced.mdx+++ b/docs/astro/src/content/docs/zh-cn/gameplay/ai/advanced.mdx@@ -54,7 +54,7 @@ const grid = navGridFromTiles((x, y) => level.tiles[y][x], {| `BuildNavGridOptions` 字段 | 说明 ||---|---|-| `width` / `height` / `cellSize` / `origin?` | 与 `NavGrid` 选项相同(见[构建网格](/docs/zh-cn/gameplay/ai-navigation/#构建网格))。 |+| `width` / `height` / `cellSize` / `origin?` | 与 `NavGrid` 选项相同(见[构建网格](/docs/zh-cn/gameplay/ai/navigation/#构建网格))。 || `blockedTileIds?` | 阻挡移动的瓦片 id 的精确集合。 || `isBlocked?` | 针对瓦片 id 的自定义谓词(`0` = 空);覆盖 `blockedTileIds`。二者都不给时,任何非空瓦片都阻挡。 |diff --git a/docs/astro/src/content/docs/zh-cn/gameplay/ai/behavior-trees.mdx b/docs/astro/src/content/docs/zh-cn/gameplay/ai/behavior-trees.mdxindex a92648477..e130c933c 100644--- a/docs/astro/src/content/docs/zh-cn/gameplay/ai/behavior-trees.mdx+++ b/docs/astro/src/content/docs/zh-cn/gameplay/ai/behavior-trees.mdx@@ -3,7 +3,7 @@ title: 行为树description: "运行 .esbt 图:选择、序列、装饰器与叶子,以及一次 tick 如何求值。"----+*行为树编辑器:**Selector** 根之下是一个 **Sequence**(Condition `seesPlayer` → Action `chase`),外加兜底的 `patrol` 动作。*diff --git a/docs/astro/src/content/docs/zh-cn/gameplay/ai/overview.mdx b/docs/astro/src/content/docs/zh-cn/gameplay/ai/overview.mdxindex 0f632ff7a..2078049df 100644--- a/docs/astro/src/content/docs/zh-cn/gameplay/ai/overview.mdx+++ b/docs/astro/src/content/docs/zh-cn/gameplay/ai/overview.mdx@@ -30,7 +30,7 @@ Estella 的 AI 层把一个实体变成会**感知**、会**决策**、会**移<Aside type="note">这里的一切都是 `esengine` 内核里的纯 TypeScript(没有 WebAssembly 侧模块)。感知、FSM、BT、导航这四个插件都由编辑器和 Web 运行时**自动**加入。只有当你从一个裸的 `new App()` 起步时,- 才需要自己加插件(见[自定义应用](/docs/zh-cn/gameplay/ai-advanced/#自定义应用))。+ 才需要自己加插件(见[自定义应用](/docs/zh-cn/gameplay/ai/advanced/#自定义应用))。</Aside>## 共享注册表@@ -60,7 +60,7 @@ registerAction('chase', (ctx) => {| `ctx.dt` | `number` | 帧间隔(秒)。 || `ctx.world` | `World` | 完整世界访问,用于跨实体读取。 || `ctx.commands` | `Commands` | 延迟的 spawn/despawn,tick 中调用安全。 |-| `ctx.blackboard` | `Blackboard` | 该 agent 的 AI 数据面(见[黑板](/docs/zh-cn/gameplay/ai-blackboard/))。 |+| `ctx.blackboard` | `Blackboard` | 该 agent 的 AI 数据面(见[黑板](/docs/zh-cn/gameplay/ai/blackboard/))。 || `ctx.get(Comp)` | `ComponentData` | 读取**本**实体上的另一个组件。 || `ctx.set(Comp, data)` | `void` | 写入**本**实体上的一个组件。 || `ctx.has(Comp)` | `boolean` | 本实体是否拥有 `Comp`。 |@@ -135,13 +135,13 @@ registerFsm('intro', {## 四个部分<CardGrid>- <LinkCard title="感知" href="/docs/zh-cn/gameplay/ai-perception/" description="视锥,以及一个 agent 此刻看到了什么。" />- <LinkCard title="导航" href="/docs/zh-cn/gameplay/ai-navigation/" description="导航网格、A* 路径,以及让 agent 沿路径移动。" />- <LinkCard title="状态机" href="/docs/zh-cn/gameplay/ai-state-machines/" description="状态、带守卫的转移,以及一次性触发器。" />- <LinkCard title="行为树" href="/docs/zh-cn/gameplay/ai-behavior-trees/" description="选择、序列、装饰器与叶子。" />- <LinkCard title="黑板" href="/docs/zh-cn/gameplay/ai-blackboard/" description="两种范式共同读写的每-agent 数据面。" />- <LinkCard title="在编辑器里编排" href="/docs/zh-cn/gameplay/ai-authoring/" description="叶子在代码里注册,图在编辑器里搭。" />- <LinkCard title="组件层之下" href="/docs/zh-cn/gameplay/ai-advanced/" description="手动寻路、感知内幕,以及裸 App 接线。" />+ <LinkCard title="感知" href="/docs/zh-cn/gameplay/ai/perception/" description="视锥,以及一个 agent 此刻看到了什么。" />+ <LinkCard title="导航" href="/docs/zh-cn/gameplay/ai/navigation/" description="导航网格、A* 路径,以及让 agent 沿路径移动。" />+ <LinkCard title="状态机" href="/docs/zh-cn/gameplay/ai/state-machines/" description="状态、带守卫的转移,以及一次性触发器。" />+ <LinkCard title="行为树" href="/docs/zh-cn/gameplay/ai/behavior-trees/" description="选择、序列、装饰器与叶子。" />+ <LinkCard title="黑板" href="/docs/zh-cn/gameplay/ai/blackboard/" description="两种范式共同读写的每-agent 数据面。" />+ <LinkCard title="在编辑器里编排" href="/docs/zh-cn/gameplay/ai/authoring/" description="叶子在代码里注册,图在编辑器里搭。" />+ <LinkCard title="组件层之下" href="/docs/zh-cn/gameplay/ai/advanced/" description="手动寻路、感知内幕,以及裸 App 接线。" /></CardGrid>## 组合起来diff --git a/docs/astro/src/content/docs/zh-cn/gameplay/ai/state-machines.mdx b/docs/astro/src/content/docs/zh-cn/gameplay/ai/state-machines.mdxindex bcb2c51e7..a9b8e9105 100644--- a/docs/astro/src/content/docs/zh-cn/gameplay/ai/state-machines.mdx+++ b/docs/astro/src/content/docs/zh-cn/gameplay/ai/state-machines.mdx@@ -3,7 +3,7 @@ title: 状态机description: "运行 .esfsm 图:带 enter/update/exit 钩子的状态、带守卫的转移,以及一次性触发器。"----+*状态机编辑器:状态(Patrol / Chase)由带守卫的转移(`?seesPlayer`、`?lostPlayer`)连接。*@@ -25,7 +25,7 @@ cmds.spawn()| `fsm` | 要运行的机器的 key:一个 `registerFsm` 名字**或**一个 `.esfsm` 资产路径。 || `current` | 当前激活状态名,每 tick 写入(只读;在检视面板可见)。 |-推荐做法是**在编辑器里把图编排成 `.esfsm` 资产**(见[在编辑器里编排](/docs/zh-cn/gameplay/ai-authoring/))。+推荐做法是**在编辑器里把图编排成 `.esfsm` 资产**(见[在编辑器里编排](/docs/zh-cn/gameplay/ai/authoring/))。状态用字符串引用你注册的动作/条件名。你也可以用代码构建一台机器:```typescriptdiff --git a/docs/astro/src/content/docs/zh-cn/gameplay/markers.mdx b/docs/astro/src/content/docs/zh-cn/gameplay/markers.mdxindex 4fd3861f9..868b4181a 100644--- a/docs/astro/src/content/docs/zh-cn/gameplay/markers.mdx+++ b/docs/astro/src/content/docs/zh-cn/gameplay/markers.mdx@@ -50,7 +50,7 @@ app.addPlugin(new PhysicsPlugin('physics.js'));在 Inspector 里设置标记的 **Type**,并添加任意多个自定义 **properties**(一个键→值映射——`targetScene: "level2"`、`team: "red"` 等等)。二者都能存/读并进入构建。-+*Inspector 里的一个 `spawn` 标记:**Type** 驱动 `Query(Marker)`,每一行 **Properties** 就是自由形式 string→string 映射里的一条。*diff --git a/docs/astro/src/content/docs/zh-cn/gameplay/physics.mdx b/docs/astro/src/content/docs/zh-cn/gameplay/physics.mdxindex 5e8002670..2b741ec15 100644--- a/docs/astro/src/content/docs/zh-cn/gameplay/physics.mdx+++ b/docs/astro/src/content/docs/zh-cn/gameplay/physics.mdx@@ -51,7 +51,7 @@ physics.applyImpulse(e, { x: 0, y: jumpPx / ppu }); // px/s → m/s## 刚体与碰撞体-+*视口里的碰撞体 gizmo:选中的 **Ground** 的盒形轮廓(琥珀色),以及墙体与斜坡。用视口的物理显示开关切换。*@@ -112,7 +112,7 @@ const spawnBall = defineSystem([Commands()], (cmds) => {## 碰撞过滤-+*项目设置 → 物理:给 16 个碰撞层命名,再在矩阵里切换哪些层两两相撞(下方还有求解器调参)。*@@ -230,7 +230,7 @@ const onHit = defineSystem([Res(PhysicsEvents)], (events) => {## 关节-+*每种关节约束什么:**Revolute** 铰链(绕销钉转动)、**Distance** 弹簧/连杆、**Prismatic** 滑轨(单轴滑动)、刚性 **Weld** 焊接、**Wheel** 车轮(悬挂 + 自由旋转),以及 **Motor** 马达(驱向目标速度)。*@@ -303,7 +303,7 @@ world.spawn(让平台恢复为普通实心体。在编辑器里,单向平台的碰撞体 gizmo 会沿实心侧法线多画一支箭头,朝向一眼可辨。-+## 鼠标 / 拖拽关节diff --git a/docs/astro/src/content/docs/zh-cn/graphics/camera.mdx b/docs/astro/src/content/docs/zh-cn/graphics/camera.mdxindex 197526856..4043f3025 100644--- a/docs/astro/src/content/docs/zh-cn/graphics/camera.mdx+++ b/docs/astro/src/content/docs/zh-cn/graphics/camera.mdx@@ -100,7 +100,7 @@ const zoomIn = defineSystem([Res(Tween)], (tween) => {给相机加一个 `FollowTarget` 并指向一个实体。跟随是帧率无关的阻尼移动,带一个死区,所以相机平滑漂移并忽略细小移动:-+```typescriptimport { defineSystem, Query, Commands, Camera, FollowTarget } from 'esengine';diff --git a/docs/astro/src/content/docs/zh-cn/graphics/lighting.mdx b/docs/astro/src/content/docs/zh-cn/graphics/lighting.mdxindex 21076eb3d..48017bdf6 100644--- a/docs/astro/src/content/docs/zh-cn/graphics/lighting.mdx+++ b/docs/astro/src/content/docs/zh-cn/graphics/lighting.mdx@@ -189,7 +189,7 @@ const app = createWebApp(module, { colorSpace: 'linear' });## 在编辑器里-+*编辑器里预览的 `Light2D`——它的照射光池,以及柱子投出的阴影(开 **Preview FX** 可在编辑态点亮场景)。*diff --git a/docs/astro/src/content/docs/zh-cn/graphics/materials.mdx b/docs/astro/src/content/docs/zh-cn/graphics/materials.mdxindex 26a414168..f1f789cd5 100644--- a/docs/astro/src/content/docs/zh-cn/graphics/materials.mdx+++ b/docs/astro/src/content/docs/zh-cn/graphics/materials.mdx@@ -40,7 +40,7 @@ std140 uniform 块,于是 CPU 能按名字设置、并安全地送到 GPU。一**Shader** 下拉框列出每个内置模板(显示为 *Built-in · Unlit*、*Built-in · Lit* ……)以及项目里每个 `.esshader`——选一个即可给材质重新绑定着色器。-+*材质检视器:**Shader** 区及其选择器(这里是 `dissolve.esshader`),下方是从该着色器 `#pragma param` 反射出的**参数**。*diff --git a/docs/astro/src/content/docs/zh-cn/graphics/sprites.mdx b/docs/astro/src/content/docs/zh-cn/graphics/sprites.mdxindex fbdb9edf6..38b6423b5 100644--- a/docs/astro/src/content/docs/zh-cn/graphics/sprites.mdx+++ b/docs/astro/src/content/docs/zh-cn/graphics/sprites.mdx@@ -63,7 +63,7 @@ sprite.color = { r: 1, g: 1, b: 1, a: 0.5 }; // 50% 透明1:1,或设成别的值来缩放。`Transform` 上的缩放会再乘上去。`pivot` 是精灵旋转/缩放所绕的归一化轴心(0–1):`{0.5, 0.5}` 居中,`{0, 0}` 是左下角,`{0.5, 0}` 钉住底部中心(适合站在地面上的角色)。-+## 单位与坐标@@ -86,7 +86,7 @@ sprite.color = { r: 1, g: 1, b: 1, a: 0.5 }; // 50% 透明**项目设置 → 渲染**里定义的命名层列表,于是检视器显示 *Background*、*Default*、*Foreground* 等下拉,而不是裸数字。较低的层先画(在后面)。-+命名是为了可读性,不是层数上限:你可以命名最多三十二个槽位(槽位的下标**就是**它的 z 序)。名字只是建议——直接敲一个列表里没有的数字,字段照样接受;一个名字都不填时,`layer` 就是@@ -162,7 +162,7 @@ world.applyEntityOrder([other, another, card]);纹理的采样方式按**纹理句柄**设置,而非按精灵:-+*同一张小纹理放大约 15×。**Nearest(最近邻)** 保留硬的纹素边缘(像素画);**Linear(线性)**在纹素间插值,得到平滑外观(默认)。*@@ -188,7 +188,7 @@ setTextureParams(tex.handle, TextureFilter.Nearest, TextureFilter.Nearest,缩小/放大过滤分开,环绕逐轴设置。`tileSize` 平铺和 UV 滚动效果要无缝,靠的就是`Repeat`。-+*各环绕模式如何处理 0–1 之外的 UV(中间那块 = 纹理本身):**Repeat** 平铺,**Clamp to edge**拉伸边缘像素,**Mirror** 每隔一块镜像翻转。*diff --git a/docs/astro/src/content/docs/zh-cn/index.mdx b/docs/astro/src/content/docs/zh-cn/index.mdxindex e623ff5ef..2861298f9 100644--- a/docs/astro/src/content/docs/zh-cn/index.mdx+++ b/docs/astro/src/content/docs/zh-cn/index.mdx@@ -48,6 +48,6 @@ import { Card, CardGrid, LinkCard } from '@astrojs/starlight/components';<LinkCard title="编辑器" href="/docs/zh-cn/editor/overview/" description="可视化编辑器及其各面板导览。" /><LinkCard title="精灵与渲染" href="/docs/zh-cn/graphics/sprites/" description="绘制图像——着色、尺寸、排序与分层。" /><LinkCard title="物理" href="/docs/zh-cn/gameplay/physics/" description="刚体、碰撞体、关节与空间查询。" />- <LinkCard title="游戏 AI" href="/docs/zh-cn/gameplay/ai/" description="导航、感知、状态机、行为树。" />+ <LinkCard title="游戏 AI" href="/docs/zh-cn/gameplay/ai/overview/" description="导航、感知、状态机、行为树。" /><LinkCard title="构建与导出" href="/docs/zh-cn/publishing/overview/" description="发布到 Web、桌面、微信、Playable 广告、Android 与 iOS。" /></CardGrid>diff --git a/docs/astro/src/content/docs/zh-cn/publishing/hot-update.mdx b/docs/astro/src/content/docs/zh-cn/publishing/hot-update.mdxindex 492ad3dbb..aa2eac487 100644--- a/docs/astro/src/content/docs/zh-cn/publishing/hot-update.mdx+++ b/docs/astro/src/content/docs/zh-cn/publishing/hot-update.mdx@@ -47,7 +47,7 @@ Estella 的热更新是**内容寻址**、**原子**(要么全成、要么回在**内容浏览器**中右键任意文件夹,选择 **交付方式 → 远端(CDN / 热更)**。这就是全部的配置动作——该文件夹下的每个资产(递归)从此改由 CDN 交付,而不再打进包内。-+*内容浏览器 → 右键文件夹 → **交付方式** → **本地 / 分包 / 远端(CDN / 热更)**。选择会写入 `.esengine/asset-groups.json`。*@@ -56,7 +56,7 @@ Estella 的热更新是**内容寻址**、**原子**(要么全成、要么回被指派到分包或远端组的文件夹会带一个角标**徽标**,让你一眼看清交付布局——`CDN`(蓝)表示远端,`分包`(紫)表示分包。-+*`cdn` 文件夹带着蓝色 **CDN** 徽标——它的资产以远端方式交付,可被热更新。*@@ -66,7 +66,7 @@ Estella 的热更新是**内容寻址**、**原子**(要么全成、要么回远端组资产需要一个**根 URL** 来拉取——你的 CDN。它是一个**构建 profile** 设置,因此 `dev` 与 `prod` 可以指向不同的 CDN,导出时会把活动 profile 的根地址烘进发布的游戏里。在**打包项目**对话框(**文件 → 构建…**)的**高级**里设置:-+***CDN 地址** 字段会把活动 profile 的 `remoteRoot` 写入 `asset-groups.json`。留空则远端资产从游戏同源加载(例如本地测试时)。*diff --git a/docs/astro/src/content/docs/zh-cn/publishing/overview.mdx b/docs/astro/src/content/docs/zh-cn/publishing/overview.mdxindex 3028ca618..f5e9ee092 100644--- a/docs/astro/src/content/docs/zh-cn/publishing/overview.mdx+++ b/docs/astro/src/content/docs/zh-cn/publishing/overview.mdx@@ -11,7 +11,7 @@ import { Aside, Steps } from '@astrojs/starlight/components';## 从编辑器导出-+*打包项目对话框:从分组的列表里选一个**目标**、一个配置、输出目录,以及 [cook 选项](#资产烘焙选项)——然后 Package。*diff --git a/docs/astro/src/content/docs/zh-cn/reference/components/animation.mdx b/docs/astro/src/content/docs/zh-cn/reference/components/animation.mdxindex 074a3d58e..38df10732 100644--- a/docs/astro/src/content/docs/zh-cn/reference/components/animation.mdx+++ b/docs/astro/src/content/docs/zh-cn/reference/components/animation.mdx@@ -4,7 +4,7 @@ description: "逐帧动画、动画状态机、时间轴与骨骼运行时。"tableOfContents: false----import ComponentReference from '../../../../../components/ComponentReference.astro';+import ComponentReference from '@/components/ComponentReference.astro';下面每个字段都由引擎自身的组件注册表推导而来——就是编辑器 **Details** 面板读的那一份——所以这里的类型和默认值就是你添加组件时真正拿到的值,且不可能与代码脱节。讲*怎么用*的正文在diff --git a/docs/astro/src/content/docs/zh-cn/reference/components/core.mdx b/docs/astro/src/content/docs/zh-cn/reference/components/core.mdxindex 86ba42cb5..ab45ee07f 100644--- a/docs/astro/src/content/docs/zh-cn/reference/components/core.mdx+++ b/docs/astro/src/content/docs/zh-cn/reference/components/core.mdx@@ -4,7 +4,7 @@ description: "变换、层级、命名,以及引擎自身读取的标签。"tableOfContents: false----import ComponentReference from '../../../../../components/ComponentReference.astro';+import ComponentReference from '@/components/ComponentReference.astro';下面每个字段都由引擎自身的组件注册表推导而来——就是编辑器 **Details** 面板读的那一份——所以这里的类型和默认值就是你添加组件时真正拿到的值,且不可能与代码脱节。讲*怎么用*的正文在diff --git a/docs/astro/src/content/docs/zh-cn/reference/components/gameplay.mdx b/docs/astro/src/content/docs/zh-cn/reference/components/gameplay.mdxindex e31526463..43c6859b5 100644--- a/docs/astro/src/content/docs/zh-cn/reference/components/gameplay.mdx+++ b/docs/astro/src/content/docs/zh-cn/reference/components/gameplay.mdx@@ -4,7 +4,7 @@ description: "AI 代理、事件连线、音频发声体与网络复制。"tableOfContents: false----import ComponentReference from '../../../../../components/ComponentReference.astro';+import ComponentReference from '@/components/ComponentReference.astro';下面每个字段都由引擎自身的组件注册表推导而来——就是编辑器 **Details** 面板读的那一份——所以这里的类型和默认值就是你添加组件时真正拿到的值,且不可能与代码脱节。讲*怎么用*的正文在diff --git a/docs/astro/src/content/docs/zh-cn/reference/components/graphics.mdx b/docs/astro/src/content/docs/zh-cn/reference/components/graphics.mdxindex c22e09cac..7c1452a0a 100644--- a/docs/astro/src/content/docs/zh-cn/reference/components/graphics.mdx+++ b/docs/astro/src/content/docs/zh-cn/reference/components/graphics.mdx@@ -4,7 +4,7 @@ description: "所有会绘制的东西:精灵、图形、网格、相机、光tableOfContents: false----import ComponentReference from '../../../../../components/ComponentReference.astro';+import ComponentReference from '@/components/ComponentReference.astro';下面每个字段都由引擎自身的组件注册表推导而来——就是编辑器 **Details** 面板读的那一份——所以这里的类型和默认值就是你添加组件时真正拿到的值,且不可能与代码脱节。讲*怎么用*的正文在diff --git a/docs/astro/src/content/docs/zh-cn/reference/components/physics.mdx b/docs/astro/src/content/docs/zh-cn/reference/components/physics.mdxindex 12bc45c25..53147e7b2 100644--- a/docs/astro/src/content/docs/zh-cn/reference/components/physics.mdx+++ b/docs/astro/src/content/docs/zh-cn/reference/components/physics.mdx@@ -4,7 +4,7 @@ description: "刚体、碰撞体形状、角色控制器与全部关节。"tableOfContents: false----import ComponentReference from '../../../../../components/ComponentReference.astro';+import ComponentReference from '@/components/ComponentReference.astro';下面每个字段都由引擎自身的组件注册表推导而来——就是编辑器 **Details** 面板读的那一份——所以这里的类型和默认值就是你添加组件时真正拿到的值,且不可能与代码脱节。讲*怎么用*的正文在diff --git a/docs/astro/src/content/docs/zh-cn/reference/components/ui.mdx b/docs/astro/src/content/docs/zh-cn/reference/components/ui.mdxindex 71f8ecbe8..e05025d5b 100644--- a/docs/astro/src/content/docs/zh-cn/reference/components/ui.mdx+++ b/docs/astro/src/content/docs/zh-cn/reference/components/ui.mdx@@ -4,7 +4,7 @@ description: "UI 盒模型、外观,以及在其之上构建的控件。"tableOfContents: false----import ComponentReference from '../../../../../components/ComponentReference.astro';+import ComponentReference from '@/components/ComponentReference.astro';下面每个字段都由引擎自身的组件注册表推导而来——就是编辑器 **Details** 面板读的那一份——所以这里的类型和默认值就是你添加组件时真正拿到的值,且不可能与代码脱节。讲*怎么用*的正文在diff --git a/docs/astro/src/content/docs/zh-cn/reference/components/world.mdx b/docs/astro/src/content/docs/zh-cn/reference/components/world.mdxindex 01b27a794..8a8c205b9 100644--- a/docs/astro/src/content/docs/zh-cn/reference/components/world.mdx+++ b/docs/astro/src/content/docs/zh-cn/reference/components/world.mdx@@ -4,7 +4,7 @@ description: "瓦片地图、粒子,以及你在场景里摆放的标记。"tableOfContents: false----import ComponentReference from '../../../../../components/ComponentReference.astro';+import ComponentReference from '@/components/ComponentReference.astro';下面每个字段都由引擎自身的组件注册表推导而来——就是编辑器 **Details** 面板读的那一份——所以这里的类型和默认值就是你添加组件时真正拿到的值,且不可能与代码脱节。讲*怎么用*的正文在diff --git a/docs/astro/src/content/docs/zh-cn/scripting/events.mdx b/docs/astro/src/content/docs/zh-cn/scripting/events.mdxindex 635bbe2ad..902198626 100644--- a/docs/astro/src/content/docs/zh-cn/scripting/events.mdx+++ b/docs/astro/src/content/docs/zh-cn/scripting/events.mdx@@ -15,11 +15,11 @@ click ─▶ ui.setPage(badge, on) 目标「Card」```连线**刻意不是**可视化编程语言。一行里没有分支、没有表达式;真的需要逻辑时,这行会指向一个-把控制权交给[状态机](/docs/zh-cn/gameplay/ai/)的动作——Estella 已经有图编辑器了。+把控制权交给[状态机](/docs/zh-cn/gameplay/ai/overview/)的动作——Estella 已经有图编辑器了。## 检视器里的一根线-+*按钮上的两根线:都在 `click` 时触发,一根切换按钮自身祖先链上的控制器,另一根按名字指向`Card` 实体。*@@ -78,7 +78,7 @@ world.insert(button, EventBinding, {动作是共享注册表里的一个具名函数——`.esfsm` 状态钩子和 `.esbt` 叶子解析的是**同一个**注册表。注册一次,三个候选列表里都能看到。-+*候选按 `namespace.` 分组,引擎自带的动作还带一行说明。*@@ -156,14 +156,14 @@ app.getResource(EntityEvents).emit(chest, 'looted', { gold: 12 });## 当一根线需要逻辑时一行只跑一个动作,没有"如果",也没有先后序列。这是**刻意**设的天花板,而 `fsm.fire` 就是-突破口——点击发出一个触发器,实体的[状态机](/docs/zh-cn/gameplay/ai/)来决定它意味着什么:+突破口——点击发出一个触发器,实体的[状态机](/docs/zh-cn/gameplay/ai/overview/)来决定它意味着什么:```click ─▶ fsm.fire(start) 目标「Hint」 → Idle ──start──▶ RunningonEnter: property.set(…)```-+*同一套参数控件,出现在状态机编辑器里:`property.set` 声明了 `path` 和 `value`,于是钩子显示两个字段,而不是一个含义不明的字符串。*diff --git a/docs/astro/src/content/docs/zh-cn/scripting/input.mdx b/docs/astro/src/content/docs/zh-cn/scripting/input.mdxindex 683af93fc..da7425645 100644--- a/docs/astro/src/content/docs/zh-cn/scripting/input.mdx+++ b/docs/astro/src/content/docs/zh-cn/scripting/input.mdx@@ -76,7 +76,7 @@ const jump = defineSystem([Query(Mut(CharacterController)), Res(Input)], (player## 输入动作(`InputMap`)-+*输入映射编辑器:命名动作(Move / Jump / Fire),每个都能挂任意多个键盘、鼠标、手柄绑定。*diff --git a/docs/astro/src/content/docs/zh-cn/scripting/overview.mdx b/docs/astro/src/content/docs/zh-cn/scripting/overview.mdxindex b96d6df98..4d4cb3311 100644--- a/docs/astro/src/content/docs/zh-cn/scripting/overview.mdx+++ b/docs/astro/src/content/docs/zh-cn/scripting/overview.mdx@@ -319,7 +319,7 @@ world.spawn()天然是*每实体*的(巡逻、抛射物、拾取物)时,用 `defineBehavior`;当你要一次处理整个查询、或在实体间协调时,用一个普通[系统](/docs/zh-cn/core-concepts/systems/)。-钩子签名——`entity`、`world`、`commands`,外加 `self`——也和[游戏 AI](/docs/zh-cn/gameplay/ai/) 层+钩子签名——`entity`、`world`、`commands`,外加 `self`——也和[游戏 AI](/docs/zh-cn/gameplay/ai/overview/) 层的动作与行为树叶子是同一套编程模型,所以在 behavior 和 AI 动作之间搬逻辑很顺手。## 热重载diff --git a/docs/astro/src/content/docs/zh-cn/ui/controllers.mdx b/docs/astro/src/content/docs/zh-cn/ui/controllers.mdxindex 6f232c7b3..ee827752e 100644--- a/docs/astro/src/content/docs/zh-cn/ui/controllers.mdx+++ b/docs/astro/src/content/docs/zh-cn/ui/controllers.mdx@@ -114,7 +114,7 @@ world.insert(btn, UIGear, {## 在编辑器里授权-+*控制器条:当前激活的控制器(这里是从 Canvas 继承来的 `theme`)、以芯片形式排列的**翻页**(`sky` / `rose`),以及**此实体的绑定**——每个绑定到控制器的字段。*@@ -160,7 +160,7 @@ activeTab.set('shop'); // 翻页,所有被绑定的元素重排```**从状态机** —— `ui.setPage` 动作让数据驱动的-[FSM / 行为树](/docs/zh-cn/gameplay/ai/)(`.esfsm` / `.esbt`)无需写码就切页。参数是 `"controller:page"`:+[FSM / 行为树](/docs/zh-cn/gameplay/ai/overview/)(`.esfsm` / `.esbt`)无需写码就切页。参数是 `"controller:page"`:```json{ "onEnter": { "name": "ui.setPage", "arg": "hud:alert" } }@@ -181,5 +181,5 @@ activeTab.set('shop'); // 翻页,所有被绑定的元素重排- [UI](/docs/zh-cn/ui/overview/) —— 绑定所驱动的 flexbox 组件模型。- [UI 控件](/docs/zh-cn/ui/widgets/) —— 控件工厂。- [时间轴](/docs/zh-cn/animation/timeline/) —— 关键帧过渡;绑定用的是同一套字段寻址。-- [游戏 AI](/docs/zh-cn/gameplay/ai/) —— 能调用 `ui.setPage` 的 `.esfsm` / `.esbt`。+- [游戏 AI](/docs/zh-cn/gameplay/ai/overview/) —— 能调用 `ui.setPage` 的 `.esfsm` / `.esbt`。- [事件绑定](/docs/zh-cn/scripting/events/) —— 把点击直接接到 `ui.setPage`,不写代码。diff --git a/docs/astro/src/content/docs/zh-cn/ui/layout.mdx b/docs/astro/src/content/docs/zh-cn/ui/layout.mdxindex d9b7b6cd7..0d06c7421 100644--- a/docs/astro/src/content/docs/zh-cn/ui/layout.mdx+++ b/docs/astro/src/content/docs/zh-cn/ui/layout.mdx@@ -20,7 +20,7 @@ UI 布局里的每个 `px` 都是**设计像素**——项目设计分辨率(Pro## 维度:`px`、`percent`、`auto`-+*三种长度单位:`px` 是固定的设计像素尺寸,`percent` 是父项对应轴的比例,`auto` 收缩到内容大小(或被容器拉伸)。*@@ -100,25 +100,25 @@ flex 容器沿一条**主轴**(由 `direction` 决定)排布子项,**交叉轴****`direction`** —— 主轴,以及子项流动的顺序:-+-+*同样四个盒子在编辑器里的真实渲染——一个 `Row` 容器、一个 `Column` 容器。上面的示意图不是近似:引擎画出来就是这样。***`justifyContent`** —— 子项沿**主轴**如何排布,以及多出来的空间如何分配:-+**`alignItems`** —— 子项沿**交叉轴**如何对齐。`Stretch`(默认)只拉伸交叉轴尺寸为 `auto` 的子项;有固定尺寸的子项保持不变:-+**`wrap`** —— 当子项在主轴上放不下时,`NoWrap` 通过 `flexShrink` 把它们压缩进一行;`Wrap` 保持其尺寸、把溢出流到新行(这些行再由 `alignContent` 分配):-+```typescriptimport { FlexContainer, FlexDirection, JustifyContent, AlignItems } from 'esengine';@@ -134,7 +134,7 @@ world.insert(panel, FlexContainer, {## 绝对定位-+*`Relative` 节点参与排布、与兄弟共享空间;`Absolute` 节点被抬出排布流、由内偏移(inset)钉住,浮在其余内容之上。*@@ -180,7 +180,7 @@ const panel = spawnUIEntity({## 代码里的锚点预设-+*锚点选择器的九个点锚——各自把盒子钉到父项的某个角、边中点或正中心——外加每轴一个 **Stretch**,让盒子沿该轴铺满。*diff --git a/docs/astro/src/content/docs/zh-cn/ui/overview.mdx b/docs/astro/src/content/docs/zh-cn/ui/overview.mdxindex 953529111..2b94d9974 100644--- a/docs/astro/src/content/docs/zh-cn/ui/overview.mdx+++ b/docs/astro/src/content/docs/zh-cn/ui/overview.mdx@@ -116,7 +116,7 @@ addStartupSystem(buildPauseMenu);九宫格把图切成 3×3 的网格,每一块按不同方式缩放:-+`sliceBorder` 就是那四个数字:从每条边往内多远是"不该拉伸"的区带。四角在任何尺寸下都保留自己的精确像素,于是同一张 100×112 的纹理既能做小提示框,也能做通栏横幅。这个边框属于**图像**本身,@@ -132,7 +132,7 @@ addStartupSystem(buildPauseMenu);这对列表视口足够了,但也正是圆形头像框以前仍然裁出方形的原因:遮罩图形是圆的,裁剪范围不是。`alphaCutoff` 大于 0 时,裁剪范围切换为遮罩实际绘制出的形状。-+`UIVisual.enabled` 只隐藏本实体的视觉;`UINode.display = None` 把该节点**连同整棵子树**从布局、渲染和命中测试中移除。给节点加 `UIMask` 可把子项裁剪到盒内。@@ -142,7 +142,7 @@ addStartupSystem(buildPauseMenu);`Cover` 保持盒子、改为裁剪 UV。两者都不会让美术变形。`NineSlice` 和 `Tiled` 会忽略它——适配盒子本来就是它们的职责。-+**`UIMask.alphaCutoff` —— 按形状裁剪,而不是按外框。** 模板遮罩裁剪的是遮罩的*矩形*,所以圆形头像框裁出来仍是方的。大于 `0` 时它按遮罩实际绘制的形状裁剪,判定用的是**精灵**的 alpha@@ -202,7 +202,7 @@ world.insert(viewport, UIScroll, { vertical: true }); // content 缺省取第## 编辑器还是代码-+*编辑器里的一个 UI Canvas——依据设计框排布,带选中节点的 gizmo。同一套控件既能从代码写,也能在编辑器里排。*diff --git a/docs/astro/src/content/docs/zh-cn/ui/text.mdx b/docs/astro/src/content/docs/zh-cn/ui/text.mdxindex 8c8d82ac3..c5455b9e1 100644--- a/docs/astro/src/content/docs/zh-cn/ui/text.mdx+++ b/docs/astro/src/content/docs/zh-cn/ui/text.mdx@@ -94,7 +94,7 @@ const pulseBanner = defineSystem([Query(Mut(Transform), Text), Res(Time)], (q, t## 对齐——有盒与无盒-+*`align`(Left / Center / Right)和 `verticalAlign`(Top / Middle / Bottom)把文本块定位在它的盒内——九种组合。*diff --git a/docs/astro/src/content/docs/zh-cn/ui/widgets.mdx b/docs/astro/src/content/docs/zh-cn/ui/widgets.mdxindex 65f2a60cd..cad78928e 100644--- a/docs/astro/src/content/docs/zh-cn/ui/widgets.mdx+++ b/docs/astro/src/content/docs/zh-cn/ui/widgets.mdx@@ -28,7 +28,7 @@ Tab 能到达、Enter/Space 能点击、方向键能驱动滑块——用 `focus绑定,可在编辑器里授权。</Aside>-+*内置控件(取自 `ui-controls` 示例):一个 **Button(按钮)**、一个 **Toggle(开关)**、一个**Slider(滑块)**、一个 **Progress(进度条)**,以及打开 **Dialog(对话框)** 和切换强调色的diff --git a/docs/astro/src/content/docs/zh-cn/world/particles.mdx b/docs/astro/src/content/docs/zh-cn/world/particles.mdxindex 03f1c3647..19aa7c2d1 100644--- a/docs/astro/src/content/docs/zh-cn/world/particles.mdx+++ b/docs/astro/src/content/docs/zh-cn/world/particles.mdx@@ -199,7 +199,7 @@ const spawnEmbers = defineSystem([Commands()], (cmds) => {## 发射器形状-+*视口里的发射器形状 gizmo——锥形、圆形、矩形,各自画在粒子生成的位置(开 **Preview FX** 可在编辑态看它们运行)。*diff --git a/docs/astro/src/content/docs/zh-cn/world/prefabs.mdx b/docs/astro/src/content/docs/zh-cn/world/prefabs.mdxindex abbdda75f..3c799aca0 100644--- a/docs/astro/src/content/docs/zh-cn/world/prefabs.mdx+++ b/docs/astro/src/content/docs/zh-cn/world/prefabs.mdx@@ -37,7 +37,7 @@ import { Aside } from '@astrojs/starlight/components';Prefab Mode 暂不支持:就地编辑**嵌套**预制体,或基不是扁平的变体。编辑预制体时 Play 与 *Save As* 被禁用。-+*Prefab Mode:**Editing Prefab** 横幅带 **Save Prefab** / **Back to scene**,预制体作为它自己的实体树打开——保存后每个实例都会更新。*diff --git a/docs/astro/src/content/docs/zh-cn/world/tilemaps.mdx b/docs/astro/src/content/docs/zh-cn/world/tilemaps.mdxindex bd58ccc51..646477b83 100644--- a/docs/astro/src/content/docs/zh-cn/world/tilemaps.mdx+++ b/docs/astro/src/content/docs/zh-cn/world/tilemaps.mdx@@ -21,7 +21,7 @@ Tiled 文件导入,无需额外设置。## 在编辑器里绘制-+*选中一个 `TilemapLayer`,**瓦片画笔**就在左侧打开——上面是工具,下面是图集调色板。直接在视口里作画。*@@ -43,7 +43,7 @@ Tiled 文件导入,无需额外设置。绘制工具激活期间,`H` / `V` 翻转印章,`R` 旋转 90°。按 `Q`、`W` 或 `Esc` 离开绘制模式,键位交还给变换工具。-+*画笔面板特写:工具行(画笔、橡皮、矩形、椭圆、直线、油漆桶、框选、吸管、地形)、当前图集标签,以及你用来盖章的瓦片调色板。*@@ -64,17 +64,17 @@ Tiled 文件导入,无需额外设置。轴/起始行与六边形边长;之后 Inspector 编辑同一组字段。视口完全跟随图层:网格覆盖层、画笔虚影、悬停/选区高亮和所有绘制工具在菱形或六边形网格上的表现与方格完全一致。-+***新建瓦片地图**对话框在最开始就选好朝向与图集。*同一张地图画在六边形与交错网格上:-+*六边形——网格、画笔虚影和所有工具都跟随六边形布局。*-+*交错等距——隔行平移半格。*@@ -182,7 +182,7 @@ tilemap.setTilesets(layer, [(毫秒)和删除/清空操作;带动画的瓦片在图集里有 ▶ 标记。帧数据保存进 `.estileset`,所有使用该图集的图层都会自动播放——编辑器视口和运行时皆然,无需一行代码。-+*动画模式:选一个瓦片(这里是 #34),点击图集瓦片追加帧,并以毫秒设置每帧时长。条带作为实时预览循环播放。*@@ -207,7 +207,7 @@ tilemap.setChunkTiles(layer, chunkX, chunkY, tiles, 32, 32);## 地形自动拼接-+*地形模式里的**角 Wang** 集:定义地形颜色(Grass / Sand / Water),再给每个瓦片的四角上色——之后 `T` 画笔据此从邻居解析出正确的瓦片。*@@ -232,7 +232,7 @@ tilemap.setChunkTiles(layer, chunkX, chunkY, tiles, 32, 32);引擎的一等图集资源是 **`.estileset`**——它引用一张图集纹理,并携带逐瓦片的碰撞、动画、地形/自动拼接(auto-tile)数据与自定义键值属性。-+***图集编辑器**的碰撞模式:选形状(**盒 / 多边形 / 圆**)、切换**单向 / 传感器**并设置摩擦 / 弹性 / 密度、放置**斜坡**预设——绿色覆盖标出每个瓦片的碰撞体。*@@ -271,7 +271,7 @@ Tiled 地图享受同等待遇:在 **Tiled 瓦片碰撞编辑器** 里画的形**Create → 2D → Collision Layer**(或 *New Collision Layer* 命令)创建一个,预置 32px网格,并打开画笔面板——此时调色板是碰撞笔刷而非图集。-+***碰撞调色板**取代了图集:挑 **实心**、一个**斜坡**或**半砖**、**单向 ↑** 或**触发器**,然后在背景上刷。**摩擦力** 和 **弹性** 字段为整个图层设一份物理材质。*diff --git a/docs/astro/src/data/componentDocs.ts b/docs/astro/src/data/componentDocs.tsindex dcee81dd2..4408da8b1 100644--- a/docs/astro/src/data/componentDocs.ts+++ b/docs/astro/src/data/componentDocs.ts@@ -129,12 +129,12 @@ export const COMPONENT_DOCS: Record<string, ComponentDoc> = {Marker: { category: 'world', summary: 'A named point or region of gameplay interest — spawn point, waypoint, trigger zone — queryable like any component.', doc: 'gameplay/markers', anchor: 'marker-component-reference', anchorZh: 'marker-组件参考' },// ── Gameplay ───────────────────────────────────────────────────────────────- NavAgent: { category: 'gameplay', summary: 'Steers an entity along a path found on the navigation grid.', doc: 'gameplay/ai-navigation' },- Perceiver: { category: 'gameplay', summary: 'Senses nearby perception targets within a sight cone and range.', doc: 'gameplay/ai-perception' },- Perception: { category: 'gameplay', summary: "What a perceiver currently sees — written each frame for the entity's own logic to read.", doc: 'gameplay/ai-perception' },- PerceptionTarget: { category: 'gameplay', summary: 'Tag: perceivers can see this entity.', doc: 'gameplay/ai-perception' },- StateMachineAgent: { category: 'gameplay', summary: 'Runs a gameplay state machine asset, calling registry actions as states enter, update and exit.', doc: 'gameplay/ai-state-machines' },- BehaviorTreeAgent: { category: 'gameplay', summary: 'Ticks a behavior tree asset against a blackboard, calling registry actions at its leaves.', doc: 'gameplay/ai-behavior-trees' },+ NavAgent: { category: 'gameplay', summary: 'Steers an entity along a path found on the navigation grid.', doc: 'gameplay/ai/navigation' },+ Perceiver: { category: 'gameplay', summary: 'Senses nearby perception targets within a sight cone and range.', doc: 'gameplay/ai/perception' },+ Perception: { category: 'gameplay', summary: "What a perceiver currently sees — written each frame for the entity's own logic to read.", doc: 'gameplay/ai/perception' },+ PerceptionTarget: { category: 'gameplay', summary: 'Tag: perceivers can see this entity.', doc: 'gameplay/ai/perception' },+ StateMachineAgent: { category: 'gameplay', summary: 'Runs a gameplay state machine asset, calling registry actions as states enter, update and exit.', doc: 'gameplay/ai/state-machines' },+ BehaviorTreeAgent: { category: 'gameplay', summary: 'Ticks a behavior tree asset against a blackboard, calling registry actions at its leaves.', doc: 'gameplay/ai/behavior-trees' },EventBinding: { category: 'gameplay', summary: 'Wires an event on this entity to named actions — gameplay authored in the inspector, with no script.', doc: 'scripting/events', anchor: 'the-data', anchorZh: '数据本身' },AudioSource: { category: 'gameplay', summary: 'Declarative playback attached to an entity, attenuated by distance when spatial.', doc: 'assets/audio', anchor: 'declarative-playback--audiosource', anchorZh: '声明式播放--audiosource' },AudioListener: { category: 'gameplay', summary: 'The ear spatial audio is mixed relative to — usually the camera or the player.', doc: 'assets/audio', anchor: 'spatial-audio', anchorZh: '空间音频' },diff --git a/docs/astro/tsconfig.json b/docs/astro/tsconfig.jsonindex 8bf91d3bb..990abae73 100644--- a/docs/astro/tsconfig.json+++ b/docs/astro/tsconfig.json@@ -1,5 +1,11 @@{"extends": "astro/tsconfigs/strict","include": [".astro/types.d.ts", "**/*"],- "exclude": ["dist"]+ "exclude": ["dist"],+ "compilerOptions": {+ "baseUrl": ".",+ "paths": {+ "@/*": ["src/*"]+ }+ }}