evomeme 0.1.9 → 0.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/canvas-public/app.js +509 -5999
- package/dist/canvas-public/assets/presets/catalog.json +47 -0
- package/dist/canvas-public/assets/presets/tiles/A_01_CaoDi.png +0 -0
- package/dist/canvas-public/assets/presets/tiles/A_02_ShaMo.png +0 -0
- package/dist/canvas-public/assets/presets/tiles/A_03_TianKong.png +0 -0
- package/dist/canvas-public/assets/presets/tiles/A_04_ShuiBo.png +0 -0
- package/dist/canvas-public/assets/presets/tiles/A_05_HaiMian.png +0 -0
- package/dist/canvas-public/assets/presets/tiles/A_06_MuDiBan.png +0 -0
- package/dist/canvas-public/assets/presets/tiles/A_07_ShiZhuan.png +0 -0
- package/dist/canvas-public/assets/presets/tiles/A_08_AnRongYan.png +0 -0
- package/dist/canvas-public/assets/presets/tiles/A_09_QingTaiShi.png +0 -0
- package/dist/canvas-public/assets/presets/tiles/A_10_ShenHai.png +0 -0
- package/dist/canvas-public/assets/presets/tiles/A_11_HuiYanShi.png +0 -0
- package/dist/canvas-public/assets/presets/tiles/A_12_HongTu.png +0 -0
- package/dist/canvas-public/assets/presets/tiles/A_13_GengDi.png +0 -0
- package/dist/canvas-public/assets/presets/tiles/A_14_HuoShanYan.png +0 -0
- package/dist/canvas-public/assets/presets/tiles/A_15_NiTu.png +0 -0
- package/dist/canvas-public/assets/presets/tiles/A_16_HuangSha.png +0 -0
- package/dist/canvas-public/assets/presets/tiles/A_17_CongLin.png +0 -0
- package/dist/canvas-public/assets/presets/tiles/A_18_ZiYanShi.png +0 -0
- package/dist/canvas-public/assets/presets/tiles/A_19_MoGuTu.png +0 -0
- package/dist/canvas-public/assets/presets/tiles/A_20_HuaDian.png +0 -0
- package/dist/canvas-public/assets/presets/tiles/A_21_HaiLang.png +0 -0
- package/dist/canvas-public/assets/presets/tiles/A_22_GanTu.png +0 -0
- package/dist/canvas-public/assets/presets/tiles/A_23_QingTaiShiBan.png +0 -0
- package/dist/canvas-public/assets/presets/tiles/A_24_XingKong.png +0 -0
- package/dist/canvas-public/assets/presets/tiles/A_25_MoFaFuWen.png +0 -0
- package/dist/canvas-public/assets/presets/tiles/A_26_ShiTuYeDi.png +0 -0
- package/dist/canvas-public/assets/presets/tiles/A_27_LanZhuan.png +0 -0
- package/dist/canvas-public/assets/presets/tiles/A_28_HongZhuan.png +0 -0
- package/dist/canvas-public/assets/presets/tiles/A_29_YueQiu.png +0 -0
- package/dist/canvas-public/assets/presets/tiles/A_30_JinShuGe.png +0 -0
- package/dist/canvas-public/assets/presets/tiles/A_31_JinShuJingGai.png +0 -0
- package/dist/canvas-public/assets/presets/tiles/A_32_ShuZiChuang.png +0 -0
- package/dist/canvas-public/canvas/actions.js +143 -0
- package/dist/canvas-public/canvas/camera.js +28 -0
- package/dist/canvas-public/canvas/chrome.js +13 -0
- package/dist/canvas-public/canvas/data.js +123 -0
- package/dist/canvas-public/canvas/dependencies.js +19 -0
- package/dist/canvas-public/canvas/interactions.js +544 -0
- package/dist/canvas-public/canvas/panel-resize.js +5 -0
- package/dist/canvas-public/canvas/renderer.js +297 -0
- package/dist/canvas-public/canvas/selection.js +62 -0
- package/dist/canvas-public/canvas/serialization.js +118 -0
- package/dist/canvas-public/canvas/sync.js +202 -0
- package/dist/canvas-public/core/api.js +27 -0
- package/dist/canvas-public/core/feature-registry.js +29 -0
- package/dist/canvas-public/core/feature-state.js +228 -0
- package/dist/canvas-public/core/layout.js +133 -0
- package/dist/canvas-public/core/operations.js +38 -0
- package/dist/canvas-public/core/project.js +203 -0
- package/dist/canvas-public/core/state.js +27 -0
- package/dist/canvas-public/dialogs/context-menu.js +118 -0
- package/dist/canvas-public/elements/base.js +100 -0
- package/dist/canvas-public/elements/connections.js +105 -0
- package/dist/canvas-public/elements/drag.js +53 -0
- package/dist/canvas-public/elements/image.js +259 -0
- package/dist/canvas-public/elements/loading-recovery.js +5 -0
- package/dist/canvas-public/elements/loading.js +21 -0
- package/dist/canvas-public/elements/map.js +64 -0
- package/dist/canvas-public/elements/registry.js +58 -0
- package/dist/canvas-public/elements/replacement.js +78 -0
- package/dist/canvas-public/elements/resize.js +210 -0
- package/dist/canvas-public/elements/task-pipeline.js +234 -0
- package/dist/canvas-public/elements/types.js +21 -0
- package/dist/canvas-public/elements/ui.js +14 -0
- package/dist/canvas-public/elements/video.js +64 -0
- package/dist/canvas-public/features/assets/local-assets.js +72 -0
- package/dist/canvas-public/features/assets/official-assets.js +538 -0
- package/dist/canvas-public/features/editing/canvas-size.js +532 -0
- package/dist/canvas-public/features/editing/color-key.js +469 -0
- package/dist/canvas-public/features/editing/cutout.js +20 -0
- package/dist/canvas-public/features/editing/interactive-image-editing.js +981 -0
- package/dist/canvas-public/features/editing/layer-decomposition.js +44 -0
- package/dist/canvas-public/features/editing/manual-split.js +114 -0
- package/dist/canvas-public/features/editing/perfect-pixel.js +336 -0
- package/dist/canvas-public/features/editing/scroll-preview.js +129 -0
- package/dist/canvas-public/features/editing/scroll-seam-elimination.js +71 -0
- package/dist/canvas-public/features/editing/seam-elimination.js +46 -0
- package/dist/canvas-public/features/editing/smart-split.js +48 -0
- package/dist/canvas-public/features/editing/source-preview.js +43 -0
- package/dist/canvas-public/features/editing/video-cycle.js +49 -0
- package/dist/canvas-public/features/editing/video-frames.js +35 -0
- package/dist/canvas-public/features/frame-editor/frame-editing.js +755 -0
- package/dist/canvas-public/features/frame-editor/frame-model.js +63 -0
- package/dist/canvas-public/features/frame-editor/playback.js +83 -0
- package/dist/canvas-public/features/frame-editor/preview.js +149 -0
- package/dist/canvas-public/features/generation/animation.js +272 -0
- package/dist/canvas-public/features/generation/asset-batch.js +102 -0
- package/dist/canvas-public/features/generation/direction.js +163 -0
- package/dist/canvas-public/features/generation/fields.js +73 -0
- package/dist/canvas-public/features/generation/game-ui.js +64 -0
- package/dist/canvas-public/features/generation/image.js +83 -0
- package/dist/canvas-public/features/generation/scroll-image.js +157 -0
- package/dist/canvas-public/features/generation/seamless-tile.js +52 -0
- package/dist/canvas-public/features/generation/tile-transition-atlas.js +79 -0
- package/dist/canvas-public/features/generation/video.js +105 -0
- package/dist/canvas-public/features/map/creation.js +73 -0
- package/dist/canvas-public/features/map/tile-map-editor.js +2518 -0
- package/dist/canvas-public/features/registry.js +59 -0
- package/dist/canvas-public/index.html +84 -259
- package/dist/canvas-public/inspector/controls.js +49 -0
- package/dist/canvas-public/inspector/frame-preview.js +11 -0
- package/dist/canvas-public/inspector/inspector.js +190 -0
- package/dist/canvas-public/inspector/media-inspector.js +517 -0
- package/dist/canvas-public/inspector/media-preview.js +56 -0
- package/dist/canvas-public/inspector/number-stepper.js +96 -0
- package/dist/canvas-public/inspector/resize.js +88 -0
- package/dist/canvas-public/inspector/scroll-preview.js +11 -0
- package/dist/canvas-public/inspector/ui-inspector.js +14 -0
- package/dist/canvas-public/language/en-US.js +1059 -0
- package/dist/canvas-public/language/index.js +79 -0
- package/dist/canvas-public/language/zh-CN.js +1059 -0
- package/dist/canvas-public/map/export.js +9 -0
- package/dist/canvas-public/map/inspector.js +8 -0
- package/dist/canvas-public/map/model.js +409 -0
- package/dist/canvas-public/map/tile-map-editor.js +2 -0
- package/dist/canvas-public/media/metadata.js +183 -0
- package/dist/canvas-public/media/support.js +183 -0
- package/dist/canvas-public/styles/base.css +49 -0
- package/dist/canvas-public/styles/canvas.css +127 -0
- package/dist/canvas-public/styles/controls.css +203 -0
- package/dist/canvas-public/styles/dialogs.css +521 -0
- package/dist/canvas-public/styles/feature-form.css +409 -0
- package/dist/canvas-public/styles/inspector.css +441 -0
- package/dist/canvas-public/styles/layout.css +344 -0
- package/dist/canvas-public/styles/map.css +11 -0
- package/dist/canvas-public/styles/nodes.css +636 -0
- package/dist/canvas-public/styles.css +9 -2247
- package/dist/canvas-public/ui/controls.js +222 -0
- package/dist/canvas-public/ui/elements.js +9 -0
- package/dist/canvas-public/ui/feature-controller.js +296 -0
- package/dist/canvas-public/ui/feature-form.js +401 -0
- package/dist/canvas-public/ui/settings.js +83 -0
- package/dist/canvas-public/ui/toolbar.js +55 -0
- package/dist/canvas-public/vendor/pixi-tilemap.js +126 -0
- package/dist/canvas-public/vendor/pixi.min.js +2340 -0
- package/dist/canvas-public/workers/color-key-worker.js +289 -0
- package/dist/canvas-public/workers/perfect-pixel-worker.js +510 -0
- package/dist/index.js +42236 -13382
- package/dist/skills/en-US/evomeme-canvas/SKILL.md +52 -0
- package/dist/skills/en-US/evomeme-canvas/agents/openai.yaml +7 -0
- package/dist/skills/en-US/evomeme-cloud-fs/SKILL.md +176 -0
- package/dist/skills/en-US/evomeme-cloud-fs/agents/openai.yaml +7 -0
- package/dist/skills/en-US/evomeme-cover/SKILL.md +132 -0
- package/dist/skills/en-US/evomeme-cover/agents/openai.yaml +7 -0
- package/dist/skills/en-US/evomeme-game-maker/SKILL.md +288 -0
- package/dist/skills/en-US/evomeme-game-maker/agents/openai.yaml +4 -0
- package/dist/skills/en-US/evomeme-login/SKILL.md +92 -0
- package/dist/skills/en-US/evomeme-login/agents/openai.yaml +7 -0
- package/dist/skills/en-US/evomeme-native-bridge-sdk/SKILL.md +286 -0
- package/dist/skills/en-US/evomeme-native-bridge-sdk/agents/openai.yaml +8 -0
- package/dist/skills/en-US/evomeme-tos-upload/SKILL.md +47 -0
- package/dist/skills/en-US/evomeme-tos-upload/agents/openai.yaml +5 -0
- package/dist/skills/en-US/evomeme-ui/SKILL.md +123 -0
- package/dist/skills/en-US/evomeme-ui/agents/openai.yaml +4 -0
- package/dist/skills/en-US/evomeme-ui/references/host-layout.md +69 -0
- package/dist/skills/en-US/game-art/SKILL.md +121 -0
- package/dist/skills/en-US/game-art/agents/openai.yaml +8 -0
- package/dist/skills/en-US/game-asset-align/SKILL.md +45 -0
- package/dist/skills/en-US/game-asset-align/agents/openai.yaml +8 -0
- package/dist/skills/en-US/game-asset-align/references/alignment-contract.md +61 -0
- package/dist/skills/en-US/game-asset-align/references/blender-scene-pipeline.md +45 -0
- package/dist/skills/en-US/game-asset-align/references/canonical-package.md +26 -0
- package/dist/skills/en-US/game-asset-align/references/engine-capabilities.md +14 -0
- package/dist/skills/en-US/game-asset-align/references/lightweight-review.md +32 -0
- package/dist/skills/en-US/game-asset-align/references/repair-policy.md +30 -0
- package/dist/skills/en-US/game-asset-align/references/tool-contract.md +39 -0
- package/dist/skills/en-US/game-asset-align/references/visual-review.md +26 -0
- package/dist/skills/en-US/game-asset-image-generator/SKILL.md +104 -0
- package/dist/skills/en-US/game-asset-image-generator/agents/openai.yaml +7 -0
- package/dist/skills/en-US/game-asset-image-generator/references/background.md +32 -0
- package/dist/skills/en-US/game-asset-image-generator/references/static-game-assets.md +38 -0
- package/dist/skills/en-US/game-audio/SKILL.md +82 -0
- package/dist/skills/en-US/game-audio/agents/openai.yaml +4 -0
- package/dist/skills/en-US/game-demo/SKILL.md +103 -0
- package/dist/skills/en-US/game-demo/agents/openai.yaml +7 -0
- package/dist/skills/en-US/game-maker/SKILL.md +111 -0
- package/dist/skills/en-US/game-maker/agents/openai.yaml +4 -0
- package/dist/skills/en-US/game-test/SKILL.md +58 -0
- package/dist/skills/en-US/game-test/agents/openai.yaml +7 -0
- package/dist/skills/en-US/game-ui/SKILL.md +177 -0
- package/dist/skills/en-US/game-ui/agents/openai.yaml +4 -0
- package/dist/skills/en-US/godot-3d-game/SKILL.md +39 -0
- package/dist/skills/en-US/godot-3d-game/agents/openai.yaml +8 -0
- package/dist/skills/en-US/godot-3d-game/references/alignment-gates.md +26 -0
- package/dist/skills/en-US/godot-3d-game/references/appearance-alignment.md +52 -0
- package/dist/skills/en-US/godot-3d-game/references/build-and-qa.md +22 -0
- package/dist/skills/en-US/godot-3d-game/references/canonical-asset-runtime.md +27 -0
- package/dist/skills/en-US/godot-3d-game/references/import-and-wrapper-scenes.md +20 -0
- package/dist/skills/en-US/godot-3d-game/references/physics-colliders.md +13 -0
- package/dist/skills/en-US/godot-3d-game/references/project-structure.md +22 -0
- package/dist/skills/en-US/godot-3d-game/references/skeleton-animation.md +16 -0
- package/dist/skills/en-US/phaser-2d-game/SKILL.md +127 -0
- package/dist/skills/en-US/phaser-2d-game/agents/openai.yaml +8 -0
- package/dist/skills/en-US/phaser-2d-game/references/engine-performance.md +64 -0
- package/dist/skills/en-US/phaser-2d-game/references/engine-physics.md +139 -0
- package/dist/skills/en-US/phaser-2d-game/references/engine-runtime.md +129 -0
- package/dist/skills/en-US/phaser-2d-game/references/engine-spritesheets.md +99 -0
- package/dist/skills/en-US/phaser-2d-game/references/engine-tilemaps.md +80 -0
- package/dist/skills/en-US/phaser-2d-game/references/file-structure.md +94 -0
- package/dist/skills/en-US/phaser-2d-graphics-builder/SKILL.md +68 -0
- package/dist/skills/en-US/phaser-2d-graphics-builder/agents/openai.yaml +7 -0
- package/dist/skills/en-US/threejs-3d-game/SKILL.md +117 -0
- package/dist/skills/en-US/threejs-3d-game/agents/openai.yaml +7 -0
- package/dist/skills/en-US/threejs-3d-game/references/engine-asset-pipeline.md +153 -0
- package/dist/skills/en-US/threejs-3d-game/references/engine-audio.md +70 -0
- package/dist/skills/en-US/threejs-3d-game/references/engine-input-camera.md +84 -0
- package/dist/skills/en-US/threejs-3d-game/references/engine-performance.md +96 -0
- package/dist/skills/en-US/threejs-3d-game/references/engine-physics.md +142 -0
- package/dist/skills/en-US/threejs-3d-game/references/engine-runtime.md +199 -0
- package/dist/skills/en-US/threejs-3d-game/references/file-structure.md +353 -0
- package/dist/skills/en-US/threejs-aaa-graphics-builder/SKILL.md +62 -0
- package/dist/skills/en-US/threejs-aaa-graphics-builder/agents/openai.yaml +7 -0
- package/{skills → dist/skills/zh-CN}/evomeme-cloud-fs/SKILL.md +4 -4
- package/{skills → dist/skills/zh-CN}/evomeme-cover/SKILL.md +1 -1
- package/{skills → dist/skills/zh-CN}/evomeme-game-maker/SKILL.md +91 -88
- package/{skills → dist/skills/zh-CN}/evomeme-tos-upload/SKILL.md +6 -5
- package/dist/skills/zh-CN/evomeme-ui/SKILL.md +123 -0
- package/dist/skills/zh-CN/evomeme-ui/agents/openai.yaml +4 -0
- package/dist/skills/zh-CN/evomeme-ui/references/host-layout.md +69 -0
- package/dist/skills/zh-CN/game-asset-align/SKILL.md +45 -0
- package/dist/skills/zh-CN/game-asset-align/agents/openai.yaml +8 -0
- package/dist/skills/zh-CN/game-asset-align/references/alignment-contract.md +61 -0
- package/dist/skills/zh-CN/game-asset-align/references/blender-scene-pipeline.md +45 -0
- package/dist/skills/zh-CN/game-asset-align/references/canonical-package.md +26 -0
- package/dist/skills/zh-CN/game-asset-align/references/engine-capabilities.md +14 -0
- package/dist/skills/zh-CN/game-asset-align/references/lightweight-review.md +32 -0
- package/dist/skills/zh-CN/game-asset-align/references/repair-policy.md +30 -0
- package/dist/skills/zh-CN/game-asset-align/references/tool-contract.md +39 -0
- package/dist/skills/zh-CN/game-asset-align/references/visual-review.md +26 -0
- package/{skills → dist/skills/zh-CN}/game-asset-image-generator/SKILL.md +1 -1
- package/dist/skills/zh-CN/game-audio/references/bgm-cdn.md +127 -0
- package/dist/skills/zh-CN/game-audio/references/sfx-cdn.md +77 -0
- package/dist/skills/zh-CN/game-test/references/checklists/playtest-qa.md +12 -0
- package/{skills → dist/skills/zh-CN}/game-ui/SKILL.md +9 -1
- package/dist/skills/zh-CN/game-ui/references/checklists/game-ui-quality.md +14 -0
- package/dist/skills/zh-CN/game-ui/references/checklists/hud-readability.md +12 -0
- package/dist/skills/zh-CN/game-ui/references/checklists/mobile-input.md +12 -0
- package/dist/skills/zh-CN/game-ui/references/checklists/responsive-ui-fit.md +12 -0
- package/dist/skills/zh-CN/game-ui/references/ui-patterns.md +140 -0
- package/dist/skills/zh-CN/game-ui/references/ui-prompt-templates.md +63 -0
- package/dist/skills/zh-CN/godot-3d-game/SKILL.md +39 -0
- package/dist/skills/zh-CN/godot-3d-game/agents/openai.yaml +8 -0
- package/dist/skills/zh-CN/godot-3d-game/references/alignment-gates.md +26 -0
- package/dist/skills/zh-CN/godot-3d-game/references/appearance-alignment.md +52 -0
- package/dist/skills/zh-CN/godot-3d-game/references/build-and-qa.md +22 -0
- package/dist/skills/zh-CN/godot-3d-game/references/canonical-asset-runtime.md +27 -0
- package/dist/skills/zh-CN/godot-3d-game/references/import-and-wrapper-scenes.md +20 -0
- package/dist/skills/zh-CN/godot-3d-game/references/physics-colliders.md +13 -0
- package/dist/skills/zh-CN/godot-3d-game/references/project-structure.md +22 -0
- package/dist/skills/zh-CN/godot-3d-game/references/skeleton-animation.md +16 -0
- package/dist/skills/zh-CN/phaser-2d-graphics-builder/assets/scorecard-anchors/scene-1.jpeg +0 -0
- package/dist/skills/zh-CN/phaser-2d-graphics-builder/assets/scorecard-anchors/scene-2.jpeg +0 -0
- package/dist/skills/zh-CN/phaser-2d-graphics-builder/assets/scorecard-anchors/scene-3.jpg +0 -0
- package/dist/skills/zh-CN/phaser-2d-graphics-builder/references/checklists/compose-quality.md +10 -0
- package/dist/skills/zh-CN/phaser-2d-graphics-builder/references/checklists/performance-safe-visual-detail.md +9 -0
- package/dist/skills/zh-CN/phaser-2d-graphics-builder/references/checklists/premium-game-quality-gate.md +15 -0
- package/dist/skills/zh-CN/phaser-2d-graphics-builder/references/checklists/sprite-quality.md +10 -0
- package/dist/skills/zh-CN/phaser-2d-graphics-builder/references/checklists/technical-art-quality.md +9 -0
- package/dist/skills/zh-CN/phaser-2d-graphics-builder/references/checklists/visual-scorecard.md +9 -0
- package/dist/skills/zh-CN/phaser-2d-graphics-builder/references/compose-recipes.md +71 -0
- package/dist/skills/zh-CN/phaser-2d-graphics-builder/references/graphics-prompt-templates.md +33 -0
- package/dist/skills/zh-CN/phaser-2d-graphics-builder/references/implementation-blueprint.md +82 -0
- package/dist/skills/zh-CN/phaser-2d-graphics-builder/references/sprite-recipes.md +90 -0
- package/dist/skills/zh-CN/phaser-2d-graphics-builder/references/technical-art.md +67 -0
- package/dist/skills/zh-CN/phaser-2d-graphics-builder/references/vfx-recipes.md +67 -0
- package/dist/skills/zh-CN/phaser-2d-graphics-builder/references/visual-scorecard.md +129 -0
- package/{skills → dist/skills/zh-CN}/threejs-3d-game/SKILL.md +6 -2
- package/{skills → dist/skills/zh-CN}/threejs-3d-game/references/engine-asset-pipeline.md +52 -15
- package/dist/skills/zh-CN/threejs-aaa-graphics-builder/assets/scorecard-anchors/scene-1.jpg +0 -0
- package/dist/skills/zh-CN/threejs-aaa-graphics-builder/assets/scorecard-anchors/scene-2.jpg +0 -0
- package/dist/skills/zh-CN/threejs-aaa-graphics-builder/assets/scorecard-anchors/scene-3.jpg +0 -0
- package/dist/skills/zh-CN/threejs-aaa-graphics-builder/references/checklists/aaa-game-quality-gate.md +23 -0
- package/dist/skills/zh-CN/threejs-aaa-graphics-builder/references/checklists/aaa-visual-scorecard.md +19 -0
- package/dist/skills/zh-CN/threejs-aaa-graphics-builder/references/checklists/material-lighting-quality.md +14 -0
- package/dist/skills/zh-CN/threejs-aaa-graphics-builder/references/checklists/performance-safe-visual-detail.md +14 -0
- package/dist/skills/zh-CN/threejs-aaa-graphics-builder/references/checklists/procedural-model-quality.md +15 -0
- package/dist/skills/zh-CN/threejs-aaa-graphics-builder/references/checklists/technical-art-quality.md +17 -0
- package/dist/skills/zh-CN/threejs-aaa-graphics-builder/references/graphics-prompt-templates.md +236 -0
- package/dist/skills/zh-CN/threejs-aaa-graphics-builder/references/implementation-blueprint.md +161 -0
- package/dist/skills/zh-CN/threejs-aaa-graphics-builder/references/model-recipes.md +146 -0
- package/dist/skills/zh-CN/threejs-aaa-graphics-builder/references/render-recipes.md +90 -0
- package/dist/skills/zh-CN/threejs-aaa-graphics-builder/references/shader-cookbook.md +292 -0
- package/dist/skills/zh-CN/threejs-aaa-graphics-builder/references/technical-art.md +167 -0
- package/dist/skills/zh-CN/threejs-aaa-graphics-builder/references/visual-scorecard.md +147 -0
- package/dist/stage-blender/bake_materials.py +102 -0
- package/dist/stage-blender/export_scene.py +275 -0
- package/dist/stage-blender/preview_camera.py +90 -0
- package/dist/stage-blender/repair_mesh.py +112 -0
- package/dist/stage-public/app.js +759 -0
- package/dist/stage-public/baked/bakePilot.js +44 -0
- package/dist/stage-public/baked/bakedScene.js +129 -0
- package/dist/stage-public/baked/sceneAppearance.js +225 -0
- package/dist/stage-public/baked/sceneCamera.js +45 -0
- package/dist/stage-public/comparison-contract.js +28 -0
- package/dist/stage-public/delivery.html +4 -0
- package/dist/stage-public/delivery.js +17 -0
- package/dist/stage-public/godot/appearance.gd +170 -0
- package/dist/stage-public/godot/preview.gd +79 -0
- package/dist/stage-public/index.html +141 -0
- package/dist/stage-public/review-app.js +289 -0
- package/dist/stage-public/review-runtime.js +63 -0
- package/dist/stage-public/review.css +24 -0
- package/dist/stage-public/review.html +47 -0
- package/dist/stage-public/scene-runtime.js +212 -0
- package/dist/stage-public/sceneContractRuntime.js +235 -0
- package/dist/stage-public/styles.css +328 -0
- package/dist/stage-public/three-appearance.js +104 -0
- package/dist/stage-public/vendor/three170/LICENSE +21 -0
- package/dist/stage-public/vendor/three170/build/three.module.js +54571 -0
- package/dist/stage-public/vendor/three170/examples/jsm/controls/OrbitControls.js +1523 -0
- package/dist/stage-public/vendor/three170/examples/jsm/environments/RoomEnvironment.js +144 -0
- package/dist/stage-public/vendor/three170/examples/jsm/libs/fflate.module.js +2672 -0
- package/dist/stage-public/vendor/three170/examples/jsm/loaders/EXRLoader.js +2563 -0
- package/dist/stage-public/vendor/three170/examples/jsm/loaders/GLTFLoader.js +4727 -0
- package/dist/stage-public/vendor/three170/examples/jsm/utils/BufferGeometryUtils.js +1373 -0
- package/dist/tile-transition-mask.svg +40 -0
- package/package.json +21 -7
- package/dist/canvas-public/cycle-detect.js +0 -166
- package/dist/canvas-public/smart-split.js +0 -185
- /package/{skills → dist/skills/en-US}/game-audio/references/bgm-cdn.md +0 -0
- /package/{skills → dist/skills/en-US}/game-audio/references/sfx-cdn.md +0 -0
- /package/{skills → dist/skills/en-US}/game-test/references/checklists/playtest-qa.md +0 -0
- /package/{skills → dist/skills/en-US}/game-ui/references/checklists/game-ui-quality.md +0 -0
- /package/{skills → dist/skills/en-US}/game-ui/references/checklists/hud-readability.md +0 -0
- /package/{skills → dist/skills/en-US}/game-ui/references/checklists/mobile-input.md +0 -0
- /package/{skills → dist/skills/en-US}/game-ui/references/checklists/responsive-ui-fit.md +0 -0
- /package/{skills → dist/skills/en-US}/game-ui/references/ui-patterns.md +0 -0
- /package/{skills → dist/skills/en-US}/game-ui/references/ui-prompt-templates.md +0 -0
- /package/{skills → dist/skills/en-US}/phaser-2d-graphics-builder/assets/scorecard-anchors/scene-1.jpeg +0 -0
- /package/{skills → dist/skills/en-US}/phaser-2d-graphics-builder/assets/scorecard-anchors/scene-2.jpeg +0 -0
- /package/{skills → dist/skills/en-US}/phaser-2d-graphics-builder/assets/scorecard-anchors/scene-3.jpg +0 -0
- /package/{skills → dist/skills/en-US}/phaser-2d-graphics-builder/references/checklists/compose-quality.md +0 -0
- /package/{skills → dist/skills/en-US}/phaser-2d-graphics-builder/references/checklists/performance-safe-visual-detail.md +0 -0
- /package/{skills → dist/skills/en-US}/phaser-2d-graphics-builder/references/checklists/premium-game-quality-gate.md +0 -0
- /package/{skills → dist/skills/en-US}/phaser-2d-graphics-builder/references/checklists/sprite-quality.md +0 -0
- /package/{skills → dist/skills/en-US}/phaser-2d-graphics-builder/references/checklists/technical-art-quality.md +0 -0
- /package/{skills → dist/skills/en-US}/phaser-2d-graphics-builder/references/checklists/visual-scorecard.md +0 -0
- /package/{skills → dist/skills/en-US}/phaser-2d-graphics-builder/references/compose-recipes.md +0 -0
- /package/{skills → dist/skills/en-US}/phaser-2d-graphics-builder/references/graphics-prompt-templates.md +0 -0
- /package/{skills → dist/skills/en-US}/phaser-2d-graphics-builder/references/implementation-blueprint.md +0 -0
- /package/{skills → dist/skills/en-US}/phaser-2d-graphics-builder/references/sprite-recipes.md +0 -0
- /package/{skills → dist/skills/en-US}/phaser-2d-graphics-builder/references/technical-art.md +0 -0
- /package/{skills → dist/skills/en-US}/phaser-2d-graphics-builder/references/vfx-recipes.md +0 -0
- /package/{skills → dist/skills/en-US}/phaser-2d-graphics-builder/references/visual-scorecard.md +0 -0
- /package/{skills → dist/skills/en-US}/threejs-aaa-graphics-builder/assets/scorecard-anchors/scene-1.jpg +0 -0
- /package/{skills → dist/skills/en-US}/threejs-aaa-graphics-builder/assets/scorecard-anchors/scene-2.jpg +0 -0
- /package/{skills → dist/skills/en-US}/threejs-aaa-graphics-builder/assets/scorecard-anchors/scene-3.jpg +0 -0
- /package/{skills → dist/skills/en-US}/threejs-aaa-graphics-builder/references/checklists/aaa-game-quality-gate.md +0 -0
- /package/{skills → dist/skills/en-US}/threejs-aaa-graphics-builder/references/checklists/aaa-visual-scorecard.md +0 -0
- /package/{skills → dist/skills/en-US}/threejs-aaa-graphics-builder/references/checklists/material-lighting-quality.md +0 -0
- /package/{skills → dist/skills/en-US}/threejs-aaa-graphics-builder/references/checklists/performance-safe-visual-detail.md +0 -0
- /package/{skills → dist/skills/en-US}/threejs-aaa-graphics-builder/references/checklists/procedural-model-quality.md +0 -0
- /package/{skills → dist/skills/en-US}/threejs-aaa-graphics-builder/references/checklists/technical-art-quality.md +0 -0
- /package/{skills → dist/skills/en-US}/threejs-aaa-graphics-builder/references/graphics-prompt-templates.md +0 -0
- /package/{skills → dist/skills/en-US}/threejs-aaa-graphics-builder/references/implementation-blueprint.md +0 -0
- /package/{skills → dist/skills/en-US}/threejs-aaa-graphics-builder/references/model-recipes.md +0 -0
- /package/{skills → dist/skills/en-US}/threejs-aaa-graphics-builder/references/render-recipes.md +0 -0
- /package/{skills → dist/skills/en-US}/threejs-aaa-graphics-builder/references/shader-cookbook.md +0 -0
- /package/{skills → dist/skills/en-US}/threejs-aaa-graphics-builder/references/technical-art.md +0 -0
- /package/{skills → dist/skills/en-US}/threejs-aaa-graphics-builder/references/visual-scorecard.md +0 -0
- /package/{skills → dist/skills/zh-CN}/evomeme-canvas/SKILL.md +0 -0
- /package/{skills → dist/skills/zh-CN}/evomeme-canvas/agents/openai.yaml +0 -0
- /package/{skills → dist/skills/zh-CN}/evomeme-cloud-fs/agents/openai.yaml +0 -0
- /package/{skills → dist/skills/zh-CN}/evomeme-cover/agents/openai.yaml +0 -0
- /package/{skills → dist/skills/zh-CN}/evomeme-game-maker/agents/openai.yaml +0 -0
- /package/{skills → dist/skills/zh-CN}/evomeme-login/SKILL.md +0 -0
- /package/{skills → dist/skills/zh-CN}/evomeme-login/agents/openai.yaml +0 -0
- /package/{skills → dist/skills/zh-CN}/evomeme-native-bridge-sdk/SKILL.md +0 -0
- /package/{skills → dist/skills/zh-CN}/evomeme-native-bridge-sdk/agents/openai.yaml +0 -0
- /package/{skills → dist/skills/zh-CN}/evomeme-tos-upload/agents/openai.yaml +0 -0
- /package/{skills → dist/skills/zh-CN}/game-art/SKILL.md +0 -0
- /package/{skills → dist/skills/zh-CN}/game-art/agents/openai.yaml +0 -0
- /package/{skills → dist/skills/zh-CN}/game-asset-image-generator/agents/openai.yaml +0 -0
- /package/{skills → dist/skills/zh-CN}/game-asset-image-generator/references/background.md +0 -0
- /package/{skills → dist/skills/zh-CN}/game-asset-image-generator/references/static-game-assets.md +0 -0
- /package/{skills → dist/skills/zh-CN}/game-audio/SKILL.md +0 -0
- /package/{skills → dist/skills/zh-CN}/game-audio/agents/openai.yaml +0 -0
- /package/{skills → dist/skills/zh-CN}/game-demo/SKILL.md +0 -0
- /package/{skills → dist/skills/zh-CN}/game-demo/agents/openai.yaml +0 -0
- /package/{skills → dist/skills/zh-CN}/game-maker/SKILL.md +0 -0
- /package/{skills → dist/skills/zh-CN}/game-maker/agents/openai.yaml +0 -0
- /package/{skills → dist/skills/zh-CN}/game-test/SKILL.md +0 -0
- /package/{skills → dist/skills/zh-CN}/game-test/agents/openai.yaml +0 -0
- /package/{skills → dist/skills/zh-CN}/game-ui/agents/openai.yaml +0 -0
- /package/{skills → dist/skills/zh-CN}/phaser-2d-game/SKILL.md +0 -0
- /package/{skills → dist/skills/zh-CN}/phaser-2d-game/agents/openai.yaml +0 -0
- /package/{skills → dist/skills/zh-CN}/phaser-2d-game/references/engine-performance.md +0 -0
- /package/{skills → dist/skills/zh-CN}/phaser-2d-game/references/engine-physics.md +0 -0
- /package/{skills → dist/skills/zh-CN}/phaser-2d-game/references/engine-runtime.md +0 -0
- /package/{skills → dist/skills/zh-CN}/phaser-2d-game/references/engine-spritesheets.md +0 -0
- /package/{skills → dist/skills/zh-CN}/phaser-2d-game/references/engine-tilemaps.md +0 -0
- /package/{skills → dist/skills/zh-CN}/phaser-2d-game/references/file-structure.md +0 -0
- /package/{skills → dist/skills/zh-CN}/phaser-2d-graphics-builder/SKILL.md +0 -0
- /package/{skills → dist/skills/zh-CN}/phaser-2d-graphics-builder/agents/openai.yaml +0 -0
- /package/{skills → dist/skills/zh-CN}/threejs-3d-game/agents/openai.yaml +0 -0
- /package/{skills → dist/skills/zh-CN}/threejs-3d-game/references/engine-audio.md +0 -0
- /package/{skills → dist/skills/zh-CN}/threejs-3d-game/references/engine-input-camera.md +0 -0
- /package/{skills → dist/skills/zh-CN}/threejs-3d-game/references/engine-performance.md +0 -0
- /package/{skills → dist/skills/zh-CN}/threejs-3d-game/references/engine-physics.md +0 -0
- /package/{skills → dist/skills/zh-CN}/threejs-3d-game/references/engine-runtime.md +0 -0
- /package/{skills → dist/skills/zh-CN}/threejs-3d-game/references/file-structure.md +0 -0
- /package/{skills → dist/skills/zh-CN}/threejs-aaa-graphics-builder/SKILL.md +0 -0
- /package/{skills → dist/skills/zh-CN}/threejs-aaa-graphics-builder/agents/openai.yaml +0 -0
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
# Engine: Asset Loading and Animation Pipeline
|
|
2
|
+
|
|
3
|
+
Focuses on **how to safely connect GLB at runtime**, and how to consume **canonical asset packages** (`model.glb` + `asset.json`).
|
|
4
|
+
|
|
5
|
+
Load this file when loading/binding meshes, `AnimationMixer`, root motion, collision proxies, or post-import performance. Paths and config contracts are still governed by `file-structure.md`. For the alignment process, see skill `game-asset-align`.
|
|
6
|
+
|
|
7
|
+
## Canonical Package (Mandatory)
|
|
8
|
+
|
|
9
|
+
**After Blender modeling/modification, the Stage board MUST be opened first. Only after the user views it and clicks "confirm current version, allow import" may the next import step proceed.** `evomeme_stage_open({workspace_dir,asset_id,target:"three_js"})`; format checks and `alignment.ready` only indicate technical status and cannot skip confirmation. After changing the model, textures, lights, or display configuration, the old confirmation becomes invalid and it MUST be viewed and confirmed again.
|
|
10
|
+
|
|
11
|
+
Before entering the game, Tripo / code-modeled / Blender / uploaded models MUST be:
|
|
12
|
+
|
|
13
|
+
```text
|
|
14
|
+
assets/canonical/<asset_id>/model.glb
|
|
15
|
+
assets/canonical/<asset_id>/asset.json
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Sync into the Vite project:
|
|
19
|
+
|
|
20
|
+
```text
|
|
21
|
+
evomeme_asset_sync_to_three
|
|
22
|
+
-> public/assets/canonical/<asset_id>/
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Key fields in `asset.json`: `forward_axis`, `scale_hint_metres`, `yaw/pitch/roll_offset_degrees`, `verified_by`.
|
|
26
|
+
For directional assets (characters/firearms/vehicles), `verified_by` MUST NOT be `unverified`.
|
|
27
|
+
|
|
28
|
+
Runtime convention: **-Z forward, +Y up** (same as Godot). For full scenes, use the synced `src/evomeme-stage/<id>/canonical_loader.js` and call `loadReviewedScene`. It shares scene-runtime.js and three-appearance.js with Stage, reproducing the confirmed PBR, lights, environment, camera, and existing baked display path. The project must use Three.js **0.170.0**; mismatched versions will error and require dependencies to be unified before viewing again.
|
|
29
|
+
|
|
30
|
+
The package includes three.appearance.json (confirmed profile, diagnostics, and file fingerprints), THREE_IMPORT.md, the pinned runtime, and independently viewable three-preview.html. The old applyCanonicalOrientation.ts is only for compatibility with old model code; it is not responsible for full-scene display.
|
|
31
|
+
|
|
32
|
+
## Output and Loading Preferences
|
|
33
|
+
|
|
34
|
+
| Purpose | Format |
|
|
35
|
+
| --- | --- |
|
|
36
|
+
| Three runtime | Prefer GLB (PBR) + same-directory `asset.json` |
|
|
37
|
+
| Animation exchange | FBX as needed, then import carefully or convert offline to GLB |
|
|
38
|
+
| Printing / AR | STL/3MF, USDZ - not the default for this game runtime |
|
|
39
|
+
|
|
40
|
+
- Use `GLTFLoader` (`three/addons/loaders/GLTFLoader.js`).
|
|
41
|
+
- Runtime URL: `./` relative paths, `/assets/canonical/<id>/model.glb`, or external `http(s)`; arbitrary site-root absolute paths are prohibited (see deployment rules).
|
|
42
|
+
- Put loading in the asset layer / `game/three` helpers; **do not** `load` inside entity per-frame update.
|
|
43
|
+
- Business code references assets through `manifest` / `config` / canonical `asset_id`, and does not hardcode bare URLs.
|
|
44
|
+
|
|
45
|
+
```ts
|
|
46
|
+
import * as THREE from 'three';
|
|
47
|
+
import { loadReviewedScene } from '../../evomeme-stage/courtyard/canonical_loader.js';
|
|
48
|
+
|
|
49
|
+
// assetBase comes from deployment resource config, points to this scene directory, and ends with /.
|
|
50
|
+
const runtime = await loadReviewedScene({
|
|
51
|
+
renderer, world: scene, camera, assetBase: config.assets.courtyard,
|
|
52
|
+
});
|
|
53
|
+
// Game main loop; the game is responsible for updating camera aspect and renderer size.
|
|
54
|
+
runtime.render(camera, deltaSeconds);
|
|
55
|
+
// When leaving the scene
|
|
56
|
+
runtime.dispose();
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
A full environment is loaded only once inside one Scene. Props use appearanceEnabled:false to attach to an existing environment. The returned root node already has canonical TRS applied; do not wrap it in compensating rotation or scale again. The return value also includes animations and stats; gameplay, physics, and animation playback are taken over by the game's asset layer. R3F or custom postprocessing must take over the render loop and call runtime.render; merely letting the framework call renderer.render will skip the full scene bake/postprocessing path.
|
|
60
|
+
|
|
61
|
+
## Wrapping Entities
|
|
62
|
+
|
|
63
|
+
When importing a scene package into game entities, explicitly handle:
|
|
64
|
+
|
|
65
|
+
- **MUST** use `asset.json` to unify scale, pivot, and orientation (outer `Group`)
|
|
66
|
+
- Bounding boxes / logical bounds
|
|
67
|
+
- **Collision proxy separated from visuals**
|
|
68
|
+
- Loading failure placeholder or error state
|
|
69
|
+
- Records: file size, triangle count, material count, texture dimensions, clip names, `verified_by`
|
|
70
|
+
|
|
71
|
+
## AnimationMixer
|
|
72
|
+
|
|
73
|
+
```ts
|
|
74
|
+
const mixer = new THREE.AnimationMixer(gltf.scene);
|
|
75
|
+
const action = mixer.clipAction(gltf.animations[0]);
|
|
76
|
+
action.play();
|
|
77
|
+
|
|
78
|
+
// After useFrame / simulation: seconds
|
|
79
|
+
mixer.update(deltaSeconds);
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
- Map gameplay states to clips: idle / walk-run / jump / attack / hurt / fall / turn, etc.
|
|
83
|
+
- Arcade default: **in-place animation + code-driven displacement**; if root motion is retained, it MUST be intentional.
|
|
84
|
+
- On restart, stop actions and dispose the mixer to avoid stacked playback.
|
|
85
|
+
|
|
86
|
+
## Root Motion and Imported Animation Notes (Engine Side)
|
|
87
|
+
|
|
88
|
+
If upstream rigging/retargeting pitfalls exist, fix them on the engine side this way:
|
|
89
|
+
|
|
90
|
+
1. When in-place animation is needed, handle it preferentially **after import**; do not depend on uncontrolled upstream `animate_in_place` behavior.
|
|
91
|
+
2. When making an animation in-place, change only the top-level root bone position track (common name `Root.position`), and pin only horizontal XZ; **preserve Y** (jumping rise/fall).
|
|
92
|
+
3. Do not broadly delete Hip/Pelvis or twist tracks: some rigs skin limbs to twist bones, and deleting tracks will collapse limbs.
|
|
93
|
+
|
|
94
|
+
```ts
|
|
95
|
+
for (const clip of clips) {
|
|
96
|
+
for (const tr of clip.tracks) {
|
|
97
|
+
if (tr.name !== 'Root.position') continue;
|
|
98
|
+
const v = tr.values;
|
|
99
|
+
const x0 = v[0];
|
|
100
|
+
const z0 = v[2];
|
|
101
|
+
for (let i = 0; i < v.length; i += 3) {
|
|
102
|
+
v[i] = x0;
|
|
103
|
+
v[i + 2] = z0;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
If batch retargeting produces `NlaTrack` / `NlaTrack.001`: map to preset names by index according to the **request order**, then after loading set `clip.name = 'walk'` and select by name.
|
|
110
|
+
|
|
111
|
+
Log after loading: `gltf.animations.map(c => \`${c.name} ${c.tracks.length} tracks\`)`. Healthy humanoid clips should drive many bones; very few tracks usually mean upstream rigging is broken, so fix rigging first.
|
|
112
|
+
|
|
113
|
+
### FBX Intake (Common for Humanoid Retargeting)
|
|
114
|
+
|
|
115
|
+
- `FBXLoader` depends on `fflate`; bundlers generally include it automatically.
|
|
116
|
+
- The same take may produce two clips with different `|` path depths: **keep the shallower** one.
|
|
117
|
+
- Select clips with keywords (walk / idle / attack); do not blindly use `animations[0]` unless the pipeline guarantees a single take.
|
|
118
|
+
- FBX is often Phong and darker than GLB PBR; final art alignment can convert offline to GLB.
|
|
119
|
+
- Apart from "pinning horizontal motion on a single root bone", avoid further loader-side animation "fixes" (they easily make things worse).
|
|
120
|
+
|
|
121
|
+
## Performance Discipline
|
|
122
|
+
|
|
123
|
+
- Browser/mobile: control polygon count and texture dimensions; hero pieces high quality + instanced/procedural supporting elements.
|
|
124
|
+
- Share geometry/material as much as possible when cloning.
|
|
125
|
+
- Dispose loaded resources on scene exit / level change.
|
|
126
|
+
- Record renderer diagnostics before and after import: calls, triangles, geometries, textures, materials, file size.
|
|
127
|
+
- Runtime stutter, pooling, DPR, and LOD are covered in `engine-performance.md`.
|
|
128
|
+
|
|
129
|
+
## Import Checkup Checklist
|
|
130
|
+
|
|
131
|
+
- [ ] File size and triangle count are acceptable
|
|
132
|
+
- [ ] Mesh / material / texture counts and dimensions
|
|
133
|
+
- [ ] PBR appearance under current lighting
|
|
134
|
+
- [ ] Metric scale and pivot / bounds come from `asset.json`, not guesses
|
|
135
|
+
- [ ] `verified_by` is recorded (directional assets are not unverified)
|
|
136
|
+
- [ ] Collision proxy is separate and visible in debug
|
|
137
|
+
- [ ] Clip names, durations, and root-motion strategy are clear
|
|
138
|
+
- [ ] Failure has a placeholder; success path enters manifest/config/canonical
|
|
139
|
+
- [ ] No leaks on unload and restart
|
|
140
|
+
- [ ] No hardcoded compensating rotation in gameplay code
|
|
141
|
+
|
|
142
|
+
## Common Fixes
|
|
143
|
+
|
|
144
|
+
| Problem | Handling |
|
|
145
|
+
| --- | --- |
|
|
146
|
+
| Too large/small | Normalize bounds on the outer Group |
|
|
147
|
+
| Wrong orientation | **Change asset.json / return to the board**, do not permanently hard-rotate inside gameplay wrappers |
|
|
148
|
+
| Wrong scale | Write `scale_hint_metres`, then reload |
|
|
149
|
+
| Broken geometry | `evomeme_asset_repair_blender` -> board alignment again -> sync again |
|
|
150
|
+
| Animation foot sliding/drifting away | Keep exported root motion, then pin only XZ as above |
|
|
151
|
+
| Too expensive | Reduce geometry, shrink textures, reduce unique retopology |
|
|
152
|
+
| Material too dark/bright | Color space, tone mapping, ambient light, exposure |
|
|
153
|
+
| Strange collision | Visual mesh does not participate in physics; create a separate proxy |
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# Engine: Audio Runtime
|
|
2
|
+
|
|
3
|
+
The audio runtime lives in `game/audio` + `gameBus`. Asset generation and music selection go through `../game-audio`; this file only governs **runtime wiring and lifecycle**.
|
|
4
|
+
|
|
5
|
+
Load this file when changing in-game BGM/SFX playback, unlock, mute, or restart cleanup.
|
|
6
|
+
|
|
7
|
+
## Ownership
|
|
8
|
+
|
|
9
|
+
| Item | Location |
|
|
10
|
+
| --- | --- |
|
|
11
|
+
| Playback / decode / dispose | `game/audio` (`audioManager`, etc.) |
|
|
12
|
+
| Gameplay facts -> sound | `audioHooks` subscribes to `gameBus` (`game:*` / `player:*` / `game:feedback`) |
|
|
13
|
+
| Mute / volume preferences | HUD emits `command:audio-prefs` -> `audioPrefs` applies |
|
|
14
|
+
| URL / toggles | `public/config.json` or `game/assets` manifest |
|
|
15
|
+
|
|
16
|
+
Prohibited:
|
|
17
|
+
|
|
18
|
+
- Playing in-game SFX with `new Audio()` inside HUD / `useFrame`
|
|
19
|
+
- Creating new audio sources or footstep loops every frame
|
|
20
|
+
- Duplicating playback logic across multiple components
|
|
21
|
+
|
|
22
|
+
## User-Gesture Unlock
|
|
23
|
+
|
|
24
|
+
Browsers require resuming `AudioContext` (or equivalent unlock) after a **user gesture**:
|
|
25
|
+
|
|
26
|
+
- The first "start / continue / tap Canvas" path calls `audioManager.unlock()` (or `context.resume()`)
|
|
27
|
+
- Unlock failure must be visible (logs / diagnostics); do not fail silently
|
|
28
|
+
- Mobile MUST be verified once on a real device or with a simulated gesture
|
|
29
|
+
|
|
30
|
+
## Event-Driven Hooks (Minimum Set)
|
|
31
|
+
|
|
32
|
+
Play sounds by state, not as random decoration:
|
|
33
|
+
|
|
34
|
+
| Event Class | Examples |
|
|
35
|
+
| --- | --- |
|
|
36
|
+
| UI | Click, pause, retry |
|
|
37
|
+
| Progress | Pickup, score, milestone / combo |
|
|
38
|
+
| Pressure | Hurt, failure, danger approaching |
|
|
39
|
+
| Ability | Dash / accelerate / fire |
|
|
40
|
+
| Ambience | BGM or environment loop (toggleable) |
|
|
41
|
+
|
|
42
|
+
Payloads such as `game:feedback` / `player:movement` use plain data; `game/audio` maps them to concrete clips, and does not write URLs into UI.
|
|
43
|
+
|
|
44
|
+
## Lifecycle
|
|
45
|
+
|
|
46
|
+
- **Pause / hidden page**: stop or lower in-game BGM; `visibilitychange` MUST NOT stack a second loop
|
|
47
|
+
- **Failure / results / restart**: stop in-game loops and short SFX; remove subscriptions for this run only; return pooled audio sources (if any)
|
|
48
|
+
- **Level change**: unload buffers unique to this level; common UI sounds may remain
|
|
49
|
+
- **Mute / volume**: preferences MUST apply to all groups (BGM / SFX / UI)
|
|
50
|
+
|
|
51
|
+
## With config
|
|
52
|
+
|
|
53
|
+
`http(s)` URLs for BGM/SFX, default volume, and whether music is enabled go into flat `config.json`; code reads through `getSetting` / manifest keys, and scattered hardcoded paths are prohibited.
|
|
54
|
+
|
|
55
|
+
## Troubleshooting
|
|
56
|
+
|
|
57
|
+
- File URL, MIME, CORS
|
|
58
|
+
- Whether decode/load rejects are visible
|
|
59
|
+
- Whether `play` is called without ever unlocking
|
|
60
|
+
- Whether SFX is triggered every frame
|
|
61
|
+
- Whether pause/restart causes double BGM
|
|
62
|
+
- Whether mute misses any group
|
|
63
|
+
|
|
64
|
+
## Engine Anti-Patterns
|
|
65
|
+
|
|
66
|
+
- UI buttons directly call `new Audio(url).play()`
|
|
67
|
+
- Depending on autoplay without unlocking
|
|
68
|
+
- BGM residue / stacked listeners after restart
|
|
69
|
+
- Business code hardcodes audio URLs
|
|
70
|
+
- Writing generation-pipeline details into `game/audio` (generation belongs to the `game-audio` skill)
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# Engine: Input and Camera
|
|
2
|
+
|
|
3
|
+
Input and camera live in `game/input` + `game/three`. This does not include UI visual design or numerical juice recipes (for game feel, see `game-designer/references/game-feel.md`).
|
|
4
|
+
|
|
5
|
+
Load this file when changing controls, touch stickiness, camera follow, FOV, or pointer lock.
|
|
6
|
+
|
|
7
|
+
## Input: Intent and Ownership
|
|
8
|
+
|
|
9
|
+
1. **Collection** (keyboard/mouse / pointer / touch / gamepad) is separated from **simulation**.
|
|
10
|
+
2. Physical device -> semantic action (such as `move`, `dash`, `confirm`) is centralized in `game/input`.
|
|
11
|
+
3. `GameCanvas` / DOM HUD only reads the unified input surface; hardcoded keybindings MUST NOT be scattered inside `useFrame`.
|
|
12
|
+
4. UI buttons enter the runtime through the same action set or `command:*`, and do not duplicate a separate rule set inside buttons.
|
|
13
|
+
|
|
14
|
+
### Stickiness and Cancellation
|
|
15
|
+
|
|
16
|
+
- MUST handle `pointerup` / `pointercancel` / `blur` / `visibilitychange` to avoid stuck joysticks or dash buttons.
|
|
17
|
+
- Pointer controls use `setPointerCapture`; test environments may not have a real pointerId, so tolerate that.
|
|
18
|
+
- Use `event.code` for keys (layout-independent); do not rely only on `key`.
|
|
19
|
+
- CSS `touch-action` is set intentionally and with controlled scope; avoid full-page scrolling stealing gestures.
|
|
20
|
+
- After failure / pause / restart, restore focus and make restarted controls usable.
|
|
21
|
+
|
|
22
|
+
### Movement Composition (Desktop + Joystick)
|
|
23
|
+
|
|
24
|
+
Normalize if the sum of the key vector and joystick vector has length > 1 (scaffold pattern):
|
|
25
|
+
|
|
26
|
+
```ts
|
|
27
|
+
target.copy(keyVector).add(pointerVector);
|
|
28
|
+
if (target.lengthSq() > 1) target.normalize();
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
When mobile is in scope: the virtual joystick is in DOM (`src/ui`) and writes to the same `move` intent through `game/input`; do not bind another conflicting listener set inside Canvas.
|
|
32
|
+
|
|
33
|
+
### Input Troubleshooting
|
|
34
|
+
|
|
35
|
+
- Whether focus is on a page that can receive keyboard input
|
|
36
|
+
- Whether listeners are attached to the correct element
|
|
37
|
+
- `touch-action` / viewport meta / safe area
|
|
38
|
+
- Whether DPR makes touch hit areas too small
|
|
39
|
+
- Whether resize updates after rotation
|
|
40
|
+
- Whether desktop keyboard/mouse still works after adding mobile controls
|
|
41
|
+
- Whether UI emits intent instead of directly changing simulation root state
|
|
42
|
+
|
|
43
|
+
## Camera: Model and Responsibilities
|
|
44
|
+
|
|
45
|
+
Choose one primary model early and write it into the implementation (logic in `game/three`; rules still in simulation):
|
|
46
|
+
|
|
47
|
+
| Model | Applies To |
|
|
48
|
+
| --- | --- |
|
|
49
|
+
| Follow + fixed offset | Runners, top-down action, arcade |
|
|
50
|
+
| Orbit / inspect | Showcases, slower exploration |
|
|
51
|
+
| Target lock | Tactical, lock-on combat |
|
|
52
|
+
| Over-the-shoulder | Lightweight third-person |
|
|
53
|
+
|
|
54
|
+
Rules:
|
|
55
|
+
|
|
56
|
+
- Separate camera from game rules: the camera reads "follow target pose / event pulses" and does not rewrite win/loss state.
|
|
57
|
+
- Shake / FOV kick only serve readability and MUST NOT block the next decision area.
|
|
58
|
+
- Readability: the next decision is visible, the player is sufficiently centered, and threats are not hidden by HUD/camera clipping.
|
|
59
|
+
- Accessibility: avoid excessive shake, flashing, and uncontrollable motion; respect hooks such as `setReducedMotion`.
|
|
60
|
+
|
|
61
|
+
### Follow Lag (Exponential Smoothing)
|
|
62
|
+
|
|
63
|
+
Common scaffold form (`lag` is the time constant in seconds; it may come from `camera_follow_lag` in `config.json`):
|
|
64
|
+
|
|
65
|
+
```ts
|
|
66
|
+
const desired = target.clone().add(offset);
|
|
67
|
+
const factor = 1 - Math.exp(-delta / Math.max(0.001, lag));
|
|
68
|
+
camera.position.lerp(desired, factor);
|
|
69
|
+
camera.lookAt(lookTarget);
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Tunable axes (change engine parameters, not rules): follow lag, look-ahead, height, distance, FOV, near/far planes, pull-in strategy for collision/occlusion.
|
|
73
|
+
|
|
74
|
+
### Verify Camera and Controls Together
|
|
75
|
+
|
|
76
|
+
After changing speed or acceleration, MUST retest:
|
|
77
|
+
|
|
78
|
+
- Whether high speed clips through geometry or the camera loses the target
|
|
79
|
+
- Whether turning fights with look-ahead
|
|
80
|
+
- Whether pointer should freeze or unlock when pause/menu opens
|
|
81
|
+
|
|
82
|
+
## Config Contract
|
|
83
|
+
|
|
84
|
+
Tunable items such as camera lag, FOV, and whether screen shake is enabled go into flat `public/config.json` (see `file-structure.md`); copying magic numbers across multiple camera files is prohibited.
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# Engine: Performance
|
|
2
|
+
|
|
3
|
+
Load when addressing stutter, frame drops, generation spikes, or low mobile frame rate.
|
|
4
|
+
|
|
5
|
+
Profiling flow and acceptance evidence are in `../game-test`; AAA rendering budgets / LOD art-side guidance is in `../threejs-aaa-graphics-builder/references/technical-art.md`. This file only governs **implementation-time engine constraints**.
|
|
6
|
+
|
|
7
|
+
## First Things to Prioritize
|
|
8
|
+
|
|
9
|
+
1. **Object pools**: bullets, pickups, fragments, short-lived VFX carriers - hot paths MUST NOT aggressively `new` / `dispose` meshes
|
|
10
|
+
2. **Shared resources**: repeated pieces use `InstancedMesh` or shared geometry / material / texture
|
|
11
|
+
3. **DPR cap**: default cap `2` (see `engine-runtime.md` Canvas config); mobile may go lower
|
|
12
|
+
4. **Zero allocation on hot paths**: `useFrame` / simulation does not create `{}` / `new Vector3` every frame; reuse temporary vectors
|
|
13
|
+
5. **Reduce physics cost first**: simple colliders, sleeping, fewer dynamic bodies, narrow sensors; CCD only for bodies that need it (see `engine-physics.md`)
|
|
14
|
+
|
|
15
|
+
## Rendering Side
|
|
16
|
+
|
|
17
|
+
| Technique | When |
|
|
18
|
+
| --- | --- |
|
|
19
|
+
| `InstancedMesh` | Lane markers, bolts, windows, grass, debris, repeated props |
|
|
20
|
+
| Shared geometry/material | Do not clone each material chain separately when cloning entities |
|
|
21
|
+
| Frustum / distance culling | Far scenery and offscreen dynamic bodies |
|
|
22
|
+
| `LOD` | Background pieces, dense world kits |
|
|
23
|
+
| Shadow reduction | Fewer casters, smaller shadow maps, contact shadows/blob substitutes |
|
|
24
|
+
| Postprocessing throttling | Keep only passes required for readability |
|
|
25
|
+
| Texture discipline | Controlled size, reuse, mipmap; avoid many unique large textures on screen |
|
|
26
|
+
|
|
27
|
+
Optimization order: **check DPR / post / shadow / instancing / culling first**, then reduce visual density; do not start by deleting hero-piece readability.
|
|
28
|
+
|
|
29
|
+
User-facing performance is governed by **production preview** (`pnpm build` + preview); do not use dev server frame rate as evidence.
|
|
30
|
+
|
|
31
|
+
## Object Pools (3D)
|
|
32
|
+
|
|
33
|
+
```ts
|
|
34
|
+
// Illustration: the pool holds constructed Object3D + optional physics body handles
|
|
35
|
+
function acquireBullet(): BulletView {
|
|
36
|
+
const b = pool.pop() ?? createBulletView();
|
|
37
|
+
b.root.visible = true;
|
|
38
|
+
// Enable collider / reset transform
|
|
39
|
+
return b;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function releaseBullet(b: BulletView): void {
|
|
43
|
+
b.root.visible = false;
|
|
44
|
+
// Stop mixer, disable body, remove listeners; do not dispose shared geometry
|
|
45
|
+
pool.push(b);
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
On level restart: return all active pooled instances, then clean non-pooled level-specific resources.
|
|
50
|
+
|
|
51
|
+
## CPU and Throttling
|
|
52
|
+
|
|
53
|
+
- Movement / camera / mixer every frame; AI, pathfinding, and distant cleanup can run at 5-10Hz.
|
|
54
|
+
- Multiple `AnimationMixer` instances update only visible / nearby entities.
|
|
55
|
+
- DOM HUD is pushed by events/store; avoid forcing the whole React tree to rerender every frame.
|
|
56
|
+
|
|
57
|
+
## Physics Cost (Summary)
|
|
58
|
+
|
|
59
|
+
- Visual mesh != collider; use primitives / compounds.
|
|
60
|
+
- Offscreen or resting bodies can sleep; narrow sensors.
|
|
61
|
+
- Expose body / collider / CCD / sensor counts in diagnostics (see runtime hooks).
|
|
62
|
+
|
|
63
|
+
## Memory and Level Changes
|
|
64
|
+
|
|
65
|
+
- On level change, dispose: level-unique geometry, materials, textures, render targets, mixers, physics bodies.
|
|
66
|
+
- Common material libraries / shared atlases may remain.
|
|
67
|
+
- Audio resource cleanup is covered in `engine-audio.md`.
|
|
68
|
+
|
|
69
|
+
## Diagnostic Fields (Implementation Side)
|
|
70
|
+
|
|
71
|
+
Provide as much as possible in `__THREE_GAME_DIAGNOSTICS__`:
|
|
72
|
+
|
|
73
|
+
- `renderer.info`: `render.calls`, `triangles`, `memory.geometries`, `memory.textures`
|
|
74
|
+
- DPR, shadow/postprocessing toggle summary
|
|
75
|
+
- Entity count, pool size, active mixer count
|
|
76
|
+
- Physics (if any): engine, timestep, bodies, colliders, sensors, ccdBodies
|
|
77
|
+
|
|
78
|
+
## Quick Check Table
|
|
79
|
+
|
|
80
|
+
| Symptom | Common Cause | Handling |
|
|
81
|
+
| --- | --- | --- |
|
|
82
|
+
| Slower over time | Missing dispose / stacked subscriptions | Check restart and pool return |
|
|
83
|
+
| Periodic hitch | GC | Pooling, reduce `useFrame` allocation |
|
|
84
|
+
| Always low frame rate | draw call / triangles / DPR | Instancing, LOD, cap DPR, reduce shadow |
|
|
85
|
+
| Generation spike | Creating meshes on the spot | Pre-pool / preload |
|
|
86
|
+
| Physics stutter | Too many bodies/contacts | Simpler colliders, sleeping, fewer dynamic bodies |
|
|
87
|
+
| Sharp drop after import | Retopology / large textures | Reduce geometry, shrink textures (generation side + import checkup) |
|
|
88
|
+
|
|
89
|
+
## Engine Anti-Patterns
|
|
90
|
+
|
|
91
|
+
- Cutting art detail before measuring
|
|
92
|
+
- Using dev server FPS as release performance evidence
|
|
93
|
+
- Creating new geometry / material / `Audio` every frame
|
|
94
|
+
- Many unique meshes that could use `InstancedMesh`
|
|
95
|
+
- Detailed imported mesh as collider
|
|
96
|
+
- Not capping DPR on mobile
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
# Engine: Physics and Collision
|
|
2
|
+
|
|
3
|
+
Three.js / R3F **is only responsible for rendering**; physics is a parallel world. After advancing with a fixed timestep, synchronize body transforms to `Object3D` in one place.
|
|
4
|
+
|
|
5
|
+
Load this file when adding/replacing physics, vehicles, pinball, rigid bodies, sensors, or high-speed collisions. Gameplay-facing guidance can be compared with `../game-designer/references/physics-engine-selection.md`; **implementation is governed by this file + the layering in `file-structure.md`**.
|
|
6
|
+
|
|
7
|
+
## Selection Ladder
|
|
8
|
+
|
|
9
|
+
1. **Custom collision**: arcade triggers, pickups, lanes, bullets, simple overlaps, deterministic tracks; game feel is authored, not simulated.
|
|
10
|
+
2. **Rapier** (`@dimforge/rapier3d-compat`): the default for serious 3D physics - rigid bodies, sensors, multiple contacts, high speed, balls, slopes, moving platforms, reliable browser/mobile behavior.
|
|
11
|
+
3. **cannon-es**: small-scale rigid bodies, lightweight JS fallback when you want to avoid WASM.
|
|
12
|
+
4. **Jolt**: consider only when its features are explicitly needed and the integration cost is acceptable.
|
|
13
|
+
5. **Ammo.js**: only for existing projects or strong dependencies; do not default to it for new projects.
|
|
14
|
+
6. **Matter.js**: only for 2D gameplay (even if rendered with Three).
|
|
15
|
+
|
|
16
|
+
Most new 3D projects that need "real physics" choose Rapier.
|
|
17
|
+
|
|
18
|
+
## Quick Lookup by Type
|
|
19
|
+
|
|
20
|
+
| Use Custom | Use Rapier |
|
|
21
|
+
| --- | --- |
|
|
22
|
+
| Endless runners, lane dodging, simple shooting, pickup gates | Mini golf, billiards, pinball, pachinko, physics puzzles |
|
|
23
|
+
| Scripted obstacles, simple sphere/box overlap | Platforms, moving platforms, slopes, character controllers |
|
|
24
|
+
| Racing guardrails with authored feel | Debris piles, boxes, high-speed objects that need CCD |
|
|
25
|
+
| | Many sensors / collision events |
|
|
26
|
+
|
|
27
|
+
Avoid using detailed visual meshes for collision: use primitives, compound shapes, or convex hulls; only simplified triangle meshes should be considered for static level geometry. Generated GLB MUST have a separate **collision proxy**.
|
|
28
|
+
|
|
29
|
+
## Ownership in This Project
|
|
30
|
+
|
|
31
|
+
| Item | Location |
|
|
32
|
+
| --- | --- |
|
|
33
|
+
| World / body / collider creation and destruction | Physics module under `game/simulation`, or an explicit `PhysicsWorld` facade |
|
|
34
|
+
| Fixed-timestep `step` | Simulation update (called into simulation by `useFrame`) |
|
|
35
|
+
| Visual sync | The **only** place inside `useFrame`: body -> `Object3D` |
|
|
36
|
+
| Debug collider drawing | `game/three` or diagnostics layer; off in release |
|
|
37
|
+
|
|
38
|
+
Prohibited: calling `createRigidBody` inside render components; writing `mesh.position` in multiple places and competing with body ownership; leaving body residue after restart.
|
|
39
|
+
|
|
40
|
+
## Update Order (Including Physics)
|
|
41
|
+
|
|
42
|
+
```text
|
|
43
|
+
input intents -> fixed physics step -> game state / collision events -> VFX / camera / UI -> render
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Rapier Integration Pattern
|
|
47
|
+
|
|
48
|
+
Install (this repository's package manager is pnpm):
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
pnpm add @dimforge/rapier3d-compat
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Initialize once before starting gameplay:
|
|
55
|
+
|
|
56
|
+
```ts
|
|
57
|
+
import RAPIER from '@dimforge/rapier3d-compat';
|
|
58
|
+
|
|
59
|
+
await RAPIER.init();
|
|
60
|
+
const world = new RAPIER.World({ x: 0, y: -9.81, z: 0 });
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Fixed-timestep accumulator:
|
|
64
|
+
|
|
65
|
+
```ts
|
|
66
|
+
const fixedDt = 1 / 60;
|
|
67
|
+
let accumulator = 0;
|
|
68
|
+
|
|
69
|
+
function stepPhysics(deltaSeconds: number) {
|
|
70
|
+
accumulator += Math.min(deltaSeconds, 0.1);
|
|
71
|
+
while (accumulator >= fixedDt) {
|
|
72
|
+
world.timestep = fixedDt;
|
|
73
|
+
world.step();
|
|
74
|
+
accumulator -= fixedDt;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Rigid body + collider + sync:
|
|
80
|
+
|
|
81
|
+
```ts
|
|
82
|
+
const body = world.createRigidBody(
|
|
83
|
+
RAPIER.RigidBodyDesc.dynamic()
|
|
84
|
+
.setTranslation(0, 2, 0)
|
|
85
|
+
.setLinearDamping(0.25)
|
|
86
|
+
.setAngularDamping(0.5),
|
|
87
|
+
);
|
|
88
|
+
world.createCollider(
|
|
89
|
+
RAPIER.ColliderDesc.ball(0.5).setRestitution(0.6).setFriction(0.4),
|
|
90
|
+
body,
|
|
91
|
+
);
|
|
92
|
+
|
|
93
|
+
// The only sync point
|
|
94
|
+
const t = body.translation();
|
|
95
|
+
const r = body.rotation();
|
|
96
|
+
mesh.position.set(t.x, t.y, t.z);
|
|
97
|
+
mesh.quaternion.set(r.x, r.y, r.z, r.w);
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Enable CCD for high speed (has cost; only for bodies that need it):
|
|
101
|
+
|
|
102
|
+
```ts
|
|
103
|
+
RAPIER.RigidBodyDesc.dynamic().setCcdEnabled(true);
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Sensors / triggers:
|
|
107
|
+
|
|
108
|
+
```ts
|
|
109
|
+
RAPIER.ColliderDesc.ball(1)
|
|
110
|
+
.setSensor(true)
|
|
111
|
+
.setActiveEvents(RAPIER.ActiveEvents.COLLISION_EVENTS);
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
## Implementation Rules
|
|
115
|
+
|
|
116
|
+
- Moving platforms / scripted obstacles use **kinematic** bodies, and visual and physics move together.
|
|
117
|
+
- Pickups, finish lines, checkpoints, and damage zones use **sensor**.
|
|
118
|
+
- Character controllers prefer capsules, locked rotation, and kinematic movement (unless ragdoll is required).
|
|
119
|
+
- Arcade vehicles: do not rely only on a bare rigid body; combine control logic + collision response.
|
|
120
|
+
- Use sleeping, and remove/dispose bodies on restart to avoid stale simulation.
|
|
121
|
+
- Tuning units must match scene scale; explicitly set friction, restitution, damping, mass/density, gravity scale, and collision groups.
|
|
122
|
+
- Debug: body/collider counts, contact pairs, velocity; off in release builds.
|
|
123
|
+
|
|
124
|
+
## Verification (Physics Changes)
|
|
125
|
+
|
|
126
|
+
- `pnpm build` / type check
|
|
127
|
+
- Real input changes body state
|
|
128
|
+
- Collision / trigger paths work
|
|
129
|
+
- No body residue after restart
|
|
130
|
+
- High speed does not tunnel through geometry
|
|
131
|
+
- Simulation does not collapse under low-frame spikes
|
|
132
|
+
- Diagnostics record: engine, timestep, body/collider count, CCD, sensor, risky collider
|
|
133
|
+
|
|
134
|
+
## Common Failures
|
|
135
|
+
|
|
136
|
+
- Variable-timestep physics -> drifting feel
|
|
137
|
+
- Visual and physics sync in multiple places -> drift
|
|
138
|
+
- Body residue after restart
|
|
139
|
+
- Imported mesh used for collision -> slow and wrong
|
|
140
|
+
- High speed without CCD -> penetration
|
|
141
|
+
- Sensor active events not enabled
|
|
142
|
+
- Kinematic platform only moves the mesh and not physics
|