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,249 @@
|
|
|
1
|
+
# Route: a finished game dissolved into shared prefabs, then the original project removed
|
|
2
|
+
|
|
3
|
+
A game that is finished but no longer maintained on its own has its scenes, characters, systems
|
|
4
|
+
and assets taken apart into modules of the prefab library (`zhuda-engine-prefabs/`): any game can fetch them
|
|
5
|
+
with `sync.mjs`, the viewer shows them at `?scene=<id>`, and every module has preview pictures
|
|
6
|
+
and a README. Afterwards the modules are compared with the original game pixel by pixel, on the
|
|
7
|
+
same engine, in the same Chrome, on a virtual clock, and only when they are the same is the
|
|
8
|
+
original project moved to the Trash. On 2026-11-25 three games (the floating island, the home
|
|
9
|
+
island and the garden island) were taken apart this way: projects of about 1.4 GB became modules
|
|
10
|
+
of about 30 MB.
|
|
11
|
+
|
|
12
|
+
- **Id:** `game-to-prefabs`
|
|
13
|
+
- **Kind:** workflow
|
|
14
|
+
- **For:** A game is to be retired, but its scenes, characters, systems and assets must stay where any later agent can call them up to use and to look at.
|
|
15
|
+
- **Checked on:** desktop WebGPU (Apple M4, headless Chrome 158, 1280 by 720); no phone
|
|
16
|
+
- **Status:** 2026-11-25: six games taken apart. The three 3D islands (garden island 6 frames,
|
|
17
|
+
floating island 15, home island 10) and three 2D games (the duel `ashfall-duel` 18 frames,
|
|
18
|
+
Dungeon Spin 26, the slot machine's maths round by round) are the same as the original games;
|
|
19
|
+
the library's 147 tests and `verify` in both viewers all pass.
|
|
20
|
+
- **Reference consumer:** `zhuda-engine-prefabs/3d/` (the three islands), `zhuda-engine-prefabs/2d/` (ashfall-duel,
|
|
21
|
+
dungeon-spin, slot-ui and others), `zhuda-engine-prefabs/viewer3d/`, `zhuda-engine-prefabs/viewer2d/`,
|
|
22
|
+
`zhuda-engine-prefabs/tools/detplay.mjs`.
|
|
23
|
+
- **Engine version:** zhuda-laya-engine 1.18.0, `def94aae9e7ebf5f9f35b915b54dbb4c3e5fe43c`
|
|
24
|
+
|
|
25
|
+
Everything on this page was done and checked on 2026-11-25, when the prefab library and the two
|
|
26
|
+
comparison tools were still in the ZhudaGameCenter workspace, beside the engine (outside this
|
|
27
|
+
repository). The paths are written as they are in this repository; nothing was run again from
|
|
28
|
+
them.
|
|
29
|
+
|
|
30
|
+
## When to take this route
|
|
31
|
+
|
|
32
|
+
- Fits: a game that is finished or stopped, with things in it that another game can use (a
|
|
33
|
+
scene, a character that moves, a set of sounds, an interface), when it has been decided to
|
|
34
|
+
remove the original project.
|
|
35
|
+
- Does not fit:
|
|
36
|
+
- A game still in development: take shared modules out of it directly; no proof and no
|
|
37
|
+
removal are needed.
|
|
38
|
+
- A feature the engine should have: record it under the route's engine gaps.
|
|
39
|
+
- A reference project that has a method but no reusable code: write the method as a route,
|
|
40
|
+
and tidy the code and the assets away somewhere else for keeping. Judge "no reusable code"
|
|
41
|
+
with care: the two stocking-tearing projects were first judged so and tidied into a folder
|
|
42
|
+
outside the workspace (2026-11-25); the next day the owner had them made into the modules
|
|
43
|
+
`3d/layered-hosiery` and `2d/spine-tights`, because a route that names files nobody can
|
|
44
|
+
open is half a route. Those two were moved in without this route's pixel proof against a
|
|
45
|
+
running original; what was compared instead is written in each module's README.
|
|
46
|
+
- Read first: `zhuda-engine-prefabs/README.md` and `zhuda-engine-prefabs/AGENTS.md` (the module rules, the folder rules,
|
|
47
|
+
sync).
|
|
48
|
+
|
|
49
|
+
## Tools
|
|
50
|
+
|
|
51
|
+
- `zhuda-engine-prefabs/scripts/sync.mjs`: copies modules into a game
|
|
52
|
+
(`node zhuda-engine-prefabs/scripts/sync.mjs <game dir> <module…>` from a checkout of this repository, or
|
|
53
|
+
from a game `node node_modules/zhuda-engine-prefabs/scripts/sync.mjs . <module…>`). `.ts`
|
|
54
|
+
files go to `src/common/`, other files (models, sounds) go unchanged to `public/common/`;
|
|
55
|
+
`--check` compares byte by byte.
|
|
56
|
+
- `zhuda-engine-prefabs/viewer3d/`: a consumer project of the engine. `?scene=<id>` opens any scene;
|
|
57
|
+
`tools/play.mjs` plays `scenarios/*.json` in headless Chrome and takes screenshots;
|
|
58
|
+
`npm run verify`.
|
|
59
|
+
- `zhuda-engine-prefabs/tools/detplay.mjs`: a player on a virtual clock (every frame is 1/60 s;
|
|
60
|
+
`performance.now`, `Date` and the timers follow it; `Math.random` has a fixed seed;
|
|
61
|
+
`BLOCK=<regex>` answers 404 for some files, `NOTRANSITIONS=1` turns CSS transitions off).
|
|
62
|
+
- `zhuda-engine-prefabs/tools/pixdiff.py`: the number of differing pixels between PNGs of the same name in
|
|
63
|
+
two folders (Python 3 with Pillow).
|
|
64
|
+
- For taking several games apart in parallel: Claude sub-agents, each with an isolated work area
|
|
65
|
+
of its own.
|
|
66
|
+
- Finder (through `osascript`) moves the original project to the Trash and keeps "Put Back".
|
|
67
|
+
|
|
68
|
+
## Steps
|
|
69
|
+
|
|
70
|
+
1. **Take stock.** Read the original project's README and HANDOFF; list the files and sizes of
|
|
71
|
+
`src/`, `public/`, `tools/`, `work/` and `evidence/`. Across projects, find files that are
|
|
72
|
+
**the same byte for byte** with `cmp` or `md5 -r` (the three islands: 6 source files, all the
|
|
73
|
+
island models, the plants, the sound effects and Zhuda's lines were the same). Take one copy
|
|
74
|
+
of what is the same.
|
|
75
|
+
2. **Make sure the engine version has what the game uses.** The original project may have been
|
|
76
|
+
built against an engine branch that was never merged (the floating island once used
|
|
77
|
+
`engines/zhuda-laya-engine-island` in the workspace). Look for those APIs in the installed
|
|
78
|
+
engine's types (`setBenders`, `lightFog.maxDistance`, the cloud sea's `baseMeters`) and make
|
|
79
|
+
sure the version now pinned has them all; only then can every module be pinned to one
|
|
80
|
+
version.
|
|
81
|
+
3. **Shared base modules first, with the differences as options.** Example: two copies of
|
|
82
|
+
`sky.ts` differed only in shadow distance, fog and cloud, so `3d/day-look` gained a
|
|
83
|
+
`DaySetting` (`CLOUD_SEA`, `OCEAN`); `tiers.ts` differed only in the amount of grass, so
|
|
84
|
+
`makeTiers(grass)`. **Prove by program that the output is unchanged**: give the original file
|
|
85
|
+
and the new module the same inputs and compare the `JSON.stringify` of the results (day-look:
|
|
86
|
+
three original files by 8,730 combinations of hour, weather and switches, all the same).
|
|
87
|
+
4. **Shared assets become modules first** (`3d/zhuda-characters`, `3d/nature-pack`), because
|
|
88
|
+
several scenes need them; write down where the master files are (those of Zhuda and Zhuer are
|
|
89
|
+
in the owner's character folder, outside the workspace).
|
|
90
|
+
5. **The viewer must build and run first.** Start with one minimal preset (`nature-pack`) to
|
|
91
|
+
make sure that binary assets sync, that `common/…` URLs load, and that the build, the types
|
|
92
|
+
and the Doctor all pass.
|
|
93
|
+
6. **One sub-agent for each game, each in an isolated work area.** `rsync` a copy of `zhuda-engine-prefabs/`
|
|
94
|
+
(without `node_modules` and `viewer3d/dist`), with `node_modules` as a symlink back to the
|
|
95
|
+
real one. In its work area a sub-agent may change `catalog.json` and `presets.ts`; only the
|
|
96
|
+
main agent merges into the real library. Say plainly: which files to read, how to cut the
|
|
97
|
+
modules, what it must not touch (the engine, other work areas, the original game, the owner's
|
|
98
|
+
site), that it must not publish, and what it must hand back.
|
|
99
|
+
7. **How to cut the modules.** The scene itself has one entry (`createGardenIsland()`,
|
|
100
|
+
`createSkyIsland()`: built in one call, one `update()` a frame, returning its queries and a
|
|
101
|
+
`dispose()`); the character, walking, sound and the interface are each a module; **code that
|
|
102
|
+
was hard-wired to one island takes it by injection instead** (`PigWorld`, `WalkWorld`), so it
|
|
103
|
+
can be used on another island. The parts that do not touch the engine (ground queries, rules,
|
|
104
|
+
the table of lines) go in a file of their own, so that node can test them. The original
|
|
105
|
+
game's node tests move into `zhuda-engine-prefabs/tests/` with them.
|
|
106
|
+
8. **A viewer preset reproduces the original game.** Keep every URL parameter it had; offer the
|
|
107
|
+
original `window.__ISLAND__` hook unchanged as `window.__SCENE__` (with `ready` added), so
|
|
108
|
+
that an original scenario file runs once `I.` is replaced by `S.`.
|
|
109
|
+
9. **The proof of equivalence.**
|
|
110
|
+
- Copy the original game into the work area (without `node_modules`, `dist`, `evidence` and
|
|
111
|
+
`work`), **change only the engine pin**, and point `node_modules` at the same engine;
|
|
112
|
+
confirm with `diff -r` that `src/` and `public/` are identical to the original project.
|
|
113
|
+
- Run the original game and the viewer with `detplay.mjs` on the same scenario and the same
|
|
114
|
+
URL parameters, then compare with `pixdiff.py`.
|
|
115
|
+
- **Always measure the original game against itself**: the same build run twice. Only when
|
|
116
|
+
the two runs are the same does the comparison mean anything; when they differ, find the
|
|
117
|
+
cause (see Pitfalls).
|
|
118
|
+
- The main agent runs at least one scenario again itself and does not go by the sub-agent's
|
|
119
|
+
numbers alone; it also confirms that the two sides really are different builds (the `md5`
|
|
120
|
+
differs, and the viewer's bundle holds other presets).
|
|
121
|
+
10. **Preview pictures.** In each scene module's `preview/`: one jpg for each representative
|
|
122
|
+
view (1280×720, quality about 85) and one `sheet.jpg` that shows them all; look at them
|
|
123
|
+
yourself before handing over.
|
|
124
|
+
11. **Merge.** `diff -rq` against the real library (excluding `node_modules` and `dist`) lists
|
|
125
|
+
what the sub-agent changed, which should be what it reported; copy the modules, tests,
|
|
126
|
+
presets and scenarios; add the new entries to `catalog.json` by program (do not overwrite
|
|
127
|
+
the whole file: another sub-agent's entries would be lost); merge `presets.ts` by hand;
|
|
128
|
+
after `node ../scripts/sync.mjs .`, `npm run verify` in both the library and the viewer; run
|
|
129
|
+
every preset of the merged viewer once, and compare pixels with the original game once more.
|
|
130
|
+
12. **A finished work that is not code goes elsewhere.** Example: the short film shot on the
|
|
131
|
+
garden island moved to the workspace's `films/zhuda-garden-island-a-day-off/` (the mp4, the
|
|
132
|
+
narration, the storyboard); the single frames are not kept.
|
|
133
|
+
13. **Documents.** The module table and the version record (raise the version) in
|
|
134
|
+
`zhuda-engine-prefabs/README.md`, the rules in its `AGENTS.md`; each module's own README (how to call it,
|
|
135
|
+
a code example, the parameters, what was verified, what was not, where it came from).
|
|
136
|
+
14. **Find what refers to the original project from outside.** `grep -rl` over the whole
|
|
137
|
+
workspace (excluding `node_modules` and `dist`); a "Reference consumer" in a route or a
|
|
138
|
+
document must be changed to point to the new module (the one in this repository's routes
|
|
139
|
+
that was left as a to-do is the last row of the gaps below).
|
|
140
|
+
15. **Remove.** Stop any preview server that uses the project and change any
|
|
141
|
+
`.claude/launch.json` that points to it; move it to the Trash with Finder (so that it can be
|
|
142
|
+
"Put Back"); write in the library's version record where it went and what was not verified.
|
|
143
|
+
|
|
144
|
+
## Pitfalls
|
|
145
|
+
|
|
146
|
+
- **Two runs on real time differ.** On a busy machine (load above 100), two runs of the original
|
|
147
|
+
game's own `play.mjs` differed by 260,000 to 720,000 pixels in each screenshot: petals,
|
|
148
|
+
fireflies, the sway of the grass and the character's pose depend on how many frames really ran
|
|
149
|
+
in those seconds. Use a virtual clock (`detplay.mjs`): every frame exactly 1/60 s, every
|
|
150
|
+
source of time replaced, a fixed seed for random numbers.
|
|
151
|
+
- **0 pixels of difference, and nothing was compared.** Found on 2026-11-25 while Dungeon Spin
|
|
152
|
+
was taken apart: the virtual clock's `Date.now()` had a fraction, the game ledger's
|
|
153
|
+
`Number.isSafeInteger` check refused most rounds, both sides failed together and the
|
|
154
|
+
screenshots were the same all the same. `detplay.mjs` now counts whole milliseconds; **with
|
|
155
|
+
every screenshot compare the game's state as well** (`state()`, or the points, round and
|
|
156
|
+
health that the script returns), never the pixels alone.
|
|
157
|
+
- **A 2D game needs the viewer that is fixed to WebGL.** The 3D viewer is `renderer: auto`
|
|
158
|
+
(headless Chrome takes WebGPU) and the original 2D games are WebGL; drawn differently, they
|
|
159
|
+
cannot be compared pixel by pixel. Use `zhuda-engine-prefabs/viewer2d` for 2D. A 2D build opens with about
|
|
160
|
+
5 s of engine logo; `ready` must wait until it is over.
|
|
161
|
+
- **The original game has no `__SCENE__` hook.** `detplay.mjs` takes `HOOK=<global name>`
|
|
162
|
+
(Dungeon Spin's `__DUNGEON_GAME__`, for example) or `PRELOAD=<script>` (the duel used a hook
|
|
163
|
+
that only reads the DOM, defined before the first frame), so the original game can be stepped
|
|
164
|
+
frame by frame as well.
|
|
165
|
+
- **A themed game made after someone else's work.** Take only the technique that carries no
|
|
166
|
+
theme (the flow, the maths engine, the server); after proving equivalence in the work area
|
|
167
|
+
with the original configuration, keep neither the configuration nor the art (2026-11-25, an
|
|
168
|
+
earlier slot game in the workspace).
|
|
169
|
+
- **The original game itself draws in two ways.** Run again on the virtual clock, the floating
|
|
170
|
+
island and the home island still switch between two results (they differ at edges, on the
|
|
171
|
+
water and around the character: at most 130 pixels, each by no more than 8 in brightness).
|
|
172
|
+
Run the original game two or three times first and note how many results it has; a module
|
|
173
|
+
passes when it is the same pixel for pixel as **one** of them. Seen on 2026-11-25: the new
|
|
174
|
+
module had 0 pixels of difference from one run of the original game, and its difference from
|
|
175
|
+
the original's other result was the same as the difference between the original's two
|
|
176
|
+
results.
|
|
177
|
+
- **Anything on real time breaks the comparison.** The playback time of an `<audio>` element
|
|
178
|
+
(the home island's song): compare with `BLOCK=song`, which makes the song file a 404. CSS
|
|
179
|
+
transitions (a hint fading out): `NOTRANSITIONS=1`. The song and the sync to its beat are
|
|
180
|
+
checked apart, on real time (it plays; `songTime` advances).
|
|
181
|
+
- **`sync.mjs` used to read text only.** Models and sounds read and written as UTF-8 are
|
|
182
|
+
broken. From version 0.7.0 of the library everything that is not `.ts` or `.css` is copied as
|
|
183
|
+
bytes and compared as bytes. Run `tests/sync.test.mjs` first when adding a file type.
|
|
184
|
+
- **The library's typecheck has `erasableSyntaxOnly` on.** No enum, no namespace, no
|
|
185
|
+
constructor parameter properties.
|
|
186
|
+
- **Overwriting the whole of `catalog.json` eats someone else's entries.** Two sub-agents start
|
|
187
|
+
from the same copy and each adds entries; when merging, add only the new keys.
|
|
188
|
+
- **The user account's Trash folder cannot be listed in this environment (Operation not
|
|
189
|
+
permitted), and `mv` into it is not reliable either.** Use
|
|
190
|
+
`osascript -e 'tell application "Finder" to delete {POSIX file "…", …}'`, which keeps "Put
|
|
191
|
+
Back".
|
|
192
|
+
- **A sub-agent cannot read some outside files** (on 2026-11-25 reading `HomeIsland.astro` of
|
|
193
|
+
the owner's site was refused). In the README mark that part as presumed; do not write it as
|
|
194
|
+
confirmed.
|
|
195
|
+
|
|
196
|
+
## Engine gaps and their workarounds
|
|
197
|
+
|
|
198
|
+
| Gap | Workaround |
|
|
199
|
+
| --- | --- |
|
|
200
|
+
| The engine's runtime has no fixed-clock mode for comparing two builds | `zhuda-engine-prefabs/tools/detplay.mjs`, which ships in the package since 2.0.0, replaces `requestAnimationFrame`, `performance.now`, `Date`, the timers and `Math.random` before the page's scripts run **After 2.0.0:** `fixedDeltaSec` on the session fixes its clock per frame (timers, waits, tweens, layers, `update(dt)`); it does not replace the page's clocks, which `detplay.mjs` still does. |
|
|
201
|
+
|
|
202
|
+
Closed in 2.0.0: the headless Chrome host is a public entry
|
|
203
|
+
(`zhuda-laya-engine/compiler/chrome-host`; when the route was checked the tools imported the
|
|
204
|
+
installed package's file by path), and [floating-island](floating-island.md) names
|
|
205
|
+
`zhuda-engine-prefabs/3d/sky-island` as its reference consumer instead of the removed game.
|
|
206
|
+
|
|
207
|
+
## Checks
|
|
208
|
+
|
|
209
|
+
```sh
|
|
210
|
+
cd prefabs && npm run verify # types (against engine def94aa) and node tests
|
|
211
|
+
cd viewer3d && node ../scripts/sync.mjs . && npm run verify # sync check, build, types, Doctor, tests
|
|
212
|
+
# from the repository root: the original game (a copy with only the pin changed) and the viewer,
|
|
213
|
+
# on the same scenario with the same parameters
|
|
214
|
+
node zhuda-engine-prefabs/tools/detplay.mjs <original game>/dist/web <scenario.json> "width=1280&height=720&fx=high&governor=0" <out A>
|
|
215
|
+
node zhuda-engine-prefabs/tools/detplay.mjs zhuda-engine-prefabs/viewer3d/dist/web <scenario.json> "scene=<id>&width=1280&height=720&fx=high&governor=0" <out B>
|
|
216
|
+
python3 zhuda-engine-prefabs/tools/pixdiff.py <out A> <out B>
|
|
217
|
+
npm run verify # in the repository root: its route audit checks the format of this page
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
Results of 2026-11-25: the garden island, 6 frames, 0 pixels (the same when the main agent ran
|
|
221
|
+
it again itself and when it was run after the merge); the floating island's hero, grab and pond,
|
|
222
|
+
15 frames, and the home island's home and back, 10 frames, 0 pixels against the same one of the
|
|
223
|
+
original game's results; `rendererErrors` and `pageErrors` were empty every time.
|
|
224
|
+
|
|
225
|
+
## Not checked
|
|
226
|
+
|
|
227
|
+
- None of the scenes taken apart has been on a phone (the vivo V40 numbers in the garden
|
|
228
|
+
island's README were measured on the older engine `a5dfc6b`).
|
|
229
|
+
- Sound was verified only for loading, unlocking, play events and the absence of errors; nobody
|
|
230
|
+
has listened to it for how it sounds or for the balance of volumes.
|
|
231
|
+
- The steps to rebuild the home island for the owner's site were built only as far as the WebGL
|
|
232
|
+
client; nothing was written into the site and nothing was published.
|
|
233
|
+
- Compared only on WebGPU in headless Chrome on a desktop; the WebGL builds were checked only in
|
|
234
|
+
the original games, at their time.
|
|
235
|
+
- There is no proof that the original project is never needed again after its removal: it is in
|
|
236
|
+
the Trash and can be put back until the Trash is emptied.
|
|
237
|
+
|
|
238
|
+
## Boundaries
|
|
239
|
+
|
|
240
|
+
- The game: its play, its levels, the content of its lines, its publishing settings. A new game
|
|
241
|
+
made after the taking apart writes only a thin layer (boot, wiring the modules, input, the
|
|
242
|
+
frame loop); the viewer's `src/presets/*.ts` are the examples of that layer.
|
|
243
|
+
- The prefab library (`zhuda-engine-prefabs/`): reusable scenes, character behaviour, walking, sound,
|
|
244
|
+
interface and assets, with their preview pictures, how they were made (`source/`) and their
|
|
245
|
+
tests.
|
|
246
|
+
- The engine: general features such as rendering, grass, water surfaces, particles, spring bones
|
|
247
|
+
and the quality governor. What the engine turns out to lack while a game is taken apart goes
|
|
248
|
+
under the route's engine gaps; do not quietly build a copy of an engine feature in a game or
|
|
249
|
+
in the prefab library.
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
# Route: A Go authoritative server for a game (mathematics, wallet, JWT, API, replay, simulation)
|
|
2
|
+
|
|
3
|
+
The result of a round-based game (a slot, a reel game, a draw) is decided by the server: the client sends "how much to bet", and the server locks the player, takes the bet, runs the mathematics with its own random numbers, pays out, stores the whole round for replay, and returns the round's steps for the client to play back. A separate simulator measures the RTP of the mathematics. Go standard library only; checked on the local machine (macOS arm64) by unit tests, HTTP tests and one connection from a real client; never deployed.
|
|
4
|
+
|
|
5
|
+
- **Id:** `go-game-server`
|
|
6
|
+
- **Kind:** workflow
|
|
7
|
+
- **For:** building a Go authoritative server for a game: mathematics whose randomness can be replaced, a wallet seam, JWT identity, an HTTP API, replay, an RTP simulator, and a round format and tests shared with the client
|
|
8
|
+
- **Checked on:** local Go 1.26.5 (darwin/arm64), `httptest` and a real server on `127.0.0.1`; no deployment, no TLS, no operator wallet
|
|
9
|
+
- **Status:** on 2026-11-25 the server of an earlier cascade slot game in the workspace (removed after it was taken apart; its theme and art were not kept) was taken apart into shared packages (the same as the original server round for round, and the simulator report the same number for number), and the general steps were worked out against the server of the original Dungeon Spin game (removed after it was taken apart); the TS client ran 30 rounds in a row against the real server with the accounts agreeing
|
|
10
|
+
- **Reference consumer:** this repository: `zhuda-engine-prefabs/server/` (`slotmath`, `slotsim`, `slotgateway`, `wallet`, `authjwt`, `replay`, `cmd/slotserver`, `cmd/slotsim`); a second example was the server of the original Dungeon Spin game (fixed-round mathematics and a single-lock authority service; now that it is taken apart, see the dungeon packages of `zhuda-engine-prefabs/server`)
|
|
11
|
+
- **Engine version:** no engine is used (a server); the client side was checked on zhuda-laya-engine 1.18.0, `def94aae9e7ebf5f9f35b915b54dbb4c3e5fe43c`
|
|
12
|
+
|
|
13
|
+
## When to take this route
|
|
14
|
+
|
|
15
|
+
- Fits: the result involves points or money, cheating must be prevented, rounds must be auditable by replay, and several clients (web page, mini game, app) must share one set of rules.
|
|
16
|
+
- Does not fit:
|
|
17
|
+
- Purely single-player play with trial points: the client's `systems/slot-round` `LocalSession` (books first and plays afterwards, computes every round again on loading) is enough, see [cascade-slot](cascade-slot.md).
|
|
18
|
+
- Real-time multiplayer and state synchronisation: this is "one request, one round", with no connection state.
|
|
19
|
+
- A slot-type game uses the packages of `zhuda-engine-prefabs/server` as they are; another game builds its own mathematics package to the structure below, and copies the way the wallet, the JWT, the replay and the API are written.
|
|
20
|
+
|
|
21
|
+
## Tools
|
|
22
|
+
|
|
23
|
+
- Go 1.26.5 (installed on the local machine), standard library only; `go vet ./...`, `go test ./...`, `gofmt`.
|
|
24
|
+
- The shared packages: `zhuda-engine-prefabs/server` (one Go module, `zhudagamecenter/commonprefabs/server`; `sync.mjs` does not copy it). In the game's `server/go.mod`:
|
|
25
|
+
```go
|
|
26
|
+
require zhudagamecenter/commonprefabs/server v0.0.0
|
|
27
|
+
replace zhudagamecenter/commonprefabs/server => <path to a checkout of zhuda-engine-prefabs>/server
|
|
28
|
+
```
|
|
29
|
+
- Checks: `cd prefabs && npm run verify:go`; simulation: `go run ./cmd/slotsim -n 1000000 -seed 1`; local server: `SLOT_JWT_SECRET=… SLOT_DEV=1 go run ./cmd/slotserver`; `curl`. Go commands run in `zhuda-engine-prefabs/server/`.
|
|
30
|
+
- Client: `RemoteSlotClient`, `RemoteSession` and `toResolvedRound()` of `2d/slot-client`.
|
|
31
|
+
|
|
32
|
+
## Steps
|
|
33
|
+
|
|
34
|
+
1. **Project structure.** In the game, `server/` (for a game of the workspace, ZhudaGameCenter `games/<game>/server/`, outside this repository): its own `go.mod`, `cmd/server/main.go` (the wiring), `cmd/simulator/main.go`, `internal/<game>math` (or the shared packages as they are). Both reference servers are divided this way: mathematics (pure functions), authority / wallet, gateway (HTTP), storage (replay).
|
|
35
|
+
2. **The mathematics is a pure function, "configuration + randomness + request → the whole round".** Randomness is injected through an interface (`slotmath.RNG`): in production `CryptoRNG` (crypto/rand); for simulation, tests and replay, `Mulberry32` with a seed that can be set. All money is in whole units; the order of the draws is fixed (do not let map iteration order affect the result or the output). Return every step of the round (the first board, every wave, every drop, the cap); the client only plays, it does not compute. Check: two runs with the same seed give the same JSON (`TestSpinIsReplayableAndConsistent`).
|
|
36
|
+
3. **Configuration apart from the program.** All of the game's numbers (board, pay tiers, reel strips, weights, free games, ante / buy prices, cap, labels) go in one `Config`, and `Validate()` stops a bad configuration first. If the client computes too (local trial), it uses the same numbers and the same algorithm (`2d/cascade-math`).
|
|
37
|
+
4. **The order for money: lock → take the bet → open the round → pay out → store the round → respond.** Both ways were checked:
|
|
38
|
+
- A seamless wallet (`wallet`, when connecting an operator): every transaction has an id, and a resend returns the balance of that time without taking or adding twice; one "spinning" lock per player (429 when it is held); when opening the round fails, `Rollback(the bet's transaction id)` refunds the bet (only one recorded bet, and only once).
|
|
39
|
+
- A single-lock authority service (dungeon-spin's `authority`, when the points are the game's own): inside one lock, "read the balance → compute the round → change the balance and the sequence number → store the round" is done in one go; when the balance is not enough the sequence number does not advance.
|
|
40
|
+
5. **Identity: JWT, never `?userId=`.** `authjwt.Sign/Verify` (HS256, `sub`, `op`, `cur`, `exp`), with the secret coming from an environment variable or a secret store. The guest path and the path that issues tokens are opened only in development (`slotgateway.Options{AllowGuest, IssueTokens}`; `cmd/slotserver` uses `SLOT_DEV=1`).
|
|
41
|
+
6. **HTTP API.** `GET /api/health`, `GET /api/user/balance`, `POST /api/spin`, `GET /api/replay?id=`. Every response is JSON (errors too), the GET paths refuse other methods, the request body is limited to 1 MiB (`http.MaxBytesReader`), CORS answers only origins on the allow-list, and by default it listens only on `127.0.0.1` (the default of dungeon-spin's `HOST`; `cmd/slotserver` does the same). Status codes: 401 identity, 402 not enough balance, 429 the same player is spinning, 400 the request or the bet amount, 500 the round failed (the bet was refunded).
|
|
42
|
+
7. **Replay.** Store the whole round (`replay.NewStore[T](limit)`) and read it back by the round id; the in-memory version must be given a limit. In production, put persistent storage in its place.
|
|
43
|
+
8. **Simulator and RTP.** `slotsim.Run`: RTP (base game / free games, 95% confidence interval), hit rate, volatility, the highest single round and multiplier, the cap, cascade depth, each symbol, the free-game trigger rate. At least 1 million rounds and three or more seeds; the report states the interval, not just one number.
|
|
44
|
+
9. **The contract with the client.** The type of the round JSON exists once on each side (Go `slotmath.Round`, TS `server-round.ts`); the client turns it into screen data with `toResolvedRound()`, and `RemoteSession` lets the same `GameRuntime` have its rounds opened by the server. If the client has the same engine too: a Go test writes the SHA-256 of a batch of rounds of the example configuration into `testdata/parity.json` (`SLOTMATH_UPDATE_PARITY=1`), and a node test reads it and compares the TS engine.
|
|
45
|
+
10. **Tests.** Mathematics: tier boundaries, award judging, drops, multipliers, the cap, determinism, Validate. Wallet: idempotency, nothing recorded when the balance is not enough, 50 goroutines at once, refund, lock. JWT: round trip, expiry, changed content, bad format. Gateway (`httptest`): health, bet → replay → balance consistent, no token, another secret, bet amount, bad JSON, CORS, 429 for the same player, and a failed round refunding the bet and releasing the lock. `Example()` has the README's example compiled and its output checked. Last, run a stretch with the real executable and a real client (see "Checks").
|
|
46
|
+
11. **Proving equivalence when an old server is taken apart.** Copy the original server in the workspace and replace only its source of randomness with the same generator, with a seed that can be set (in the earlier cascade slot game it was `pkg/crypto/rng.go`), and make the original tables into the new package's `Config`; because an `internal/` package cannot be imported from an outside module, the comparison program goes **inside the copy** (`cmd/equiv`, with `replace` in `go.mod` pointing to the shared packages), compares round by round, and at the end compares the next random number left on each side (to confirm that the same amount was used). The simulator report is compared number by number, line by line (leaving out the line with the elapsed time).
|
|
47
|
+
|
|
48
|
+
## Pitfalls
|
|
49
|
+
|
|
50
|
+
- **In the original server anyone could use someone else's wallet.** With no token it accepted `?userId=`, the JWT secret was written into `main.go`, CORS was always `*`, and it listened on every network interface. → Made into options that are off by default; development mode has to be stated explicitly.
|
|
51
|
+
- **The bet was taken and not refunded when the round failed.** In the original flow, if opening the round panicked after the bet was taken, the money was gone; a pay-out error was ignored. → `Rollback` after `recover`, and a failed pay-out answers 500.
|
|
52
|
+
- **The wallet's starting-balance parameter was not used** (`NewSeamlessWalletManager(initial)` always gave 100000); **`Rollback` could refund any amount**. → Corrected, with tests added.
|
|
53
|
+
- **crypto/rand makes results impossible to replay and a simulation impossible to reproduce.** → Inject the randomness; the simulator's `-seed`.
|
|
54
|
+
- **Go's map iteration order differs on every run** (the original list of multipliers was collected from a map, so the same round's output order changed). → Sort by position.
|
|
55
|
+
- **Step numbers repeated** (a win step used the wave number, the others their position). → Always the position; the wave number goes in a field of its own.
|
|
56
|
+
- **100,000 rounds do not measure RTP accurately.** For the original configuration the 95% interval at 100,000 rounds is about ±8 percentage points, and three seeds of 1 million rounds gave 89.34% to 96.14% (96.5% was claimed). → At least 1 million rounds, several seeds, and write the interval.
|
|
57
|
+
- **Ante charges more but the mathematics did not change** (the comment says there will be more scatter symbols). → The price and the probability must change together; measure with the simulator's `-ante`.
|
|
58
|
+
- **The cap comparison for free games is written in two ways**: a single spin uses ">", the whole run of free games uses "≥" (so in the original code; kept). To change it, change both sides (Go and TS) together and write parity again.
|
|
59
|
+
- **An `internal/` package cannot be imported by another module**, so the comparison program can only go into a copy of the original project.
|
|
60
|
+
- **dungeon-spin's mathematics multiplies a floating-point number by a ratio and then converts to an integer** (`int64(float64(x) * scale)`); an amount can be a little off because of the truncation. The shared slot mathematics is integers throughout: `bet × percentage / 100`, rounded down.
|
|
61
|
+
|
|
62
|
+
## Engine gaps and their workarounds
|
|
63
|
+
|
|
64
|
+
| Gap | Workaround |
|
|
65
|
+
| --- | --- |
|
|
66
|
+
| The server does not go through the engine; the engine has no contract for "round JSON and the client's presentation" | The contract is kept in the prefab library (`zhuda-engine-prefabs/`): Go `slotmath.Round` + TS `2d/slot-client/server-round.ts`, held together by the parity digest test |
|
|
67
|
+
|
|
68
|
+
## Checks
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
cd prefabs
|
|
72
|
+
npm run verify:go # go vet + go test (six packages, parity, Example)
|
|
73
|
+
npm run verify # node tests, the TS engine against parity and RemoteSession among them
|
|
74
|
+
cd server && go run ./cmd/slotsim -n 1000000 -seed 1
|
|
75
|
+
go build -o /tmp/slotserver ./cmd/slotserver && SLOT_JWT_SECRET=dev SLOT_DEV=1 PORT=18088 /tmp/slotserver &
|
|
76
|
+
curl -s http://127.0.0.1:18088/api/health
|
|
77
|
+
curl -s 'http://127.0.0.1:18088/api/auth/token?userId=p1' # development mode only
|
|
78
|
+
curl -s -X POST -H "Authorization: Bearer <token>" -d '{"betAmount":10}' http://127.0.0.1:18088/api/spin
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Results of 2026-11-25: the tests of all six packages pass; the same as the original server round for round (5,000 seeds × 5 kinds of request = 111,010 rounds; with the cap changed to 50×, another 60,785 rounds, 1,548 of them capped); the original simulator and the shared simulator at `-n 100000` with two seeds: the report's 41 lines and 104 numbers are the same; the TS client (`RemoteSession` + `GameRuntime` + the presentation player) ran 30 rounds in a row against `cmd/slotserver`, 3 buys among them: the client's balance = the server's balance = start − bets + wins, and every round's replay amount was the same.
|
|
82
|
+
|
|
83
|
+
## Not checked
|
|
84
|
+
|
|
85
|
+
- No deployment: TLS, a reverse proxy, rate limiting, logs, monitoring and persistence (the wallet and the replay are both in memory) were neither built nor tested.
|
|
86
|
+
- It has never been connected to an operator's wallet API; `wallet` is only an in-memory version of the same set of methods.
|
|
87
|
+
- No third-party certification of the RNG or the mathematics (GLI or the like); the original project's README said "compliant with GLI-19" with no evidence of any kind, and that was not carried over.
|
|
88
|
+
- Load: only the simulator's throughput was measured (about 350,000 rounds per second, on the local machine); HTTP concurrency was not measured.
|
|
89
|
+
- A client resending after a disconnection, and idempotency of the same request (at present the round id is used as the transaction id, so a resend opens a new round), are not handled.
|
|
90
|
+
|
|
91
|
+
## Boundaries
|
|
92
|
+
|
|
93
|
+
- The game: its own mathematics configuration and simulation report, the wiring of `cmd/server` and the deployment settings, the secrets, the integration with an operator.
|
|
94
|
+
- The prefab library (`zhuda-engine-prefabs/server`): the general packages (mathematics engine, simulator, gateway, wallet seam, JWT, replay) and their tests; the client's counterpart in `2d/slot-client`.
|
|
95
|
+
- The engine: not involved.
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# Route: a 3D scene that looks lit, grounded and deep
|
|
2
|
+
|
|
3
|
+
The order in which a 3D scene is given its look, the same for a film scene (data,
|
|
4
|
+
through the `film_*` tools) and a game (`ZhudaSceneLook`): preset and grade,
|
|
5
|
+
physically based surfaces, light from the side, shadows, air, wet ground, bounced
|
|
6
|
+
light, finish, and a frame budget. Every step has a check an agent can read without
|
|
7
|
+
judging a picture. Drawn on a desktop with both backends.
|
|
8
|
+
|
|
9
|
+
- **Id:** `good-looking-3d-scene`
|
|
10
|
+
- **Kind:** workflow
|
|
11
|
+
- **For:** Any 3D scene, film or game, that must look good: which look settings to give, in which order, and how to tell from advice and metrics that each step worked.
|
|
12
|
+
- **Checked on:** desktop WebGL; desktop WebGPU; no phone
|
|
13
|
+
- **Status:** the two example scenes and every step's check are drawn by
|
|
14
|
+
`npm run verify:quality-route` and the film checks on an Apple M4, WebGL and
|
|
15
|
+
WebGPU. No phone.
|
|
16
|
+
- **Reference consumer:** the engine's example scenes (`get_golden_example`, ids
|
|
17
|
+
listed by `get_quality_route`).
|
|
18
|
+
- **Engine version:** 1.18.0 (this checkout).
|
|
19
|
+
|
|
20
|
+
## When to take this route
|
|
21
|
+
|
|
22
|
+
For every 3D scene, beside the route for its kind. It decides the look, not the
|
|
23
|
+
content: for the format of nodes and materials take [film-as-data](film-as-data.md);
|
|
24
|
+
for a scene kind that has a route of its own ([underwater](underwater.md),
|
|
25
|
+
[floating-island](floating-island.md)) read that as well. Read "what is not built"
|
|
26
|
+
in the [quality route](../quality-route.md#not-built-yet) first when deciding
|
|
27
|
+
whether the engine can carry the scene at all.
|
|
28
|
+
|
|
29
|
+
## Tools
|
|
30
|
+
|
|
31
|
+
- MCP: `get_quality_route` (these steps as data, limits, advice rules, what is not
|
|
32
|
+
built), `film_scene_create`, `film_scene_apply`, `film_scene_preview`,
|
|
33
|
+
`film_scene_review`, `film_scene_lint`, `film_scene_query`.
|
|
34
|
+
- In a game: `ZhudaSceneLook`, `ZhudaQualityGovernor`, `zhudaQualitySteps`.
|
|
35
|
+
|
|
36
|
+
## Steps
|
|
37
|
+
|
|
38
|
+
The full text of each step, with its API, reason and check, is the
|
|
39
|
+
[quality route](../quality-route.md#the-steps); `get_quality_route` returns the same.
|
|
40
|
+
|
|
41
|
+
1. **Pick the surface**: a film scene (data) or a game (code). Both resolve one `look`.
|
|
42
|
+
2. **Start from a preset and a grade**: `look: { "preset": "day", "grade": {} }`.
|
|
43
|
+
3. **Physically based surfaces only**, sized for the camera: recipes at 256 pixels a
|
|
44
|
+
metre or more where the camera stands; `detail` for close range; `projection:
|
|
45
|
+
"triplanar"` on steep ground, cones and rocks.
|
|
46
|
+
4. **Ground and plants**: a `terrain` node for ground with heights, a `grass` node on
|
|
47
|
+
it or on level ground; ask `film_scene_query` for heights instead of working
|
|
48
|
+
positions out by hand.
|
|
49
|
+
5. **Light from the side**, and say what the ground throws back (`ambientGround`).
|
|
50
|
+
6. **Shadows that carry**: cascades by day; the key lamp casts a shadow by night.
|
|
51
|
+
7. **Air**: ground fog in the sky's colour, shafts with a low sun.
|
|
52
|
+
8. **Wet ground and water**: one reflector or one water node.
|
|
53
|
+
9. **Bounced and baked light**: `bounceLight` for props, shapes and ground (it also
|
|
54
|
+
carries the light of what glows); lightmaps for static models.
|
|
55
|
+
10. **Distance**: `cullMeters`, `castShadow` and levels on models and props that are
|
|
56
|
+
many or far.
|
|
57
|
+
11. **Finish**: exposure, then bloom, then grain and vignette.
|
|
58
|
+
12. **Look at it**: preview after every change; advice empty, no metrics flag.
|
|
59
|
+
13. **Hold the frame budget** in a game with the governor.
|
|
60
|
+
14. **Final evidence**: a render job for a film; a real browser report for a game.
|
|
61
|
+
|
|
62
|
+
## Pitfalls
|
|
63
|
+
|
|
64
|
+
- **Blinn-Phong by accident.** `Zhuda3D.createMaterial` given a `shininess` (or
|
|
65
|
+
`type: "blinn-phong"`) ignores the sky and the HDR chain: the scene looks flat
|
|
66
|
+
whatever the look.
|
|
67
|
+
- **The sun behind the camera.** Shadows fall out of sight; advice
|
|
68
|
+
`sun.behind-camera`.
|
|
69
|
+
- **A coarse ground texture.** A recipe bakes at 256 unless given `size`; advice
|
|
70
|
+
`texture.density`.
|
|
71
|
+
- **Emission is not light.** A glowing surface lights nothing without
|
|
72
|
+
`bounceLight` or lamps; advice `emission.lights-nothing`.
|
|
73
|
+
- **Fog darker than the sky** draws a band on the horizon; leave its colour alone.
|
|
74
|
+
- **Judging by one preview.** A preview is one sample on one GPU; use the review
|
|
75
|
+
grid, and a render job for the final picture.
|
|
76
|
+
|
|
77
|
+
## Engine gaps and their workarounds
|
|
78
|
+
|
|
79
|
+
Listed, and kept current, in the quality route's
|
|
80
|
+
[what is not built](../quality-route.md#not-built-yet): real-time global
|
|
81
|
+
illumination, reflections of what is off screen, more than eight point-light
|
|
82
|
+
shadows, area lights, parallax, weather beyond one cloud layer.
|
|
83
|
+
|
|
84
|
+
## Checks
|
|
85
|
+
|
|
86
|
+
`npm run verify:quality-route` and the film checks listed under
|
|
87
|
+
[evidence](../quality-route.md#evidence); all of them on WebGPU with
|
|
88
|
+
`npm run verify:film-webgpu`.
|
|
89
|
+
|
|
90
|
+
## Not checked
|
|
91
|
+
|
|
92
|
+
No phone and no mini-game host. Frame time on a target device is the game's own
|
|
93
|
+
record: see the frame-rate tiers (`ZHUDA_FRAME_TIERS`) in
|
|
94
|
+
[film scenes](../film-scenes.md#the-same-look-in-a-game).
|
|
95
|
+
|
|
96
|
+
## Boundaries
|
|
97
|
+
|
|
98
|
+
The look is data the engine resolves; what the scene holds, and whether its picture
|
|
99
|
+
is approved, is the consumer's.
|