zhuda-laya-engine 0.0.0-stage → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +236 -0
- package/CHANGELOG.md +431 -0
- package/LICENSE +41 -0
- package/README.md +247 -2
- package/assets/branding/layaair-tribute-mark.svg +5 -0
- package/assets/branding/zhuda-layaair-mark.svg +34 -0
- package/assets/prefabs/CoinFountainVfx.lh +197 -0
- package/assets/prefabs/ConfirmActionButton.lh +87 -0
- package/assets/prefabs/LevelUpAuraVfx.lh +136 -0
- package/assets/prefabs/MineExplosionParticle.lh +352 -0
- package/assets/prefabs/NineSliceDialogFrame.lh +171 -0
- package/assets/prefabs/SwordSlashTrailVfx.lh +117 -0
- package/assets/prefabs/TacticalHudBar.lh +134 -0
- package/assets/prefabs/TelemetryDashboard.lh +87 -0
- package/assets/prefabs/UnityCrystalGuardian.lh +144 -0
- package/assets/prefabs/ZhudaSpine42Mascot.lh +183 -0
- package/assets/scenes/MinesweeperStage.ls +1180 -0
- package/dist/asset-calibration-report.json +969 -0
- package/dist/build-manifest.json +254 -0
- package/dist/sdk/zhuda-laya-csg.cjs +710 -0
- package/dist/sdk/zhuda-laya-csg.esm.js +683 -0
- package/dist/sdk/zhuda-laya-csg.min.cjs +7 -0
- package/dist/sdk/zhuda-laya-csg.min.esm.js +7 -0
- package/dist/sdk/zhuda-laya-demo.cjs +5990 -0
- package/dist/sdk/zhuda-laya-demo.esm.js +5956 -0
- package/dist/sdk/zhuda-laya-demo.min.cjs +12 -0
- package/dist/sdk/zhuda-laya-demo.min.esm.js +12 -0
- package/dist/sdk/zhuda-laya-engine.cjs +52628 -0
- package/dist/sdk/zhuda-laya-engine.esm.js +51848 -0
- package/dist/sdk/zhuda-laya-engine.min.cjs +2710 -0
- package/dist/sdk/zhuda-laya-engine.min.esm.js +2710 -0
- package/docs/3d-acceptance.md +47 -0
- package/docs/3d-integration.md +190 -0
- package/docs/README.md +112 -0
- package/docs/SUPPORT.md +21 -0
- package/docs/agent-development.md +219 -0
- package/docs/animation-control.md +213 -0
- package/docs/asset-loading.md +97 -0
- package/docs/assets/reference-games.jpg +0 -0
- package/docs/assets/solana-qr.png +0 -0
- package/docs/assets/sponsor-pass.svg +32 -0
- package/docs/audio.md +319 -0
- package/docs/backend-delivery.md +218 -0
- package/docs/basis-textures.md +94 -0
- package/docs/browser-sdk-releases.json +204 -0
- package/docs/browser-sdk.md +187 -0
- package/docs/cinematics.md +267 -0
- package/docs/cloth.md +280 -0
- package/docs/combat-runtime.md +82 -0
- package/docs/consumer-route.md +169 -0
- package/docs/consumer-tooling.md +518 -0
- package/docs/crowd-runtime.md +195 -0
- package/docs/developer-tooling.md +191 -0
- package/docs/film-scenes.md +1504 -0
- package/docs/filmic-rendering.md +743 -0
- package/docs/flythrough.md +89 -0
- package/docs/gpu-depth.md +207 -0
- package/docs/grass.md +127 -0
- package/docs/hdr-environment.md +76 -0
- package/docs/instanced-meshes.md +137 -0
- package/docs/layout-and-media.md +37 -0
- package/docs/layout-wireframe.md +80 -0
- package/docs/lighting-depth.md +185 -0
- package/docs/minigame-packaging.md +79 -0
- package/docs/model-editor.md +66 -0
- package/docs/model-lod.md +122 -0
- package/docs/model-pipeline.md +74 -0
- package/docs/model-showcase.md +365 -0
- package/docs/overview.md +183 -0
- package/docs/plans/README.md +133 -0
- package/docs/plans/TASK-TEMPLATE.md +64 -0
- package/docs/plans/TASK-spine38-isolated-topology-20261106.md +89 -0
- package/docs/plans/TEMPLATE.md +44 -0
- package/docs/plans/VERIFICATION-TEMPLATE.md +45 -0
- package/docs/plans/asset-packaging.md +140 -0
- package/docs/plans/cinematic-production/task.md +97 -0
- package/docs/plans/cinematic-production/verification.md +49 -0
- package/docs/plans/consumer-delivery-followups.md +129 -0
- package/docs/plans/desktop-and-agent-gates/hardening-task.md +85 -0
- package/docs/plans/desktop-and-agent-gates/hardening-verification.md +109 -0
- package/docs/plans/desktop-and-agent-gates/task.md +94 -0
- package/docs/plans/desktop-and-agent-gates/verification.md +60 -0
- package/docs/plans/prefab-toolchain.md +73 -0
- package/docs/plans/preview-runtime-hardening.md +68 -0
- package/docs/platform-adapters.md +113 -0
- package/docs/post-quality.md +242 -0
- package/docs/prefab-editor.md +194 -0
- package/docs/prefab-library.md +94 -0
- package/docs/prefab-workflow.md +75 -0
- package/docs/procedural-assets.md +463 -0
- package/docs/procedural-prefabs.md +133 -0
- package/docs/quality-route.md +386 -0
- package/docs/release-policy.md +79 -0
- package/docs/routes/README.md +180 -0
- package/docs/routes/TEMPLATE.md +54 -0
- package/docs/routes/action-adventure-3d-minigame.md +238 -0
- package/docs/routes/apocalypse-survival-3d.md +219 -0
- package/docs/routes/aqua-freeze-2d-minigame.md +183 -0
- package/docs/routes/astral-minimal-film-look.md +141 -0
- package/docs/routes/cascade-slot.md +93 -0
- package/docs/routes/clip-free-garments.md +229 -0
- package/docs/routes/drop-merge-2d-minigame.md +200 -0
- package/docs/routes/dungeon-line-slot.md +87 -0
- package/docs/routes/film-as-data.md +131 -0
- package/docs/routes/film-fight-that-lands.md +198 -0
- package/docs/routes/film-ink-lines.md +120 -0
- package/docs/routes/floating-island.md +229 -0
- package/docs/routes/game-2d.md +168 -0
- package/docs/routes/game-rules-first.md +89 -0
- package/docs/routes/game-to-prefabs.md +249 -0
- package/docs/routes/go-game-server.md +95 -0
- package/docs/routes/good-looking-3d-scene.md +99 -0
- package/docs/routes/high-quality-character.md +263 -0
- package/docs/routes/humanoid-from-shapes.md +97 -0
- package/docs/routes/hunting-action-3d.md +76 -0
- package/docs/routes/idle-gacha-2d.md +67 -0
- package/docs/routes/interactive-film-viewer.md +141 -0
- package/docs/routes/isometric-mystery-2d.md +217 -0
- package/docs/routes/key-art-to-animated-title.md +132 -0
- package/docs/routes/laya-ide-project-cli-web.md +125 -0
- package/docs/routes/layered-cloth-on-body.md +240 -0
- package/docs/routes/low-poly-character-from-shapes.md +475 -0
- package/docs/routes/match-three-2d.md +64 -0
- package/docs/routes/merge-2d.md +59 -0
- package/docs/routes/mini-game-build.md +80 -0
- package/docs/routes/mobile-always-landscape.md +149 -0
- package/docs/routes/mobile-web-fullscreen.md +255 -0
- package/docs/routes/model-from-dcc.md +106 -0
- package/docs/routes/new-game-project.md +100 -0
- package/docs/routes/onboarding-tutorial-2d.md +54 -0
- package/docs/routes/online-lockstep-match.md +473 -0
- package/docs/routes/outdoor-landscape.md +134 -0
- package/docs/routes/outfit-swap-3d.md +144 -0
- package/docs/routes/papercraft-diorama.md +186 -0
- package/docs/routes/platform-fighter-2d.md +235 -0
- package/docs/routes/platformer-2d.md +69 -0
- package/docs/routes/pole-rescue-arcade-3d.md +198 -0
- package/docs/routes/pose-atlas-motion.md +188 -0
- package/docs/routes/prototype-to-center.md +162 -0
- package/docs/routes/raft-brawl-3d-minigame.md +205 -0
- package/docs/routes/rhythm-2d.md +82 -0
- package/docs/routes/rigged-phone-character.md +120 -0
- package/docs/routes/screen-fit-game-box.md +127 -0
- package/docs/routes/shared-islands.md +195 -0
- package/docs/routes/side-view-duel.md +266 -0
- package/docs/routes/single-html-page.md +83 -0
- package/docs/routes/smooth-character-motion.md +162 -0
- package/docs/routes/spine-character.md +175 -0
- package/docs/routes/story-counting-2d.md +219 -0
- package/docs/routes/survivors-2d.md +60 -0
- package/docs/routes/third-person-town-3d.md +240 -0
- package/docs/routes/tower-defence-3d.md +67 -0
- package/docs/routes/ui-test-by-probe.md +219 -0
- package/docs/routes/underwater.md +138 -0
- package/docs/routes/visual-content-prefab.md +101 -0
- package/docs/runtime-hardening.md +108 -0
- package/docs/shader-warm-up.md +125 -0
- package/docs/spring-bones.md +79 -0
- package/docs/stylized-shading.md +171 -0
- package/docs/terrain-shader.md +130 -0
- package/docs/vrm.md +128 -0
- package/docs/walking.md +97 -0
- package/docs/webgpu.md +225 -0
- package/docs/white-label-themes.md +212 -0
- package/docs/zh-CN/README.md +130 -0
- package/examples/browser-sdk/2d-webgpu.html +46 -0
- package/examples/browser-sdk/2d.html +46 -0
- package/examples/browser-sdk/3d-gltf-webgpu.html +50 -0
- package/examples/browser-sdk/3d-gltf.html +50 -0
- package/examples/browser-sdk/3d-webgpu.html +46 -0
- package/examples/browser-sdk/3d.html +46 -0
- package/examples/cinematic-capture/Main.ts +294 -0
- package/examples/cinematic-capture/README.md +27 -0
- package/examples/model-inspector/README.md +15 -0
- package/examples/model-inspector/asset.gltf +158 -0
- package/examples/windows-webgpu/README.md +57 -0
- package/examples/windows-webgpu/bundle.mjs +122 -0
- package/examples/windows-webgpu/main.mjs +302 -0
- package/examples/windows-webgpu/package-lock.json +2353 -0
- package/examples/windows-webgpu/package.json +40 -0
- package/examples/windows-webgpu/squirrel.mjs +66 -0
- package/package.json +259 -4
- package/packages/ci-gate/export-film.mjs +347 -0
- package/packages/ci-gate/verify-sequence.mjs +285 -0
- package/packages/compiler/agent-contract.mjs +545 -0
- package/packages/compiler/ast-scanner.mjs +254 -0
- package/packages/compiler/backend-loader.mjs +62 -0
- package/packages/compiler/branding-assets.mjs +32 -0
- package/packages/compiler/branding.mjs +324 -0
- package/packages/compiler/browser-auto-example.mjs +31 -0
- package/packages/compiler/browser-model-example.mjs +53 -0
- package/packages/compiler/browser-process.mjs +344 -0
- package/packages/compiler/browser-sdk-example.mjs +50 -0
- package/packages/compiler/browser-sdk.mjs +342 -0
- package/packages/compiler/chrome-host.mjs +196 -0
- package/packages/compiler/cli.mjs +22 -0
- package/packages/compiler/compiler-runtime.mjs +41 -0
- package/packages/compiler/consumer-accept.mjs +89 -0
- package/packages/compiler/consumer-build.mjs +641 -0
- package/packages/compiler/consumer-guards.mjs +422 -0
- package/packages/compiler/consumer-publication.mjs +56 -0
- package/packages/compiler/consumer-scripts.mjs +134 -0
- package/packages/compiler/consumer-starter-2d.mjs +54 -0
- package/packages/compiler/consumer-starter-minigame.mjs +30 -0
- package/packages/compiler/editor-http.mjs +210 -0
- package/packages/compiler/editor-request.ts +12 -0
- package/packages/compiler/film-host-client.ts +249 -0
- package/packages/compiler/flythrough-file.mjs +144 -0
- package/packages/compiler/json-locate.mjs +85 -0
- package/packages/compiler/layout-contract.mjs +472 -0
- package/packages/compiler/minigame-bootstrap.mjs +24 -0
- package/packages/compiler/minigame-bridge.mjs +66 -0
- package/packages/compiler/minigame-guards.mjs +107 -0
- package/packages/compiler/minigame-toolchain.mjs +241 -0
- package/packages/compiler/model-crown.mjs +173 -0
- package/packages/compiler/model-editor-client.ts +809 -0
- package/packages/compiler/model-editor.mjs +242 -0
- package/packages/compiler/model-lod.mjs +547 -0
- package/packages/compiler/prefab-check.mjs +288 -0
- package/packages/compiler/prefab-checks.mjs +74 -0
- package/packages/compiler/prefab-dependencies.mjs +102 -0
- package/packages/compiler/prefab-editor-client.ts +950 -0
- package/packages/compiler/prefab-editor-preview.ts +89 -0
- package/packages/compiler/prefab-editor-server.mjs +585 -0
- package/packages/compiler/prefab-editor.mjs +43 -0
- package/packages/compiler/prefab-environment.mjs +107 -0
- package/packages/compiler/prefab-lifecycle.mjs +60 -0
- package/packages/compiler/prefab-preview.mjs +159 -0
- package/packages/compiler/prefab-watch.mjs +459 -0
- package/packages/compiler/runtime3d-types.mjs +91 -0
- package/packages/compiler/stage-probe.mjs +557 -0
- package/packages/compiler/visual-asset-audit.mjs +609 -0
- package/packages/compiler/visual-contract-audit.mjs +173 -0
- package/packages/compiler/webgpu-loader.mjs +153 -0
- package/packages/compiler/zhuda-build.mjs +714 -0
- package/packages/compiler/zhuda-doctor.mjs +186 -0
- package/packages/compiler/zhuda-init.mjs +353 -0
- package/packages/compiler/zhuda-layout.mjs +163 -0
- package/packages/compiler/zhuda-minigame.mjs +636 -0
- package/packages/core/BenchmarkEngine.ts +2 -0
- package/packages/core/BitmapFontContract.ts +159 -0
- package/packages/core/DeclarativeSDK.ts +686 -0
- package/packages/core/IframeSoundAdapter.ts +1824 -0
- package/packages/core/NoSleepAdapter.ts +302 -0
- package/packages/core/PixelCalibrationEngine.ts +602 -0
- package/packages/core/Prefab.ts +314 -0
- package/packages/core/RealmGuards.ts +111 -0
- package/packages/core/ResponsiveLayout.ts +149 -0
- package/packages/core/RuntimeGuards.ts +261 -0
- package/packages/core/SpineCharacter.ts +243 -0
- package/packages/core/SpineVisualContract.ts +238 -0
- package/packages/core/SplashSignal.ts +72 -0
- package/packages/core/StaticAssetPipeline.ts +3 -0
- package/packages/core/TopologyGraph.ts +693 -0
- package/packages/core/UnityBridgePipeline.ts +2 -0
- package/packages/core/VideoSurface.ts +75 -0
- package/packages/core/ViewportMatrixEngine.ts +237 -0
- package/packages/core/VisualFocusContract.ts +76 -0
- package/packages/core/VisualMigrationPipeline.ts +245 -0
- package/packages/core/WebViewSurface.ts +116 -0
- package/packages/core/audio/OfflineMix.ts +186 -0
- package/packages/core/audio/Spatial.ts +312 -0
- package/packages/core/audio/StreamVoice.ts +161 -0
- package/packages/core/csg/Bsp.ts +310 -0
- package/packages/core/csg/index.ts +589 -0
- package/packages/core/effects/Effect2D.ts +286 -0
- package/packages/core/effects/Effect3D.ts +213 -0
- package/packages/core/effects/EffectBudget.ts +695 -0
- package/packages/core/effects/EffectDirector.ts +254 -0
- package/packages/core/effects/EffectPresets.ts +843 -0
- package/packages/core/effects/EffectPresets2D.ts +1011 -0
- package/packages/core/effects/EffectSprites.ts +143 -0
- package/packages/core/effects/ParticleEventLink.ts +53 -0
- package/packages/core/effects/README.md +108 -0
- package/packages/core/effects/VfxMaterial.ts +253 -0
- package/packages/core/film/BakeKey.ts +21 -0
- package/packages/core/film/ColorValues.ts +44 -0
- package/packages/core/film/FilmLint.ts +353 -0
- package/packages/core/film/FilmPrefab.ts +82 -0
- package/packages/core/film/FilmReview.ts +84 -0
- package/packages/core/film/FilmScene.ts +3442 -0
- package/packages/core/film/FilmStage.ts +2148 -0
- package/packages/core/film/Flythrough.ts +169 -0
- package/packages/core/film/FlythroughReport.ts +326 -0
- package/packages/core/film/FrameMetrics.ts +167 -0
- package/packages/core/film/LiveLook.ts +242 -0
- package/packages/core/film/LookQuality.ts +94 -0
- package/packages/core/film/Projection.ts +74 -0
- package/packages/core/film/SceneLook.ts +363 -0
- package/packages/core/film/index.ts +12 -0
- package/packages/core/index.ts +48 -0
- package/packages/core/particles/EffectEnvelope.ts +52 -0
- package/packages/core/particles/LayaParticleRenderer.ts +182 -0
- package/packages/core/particles/LayaParticleRenderer3D.ts +218 -0
- package/packages/core/particles/ParticleExtras.ts +163 -0
- package/packages/core/particles/ParticleMesh3D.ts +156 -0
- package/packages/core/particles/ParticleSystem.ts +324 -0
- package/packages/core/particles/ParticleSystem3D.ts +411 -0
- package/packages/core/particles/ParticleTypes.ts +230 -0
- package/packages/core/particles/ParticleTypes3D.ts +115 -0
- package/packages/core/particles/README.md +181 -0
- package/packages/core/particles/RibbonPath3D.ts +234 -0
- package/packages/core/particles/RibbonTrail.ts +145 -0
- package/packages/core/particles/RibbonTrail3D.ts +166 -0
- package/packages/core/particles/index.ts +12 -0
- package/packages/core/prefabs/PrefabLibrary.ts +692 -0
- package/packages/core/prefabs/PrefabTree3D.ts +291 -0
- package/packages/core/prefabs/index.ts +10 -0
- package/packages/core/procedural/Geometry.ts +1871 -0
- package/packages/core/procedural/Hand.ts +1510 -0
- package/packages/core/procedural/Isosurface.ts +1035 -0
- package/packages/core/procedural/ModuleHarness.ts +180 -0
- package/packages/core/procedural/Noise.ts +123 -0
- package/packages/core/procedural/PhotoMaterial.ts +283 -0
- package/packages/core/procedural/ProceduralAssetProvider.ts +105 -0
- package/packages/core/procedural/ProceduralMaterial.ts +184 -0
- package/packages/core/procedural/PropFactory.ts +307 -0
- package/packages/core/procedural/Random.ts +70 -0
- package/packages/core/procedural/SynthAudio.ts +221 -0
- package/packages/core/procedural/TerrainMesh.ts +207 -0
- package/packages/core/procedural/TextureRecipe.ts +464 -0
- package/packages/core/procedural/TriplanarMaterial.ts +169 -0
- package/packages/core/procedural/Variation.ts +94 -0
- package/packages/core/procedural/index.ts +15 -0
- package/packages/core/runtime3d/ActionFrames.ts +245 -0
- package/packages/core/runtime3d/AnimationBlend.ts +282 -0
- package/packages/core/runtime3d/AnimationBlendMath.ts +98 -0
- package/packages/core/runtime3d/AssetProvider.ts +775 -0
- package/packages/core/runtime3d/AssetShowcase.ts +190 -0
- package/packages/core/runtime3d/Assets.ts +801 -0
- package/packages/core/runtime3d/AsyncDeadline.ts +53 -0
- package/packages/core/runtime3d/AsyncOperation.ts +39 -0
- package/packages/core/runtime3d/BackendChoice.ts +359 -0
- package/packages/core/runtime3d/BakedCrowd.ts +575 -0
- package/packages/core/runtime3d/BasisTexture.ts +657 -0
- package/packages/core/runtime3d/CameraCollision.ts +69 -0
- package/packages/core/runtime3d/CameraEffects.ts +752 -0
- package/packages/core/runtime3d/CameraRig.ts +70 -0
- package/packages/core/runtime3d/CharacterController.ts +272 -0
- package/packages/core/runtime3d/CinematicCapture.ts +457 -0
- package/packages/core/runtime3d/Clocks.ts +724 -0
- package/packages/core/runtime3d/Cloth.ts +183 -0
- package/packages/core/runtime3d/Clouds.ts +462 -0
- package/packages/core/runtime3d/ColorLut.ts +351 -0
- package/packages/core/runtime3d/CombatQueries.ts +240 -0
- package/packages/core/runtime3d/ComputePass.ts +582 -0
- package/packages/core/runtime3d/CrowdPresentation.ts +368 -0
- package/packages/core/runtime3d/DebugDraw.ts +567 -0
- package/packages/core/runtime3d/DebugStats.ts +35 -0
- package/packages/core/runtime3d/Decals.ts +309 -0
- package/packages/core/runtime3d/DensityVolume.ts +238 -0
- package/packages/core/runtime3d/DistanceBricks.ts +349 -0
- package/packages/core/runtime3d/Dither.ts +199 -0
- package/packages/core/runtime3d/DrawWarmUp.ts +217 -0
- package/packages/core/runtime3d/EdgeSmoothing.ts +108 -0
- package/packages/core/runtime3d/EnvironmentProbe.ts +656 -0
- package/packages/core/runtime3d/Filmic.ts +973 -0
- package/packages/core/runtime3d/Foliage.ts +367 -0
- package/packages/core/runtime3d/GltfIntake.ts +914 -0
- package/packages/core/runtime3d/GltfSecondUv.ts +153 -0
- package/packages/core/runtime3d/GraphicsGuard.ts +171 -0
- package/packages/core/runtime3d/Grass.ts +1080 -0
- package/packages/core/runtime3d/GroundTruthAO.ts +360 -0
- package/packages/core/runtime3d/HalfFloat.ts +44 -0
- package/packages/core/runtime3d/HdrEnvironment.ts +588 -0
- package/packages/core/runtime3d/Ik.ts +392 -0
- package/packages/core/runtime3d/InputBuffer.ts +165 -0
- package/packages/core/runtime3d/InstancedMesh.ts +460 -0
- package/packages/core/runtime3d/Laya342Adapters.ts +1095 -0
- package/packages/core/runtime3d/Laya342GltfAdapter.ts +751 -0
- package/packages/core/runtime3d/LensFinish.ts +153 -0
- package/packages/core/runtime3d/LensFlare.ts +490 -0
- package/packages/core/runtime3d/LightFog.ts +1008 -0
- package/packages/core/runtime3d/LightingDepth.ts +544 -0
- package/packages/core/runtime3d/Lightmap.ts +238 -0
- package/packages/core/runtime3d/Math3D.ts +84 -0
- package/packages/core/runtime3d/MeshQuery.ts +547 -0
- package/packages/core/runtime3d/MeshoptModelDecoder.ts +354 -0
- package/packages/core/runtime3d/MiniGameSplash.ts +70 -0
- package/packages/core/runtime3d/ModelAnimationSampler.ts +97 -0
- package/packages/core/runtime3d/ModelCompatibility.ts +890 -0
- package/packages/core/runtime3d/ModelDecoder.ts +294 -0
- package/packages/core/runtime3d/ModelInspector.ts +226 -0
- package/packages/core/runtime3d/ModelLod.ts +163 -0
- package/packages/core/runtime3d/ModelPlacements.ts +426 -0
- package/packages/core/runtime3d/ObjectMotion.ts +217 -0
- package/packages/core/runtime3d/PhysicalCamera.ts +190 -0
- package/packages/core/runtime3d/PointShadow.ts +500 -0
- package/packages/core/runtime3d/PointShadowSchedule.ts +201 -0
- package/packages/core/runtime3d/Pool.ts +120 -0
- package/packages/core/runtime3d/ProbeVolume.ts +695 -0
- package/packages/core/runtime3d/QualityGovernor.ts +385 -0
- package/packages/core/runtime3d/QualityMemory.ts +200 -0
- package/packages/core/runtime3d/RenderScale.ts +356 -0
- package/packages/core/runtime3d/RenderSpaces.ts +105 -0
- package/packages/core/runtime3d/Renderer.ts +377 -0
- package/packages/core/runtime3d/ResultPlayback.ts +239 -0
- package/packages/core/runtime3d/Runtime.ts +507 -0
- package/packages/core/runtime3d/RuntimeDriver.ts +127 -0
- package/packages/core/runtime3d/SceneLifecycle.ts +211 -0
- package/packages/core/runtime3d/SceneMutation.ts +107 -0
- package/packages/core/runtime3d/SceneQueries.ts +191 -0
- package/packages/core/runtime3d/ScreenReflections.ts +595 -0
- package/packages/core/runtime3d/SelectionOutline.ts +389 -0
- package/packages/core/runtime3d/ShaderErrors.ts +104 -0
- package/packages/core/runtime3d/ShaderRegistry.ts +34 -0
- package/packages/core/runtime3d/ShaderWarmUp.ts +473 -0
- package/packages/core/runtime3d/ShadowUpdates.ts +287 -0
- package/packages/core/runtime3d/SkinBinding.ts +235 -0
- package/packages/core/runtime3d/Smaa.ts +386 -0
- package/packages/core/runtime3d/SmaaTables.ts +244 -0
- package/packages/core/runtime3d/SpringBones.ts +184 -0
- package/packages/core/runtime3d/SurfaceBuffer.ts +76 -0
- package/packages/core/runtime3d/Surfaces.ts +1105 -0
- package/packages/core/runtime3d/Themes.ts +344 -0
- package/packages/core/runtime3d/Timeline.ts +362 -0
- package/packages/core/runtime3d/ToneCurves.ts +292 -0
- package/packages/core/runtime3d/TransformGizmo.ts +539 -0
- package/packages/core/runtime3d/TriangleMask.ts +250 -0
- package/packages/core/runtime3d/Underwater.ts +778 -0
- package/packages/core/runtime3d/Utf8.ts +87 -0
- package/packages/core/runtime3d/Vrm.ts +773 -0
- package/packages/core/runtime3d/VrmDocument.ts +1830 -0
- package/packages/core/runtime3d/WalkGrid.ts +471 -0
- package/packages/core/runtime3d/WebGPU342Adapters.ts +280 -0
- package/packages/core/runtime3d/index.ts +147 -0
- package/packages/core/shaders/Laya342ShaderTemplates.ts +6 -0
- package/packages/core/shaders/LitSurfaceMaterial.ts +1076 -0
- package/packages/core/shaders/LitSurfaceTemplates.ts +13 -0
- package/packages/core/shaders/ReflectiveSurface.ts +285 -0
- package/packages/core/shaders/ShaderMaterials.ts +387 -0
- package/packages/core/shaders/ToonMaterial.ts +559 -0
- package/packages/core/shaders/WaterRipples.ts +170 -0
- package/packages/core/shaders/WaterSurface.ts +480 -0
- package/packages/core/shaders/ZhudaCommon.ts +109 -0
- package/packages/core/shaders/index.ts +6 -0
- package/packages/core/simulation/Cloth.ts +1541 -0
- package/packages/core/simulation/ParticleCore.ts +498 -0
- package/packages/core/simulation/SpringBones.ts +553 -0
- package/packages/core/simulation/index.ts +3 -0
- package/packages/core/terrain/Heightfield.ts +385 -0
- package/packages/core/terrain/Terrain2D.ts +324 -0
- package/packages/core/terrain/Terrain3D.ts +452 -0
- package/packages/core/terrain/TerrainShell.ts +94 -0
- package/packages/core/terrain/index.ts +3 -0
- package/packages/demo/BenchmarkEngine.ts +184 -0
- package/packages/demo/PixelCalibrationEngine.ts +36 -0
- package/packages/demo/ProceduralStarter.ts +312 -0
- package/packages/demo/StaticAssetPipeline.ts +1631 -0
- package/packages/demo/UnityBridgePipeline.ts +485 -0
- package/packages/demo/index.ts +6 -0
- package/packages/mcp-server/arguments.mjs +81 -0
- package/packages/mcp-server/corpus.mjs +627 -0
- package/packages/mcp-server/film-host.mjs +627 -0
- package/packages/mcp-server/film-session.mjs +95 -0
- package/packages/mcp-server/film-tools.mjs +460 -0
- package/packages/mcp-server/index.mjs +931 -0
- package/packages/mcp-server/quality-route.mjs +332 -0
- package/packages/mcp-server/roots.mjs +72 -0
- package/packages/mcp-server/runtime.mjs +81 -0
- package/packages/types/BitmapFontContract.d.ts +19 -0
- package/packages/types/DeclarativeSDK.d.ts +137 -0
- package/packages/types/IframeSoundAdapter.d.ts +173 -0
- package/packages/types/NoSleepAdapter.d.ts +50 -0
- package/packages/types/PixelCalibrationEngine.d.ts +83 -0
- package/packages/types/Prefab.d.ts +11 -0
- package/packages/types/RealmGuards.d.ts +26 -0
- package/packages/types/ResponsiveLayout.d.ts +10 -0
- package/packages/types/RuntimeGuards.d.ts +55 -0
- package/packages/types/SpineCharacter.d.ts +94 -0
- package/packages/types/SpineVisualContract.d.ts +50 -0
- package/packages/types/SplashSignal.d.ts +27 -0
- package/packages/types/TopologyGraph.d.ts +76 -0
- package/packages/types/VideoSurface.d.ts +21 -0
- package/packages/types/ViewportMatrixEngine.d.ts +27 -0
- package/packages/types/VisualFocusContract.d.ts +32 -0
- package/packages/types/VisualMigrationPipeline.d.ts +53 -0
- package/packages/types/WebViewSurface.d.ts +26 -0
- package/packages/types/audio/OfflineMix.d.ts +10 -0
- package/packages/types/audio/Spatial.d.ts +63 -0
- package/packages/types/audio/StreamVoice.d.ts +31 -0
- package/packages/types/browser.d.ts +44 -0
- package/packages/types/csg/Bsp.d.ts +85 -0
- package/packages/types/csg/index.d.ts +81 -0
- package/packages/types/demo/BenchmarkEngine.d.ts +61 -0
- package/packages/types/demo/PixelCalibrationEngine.d.ts +13 -0
- package/packages/types/demo/ProceduralStarter.d.ts +11 -0
- package/packages/types/demo/StaticAssetPipeline.d.ts +87 -0
- package/packages/types/demo/UnityBridgePipeline.d.ts +49 -0
- package/packages/types/demo/index.d.ts +7 -0
- package/packages/types/editor-preview.d.ts +27 -0
- package/packages/types/effects/Effect2D.d.ts +65 -0
- package/packages/types/effects/Effect3D.d.ts +42 -0
- package/packages/types/effects/EffectBudget.d.ts +179 -0
- package/packages/types/effects/EffectDirector.d.ts +68 -0
- package/packages/types/effects/EffectPresets.d.ts +27 -0
- package/packages/types/effects/EffectPresets2D.d.ts +32 -0
- package/packages/types/effects/EffectSprites.d.ts +23 -0
- package/packages/types/effects/ParticleEventLink.d.ts +16 -0
- package/packages/types/effects/VfxMaterial.d.ts +52 -0
- package/packages/types/film/BakeKey.d.ts +9 -0
- package/packages/types/film/ColorValues.d.ts +25 -0
- package/packages/types/film/FilmLint.d.ts +40 -0
- package/packages/types/film/FilmPrefab.d.ts +22 -0
- package/packages/types/film/FilmReview.d.ts +27 -0
- package/packages/types/film/FilmScene.d.ts +1214 -0
- package/packages/types/film/FilmStage.d.ts +237 -0
- package/packages/types/film/Flythrough.d.ts +44 -0
- package/packages/types/film/FlythroughReport.d.ts +132 -0
- package/packages/types/film/FrameMetrics.d.ts +49 -0
- package/packages/types/film/LiveLook.d.ts +60 -0
- package/packages/types/film/LookQuality.d.ts +24 -0
- package/packages/types/film/Projection.d.ts +20 -0
- package/packages/types/film/SceneLook.d.ts +122 -0
- package/packages/types/film/index.d.ts +13 -0
- package/packages/types/index.d.ts +49 -0
- package/packages/types/particles/EffectEnvelope.d.ts +18 -0
- package/packages/types/particles/LayaParticleRenderer.d.ts +30 -0
- package/packages/types/particles/LayaParticleRenderer3D.d.ts +29 -0
- package/packages/types/particles/ParticleExtras.d.ts +50 -0
- package/packages/types/particles/ParticleMesh3D.d.ts +24 -0
- package/packages/types/particles/ParticleSystem.d.ts +52 -0
- package/packages/types/particles/ParticleSystem3D.d.ts +69 -0
- package/packages/types/particles/ParticleTypes.d.ts +89 -0
- package/packages/types/particles/ParticleTypes3D.d.ts +56 -0
- package/packages/types/particles/RibbonPath3D.d.ts +32 -0
- package/packages/types/particles/RibbonTrail.d.ts +38 -0
- package/packages/types/particles/RibbonTrail3D.d.ts +22 -0
- package/packages/types/particles/index.d.ts +13 -0
- package/packages/types/prefabs/PrefabLibrary.d.ts +176 -0
- package/packages/types/prefabs/PrefabTree3D.d.ts +59 -0
- package/packages/types/prefabs/index.d.ts +4 -0
- package/packages/types/procedural/Geometry.d.ts +252 -0
- package/packages/types/procedural/Hand.d.ts +150 -0
- package/packages/types/procedural/Isosurface.d.ts +181 -0
- package/packages/types/procedural/ModuleHarness.d.ts +90 -0
- package/packages/types/procedural/Noise.d.ts +15 -0
- package/packages/types/procedural/PhotoMaterial.d.ts +49 -0
- package/packages/types/procedural/ProceduralAssetProvider.d.ts +31 -0
- package/packages/types/procedural/ProceduralMaterial.d.ts +63 -0
- package/packages/types/procedural/PropFactory.d.ts +94 -0
- package/packages/types/procedural/Random.d.ts +26 -0
- package/packages/types/procedural/SynthAudio.d.ts +49 -0
- package/packages/types/procedural/TerrainMesh.d.ts +55 -0
- package/packages/types/procedural/TextureRecipe.d.ts +125 -0
- package/packages/types/procedural/TriplanarMaterial.d.ts +27 -0
- package/packages/types/procedural/Variation.d.ts +23 -0
- package/packages/types/procedural/index.d.ts +16 -0
- package/packages/types/runtime3d/ActionFrames.d.ts +62 -0
- package/packages/types/runtime3d/AnimationBlend.d.ts +57 -0
- package/packages/types/runtime3d/AnimationBlendMath.d.ts +27 -0
- package/packages/types/runtime3d/AssetProvider.d.ts +167 -0
- package/packages/types/runtime3d/AssetShowcase.d.ts +44 -0
- package/packages/types/runtime3d/Assets.d.ts +166 -0
- package/packages/types/runtime3d/AsyncDeadline.d.ts +6 -0
- package/packages/types/runtime3d/AsyncOperation.d.ts +3 -0
- package/packages/types/runtime3d/BackendChoice.d.ts +130 -0
- package/packages/types/runtime3d/BakedCrowd.d.ts +156 -0
- package/packages/types/runtime3d/BasisTexture.d.ts +169 -0
- package/packages/types/runtime3d/CameraCollision.d.ts +20 -0
- package/packages/types/runtime3d/CameraEffects.d.ts +134 -0
- package/packages/types/runtime3d/CameraRig.d.ts +27 -0
- package/packages/types/runtime3d/CharacterController.d.ts +71 -0
- package/packages/types/runtime3d/CinematicCapture.d.ts +103 -0
- package/packages/types/runtime3d/Clocks.d.ts +200 -0
- package/packages/types/runtime3d/Cloth.d.ts +57 -0
- package/packages/types/runtime3d/Clouds.d.ts +69 -0
- package/packages/types/runtime3d/ColorLut.d.ts +73 -0
- package/packages/types/runtime3d/CombatQueries.d.ts +50 -0
- package/packages/types/runtime3d/ComputePass.d.ts +134 -0
- package/packages/types/runtime3d/CrowdPresentation.d.ts +104 -0
- package/packages/types/runtime3d/DebugDraw.d.ts +161 -0
- package/packages/types/runtime3d/DebugStats.d.ts +24 -0
- package/packages/types/runtime3d/Decals.d.ts +65 -0
- package/packages/types/runtime3d/DensityVolume.d.ts +39 -0
- package/packages/types/runtime3d/DistanceBricks.d.ts +97 -0
- package/packages/types/runtime3d/Dither.d.ts +78 -0
- package/packages/types/runtime3d/DrawWarmUp.d.ts +93 -0
- package/packages/types/runtime3d/EdgeSmoothing.d.ts +10 -0
- package/packages/types/runtime3d/EnvironmentProbe.d.ts +139 -0
- package/packages/types/runtime3d/Filmic.d.ts +243 -0
- package/packages/types/runtime3d/Foliage.d.ts +95 -0
- package/packages/types/runtime3d/GltfIntake.d.ts +236 -0
- package/packages/types/runtime3d/GltfSecondUv.d.ts +54 -0
- package/packages/types/runtime3d/GraphicsGuard.d.ts +18 -0
- package/packages/types/runtime3d/Grass.d.ts +226 -0
- package/packages/types/runtime3d/GroundTruthAO.d.ts +64 -0
- package/packages/types/runtime3d/HalfFloat.d.ts +13 -0
- package/packages/types/runtime3d/HdrEnvironment.d.ts +144 -0
- package/packages/types/runtime3d/Ik.d.ts +123 -0
- package/packages/types/runtime3d/InputBuffer.d.ts +49 -0
- package/packages/types/runtime3d/InstancedMesh.d.ts +116 -0
- package/packages/types/runtime3d/Laya342Adapters.d.ts +306 -0
- package/packages/types/runtime3d/Laya342GltfAdapter.d.ts +105 -0
- package/packages/types/runtime3d/LensFinish.d.ts +38 -0
- package/packages/types/runtime3d/LensFlare.d.ts +114 -0
- package/packages/types/runtime3d/LightFog.d.ts +190 -0
- package/packages/types/runtime3d/LightingDepth.d.ts +128 -0
- package/packages/types/runtime3d/Lightmap.d.ts +55 -0
- package/packages/types/runtime3d/Math3D.d.ts +19 -0
- package/packages/types/runtime3d/MeshQuery.d.ts +107 -0
- package/packages/types/runtime3d/MeshoptModelDecoder.d.ts +34 -0
- package/packages/types/runtime3d/MiniGameSplash.d.ts +4 -0
- package/packages/types/runtime3d/ModelAnimationSampler.d.ts +26 -0
- package/packages/types/runtime3d/ModelCompatibility.d.ts +169 -0
- package/packages/types/runtime3d/ModelDecoder.d.ts +66 -0
- package/packages/types/runtime3d/ModelInspector.d.ts +77 -0
- package/packages/types/runtime3d/ModelLod.d.ts +61 -0
- package/packages/types/runtime3d/ModelPlacements.d.ts +77 -0
- package/packages/types/runtime3d/ObjectMotion.d.ts +43 -0
- package/packages/types/runtime3d/PhysicalCamera.d.ts +51 -0
- package/packages/types/runtime3d/PointShadow.d.ts +71 -0
- package/packages/types/runtime3d/PointShadowSchedule.d.ts +74 -0
- package/packages/types/runtime3d/Pool.d.ts +33 -0
- package/packages/types/runtime3d/ProbeVolume.d.ts +123 -0
- package/packages/types/runtime3d/QualityGovernor.d.ts +201 -0
- package/packages/types/runtime3d/QualityMemory.d.ts +83 -0
- package/packages/types/runtime3d/RenderScale.d.ts +69 -0
- package/packages/types/runtime3d/RenderSpaces.d.ts +44 -0
- package/packages/types/runtime3d/Renderer.d.ts +62 -0
- package/packages/types/runtime3d/ResultPlayback.d.ts +70 -0
- package/packages/types/runtime3d/Runtime.d.ts +136 -0
- package/packages/types/runtime3d/RuntimeDriver.d.ts +42 -0
- package/packages/types/runtime3d/SceneLifecycle.d.ts +84 -0
- package/packages/types/runtime3d/SceneMutation.d.ts +34 -0
- package/packages/types/runtime3d/SceneQueries.d.ts +71 -0
- package/packages/types/runtime3d/ScreenReflections.d.ts +78 -0
- package/packages/types/runtime3d/SelectionOutline.d.ts +68 -0
- package/packages/types/runtime3d/ShaderErrors.d.ts +27 -0
- package/packages/types/runtime3d/ShaderRegistry.d.ts +10 -0
- package/packages/types/runtime3d/ShaderWarmUp.d.ts +162 -0
- package/packages/types/runtime3d/ShadowUpdates.d.ts +125 -0
- package/packages/types/runtime3d/SkinBinding.d.ts +53 -0
- package/packages/types/runtime3d/Smaa.d.ts +60 -0
- package/packages/types/runtime3d/SmaaTables.d.ts +12 -0
- package/packages/types/runtime3d/SpringBones.d.ts +69 -0
- package/packages/types/runtime3d/SurfaceBuffer.d.ts +28 -0
- package/packages/types/runtime3d/Surfaces.d.ts +326 -0
- package/packages/types/runtime3d/Themes.d.ts +70 -0
- package/packages/types/runtime3d/Timeline.d.ts +88 -0
- package/packages/types/runtime3d/ToneCurves.d.ts +59 -0
- package/packages/types/runtime3d/TransformGizmo.d.ts +139 -0
- package/packages/types/runtime3d/TriangleMask.d.ts +84 -0
- package/packages/types/runtime3d/Underwater.d.ts +120 -0
- package/packages/types/runtime3d/Utf8.d.ts +12 -0
- package/packages/types/runtime3d/Vrm.d.ts +120 -0
- package/packages/types/runtime3d/VrmDocument.d.ts +381 -0
- package/packages/types/runtime3d/WalkGrid.d.ts +94 -0
- package/packages/types/runtime3d/WebGPU342Adapters.d.ts +27 -0
- package/packages/types/runtime3d/index.d.ts +102 -0
- package/packages/types/shaders/Laya342ShaderTemplates.d.ts +3 -0
- package/packages/types/shaders/LitSurfaceMaterial.d.ts +257 -0
- package/packages/types/shaders/LitSurfaceTemplates.d.ts +7 -0
- package/packages/types/shaders/ReflectiveSurface.d.ts +58 -0
- package/packages/types/shaders/ShaderMaterials.d.ts +60 -0
- package/packages/types/shaders/ToonMaterial.d.ts +176 -0
- package/packages/types/shaders/WaterRipples.d.ts +48 -0
- package/packages/types/shaders/WaterSurface.d.ts +110 -0
- package/packages/types/shaders/ZhudaCommon.d.ts +31 -0
- package/packages/types/shaders/index.d.ts +7 -0
- package/packages/types/simulation/Cloth.d.ts +381 -0
- package/packages/types/simulation/ParticleCore.d.ts +125 -0
- package/packages/types/simulation/SpringBones.d.ts +107 -0
- package/packages/types/simulation/index.d.ts +4 -0
- package/packages/types/terrain/Heightfield.d.ts +67 -0
- package/packages/types/terrain/Terrain2D.d.ts +81 -0
- package/packages/types/terrain/Terrain3D.d.ts +80 -0
- package/packages/types/terrain/TerrainShell.d.ts +8 -0
- package/packages/types/terrain/index.d.ts +4 -0
- package/packages/types/vendor/LayaAir.runtime.d.ts +97440 -0
- package/packages/types/vendor/REPAIRS.md +30 -0
- package/packages/types/vendor/restored-3.4.2.json +142 -0
- package/packages/types/vendor/spine.runtime.d.ts +1507 -0
- package/packages/types/vendor/wechat-media.d.ts +877 -0
- package/packages/types/zhuda-2d-ui.d.ts +244 -0
- package/packages/types/zhuda-3d-physics.d.ts +34 -0
- package/packages/types/zhuda-audio.d.ts +128 -0
- package/packages/types/zhuda-bootstrap.d.ts +100 -0
- package/packages/types/zhuda-branding.d.ts +6 -0
- package/packages/types/zhuda-core.d.ts +46 -0
- package/packages/types/zhuda-declarative.d.ts +81 -0
- package/packages/types/zhuda-effects.d.ts +302 -0
- package/packages/types/zhuda-layout.d.ts +96 -0
- package/packages/types/zhuda-particles.d.ts +477 -0
- package/packages/types/zhuda-spine42.d.ts +23 -0
- package/packages/types/zhuda-static-assets.d.ts +389 -0
- package/packages/types/zhuda-video.d.ts +24 -0
- package/packages/types/zhuda-visual-contract.d.ts +52 -0
- package/packages/types/zhuda-webview.d.ts +43 -0
- package/vendor/basis/LICENSE.txt +55 -0
- package/vendor/basis/README.md +25 -0
- package/vendor/basis/basis_transcoder.js +19 -0
- package/vendor/basis/basis_transcoder.wasm +0 -0
- package/vendor/laya-3.4.2/WEBGPU-LICENSES.txt +1259 -0
- package/vendor/laya-3.4.2/libs/laya.ani.js +1 -0
- package/vendor/laya-3.4.2/libs/laya.box2D.js +1209 -0
- package/vendor/laya-3.4.2/libs/laya.bridge.js +2273 -0
- package/vendor/laya-3.4.2/libs/laya.bullet.js +1 -0
- package/vendor/laya-3.4.2/libs/laya.core.js +1 -0
- package/vendor/laya-3.4.2/libs/laya.d3.js +1 -0
- package/vendor/laya-3.4.2/libs/laya.device.js +1 -0
- package/vendor/laya-3.4.2/libs/laya.gltf.js +1 -0
- package/vendor/laya-3.4.2/libs/laya.ik.js +1 -0
- package/vendor/laya-3.4.2/libs/laya.light2D.js +1 -0
- package/vendor/laya-3.4.2/libs/laya.line2D.js +1 -0
- package/vendor/laya-3.4.2/libs/laya.native-spine42.js +7672 -0
- package/vendor/laya-3.4.2/libs/laya.navMesh2d.js +1 -0
- package/vendor/laya-3.4.2/libs/laya.navMesh3d.js +1 -0
- package/vendor/laya-3.4.2/libs/laya.navMeshCommon.js +1 -0
- package/vendor/laya-3.4.2/libs/laya.particle.js +1 -0
- package/vendor/laya-3.4.2/libs/laya.particle3D.js +1 -0
- package/vendor/laya-3.4.2/libs/laya.particleCommon.js +1 -0
- package/vendor/laya-3.4.2/libs/laya.physics2D.js +3774 -0
- package/vendor/laya-3.4.2/libs/laya.physics3D.js +1 -0
- package/vendor/laya-3.4.2/libs/laya.postProcess.js +1 -0
- package/vendor/laya-3.4.2/libs/laya.spine.js +1 -0
- package/vendor/laya-3.4.2/libs/laya.spine3D.js +1 -0
- package/vendor/laya-3.4.2/libs/laya.tilemap.js +1 -0
- package/vendor/laya-3.4.2/libs/laya.trail2D.js +1 -0
- package/vendor/laya-3.4.2/libs/laya.trail3D.js +1 -0
- package/vendor/laya-3.4.2/libs/laya.trailCommon.js +1 -0
- package/vendor/laya-3.4.2/libs/laya.ui.js +1 -0
- package/vendor/laya-3.4.2/libs/laya.ui2.js +9904 -0
- package/vendor/laya-3.4.2/libs/laya.vfx.js +6754 -0
- package/vendor/laya-3.4.2/libs/laya.webgl_2D.js +1 -0
- package/vendor/laya-3.4.2/libs/laya.webgl_3D.js +1 -0
- package/vendor/laya-3.4.2/libs/laya.webgpu_2D.js +18576 -0
- package/vendor/laya-3.4.2/libs/laya.webgpu_3D.js +6729 -0
- package/vendor/laya-3.4.2/libs/nagabind.js +395 -0
- package/vendor/laya-3.4.2/libs/nagabind_bg.wasm +0 -0
- package/vendor/laya-3.4.2/libs/shader_compiler_web.js +22 -0
- package/vendor/laya-3.4.2/libs/shader_compiler_web.wasm +0 -0
- package/vendor/laya-3.4.2/libs/spine-core-3.8.js +1 -0
- package/vendor/laya-3.4.2/libs/spine-core-4.2.js +10216 -0
- package/vendor/laya-3.4.2/webgpu-provenance.json +41 -0
- package/vendor/meshoptimizer/LICENSE.txt +21 -0
- package/vendor/meshoptimizer/README.md +13 -0
- package/vendor/threejs-post/LICENSE.txt +53 -0
- package/vendor/threejs-post/README.md +54 -0
- package/zhuda.config.json +22 -0
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# Route: A pay-anywhere cascade slot (client and authoritative server)
|
|
2
|
+
|
|
3
|
+
A slot game in which eight or more of one symbol anywhere on the board pay and are removed, new symbols drop in from above and the board is judged again, multiplier orbs multiply the total win, and scatter symbols lead into free games. In the browser it is fully playable with the shared round state machine, the cascade mathematics, and a board and control bar drawn in code (local save, seeded rounds); when the same screen is connected to the Go authoritative server, the server opens the round, takes the bet and pays out, and the mathematics on the two sides is one algorithm: same seed, same result. Driven by the mouse (touch was not tested); checked only in desktop headless Chrome (WebGL) and against a local Go server, not on a phone.
|
|
4
|
+
|
|
5
|
+
- **Id:** `cascade-slot`
|
|
6
|
+
- **Kind:** scene
|
|
7
|
+
- **For:** building a slot with pay-anywhere awards, cascades, multipliers and free games (or a reel game of the same kind, where the board is refilled after symbols are removed), as a client and a Go authoritative server, with a theme of your own
|
|
8
|
+
- **Checked on:** desktop WebGL (Apple M4, headless Chrome, 1280×720, virtual clock); local Go 1.26.5 (darwin/arm64); no phone
|
|
9
|
+
- **Status:** taken on 2026-11-25 out of an earlier cascade slot game in the workspace (removed after it was taken apart; its theme and art were not kept): the mathematics is the same as the original game's round for round (Go 111,010 rounds; TS 86,000 rounds plus 40,000 sets of bonus rows), the simulator report is the same number for number, the TS engine and the Go engine give the same digest over 90 rounds, ten viewer screens were checked against the ledger, and the client ran 30 rounds in a row against the real server with the accounts agreeing
|
|
10
|
+
- **Reference consumer:** this repository: `zhuda-engine-prefabs/viewer2d/src/presets/cascade-slot.ts` (the whole client), `zhuda-engine-prefabs/2d/cascade-math`, `zhuda-engine-prefabs/2d/slot-client`, `zhuda-engine-prefabs/2d/slot-ui`, `zhuda-engine-prefabs/systems/slot-round`; `zhuda-engine-prefabs/server/cmd/slotserver` and `zhuda-engine-prefabs/server/cmd/slotsim` (the server and the simulator)
|
|
11
|
+
- **Engine version:** zhuda-laya-engine 1.18.0, `def94aae9e7ebf5f9f35b915b54dbb4c3e5fe43c`
|
|
12
|
+
|
|
13
|
+
## When to take this route
|
|
14
|
+
|
|
15
|
+
- Fits: a board of cells, awards judged by how many of one symbol there are (not by lines), winning cells removed and the board refilled by dropping, multipliers, free games, buy / ante; local trial points or an authoritative server.
|
|
16
|
+
- Does not fit:
|
|
17
|
+
- Payline or ways awards, or a reel-stop presentation: the award judging and the drop are yours to write, but `systems/slot-round` (round state machine, ledger, auto play), `2d/slot-client`, and the control bar, dialogs, clock and sound bridge of `2d/slot-ui` are used as they are.
|
|
18
|
+
- Only a server: read [go-game-server](go-game-server.md).
|
|
19
|
+
- A game whose mathematics is still being designed: run your own `Config` through `server/slotsim` first, and build the screen once the numbers are settled.
|
|
20
|
+
- Read first: the routes [new-game-project](new-game-project.md) and [game-2d](game-2d.md) (project, size, time, input, prefabs, audio), and `zhuda-engine-prefabs/README.md`. This route covers only the slot layer.
|
|
21
|
+
|
|
22
|
+
## Tools
|
|
23
|
+
|
|
24
|
+
- `zhuda-engine-prefabs/scripts/sync.mjs`: from a checkout of this repository `node zhuda-engine-prefabs/scripts/sync.mjs <game dir> 2d/slot-ui 2d/cascade-math`, or from a game `node node_modules/zhuda-engine-prefabs/scripts/sync.mjs . 2d/slot-ui 2d/cascade-math` (`2d/slot-client` and `systems/slot-round` come along). `<game dir>` is the game's client project; for a game of the workspace that is ZhudaGameCenter `games/<game>/client` (outside this repository).
|
|
25
|
+
- `zhuda-engine-prefabs/viewer2d` (the viewer): `?scene=cascade-slot` (`&round=seed:168`, `&round=seed:22:buy`, `&turbo=1`, `&autoplay=10`, `&dialog=buy|auto|receipt`); `scenarios/cascade-slot*.json`.
|
|
26
|
+
- `zhuda-engine-prefabs/server`: `go run ./cmd/slotsim -n 1000000 -seed 1` (simulation), `SLOT_JWT_SECRET=… SLOT_DEV=1 go run ./cmd/slotserver` (local server). Go 1.26.5, standard library only. Go commands run in `zhuda-engine-prefabs/server/`.
|
|
27
|
+
- `zhuda-engine-prefabs/tools/detplay.mjs` (screenshots under a virtual clock; the fraction in its `Date.now()` was fixed on 2026-11-25), `zhuda-engine-prefabs/tools/pixdiff.py`.
|
|
28
|
+
- Engine: `ZhudaEngine.boot({ features: ['core', '2d', 'ui'] })`, `context.runtime.start(dt)`, `IframeSoundAdapter`.
|
|
29
|
+
|
|
30
|
+
## Steps
|
|
31
|
+
|
|
32
|
+
1. **Settle the mathematics first, one copy for both sides.** Write the game's numbers as one configuration: Go's `slotmath.Config` and TS's `CascadeConfig` have exactly the same fields (the JSON names), and the reel strips are laid out by `BuildStrip(counts, seed)` / `buildStrip` from "how many of each symbol", so both sides lay out the same strip. The template is `slotmath.ExampleConfig()` / `exampleConfig()` (neutral: 6×5, three tiers at 8 / 11 / 14, 12 free games from 4 gold rings, multipliers ×2–×100, capped at 5000×). Check: run `go run ./cmd/slotsim -n 1000000` with three or more seeds and read the RTP, the hit rate and the trigger rate; the example configuration measured 92.98% / 94.44% / 91.67%.
|
|
33
|
+
2. **The engines on the two sides agree.** After changing numbers or the algorithm on the Go side, `SLOTMATH_UPDATE_PARITY=1 go test ./slotmath -run Parity` rewrites `testdata/parity.json`, and `tests/cascade-math.test.mjs` computes the SHA-256 of the same 90 rounds with the TS engine; all must be the same (make one of these for your own configuration in the same way).
|
|
34
|
+
3. **Local trial: seeded rounds and a ledger.** `LocalSession({ resolve: createSeedResolver(cfg), saveKey, rules, bets })`; the key of every round is `seed:<n>` (`:buy`, `:ante`). The ledger stores only the key and the bet and, on loading, computes every round again to check the accounts, so `resolve` must give "same key, same round", which a seeded round does. `GameRuntime({ beforeRound: () => ({ fixture: seedKey(next++) }) })` gives every round, manual or automatic, a new seed.
|
|
35
|
+
4. **The screen: a state machine and a presentation player.** `GameRuntime<CascadeSnapshot>({ presentation: new CascadeStepPlayer({ board, celebration, hud, sound, wait: clock.wait }) , fsm: true })`. The player keeps the original game's order and pace: the drop 700 ms (turbo 90), each wave highlight → remove → refill, 240 ms between waves, a 360 ms pause before the multiplier and then "base × m = win" is played, a pause of 380 (60) ms on no win, coins 80 (45) ms, free games played spin by spin (280 / 50 ms between spins), and last the total win; an ordinary round plays the big-win screen only when the win is ≥ 10 times the bet (never in turbo). The big button's five states (spin / fast-forward / collect / stop / wait) are decided by `state.primary`, and `ControlBar.updateAction()` draws what it says.
|
|
36
|
+
5. **Time follows the game loop.** Every wait and tween uses `FrameClock`, `context.runtime.start((dt) => clock.update(Math.min(dt, 0.1)))` (dt is in seconds). Fast-forward = `clock.speed = 4` (`onAccelerate`). Do not schedule the presentation with `setTimeout` (the rule of [game-2d](game-2d.md); screenshots under the virtual clock depend on it too).
|
|
37
|
+
6. **Sound goes through the engine.** `new SlotSoundBridge(new IframeSoundAdapter({ voiceOverflow: 'fifo', maxActiveVoices: 24 }))`, and the first pointerdown calls `unlock()`; with recordings, `adapter.loadSample()` and then `markLoaded()`; without, the placeholder cues made of scheduled tones are used.
|
|
38
|
+
7. **Showing the balance.** The ledger books the round before the presentation, so `session.points` already holds this round's win before it is played: during the presentation show `last.pointsAfter − last.win`, and show `points` again after `operation.finished` (this is what the viewer does).
|
|
39
|
+
8. **Connect the server.** Build the server by [go-game-server](go-game-server.md) (or use `slotgateway` as it is). The client replaces `LocalSession` with `RemoteSession({ client: new RemoteSlotClient({ baseUrl, token }), cols, rows })` and nothing else changes; the chosen fixture `'buy'` / `'ante'` is the buy / the ante. The round JSON is converted with `toResolvedRound()`; `p.mainWin + b.total === totalWin`.
|
|
40
|
+
9. **Change the theme.** Symbols: your own `SymbolPainter` (or images, or Spine) passed to `CascadeBoard`; panels and text: options; finished art goes through [visual-content-prefab](visual-content-prefab.md). The mathematics, the ledger and the state machine are not touched.
|
|
41
|
+
10. **Screenshots and checking.** The viewer preset sets `window.__SCENE__` (`state()` gives the round count, the balance, the phase and a trace) and sets `ready` only once the LayaAir splash screen at the engine's start, about 5 seconds, has passed (the viewer uses `clock.time > 5.5`). When `detplay.mjs` takes screenshots, **read state() for every picture**: which round it is and whether the balance is right, not only the pixels.
|
|
42
|
+
|
|
43
|
+
## Pitfalls
|
|
44
|
+
|
|
45
|
+
- **The original game's local mode had no random rounds at all.** The client cycled through 14 fixed scripted rounds; randomness existed only in a pipeline that was never connected to the screen; and the server was yet another mathematics (the client: every bet ×9 lines, scores ÷10; the server: the single bet as the unit, and real cascades). → One algorithm in two languages (`CascadeEngine` = `slotmath`), held together by the digest test; scripted rounds are for show only (`fixture-pipeline.ts`).
|
|
46
|
+
- **The original game's free games were made up by the presentation layer.** The player improvised the boards of 15 spins from `b.total` to make the number come out, with no relation to the real mathematics. → The server round carries every spin (`freeSpins`), and the player plays the real ones spin by spin.
|
|
47
|
+
- **An engine that uses crypto/rand cannot be replayed or compared.** → Randomness is always injected (the `RNG` interface); for the comparison, only `pkg/crypto` in the copy of the original project was replaced, by the same generator with a seed that can be set.
|
|
48
|
+
- **Go's map iteration order differs every time.** The original server's `orbMultipliers` were collected from a map, so the same round came out in a different order twice. → Multipliers are sorted by cell and carry the cell's position (`orbs: [{cell, value}]`), so the screen knows which orb is which multiplier.
|
|
49
|
+
- **The original server's `stepIndex` repeated numbers** (a win step used "which wave", a drop step used its position). → Always the position; the wave number goes separately in `cascade`.
|
|
50
|
+
- **Ante charges 25% more but the mathematics did not change** (a comment in the original code says there will be more scatter symbols; the program did not do it). → The example likewise changes only the price and says so; to really raise the probability, ante needs another set of reel strips.
|
|
51
|
+
- **The state of the JS Mulberry32 grows into a floating-point number.** The original client's `a += 0x6d2b79f5` does not wrap round, and after about 4.9 million calls it differs from the 32-bit version. → Wrap with `>>> 0` (the first 4.9 million results are the same).
|
|
52
|
+
- **`executeSync` running async plug-ins** finishes synchronously only when every plug-in has done its work before it does `await next()`; a plug-in that awaits something else part-way "has returned but has not finished computing". The mathematics plug-ins are written to this rule.
|
|
53
|
+
- **Auto advance could only replay the same round.** The original state machine cannot `configure()` during auto. → The `beforeRound` option of `systems/slot-round`.
|
|
54
|
+
- **A big win's timer closed the next big win.** The previous one's "pause a moment, then close" arrived after the next had started. → `Celebration` gives every `play()` a serial number, and an old timer leaves the new one alone.
|
|
55
|
+
- **Half of the 95 items of the original game's gate were string searches or `assert(true)`** (the "10,000 chaos tests", for example, did nothing at all). → Only the checks that really run were carried over (mathematics, ledger, locale); the rest do not count.
|
|
56
|
+
- **The virtual clock's `Date.now()` has a fraction** (1000/60 ms per frame), and the ledger's `Number.isSafeInteger` rejects that round; both builds break in the same way, so the pixels still differ by 0. → Use the fixed `detplay.mjs` (whole milliseconds), and check `state()`.
|
|
57
|
+
- **After the original game was re-pinned to def94aa only two gate items differed**: `npm run build`, `typecheck`, `doctor` (HEALTHY) and the 3 unit tests all pass; the gate is 93 / 95, and the two failing items check whether the screenshot files in `evidence/` are there (the copy did not bring its evidence); with the original evidence attached it is 95 / 95. Headless Chrome (572×1024, virtual clock) starts, can open a round (multi, wins 13,000) and has no page errors; but 24 seconds later that round was still not marked "presented" (presumably the real-time WebM / audio never ends under the virtual clock; not investigated).
|
|
58
|
+
|
|
59
|
+
## Engine gaps and their workarounds
|
|
60
|
+
|
|
61
|
+
| Gap | Workaround |
|
|
62
|
+
| --- | --- |
|
|
63
|
+
| A 2D start shows a LayaAir splash screen for about 5 seconds | The ready signal (`__SCENE__.ready`), the screenshots and the automatic round start all wait until `FrameClock` has passed 5.5 seconds **After 2.0.0:** `await whenZhudaSplashGone()` or the page's `zhuda:splash-gone` event says when it is out of the page. |
|
|
64
|
+
| There are per-frame timers (`runtime.timers`), but no tweens and no "wait this long" Promise that follow the run-time clock | `2d/slot-ui/frame-clock.ts` (`wait`, `tween`, `speed`, `finishAll`), with `update(dt)` every frame **After 2.0.0:** `runtime.timers.wait(seconds)` and `runtime.timers.tween({ duration, update, ease })` follow the session's clock; `finishAll` and a speed of their own remain the module's. |
|
|
65
|
+
| No general slot-machine components (the engine should not have them) | They are all in the prefab library (`zhuda-engine-prefabs/`): this route's modules |
|
|
66
|
+
|
|
67
|
+
## Checks
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
cd prefabs
|
|
71
|
+
npm run verify # types (against the engine: def94aa when checked) + node tests (cascade-math, slot-client, slot-ui, slot-round options and the save gate among them)
|
|
72
|
+
npm run verify:go # go vet, go test (the parity digest, the HTTP tests and Example among them)
|
|
73
|
+
cd server && go run ./cmd/slotsim -n 1000000 -seed 1 # put your own configuration in place of ExampleConfig
|
|
74
|
+
cd ../viewer2d && node ../scripts/sync.mjs . && npm run verify
|
|
75
|
+
node ../tools/detplay.mjs dist/web scenarios/cascade-slot.json "scene=cascade-slot" <output folder>
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Results of 2026-11-25: the library's 109 node tests and all six Go packages pass; the viewer's verify passes in full (Doctor HEALTHY); three scenarios, ten pictures, `rendererErrors` and `pageErrors` empty, balance 100,000 → 100,194 (seed 168) / 100,805 (buy, seed 22) / 100,033 (auto, 10 rounds); the client (`RemoteSession` + `GameRuntime` + the player) ran 30 rounds in a row against `cmd/slotserver`, 3 buys among them: the client's balance = the server's balance = start − 2,670 + 458, and for every round the amount in the replay asked of the server was the same.
|
|
79
|
+
|
|
80
|
+
## Not checked
|
|
81
|
+
|
|
82
|
+
- Not on a phone, not played with fingers, no frame rate measured; only WebGL in desktop headless Chrome.
|
|
83
|
+
- The cue sounds were only confirmed to be sent into `IframeSoundAdapter` (`played`); no one has listened to them; there are no real recordings.
|
|
84
|
+
- The example configuration's RTP is measured, not tuned and not certified; any use with real money needs its own mathematics, its own simulation and testing by a third party.
|
|
85
|
+
- The client against the server ran only locally, on one machine, in development mode; cross-origin, disconnection, resending and several tabs at once were not tested.
|
|
86
|
+
- The original game's portrait 572×1024 layout was not rebuilt (the control bar is a landscape one, 1280 wide).
|
|
87
|
+
- After the original game was re-pinned to def94aa, the presentation running to its end, the big win, the free games, the WebM effects and the sound were not checked one by one (only seen: a round can be opened, the picture is normal, there are no errors).
|
|
88
|
+
|
|
89
|
+
## Boundaries
|
|
90
|
+
|
|
91
|
+
- The game: the theme, the symbol pictures, the text, its own `Config` numbers and simulation report, the layout, the release; the server's deployment (secrets, TLS, persistence, the operator's wallet).
|
|
92
|
+
- The prefab library (`zhuda-engine-prefabs/`): the round state machine and the ledger (`systems/slot-round`), the cascade mathematics and its example (`2d/cascade-math`, `server/slotmath`), the rest of the client (`2d/slot-client`), the screen drawn in code (`2d/slot-ui`), the server packages (`server/`), the viewer preset.
|
|
93
|
+
- The engine: 2D drawing, the run-time clock, the audio authority, the prefab flow. What taking a game apart shows the engine should add is written under "Engine gaps and their workarounds" above.
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
# Route: Garments and objects made in number that nothing comes through
|
|
2
|
+
|
|
3
|
+
A catalogue of clothes and objects for one body, each a line of numbers (where it starts and ends,
|
|
4
|
+
how thick, what hangs from it), built by one tool and passed through two measures before it is
|
|
5
|
+
listed: the body must stay under it in every pose, and looked at from all round it must show no
|
|
6
|
+
hole and nothing that it covers. Thirty-two items made this way, with three hairstyles, are in the
|
|
7
|
+
reference game; all pass, and of their 118 overlapping pairs one is kept apart.
|
|
8
|
+
|
|
9
|
+
- **Id:** `clip-free-garments`
|
|
10
|
+
- **Kind:** workflow
|
|
11
|
+
- **For:** many garments, shoes and worn objects for one skeleton, made by a tool and not by hand, that may be combined freely and must not clip in any animation
|
|
12
|
+
- **Checked on:** the two measures run in Node (no browser); the result drawn in headless Chromium 153 on SwiftShader (Linux container); no phone, no GPU, nobody judged how it looks
|
|
13
|
+
- **Status:** 31 kit-made parts on a body with a real size chart's measurements, built and measured in 153 poses on 2026-11-25; one character, one body shape (draft)
|
|
14
|
+
- **Reference consumer:** this repository, `games/zhuda-wardrobe` (`tools/catalogue.mjs`, `tools/build-parts.mjs`, `tools/look-report.mjs`)
|
|
15
|
+
- **Engine version:** zhuda-laya-engine 1.18.0 with `setZhudaTriangleMask`; built and run against this repository's engine
|
|
16
|
+
|
|
17
|
+
Read `outfit-swap-3d` for how parts are worn at run time and `humanoid-from-shapes` for how the
|
|
18
|
+
body is made. This route is what lies between: how a part is made so that it cannot clip, and how
|
|
19
|
+
that is shown.
|
|
20
|
+
|
|
21
|
+
## When to take this route
|
|
22
|
+
|
|
23
|
+
Take it when the garments are many, are combined by the player, and are made by a tool from the
|
|
24
|
+
body's own shape. It needs the body as shapes (signed distances), so it fits a body made by
|
|
25
|
+
`humanoid-from-shapes`. For garments modelled by hand in another program, take only steps 6 to 9:
|
|
26
|
+
the measures and the masks work on any `.glb` on the body's skeleton, and say what does not pass.
|
|
27
|
+
For cloth that should swing, flutter or tear, see `layered-cloth-on-body`; nothing here simulates.
|
|
28
|
+
|
|
29
|
+
## Tools
|
|
30
|
+
|
|
31
|
+
- `games/tools/characters/garment.mjs`: `buildGarment`, `zone`, `volume`, `coverOf`.
|
|
32
|
+
- `games/tools/characters/clip-check.mjs`: `loadModel`, `posesOf`, `checkPair`, `coverMasks`,
|
|
33
|
+
`maskWhere`, `folds`. Skins every model in Node exactly as the engine does when a part is bound.
|
|
34
|
+
- `games/tools/characters/look-check.mjs` and `raster.mjs`: `lookCheck`, `dressed`, `picture`: an
|
|
35
|
+
orthographic rasteriser with a depth buffer, for looking without a browser.
|
|
36
|
+
- `games/tools/characters/islands.mjs`: stray scraps of triangles.
|
|
37
|
+
- Engine: `setZhudaTriangleMask(node, mask)` hides triangles of a drawn mesh;
|
|
38
|
+
`bindZhudaSkinToSkeleton` wears the part.
|
|
39
|
+
- meshoptimizer's simplifier with `Regularize` (already an engine dependency).
|
|
40
|
+
|
|
41
|
+
## Steps
|
|
42
|
+
|
|
43
|
+
1. **Cloth is the body's surface moved outwards.** A garment is the surface at its thickness from
|
|
44
|
+
the body, kept inside a zone: a slab for the trunk, capsules round the limbs, planes where cuffs
|
|
45
|
+
and hems are cut. Nothing is modelled; a tee is `{ hem: 0.955, sleeve: 'short', collar: 'crew' }`.
|
|
46
|
+
Thickness sets what lies over what, and must differ by 5 mm or more between layers worn together:
|
|
47
|
+
shoes 6 mm, bottoms 11, tops 17, whole garments 22, a belt 27.
|
|
48
|
+
2. **Each vertex of the cloth takes the weights of the skin under it**: step from the vertex down
|
|
49
|
+
the body's distance to the surface, and take the body's weights there. Cloth and skin then move
|
|
50
|
+
as one, in any pose of any animation, and the garment needs no joint of its own.
|
|
51
|
+
3. **Loose cloth is a volume added to that** (the bell of a skirt, a pouch). It takes the weights
|
|
52
|
+
the body would have at the cloth's own place, more softly, among the joints named for it (a
|
|
53
|
+
skirt: hips and legs, never a hand hanging beside it), blended into the skin's weights over the
|
|
54
|
+
3 cm where it leaves the body. The half of a skirt before a thigh follows that thigh. Give loose
|
|
55
|
+
cloth both sides (two triangles for one): in a high kick some of it turns over.
|
|
56
|
+
4. **Close every edge.** Mesh the garment alone, as a solid that reaches 5 mm into the skin: a cuff
|
|
57
|
+
then ends in a face that passes into the arm, and a skirt in a face from hem to legs. Nobody sees
|
|
58
|
+
into a sleeve or up a skirt, and the garment with the body in it is one closed solid. Drop the
|
|
59
|
+
face inside the body and any scrap of fewer than 12 triangles.
|
|
60
|
+
5. **Simplify for skinning, not for looks.** Use the simplifier's `Regularize` with locked borders,
|
|
61
|
+
on the body as on the parts. Without it a limb, flat along its length, is left with triangles
|
|
62
|
+
20 cm long: they cannot be hidden under a cuff that ends halfway along them, and they bend badly.
|
|
63
|
+
6. **Hide what is covered** instead of hoping it stays under. The tool that made a garment can say
|
|
64
|
+
exactly what lies under its cloth (`coverOf`): every triangle of the body, and of thinner cloth
|
|
65
|
+
on the body, whose three corners are 3 mm under the surface and 8 mm inside its edges gets a bit
|
|
66
|
+
in a mask. At run time the union of the worn parts' masks is applied with
|
|
67
|
+
`setZhudaTriangleMask`; a region wholly hidden is switched off. Loose cloth of an inner part is
|
|
68
|
+
never hidden (it swings away from what was over it), and only a closed volume hides what is in
|
|
69
|
+
it. For a part made elsewhere, `coverMasks` measures the same from the two surfaces.
|
|
70
|
+
7. **Measure one: does anything come through.** For each part against the body, and each pair of
|
|
71
|
+
parts that can be worn together, in every second frame of every clip and of a clip of poses no
|
|
72
|
+
game clip reaches (arms overhead with a twist, a deep crouch, a high kick): each vertex still
|
|
73
|
+
drawn that lay under the outer cloth at rest must stay under it. It has come through when it is
|
|
74
|
+
outside both the triangle that was over it at rest and the cloth nearest to it in the pose, by
|
|
75
|
+
more than 1 mm, and that nearest cloth is not an open edge or the face a cuff ends in. A part
|
|
76
|
+
that fails stops the build; a pair that fails is written into both parts' `avoid` and the game
|
|
77
|
+
does not let them be worn together.
|
|
78
|
+
8. **Measure two: what would be on the screen.** Skin every part of a whole outfit in a pose,
|
|
79
|
+
rasterise it from 26 directions with back faces culled as a graphics card culls them, and count
|
|
80
|
+
two kinds of pixel: one whose nearest surface faces away (a hole: one sees through), and one
|
|
81
|
+
whose nearest surface is skin or inner cloth at a place the garment over it covers. Every part
|
|
82
|
+
alone and a seeded sample of whole outfits; the limit is 1 cm² in the worst single view.
|
|
83
|
+
9. **Look at a sheet of pictures** from the same rasteriser before trusting either number: a zone
|
|
84
|
+
written wrongly gives a garment that passes every measure and is a bib.
|
|
85
|
+
10. **Hard objects only where the body does not bend** (a hat on the head, a pack on the chest),
|
|
86
|
+
each wholly on one joint. Anything else worn on the body (a pouch on a belt at the hip) is a
|
|
87
|
+
loose volume: it gives with what is under it.
|
|
88
|
+
11. **Record what was measured** beside the parts (`docs/evidence/clip-report.json`,
|
|
89
|
+
`look-report.json`) and let the game's tests read it: a part whose triangle count is not the
|
|
90
|
+
report's was rebuilt without being measured.
|
|
91
|
+
|
|
92
|
+
### Cut it from a real garment, not from an idea of one
|
|
93
|
+
|
|
94
|
+
The first catalogue passed both measures and was wrong: nobody had compared it with anything. A
|
|
95
|
+
tape (`games/tools/characters/tape.mjs`: cut the mesh with a plane, take the length round the cut)
|
|
96
|
+
showed a bust 76 % of a real one, a neck 68 %, a T-shirt that followed the waist in like a wetsuit
|
|
97
|
+
and ended at the waist, trouser legs that narrowed to the ankle, a 26 cm skirt. So:
|
|
98
|
+
|
|
99
|
+
1. **Give the body a real size chart's measurements first.** Take a published table (here ASTM
|
|
100
|
+
D5585 size 8), measure the figure the way the table says, and move the shapes until every
|
|
101
|
+
girth and height is within a few per cent. Clothes cut for a body that is too thin cannot have
|
|
102
|
+
real proportions.
|
|
103
|
+
2. **Read the garment's numbers from real specification sheets**, with their sources and ranges,
|
|
104
|
+
into one file (`tools/reference.mjs` in the game): length from the shoulder's high point, ease,
|
|
105
|
+
neck width and drops, sleeve length and opening, inseam, leg opening, skirt length and sweep.
|
|
106
|
+
Look at photographs for what a table does not say (a T-shirt hangs straight from the bust and
|
|
107
|
+
the shoulder blades; a trouser leg is a tube).
|
|
108
|
+
3. **Read positions off the body, never type them.** The catalogue asks the body's own distance
|
|
109
|
+
field how far it reaches at a height in a direction, so a changed body needs no new numbers.
|
|
110
|
+
4. **Cloth that hangs is loose cloth**: a top is a squared oval at each height, as far out as the
|
|
111
|
+
body is anywhere above and straight between what holds it out (`drape`); a trouser leg below
|
|
112
|
+
the knee is a straight tube (`volume.tube`). It moves with the skin under it (the skin's own
|
|
113
|
+
softness), or what is worn under it comes through in a deep bend.
|
|
114
|
+
5. **A hard object is a solid with edges** (`solid.lathe`, `solid.block`), at a real one's size:
|
|
115
|
+
a cone for a conical hat, a rounded box for a pack. Soft shapes make everything a ball.
|
|
116
|
+
6. **Measure the made garment with the same tape** and list what is outside the real range. Three
|
|
117
|
+
things are, here; the test names them, so that neither a regression nor a quiet fix passes.
|
|
118
|
+
|
|
119
|
+
What this cost: loose cloth has two sides (a long-sleeved top, trousers and boots draw about 3,200
|
|
120
|
+
triangles more than the bare body, where cloth on the skin cost under 2,000); and four cuts at real
|
|
121
|
+
lengths (a 43 cm skirt, tops to the middle of the thigh) failed measure two in the split kick and
|
|
122
|
+
were left out of the catalogue.
|
|
123
|
+
|
|
124
|
+
## Pitfalls
|
|
125
|
+
|
|
126
|
+
- **Zones that leave a seam.** A sleeve's capsule only a little wider than the arm hole the trunk
|
|
127
|
+
leaves: the two met in a thin band under the arm, where faces were taken for cut edges and skin
|
|
128
|
+
was left drawn. Overlap zones deeply. And a wide capsule from the shoulder took in the neck: cut
|
|
129
|
+
it by a plane.
|
|
130
|
+
- **A plane across the whole body.** An arm hole cut by a plane through the shoulder cut the
|
|
131
|
+
trunk away below it too, leaving a bib; every measure passed. Limit a cut to the limb it is for.
|
|
132
|
+
- **The body drawn is not the body shaped.** Simplified to a tenth of its triangles it lies up to
|
|
133
|
+
4 mm inside its true surface; a cuff ending at the true surface left a slit all round.
|
|
134
|
+
- **Measuring against one triangle** counts cloth sliding (a neck in a collar, a boot below a hem)
|
|
135
|
+
as coming through; **measuring against the nearest cloth** counts a crease closing (a sleeve's
|
|
136
|
+
underside on the ribs). Each alone gave false alarms in dozens; a vertex is through when both say so.
|
|
137
|
+
- **A hard object across a joint** (a pouch at the hip) came through whatever was under it at 11 mm
|
|
138
|
+
in a crouch, wherever it was moved. As a soft volume it passes with every part.
|
|
139
|
+
- **Hair that follows only the head**: the neck turns under it and came through at 5.7 mm with the
|
|
140
|
+
head turned 35 degrees. Where hair lies within 1 cm of the skin it now takes the skin's weights,
|
|
141
|
+
easing to its own joints by 3 cm.
|
|
142
|
+
- **The triangle order of a loaded mesh is not the file's.** LayaAir 3.4.2 reads each glTF
|
|
143
|
+
primitive last index first; a mask applied in the file's order hid the wrong triangles and drew
|
|
144
|
+
no error. `setZhudaTriangleMask` turns it; the reference run reads back which triangles are
|
|
145
|
+
hidden and compares them with the file.
|
|
146
|
+
- **A skirt as panels on joints of its own** needs those joints driven in every clip; as a bell
|
|
147
|
+
following the legs it needs nothing, and does not gape.
|
|
148
|
+
|
|
149
|
+
- **Skin outside loose cloth at rest is found by no pose check.** A skirt's oval fitted to the
|
|
150
|
+
front, the back and the side left the fronts of the thighs outside it; they were never under
|
|
151
|
+
the cloth, so nothing paired them with it, and no pixel was a hole. Only the picture showed it.
|
|
152
|
+
Fit the oval to every direction, and count the body's vertices outside it at rest
|
|
153
|
+
(`standsOut`, measure three).
|
|
154
|
+
- **A hard object covers nothing, so the measures never look at it.** A bun stood through the
|
|
155
|
+
cone of the hat. Check what is worn with a solid against it at rest, or keep the two apart.
|
|
156
|
+
- **A new body changes which triangles the simplifier keeps**, and a margin of a millimetre flips.
|
|
157
|
+
Give loose cloth a few millimetres over what lies under it rather than tuning one vertex.
|
|
158
|
+
- **What is just above a hem is lifted out from under it in a stride**; if it was not drawn, it is
|
|
159
|
+
missing. Keep the last 3 cm above a hem drawn (`coverOf`, `looseHem`).
|
|
160
|
+
|
|
161
|
+
- **Do not shade by distance to a zone's boundary.** It is a distance in space, not along the
|
|
162
|
+
cloth to its rim: where a zone only encloses a limb its boundary runs close to the surface, and
|
|
163
|
+
a "trim" painted by it came out as dark patches on the seat of trousers and the hips of a dress.
|
|
164
|
+
No measure sees colour; a person looking at a graphics card's picture did. A band on vertex
|
|
165
|
+
colours is ragged anyway (it follows the triangles): leave ribs and stitching to a texture.
|
|
166
|
+
- **The corner at a cut comes out of the mesher rounded and ragged.** Moving every vertex near a
|
|
167
|
+
cut onto the cut straightens a hem at rest and turns faces over at the corner: the pixel
|
|
168
|
+
measure found slivers on five parts. Not solved here.
|
|
169
|
+
- **The face that closes a hem moves with the leg, the hem with the hips**: in a stride it hangs
|
|
170
|
+
below the hem as teeth. Not solved here.
|
|
171
|
+
|
|
172
|
+
## Engine gaps and their workarounds
|
|
173
|
+
|
|
174
|
+
- The makers and the measures are consumer tools under `games/tools/characters/`, not engine API,
|
|
175
|
+
and they are tied to bodies made of the kit's shapes. Only the mask is in the engine.
|
|
176
|
+
- A masked mesh is a copy of its own (LayaAir cannot share vertices between index lists): about
|
|
177
|
+
0.5 MB a dressed character here. A mesh with more than 65,535 vertices is masked in place.
|
|
178
|
+
- Masks are a bit per triangle per pair of parts: 85 KB of JSON for 32 parts. A catalogue of
|
|
179
|
+
hundreds wants them packed or made on demand.
|
|
180
|
+
- Loose cloth with both sides costs its triangles twice: the long robe is 8,460.
|
|
181
|
+
- Nothing simulates: a skirt follows the legs and does not swing after them.
|
|
182
|
+
- One body. A garment is built for the shape it was offset from; another build of body needs the
|
|
183
|
+
catalogue built again (a few seconds a part), not refitted.
|
|
184
|
+
|
|
185
|
+
## Checks
|
|
186
|
+
|
|
187
|
+
- Measure one, 153 poses (four game clips and the extreme poses): of 3,189 skin vertices still
|
|
188
|
+
drawn under the 31 kit-made parts none is through at 1 mm; of 91 overlapping pairs of kit-made
|
|
189
|
+
parts one fails (a high collar under long hair, 2.5 mm) and is kept apart. Eight more pairs are
|
|
190
|
+
kept apart by their cut and not by the measure (a belt under a top that hangs over it, a bun
|
|
191
|
+
under a conical hat, long hair where a pack is).
|
|
192
|
+
- Measure two, 26 directions by 41 poses for each of the 32 parts alone and 24 sampled outfits:
|
|
193
|
+
worst view seen through 0.89 cm², worst covered surface showing 0.78 cm².
|
|
194
|
+
- Measure three, at rest: none of the body's vertices stands out of the loose cloth of the 17
|
|
195
|
+
parts that hang round it; nothing worn with the hat or the pack stands through them (22 pairs).
|
|
196
|
+
- Against reality (`npm run measure` in the game): the body's 13 girths are within 6 % of ASTM
|
|
197
|
+
D5585 size 8; 19 of 22 measurements of the T-shirt, trousers, skirts, hat and pack are inside
|
|
198
|
+
the ranges real ones are made in. Outside: the T-shirt's hem is 1.14 of its chest round (real
|
|
199
|
+
0.9 to 1.05) and both skirts have 13.3 cm of ease at the hips (real 4 to 10).
|
|
200
|
+
- The counter-example: a top made the naive way by another script (the body's surface pushed out
|
|
201
|
+
16 mm, weights copied, edges open) is measured the same: 21 vertices through, up to 8.5 mm, and
|
|
202
|
+
150 cm² seen through at its open edges. It is listed as not passing and marked in the game.
|
|
203
|
+
- In the browser, with real clicks: the triangles hidden on the loaded meshes are the ones the
|
|
204
|
+
masks name (read back from ten meshes and compared with the files); pictures of a shirt, trousers,
|
|
205
|
+
boots and belt with arms overhead, crouched and kicking, and of skirts and a robe in the same
|
|
206
|
+
(`games/zhuda-wardrobe/docs/evidence/hands.jpg`, `outfits.png`).
|
|
207
|
+
- The game's tests read both reports and fail if a kit-made part does not pass or was rebuilt
|
|
208
|
+
without being measured.
|
|
209
|
+
|
|
210
|
+
## Not checked
|
|
211
|
+
|
|
212
|
+
- How it looks to a person. The garments are plain: no folds, seams, buttons or texture, collars
|
|
213
|
+
are rough, the figure is thin. "Nothing comes through" is measured; "looks good" is not.
|
|
214
|
+
- A phone or a GPU. The pictures are software WebGL and a rasteriser written for the measure.
|
|
215
|
+
- Animations other than this body's five clips: a clip that bends further than the extreme poses
|
|
216
|
+
is outside what was measured. Add its poses to the measure before using it.
|
|
217
|
+
- Garments from a modelling program, measured as made by hand: none was available. The one foreign
|
|
218
|
+
part is a script's.
|
|
219
|
+
- Self-crossing of cloth where creases close (an armpit, the back of a knee): the cloth there
|
|
220
|
+
folds into itself as the skin does; it is counted (`foldedCm2`) and not judged.
|
|
221
|
+
- Whether hard objects overlap each other at rest (a bun inside a hat): looked at, not measured.
|
|
222
|
+
- Other body shapes, and more than one character on screen.
|
|
223
|
+
|
|
224
|
+
## Boundaries
|
|
225
|
+
|
|
226
|
+
The engine hides triangles and binds parts. What a garment is, how it is made, what counts as
|
|
227
|
+
coming through and which parts may be worn together belong to the game and its tools. The
|
|
228
|
+
numbers are this body's and these clips'; another body or another set of animations is measured
|
|
229
|
+
again.
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
# Route: a drop-and-merge bowl game as a WeChat mini game
|
|
2
|
+
|
|
3
|
+
A portrait 2D game: hold and slide to aim, let go, and a piece falls into a bowl. Pieces are circles
|
|
4
|
+
that roll and stack; two of the same tier that touch become one of the next, through ten tiers, until
|
|
5
|
+
the stack stays above a line. One code base builds two skins (a Chinese one, 猪大合一合, and an English
|
|
6
|
+
one, Moo Merge, with another character and item chain) as `wxgame` packages under 4 MB and as a web
|
|
7
|
+
build. Touch or mouse. The game's records show headless Chrome at phone sizes and the WeChat developer
|
|
8
|
+
tools' command line; they show no play in those tools and none on a phone.
|
|
9
|
+
|
|
10
|
+
- **Id:** `drop-merge-2d-minigame`
|
|
11
|
+
- **Kind:** workflow
|
|
12
|
+
- **For:** Building a portrait 2D mini game where pieces dropped into a container fall, roll and stack as circles and two of a kind merge into the next tier, packaged for WeChat from one code base with several skins.
|
|
13
|
+
- **Checked on:** desktop headless Chrome at phone viewport sizes (390×844 at DPR 2 and four others),
|
|
14
|
+
WebGL, GPU or software not recorded; WeChat developer tools command line for preview code and
|
|
15
|
+
upload only; no run in a host recorded; no phone
|
|
16
|
+
- **Status:** recorded in the game's HANDOFF on 2026-11-18: `npm run verify` passed (build, types,
|
|
17
|
+
Doctor HEALTHY, five physics tests), a scripted play-through in headless Chrome ended without
|
|
18
|
+
errors, and `wxgame` packages were uploaded as development versions 1.0.0 and 1.0.1; nobody is
|
|
19
|
+
recorded playing it in the developer tools or on a phone, and nothing was submitted for review.
|
|
20
|
+
- **Reference consumer:** ZhudaGameCenter `games/zhuda-hehele` (outside this repository; the workspace is not under version control)
|
|
21
|
+
- **Engine version:** zhuda-laya-engine 1.18.0 at commit `a5dfc6b12595e2668af63255bd96c45f8f9caa33` (the pin in the game's `package.json`). Moved to 2.0.0 (`91d21f79`) on 2026-11-26: `npm run verify` 5 of 5 with Doctor HEALTHY, `npm run build:wx` ok (the wxgame folder 4,152 KB to 4,260 KB); no run in a host
|
|
22
|
+
|
|
23
|
+
## When to take this route
|
|
24
|
+
|
|
25
|
+
- After [new-game-project](new-game-project.md), [game-rules-first](game-rules-first.md) and
|
|
26
|
+
[mini-game-build](mini-game-build.md): this page adds only what this kind of game needs.
|
|
27
|
+
- A board that is a container of loose round pieces under gravity, merged by contact; short rounds,
|
|
28
|
+
one finger, a score and a best score; a WeChat mini game, the same build also on the web.
|
|
29
|
+
- Several variants of one game (character, item chain, language, ad units, account) where a package
|
|
30
|
+
must not contain another variant's art or text.
|
|
31
|
+
- Not a grid the player rearranges by dragging, with orders, energy and levels: that is
|
|
32
|
+
[merge-2d](merge-2d.md). Here are no cells, no economy and no saved board: only a physics world.
|
|
33
|
+
- Not for bodies that are not circles, joints, or hundreds of bodies (every pair is tested). Only
|
|
34
|
+
`wxgame` was built. For a browser-only phone page: [mobile-web-fullscreen](mobile-web-fullscreen.md).
|
|
35
|
+
|
|
36
|
+
## Tools
|
|
37
|
+
|
|
38
|
+
- Engine pinned as in the header; `features: ["core","2d"]`, `renderer: "webgl"`, `branding.mode:
|
|
39
|
+
"none"` ([branding](../white-label-themes.md)); `zhuda-laya-build`, `zhuda-laya-doctor`,
|
|
40
|
+
`zhuda-laya-minigame` ([mini-game packaging](../minigame-packaging.md)); LayaAir command line 3.4.2.
|
|
41
|
+
- Node 24 or newer (`node --test` runs `tests/*.test.ts` as they are); TypeScript 5.9.3; esbuild
|
|
42
|
+
0.27.1, not declared by the game: it arrives through the engine's dependencies.
|
|
43
|
+
- WeChat developer tools command line (version not recorded); the owner opens its port and logs in.
|
|
44
|
+
- Pictures: the owner's image generation command (tool 1.5.0, model `gpt-image-2.6-flare`, per the
|
|
45
|
+
`.json` beside each raw picture); prompts in `prompts/gen_*.sh`, which name the generator and the
|
|
46
|
+
character sheets by paths on the owner's machine and do not run elsewhere. Pillow for
|
|
47
|
+
`tools/process_*.py`. Sound: `tools/make_sfx.py` (numpy, ffmpeg) for every effect; music from a
|
|
48
|
+
local rule-based generator ("instrument-music") and the one line in `prompts/bgm.txt`.
|
|
49
|
+
- No licence note for generated art or music is in the game; `store/itch/spec.json` has the owner's
|
|
50
|
+
AI disclosure. Raw art (66 MB, `art/`) stays in the game; only `skins/` is packaged.
|
|
51
|
+
|
|
52
|
+
## Steps
|
|
53
|
+
|
|
54
|
+
1. **Project.** As [new-game-project](new-game-project.md). `zhuda.config.json`: `viewport` 750×1334
|
|
55
|
+
`fixedwidth`, `minigame.maxMainPackageBytes: 4194304` (WeChat's main-package limit), the `appid`.
|
|
56
|
+
2. **Tier table** (`src/tiers.ts`). Radii in design pixels at width 750: 26, 35, 45, 56, 68, 82, 97,
|
|
57
|
+
113, 131, 150 (the bowl is 682 wide). Points `(i+1)(i+2)/2`. Only the five smallest are dropped,
|
|
58
|
+
weights 30, 27, 20, 14, 9 (`pickDropTier(random)`, tested). Names and colours come from the skin.
|
|
59
|
+
3. **Circle physics and merging with no engine import** (`src/physics.ts`, 195 lines): `World(bounds,
|
|
60
|
+
radii, points)`, `add`, `step(dt)` returning merge events, `highestSettledTop(grace)`. Gravity
|
|
61
|
+
2200 px/s²; `dt` capped at 1/20 s, 6 substeps of 3 collision passes; restitution 0.12, friction
|
|
62
|
+
0.04, velocity × 0.998 per substep, mass as r². Two overlapping bodies of one tier die and one of
|
|
63
|
+
the next appears at their midpoint; two of the top tier vanish for twice the top points. Check:
|
|
64
|
+
`tests/physics.test.ts`: rests on the floor inside the walls; two alike merge with the next tier's
|
|
65
|
+
points; two top-tier vanish; a mixed stack of 12 settles at least 0.9 of the summed radii apart.
|
|
66
|
+
4. **Boot and layout** (`src/Main.ts`). `ZhudaEngine.boot` with `designSize` 750×1334, `scaleMode:
|
|
67
|
+
'fixedwidth'`, `dprCap: 2` ([runtime sizing](../platform-adapters.md#runtime-sizing-drivers-and-recovery-170)).
|
|
68
|
+
On `Laya.Event.RESIZE`: fixed width when the screen is at least as tall as the design, otherwise
|
|
69
|
+
the game sets `Laya.stage.scaleMode` to show-all, centred. Then `H = max(1334, stage.height)`,
|
|
70
|
+
floor `H − 142` (bodies move with it), lose line `max(inset + 420, floor − 900)` (step 7's inset). The
|
|
71
|
+
engine's layout helpers ([layout](../layout-and-media.md)) are not used. Check: `tools/viewports.mjs`.
|
|
72
|
+
5. **Draw.** A `world2d` sprite that shakes (bowl, pieces, character, effects) under HUD and panel
|
|
73
|
+
layers. One `Laya.Sprite` per body with a rotating child, `graphics.drawTexture` at radius × 1.03;
|
|
74
|
+
pop-in over 0.28 s, a squash spring fed by impacts above 380 px/s; `src/fx.ts` (crumbs, ring,
|
|
75
|
+
score, shake); `src/zhuda.ts` (seven aligned frames as clips). Frame: `context.runtime.start`.
|
|
76
|
+
6. **Input and round rules.** Stage `MOUSE_DOWN`, `MOUSE_MOVE`, `MOUSE_UP` with `stage.mouseX/Y` in
|
|
77
|
+
design units: hold and slide aims, release drops (`vy` 160), then a 0.5 s cooldown; buttons are
|
|
78
|
+
rectangles tested in the same handlers. Losing: a body older than 1.6 s and slower than 260 px/s
|
|
79
|
+
above the line fills a timer; 2.4 s ends the round. A merge within 1.1 s of the last adds `combo × 2`.
|
|
80
|
+
7. **Host bridge** (`src/platform.ts`, 146 lines). `isWeChat` is "`wx.getSystemInfoSync` exists";
|
|
81
|
+
every call sits in `try`, with a browser fallback where one makes sense. Save:
|
|
82
|
+
`wx.getStorageSync` / `setStorageSync`, else `localStorage`, numbers only (best score, highest
|
|
83
|
+
tier made, tutorial seen, mute). Vibration: `wx.vibrateShort` on merges from the sixth tier up
|
|
84
|
+
and at the end of a round. Top inset: `wx.getMenuButtonBoundingClientRect().bottom + 8` in design
|
|
85
|
+
pixels, clear of the capsule button. Share: `wx.showShareMenu`, `onShareAppMessage`,
|
|
86
|
+
`onShareTimeline`, a button on the result card only in WeChat, no reward for sharing. Ads: unit
|
|
87
|
+
ids from the skin (empty: no ads, no button); rewarded video only from a button that says it
|
|
88
|
+
plays a video and shows once an ad has loaded, the reward (clear the upper 45% of the bowl, once
|
|
89
|
+
a round) only when `onClose` reports `isEnded`; interstitial only at the end of a round, every
|
|
90
|
+
third round, 60 s apart, not in the first 30 s.
|
|
91
|
+
8. **Sound** (`src/sound.ts`). `Laya.SoundManager.playSound` and `playMusic(url, 0)` at `musicVolume`
|
|
92
|
+
0.45, started on the first button release; the engine's audio authority ([audio](../audio.md)) is
|
|
93
|
+
not used. Effects (`drop`, `pop01` to `pop10` rising with the tier, `big`, `over`, `click`): mono
|
|
94
|
+
MP3, 64 kbit/s, about 40 KB for 14 files. Music: 16 bars at 112 BPM, 34.286 s cut to loop, 240 KB.
|
|
95
|
+
9. **Art.** One base pose per character, then each expression as an edit of that picture ("keep
|
|
96
|
+
everything identical, only change the face"); all frames through one crop box (the union of their
|
|
97
|
+
alpha boxes), bottom-aligned, 420 px, 256 colours, so they swap without a jump. Pieces: a round
|
|
98
|
+
silhouette filling about 92% of a square, cropped to the alpha box plus 2%, radius × 3.2 px (96 to 320).
|
|
99
|
+
10. **Skins.** `src/skin.ts` defines `Skin` (id, title, ten names, ten colours, `healthAdvice`, `ads`,
|
|
100
|
+
strings `t`); `src/skins/<id>.ts` fills it; `skins/<id>/assets/` holds the same 19 file names
|
|
101
|
+
(about 0.5 MB); `skins/common/sfx/` is shared. `npm run skin:<id>` (`tools/use-skin.mjs`) writes
|
|
102
|
+
`src/skin-current.ts`, a one-line re-export so only that skin is bundled, replaces `public/assets`
|
|
103
|
+
and sets the page's title and `lang`. Recorded on 2026-11-18: the English package was confirmed
|
|
104
|
+
to hold no picture or text of the other skin.
|
|
105
|
+
11. **A report and hooks on `globalThis.__HEHELE__`**: `ready`, `phase`, `score`, `bodies`, `error`,
|
|
106
|
+
`api` (`start`, `dropAt`, `stepFast`, `overfill`, `tapAt`, `buttons`, `resetProgress`).
|
|
107
|
+
`tools/play-check.mjs` drives them in headless Chrome (the engine's `chromeFixture`): title, 40
|
|
108
|
+
drops, unlock banner, overfill, result, play again; it prints state and page errors, six shots.
|
|
109
|
+
12. **Package.** `npm run skin:<id>`, then `npm run build:wx` (`zhuda-laya-minigame --platform wxgame
|
|
110
|
+
&& node tools/patch-wx.mjs`). The patch lowers every `.js` of the package to ES2017 with esbuild
|
|
111
|
+
and rewrites `project.config.json`: `es6`, `enhance`, `minified`, `postcss` on, `urlCheck` off,
|
|
112
|
+
the skin's project name and `appid` (the mainland skin reads `WX_APPID`). Sizes: 2.5 MB and 2.76
|
|
113
|
+
MB in the HANDOFF; 2,896,137 bytes (13:32, 13:33) and 2,546,922 (20:07) in `evidence/wechat/*.json`.
|
|
114
|
+
13. **Preview, upload, store material.** The developer tools' command line makes a preview code and
|
|
115
|
+
uploads a development version; every upload and backend change is asked of the owner first.
|
|
116
|
+
`store/icon-512.png`, `icon-144.png`; for a web portal, `store/itch/`: a 630×500 cover, three
|
|
117
|
+
780×1688 screenshots from the play check, `spec.json` (texts, tags, AI disclosure). The HANDOFF
|
|
118
|
+
holds the owner's notes of the platform's 2026 rules (4 MB main package, health notice on a
|
|
119
|
+
mainland start screen, no personal data in a single-player game, ads never forced).
|
|
120
|
+
|
|
121
|
+
## Pitfalls
|
|
122
|
+
|
|
123
|
+
- **The developer tools refused the package: `invalid file: js/index.js`, a syntax error.** The
|
|
124
|
+
bundle had syntax newer than the tool's check accepts (the patch names object spread and optional
|
|
125
|
+
chaining). Fix: `tools/patch-wx.mjs` after the official build.
|
|
126
|
+
- **The name and the category decided the art.** A first name was flagged as an industry term that
|
|
127
|
+
needs a business licence: rename, new logo. The owner's account could only choose the overseas
|
|
128
|
+
games category, whose self-test excludes pigs and asks for English or a local language: hence a
|
|
129
|
+
second skin (another character, an item chain without beef or pork, no health notice, no ads) and
|
|
130
|
+
a second account for the mainland skin. Settle both before generating a logo or a character.
|
|
131
|
+
- **An account may already carry a released game.** The second account did: an upload and release
|
|
132
|
+
would replace it. Only a preview code was made there.
|
|
133
|
+
- **Selecting a skin edits source files** (`src/skin-current.ts`, `public/assets`,
|
|
134
|
+
`public/index.html`): the folder is whichever skin was chosen last, so select and build in one
|
|
135
|
+
command line. Without `WX_APPID` the mainland skin is packaged as `touristappid`.
|
|
136
|
+
- **Ad unit ids belong to one account**: keep them in the skin built for it. The HANDOFF notes that
|
|
137
|
+
an account opens ads only above a visitor threshold (UV over 500).
|
|
138
|
+
- **Rules that tests reach are imported with `.ts` endings** and must not touch `Laya`, parameter
|
|
139
|
+
properties or enums. `tiers.ts` imports the current skin, so tests run against the selected one.
|
|
140
|
+
- **Runs do not repeat**: `Math.random`, no seed, no bot; take both from `game-rules-first`.
|
|
141
|
+
- **`tools/process_art.py` is from before skins** (it writes `zhuda_*.png` into `public/assets`) and
|
|
142
|
+
`process_skin.py` knows only the `cow` prefix: no recorded command rebuilds `skins/zhuda/assets`.
|
|
143
|
+
|
|
144
|
+
## Engine gaps and their workarounds
|
|
145
|
+
|
|
146
|
+
- `zhuda-laya-minigame` has no syntax target, one `appid` per target and no per-variant
|
|
147
|
+
`project.config.json`: `tools/patch-wx.mjs` does all three. By the order of the two commands, the
|
|
148
|
+
engine's payload check and `game.zip` describe the files before the patch.
|
|
149
|
+
- No host bridge for mini-game storage, vibration, share, ads or the capsule inset
|
|
150
|
+
([platform adapters](../platform-adapters.md) has none): `src/platform.ts`.
|
|
151
|
+
- The packaging guide lists browser audio providers and WASM physics as refused for a mini game: the
|
|
152
|
+
game calls `Laya.SoundManager` itself (not heard in a host) and carries its own physics.
|
|
153
|
+
- No "fixed width, but the whole design on a wide screen" scale mode: set on resize by the game.
|
|
154
|
+
- No build-time variant that leaves another variant's files out of a package; the run-time theme
|
|
155
|
+
contracts ([themes](../white-label-themes.md)) were not tried: `tools/use-skin.mjs`.
|
|
156
|
+
- Closed in 2.0.0: the headless Chrome helper is the public export
|
|
157
|
+
`zhuda-laya-engine/compiler/chrome-host`. Both of the game's tools still import the file by path.
|
|
158
|
+
- Doctor reports HEALTHY though all is drawn from code: `visual-content-prefab` was not followed.
|
|
159
|
+
- No item under `docs/plans/` was found for any of these.
|
|
160
|
+
|
|
161
|
+
## Checks
|
|
162
|
+
|
|
163
|
+
- `npm run verify` (`zhuda-laya-build`, `tsc --noEmit`, `zhuda-laya-doctor --project .`,
|
|
164
|
+
`node --test`): passed, Doctor HEALTHY, five tests; HANDOFF, 2026-11-18. Not re-run since.
|
|
165
|
+
- `node tools/play-check.mjs <url> <dir>`: headless Chrome, 390×844 at DPR 2, start to result to
|
|
166
|
+
play again with no page error; HANDOFF, 2026-11-18. Screenshot sets under `evidence/`: `web-1` to
|
|
167
|
+
`web-7`, `skin-zhuda`, `cow-web`, `final-zhuda`, `final-cow`, `ads-zhuda`, and `live-*` for the
|
|
168
|
+
published web build (no errors, per `PORTALS.md` in the workspace, 2026-11-18).
|
|
169
|
+
- `node tools/viewports.mjs <url> <dir>`: title and play at 375×667, 390×844, 430×932, 768×1024 and
|
|
170
|
+
1280×800; screenshots of 2026-11-18 in `evidence/viewports*` and `cow-viewports`, no values kept.
|
|
171
|
+
- `npm run build:wx`, 2026-11-18: under the 4 MB gate (step 12). Developer tools command line, same
|
|
172
|
+
day: development versions 1.0.0 (first skin) and 1.0.1 (English skin) uploaded to a WeChat
|
|
173
|
+
mini-game account; preview codes in `evidence/wechat/`.
|
|
174
|
+
|
|
175
|
+
## Not checked
|
|
176
|
+
|
|
177
|
+
- Play in the developer tools' simulator or on a phone: the HANDOFF's "not verified" list says
|
|
178
|
+
neither happened, and its later records of previews and uploads name nobody who scanned and played.
|
|
179
|
+
- Real touch or mouse input by script: the play check calls `api.dropAt` and `api.tapAt` and sends
|
|
180
|
+
no pointer event, so no record covers the stage handlers, the aim line or the mute button.
|
|
181
|
+
- In a host: sound (`Laya.SoundManager` to `InnerAudioContext`), storage, vibration, the share menu,
|
|
182
|
+
the capsule inset, a rewarded video, an interstitial, the emoji used as icons, the font stack;
|
|
183
|
+
anywhere: the music's loop seam, loudness when effects overlap (`play` sets a global volume).
|
|
184
|
+
- Frame rate, memory and load time on any device; more bodies than the play check makes; the Chrome
|
|
185
|
+
version and whether WebGL ran on a GPU; how the music WAV became the MP3.
|
|
186
|
+
- Review, filing and release (nothing was submitted); the platform's rules themselves; engine 2.0.0.
|
|
187
|
+
|
|
188
|
+
## Boundaries
|
|
189
|
+
|
|
190
|
+
- **Game:** tier values, names, art, strings, ad unit ids, lose timings, `src/Main.ts`, store
|
|
191
|
+
material; where it is published: the owner's portals (see `PORTALS.md` in the workspace).
|
|
192
|
+
- **Prefab library (`zhuda-engine-prefabs/` in this repository); the game uses no shared module today.**
|
|
193
|
+
Candidates: `src/physics.ts` with its test (no imports: a circle world that merges by tier);
|
|
194
|
+
`src/platform.ts` (a `wx` back end beside the library's browser-only `systems/storage`, plus the
|
|
195
|
+
ad pacing); the skin switch (`src/skin.ts`, `tools/use-skin.mjs`: tied to two skin ids and the
|
|
196
|
+
page title; `systems/i18n` covers run-time language, not build-time exclusion); `src/fx.ts`, the
|
|
197
|
+
frame-clip character in `src/zhuda.ts`, `tools/make_sfx.py`.
|
|
198
|
+
- **Engine:** boot, sizing, the build, the Doctor and the `wxgame` package. The ES2017 lowering and
|
|
199
|
+
per-variant project settings belong in the mini-game build, not in a game's tool.
|
|
200
|
+
- **Platform and owner:** account, filing, review, release, whatever needs the owner's scan or consent.
|