@wildshard/sdk 0.0.1 → 0.2.3
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/GUIDE.md +790 -0
- package/README.md +13 -5
- package/bin/wildshard.mjs +38 -0
- package/lint/declaration-config.d.mts +2 -0
- package/lint/declaration-config.mjs +19 -0
- package/lint/engine-plugin.d.mts +2 -0
- package/lint/engine-plugin.mjs +40 -0
- package/lint/host-callbacks.d.mts +6 -0
- package/lint/host-callbacks.mjs +123 -0
- package/lint/host-files.d.mts +1 -0
- package/lint/host-files.mjs +7 -0
- package/lint/layer-exports.d.mts +2 -0
- package/lint/layer-exports.mjs +21 -0
- package/lint/legacy-line-basis.json +995 -0
- package/lint/nine-tiling-baseline.json +35 -0
- package/lint/ratchet.json +11 -0
- package/lint/runtime-files.d.mts +12 -0
- package/lint/runtime-files.json +16 -0
- package/lint/runtime-files.mjs +69 -0
- package/lint/runtime-performance.d.mts +6 -0
- package/lint/runtime-performance.mjs +184 -0
- package/lint/sdk-plugin.d.mts +4 -0
- package/lint/sdk-plugin.mjs +134 -0
- package/lint/shardfile-boundaries.d.mts +10 -0
- package/lint/shardfile-boundaries.mjs +122 -0
- package/lint/tile-bake-debt.json +556 -0
- package/package.json +365 -3
- package/scripts/agent-parity.mjs +1524 -0
- package/scripts/agent-sync.mjs +518 -0
- package/scripts/apfs-clone.mjs +67 -0
- package/scripts/assert-store-layout.mjs +23 -0
- package/scripts/astc6-phone-cap.d.mts +3 -0
- package/scripts/astc6-phone-cap.mjs +137 -0
- package/scripts/audit-assets.d.mts +10 -0
- package/scripts/audit-assets.mjs +151 -0
- package/scripts/bake/coatFiles.d.mts +6 -0
- package/scripts/bake/coatFiles.mjs +37 -0
- package/scripts/bake/environment.d.mts +2 -0
- package/scripts/bake/environment.mjs +58 -0
- package/scripts/bake/far-proxies.mjs +45 -0
- package/scripts/bake/keyed-sky.d.mts +4 -0
- package/scripts/bake/keyed-sky.mjs +34 -0
- package/scripts/bake/movers.mjs +56 -0
- package/scripts/bake/nativeWorld.d.mts +6 -0
- package/scripts/bake/nativeWorld.mjs +43 -0
- package/scripts/bake/navmeshGround.ts +22 -0
- package/scripts/bake/near-placeholder.mjs +331 -0
- package/scripts/bake/placeholderShards.mjs +41 -0
- package/scripts/bake/skins.mjs +15 -0
- package/scripts/bake/template-skins.mjs +33 -0
- package/scripts/bake/viewmodelBytes.ts +26 -0
- package/scripts/bake/viewmodelPage.ts +11 -0
- package/scripts/bake/worldHost.d.mts +35 -0
- package/scripts/bake/worldHost.mjs +110 -0
- package/scripts/bake-astc6.cache.json +80 -0
- package/scripts/bake-astc6.far-reach.cache.json +23 -0
- package/scripts/bake-astc6.list.json +111 -0
- package/scripts/bake-astc6.mjs +279 -0
- package/scripts/bake-astc6.nalati-grasslands.cache.json +42 -0
- package/scripts/bake-catalogue.mjs +44 -0
- package/scripts/bake-check.mjs +54 -0
- package/scripts/bake-chunk.mjs +124 -0
- package/scripts/bake-cloud-field.mjs +24 -0
- package/scripts/bake-coats.mjs +110 -0
- package/scripts/bake-data-maps.d.mts +24 -0
- package/scripts/bake-data-maps.mjs +72 -0
- package/scripts/bake-entry-programs.mjs +117 -0
- package/scripts/bake-geometry.mjs +106 -0
- package/scripts/bake-hybrid-tiles.mjs +28 -0
- package/scripts/bake-ktx2.cache.json +276 -0
- package/scripts/bake-ktx2.list.json +365 -0
- package/scripts/bake-ktx2.mjs +477 -0
- package/scripts/bake-map-glb.mjs +127 -0
- package/scripts/bake-map-rest.d.mts +7 -0
- package/scripts/bake-map-rest.mjs +50 -0
- package/scripts/bake-maps.mjs +200 -0
- package/scripts/bake-navmesh.mjs +259 -0
- package/scripts/bake-packs.mjs +129 -0
- package/scripts/bake-pickups.mjs +102 -0
- package/scripts/bake-query-terrain.mjs +64 -0
- package/scripts/bake-recurve-pool.mjs +16 -0
- package/scripts/bake-section-schemas.d.mts +3 -0
- package/scripts/bake-template-shardfile.mjs +32 -0
- package/scripts/bake-textures.mjs +80 -0
- package/scripts/bake-viewmodel-sets.json +45 -0
- package/scripts/bake-viewmodel-sets.mjs +137 -0
- package/scripts/bake-voxel-ao.mjs +119 -0
- package/scripts/bake-water-ripples.mjs +25 -0
- package/scripts/blender/README.md +129 -0
- package/scripts/blender/build.sh +166 -0
- package/scripts/blender/lib/export-scene.mjs +129 -0
- package/scripts/blender/lib/glb-digest.mjs +188 -0
- package/scripts/blender/lib/glb.py +68 -0
- package/scripts/blender/lib/save_blend.py +17 -0
- package/scripts/blender/lib/world_fixture.py +55 -0
- package/scripts/blender/targets.json +591 -0
- package/scripts/build-sdk.mjs +95 -0
- package/scripts/build-shardfiles.d.mts +7 -0
- package/scripts/build-shardfiles.mjs +206 -0
- package/scripts/capture-hero.mjs +137 -0
- package/scripts/check-lift-review.mjs +23 -0
- package/scripts/chromium-keychain-check.mjs +139 -0
- package/scripts/chromium-keychain.d.mts +1 -0
- package/scripts/chromium-keychain.mjs +5 -0
- package/scripts/compile-script.d.mts +3 -0
- package/scripts/compile-script.mjs +8 -0
- package/scripts/creature-color.mjs +255 -0
- package/scripts/decide/calibrate.py +127 -0
- package/scripts/decide/calibration/2026-10-03/labels-s1.tsv +281 -0
- package/scripts/decide/calibration/2026-10-03/labels-s2.tsv +97 -0
- package/scripts/decide/calibration/2026-10-03/labels-s3.tsv +48 -0
- package/scripts/decide/calibration/2026-10-03/labels-s3b.tsv +26 -0
- package/scripts/decide/calibration/2026-10-03/res-capture-status-v1.jsonl +376 -0
- package/scripts/decide/calibration/2026-10-03/res-text-garbled-strings.jsonl +48 -0
- package/scripts/decide/calibration/2026-10-03/res-text-garbled-v1.jsonl +73 -0
- package/scripts/decide/decide.py +262 -0
- package/scripts/decide/decide.sh +50 -0
- package/scripts/decide/layer-purity-pilot.mjs +41 -0
- package/scripts/decide/sets/capture-status.json +46 -0
- package/scripts/decide/sets/layer-purity.json +28 -0
- package/scripts/decide/sets/text-garbled.json +17 -0
- package/scripts/decide/test_decide.py +37 -0
- package/scripts/docs.mjs +15 -0
- package/scripts/entry-reads/crawl.ts +152 -0
- package/scripts/entry-reads/tsconfig.json +25 -0
- package/scripts/gen-format-schema.d.mts +2 -0
- package/scripts/gen-format-schema.mjs +21 -0
- package/scripts/gen-host-catalogue.d.mts +14 -0
- package/scripts/gen-host-catalogue.mjs +108 -0
- package/scripts/gen-shard-layout-doc.d.mts +4 -0
- package/scripts/gen-shard-layout-doc.mjs +55 -0
- package/scripts/gen-shards.d.mts +17 -0
- package/scripts/gen-shards.mjs +311 -0
- package/scripts/goldens/capture-inputs.d.mts +4 -0
- package/scripts/goldens/capture-inputs.mjs +34 -0
- package/scripts/goldens/colour_shift.py +27 -0
- package/scripts/goldens/native-residency.d.mts +10 -0
- package/scripts/goldens/native-residency.mjs +104 -0
- package/scripts/goldens/plot-inputs.d.mts +12 -0
- package/scripts/goldens/plot-inputs.mjs +46 -0
- package/scripts/gpu-texmem.mjs +98 -0
- package/scripts/horizon-matte/config.py +24 -0
- package/scripts/horizon-matte/encode.py +91 -0
- package/scripts/horizon-matte/key.py +141 -0
- package/scripts/horizon-matte/mkjobs.py +33 -0
- package/scripts/horizon-matte/mkjobs_day2.py +11 -0
- package/scripts/horizon-matte/overlap.py +80 -0
- package/scripts/horizon-matte/run_codex.py +57 -0
- package/scripts/horizon-matte/stitch.py +133 -0
- package/scripts/img2mesh/CC0.md +105 -0
- package/scripts/img2mesh/README.md +209 -0
- package/scripts/img2mesh/ab_board.py +102 -0
- package/scripts/img2mesh/birds/birds.json +255 -0
- package/scripts/img2mesh/birds/birds_atlas.py +150 -0
- package/scripts/img2mesh/birds/birds_fix_preview.mjs +103 -0
- package/scripts/img2mesh/birds/birds_fix_render.py +75 -0
- package/scripts/img2mesh/birds/birds_pack.py +110 -0
- package/scripts/img2mesh/birds/birds_phone_b.py +112 -0
- package/scripts/img2mesh/birds/birds_post.py +550 -0
- package/scripts/img2mesh/birds/birds_render.py +125 -0
- package/scripts/img2mesh/birds/birds_sheet.py +33 -0
- package/scripts/img2mesh/birds/birds_view.py +60 -0
- package/scripts/img2mesh/board.py +100 -0
- package/scripts/img2mesh/build_cc0.sh +52 -0
- package/scripts/img2mesh/build_driftwood.sh +12 -0
- package/scripts/img2mesh/build_faces.sh +53 -0
- package/scripts/img2mesh/build_props.py +81 -0
- package/scripts/img2mesh/cc0_export.py +186 -0
- package/scripts/img2mesh/driftwood_post.py +571 -0
- package/scripts/img2mesh/e304_faces.sh +67 -0
- package/scripts/img2mesh/face_remaster.py +911 -0
- package/scripts/img2mesh/face_views.py +95 -0
- package/scripts/img2mesh/faces-e304.json +9 -0
- package/scripts/img2mesh/faces.json +30 -0
- package/scripts/img2mesh/head_cut.py +100 -0
- package/scripts/img2mesh/hi3d_paint.py +94 -0
- package/scripts/img2mesh/hi3d_refine.py +161 -0
- package/scripts/img2mesh/hunyuan_cpu_rasterizer.sh +42 -0
- package/scripts/img2mesh/pine_hollow_phone.sh +13 -0
- package/scripts/img2mesh/props/coral-arch.json +32 -0
- package/scripts/img2mesh/props/ember-furnace.json +30 -0
- package/scripts/img2mesh/props/night-market-gate.json +10 -0
- package/scripts/img2mesh/render_still.py +86 -0
- package/scripts/img2mesh/rig_strip.mjs +46 -0
- package/scripts/img2mesh/rig_transfer.mjs +104 -0
- package/scripts/img2mesh/split_sheet.py +48 -0
- package/scripts/img2mesh/trellis_batch.py +110 -0
- package/scripts/img2mesh/versus_board.py +114 -0
- package/scripts/import-bundle.d.mts +2 -0
- package/scripts/import-bundle.mjs +20 -0
- package/scripts/ktx2-ab-board.py +133 -0
- package/scripts/ktx2-ab.mjs +111 -0
- package/scripts/ktx2-settings.mjs +18 -0
- package/scripts/land.d.mts +14 -0
- package/scripts/land.mjs +809 -0
- package/scripts/lint-dispatch.mjs +14 -0
- package/scripts/map-bake-frames.d.mts +4 -0
- package/scripts/map-bake-frames.mjs +23 -0
- package/scripts/map-geometry.d.mts +9 -0
- package/scripts/map-geometry.mjs +29 -0
- package/scripts/map-world.mjs +162 -0
- package/scripts/mockup-local.sh +46 -0
- package/scripts/music/export-midi.mjs +68 -0
- package/scripts/music/gen/analyze.py +308 -0
- package/scripts/music/gen/audio_jobs.py +46 -0
- package/scripts/music/gen/briefs.json +51 -0
- package/scripts/music/gen/build_page.py +334 -0
- package/scripts/music/gen/folk.json +3187 -0
- package/scripts/music/gen/gen_ace_step.py +156 -0
- package/scripts/music/gen/gen_heartmula.py +187 -0
- package/scripts/music/gen/gen_minimax.py +143 -0
- package/scripts/music/gen/gen_sao.py +122 -0
- package/scripts/music/gen/gen_sao_small.py +104 -0
- package/scripts/music/gen/gen_sfx.py +98 -0
- package/scripts/music/gen/gen_sfx_ezaudio.py +112 -0
- package/scripts/music/gen/gen_sfx_moss.py +112 -0
- package/scripts/music/gen/models.json +61 -0
- package/scripts/music/gen/nalati-jobs.json +104 -0
- package/scripts/music/gen/nalati-score-build.json +119 -0
- package/scripts/music/gen/nalati-score.json +3448 -0
- package/scripts/music/gen/ob7-fit-decisions.json +38 -0
- package/scripts/music/gen/ob7-score-jobs.json +152 -0
- package/scripts/music/gen/ob7-sfx-jobs.json +897 -0
- package/scripts/music/gen/ob7_build.py +469 -0
- package/scripts/music/gen/ob7_generate.py +67 -0
- package/scripts/music/gen/ob7_run.sh +42 -0
- package/scripts/music/gen/orchestral.json +3187 -0
- package/scripts/music/gen/own_score.py +486 -0
- package/scripts/music/gen/ph-jobs.json +27 -0
- package/scripts/music/gen/ph_page.py +222 -0
- package/scripts/music/gen/piano.json +3175 -0
- package/scripts/music/gen/rank_v3.py +248 -0
- package/scripts/music/gen/sfx-best.json +2486 -0
- package/scripts/music/gen/sfx-ezaudio.json +4082 -0
- package/scripts/music/gen/sfx-jobs.json +57 -0
- package/scripts/music/gen/sfx-minimax-jobs.json +16 -0
- package/scripts/music/gen/sfx-minimax.json +289 -0
- package/scripts/music/gen/sfx-moss.json +4082 -0
- package/scripts/music/gen/sfx-nalati-b3-jobs.json +17 -0
- package/scripts/music/gen/sfx-nalati-jobs.json +338 -0
- package/scripts/music/gen/sfx-nalati.json +11202 -0
- package/scripts/music/gen/sfx-nd-jobs.json +57 -0
- package/scripts/music/gen/sfx-nd-moss.json +2097 -0
- package/scripts/music/gen/sfx-nd-sa3-medium.json +2097 -0
- package/scripts/music/gen/sfx-nd-summary.json +38 -0
- package/scripts/music/gen/sfx-peaks.json +7 -0
- package/scripts/music/gen/sfx-ph-jobs.json +169 -0
- package/scripts/music/gen/sfx-ph-moss.json +6564 -0
- package/scripts/music/gen/sfx-ph-sa3-medium.json +7239 -0
- package/scripts/music/gen/sfx-ph-summary.json +63 -0
- package/scripts/music/gen/sfx-sa3-medium.json +4082 -0
- package/scripts/music/gen/sfx-sa3.json +4082 -0
- package/scripts/music/gen/sfx-summary.json +107 -0
- package/scripts/music/gen/sfx_build.py +332 -0
- package/scripts/music/gen/sfx_merge.py +255 -0
- package/scripts/music/gen/sfx_minimax.py +61 -0
- package/scripts/music/gen/sfx_nalati.py +331 -0
- package/scripts/music/gen/sfx_sprite.py +424 -0
- package/scripts/music/gen/stems.py +539 -0
- package/scripts/music/gen/test_loop_meter.py +29 -0
- package/scripts/music/gen/test_ob7_provenance.py +77 -0
- package/scripts/music/gen/v3-folk-build.json +148 -0
- package/scripts/music/gen/v3-folk.json +1818 -0
- package/scripts/music/gen/v3-jobs.json +145 -0
- package/scripts/music/gen/v3-orchestral-build.json +148 -0
- package/scripts/music/gen/v3-orchestral.json +1813 -0
- package/scripts/music/gen/v3-ph-folk-build.json +94 -0
- package/scripts/music/gen/v3-ph-folk.json +1806 -0
- package/scripts/music/gen/v3-ph-orchestral-build.json +94 -0
- package/scripts/music/gen/v3-ph-orchestral.json +1824 -0
- package/scripts/music/gen/v3-ph-piano-build.json +94 -0
- package/scripts/music/gen/v3-ph-piano.json +1818 -0
- package/scripts/music/gen/v3-piano-build.json +148 -0
- package/scripts/music/gen/v3-piano.json +1813 -0
- package/scripts/music/wildshard-theme.mid +0 -0
- package/scripts/music/wildshard-trailer30.mid +0 -0
- package/scripts/named-blob-output.d.mts +8 -0
- package/scripts/named-blob-output.mjs +48 -0
- package/scripts/pack-all.mjs +15 -0
- package/scripts/pid-lock.d.mts +1 -0
- package/scripts/pid-lock.mjs +63 -0
- package/scripts/practice/bake_dummy.py +53 -0
- package/scripts/practice/build_dummies.sh +43 -0
- package/scripts/practice/dummy_parts.py +568 -0
- package/scripts/practice/dummy_rig_gate.py +139 -0
- package/scripts/practice/gate_sheet.py +36 -0
- package/scripts/practice/generate_dummy_unimate.py +132 -0
- package/scripts/practice/pack_dummy.mjs +59 -0
- package/scripts/practice/repair_dummy_weights.mjs +68 -0
- package/scripts/practice/rig_dummy.py +828 -0
- package/scripts/practice/verify_unimate_skin.mjs +356 -0
- package/scripts/preparation-seed.mjs +15 -0
- package/scripts/prepare-basis-tool.mjs +6 -0
- package/scripts/prepare-product.d.mts +14 -0
- package/scripts/prepare-product.mjs +101 -0
- package/scripts/product-build-tools.d.mts +3 -0
- package/scripts/product-build-tools.json +3 -0
- package/scripts/product-build-tools.mjs +31 -0
- package/scripts/publish-public.mjs +7 -0
- package/scripts/push-tables.d.mts +1 -0
- package/scripts/push-tables.mjs +28 -0
- package/scripts/record-shard-mounts.mjs +133 -0
- package/scripts/sdk-externals.d.mts +2 -0
- package/scripts/sdk-externals.mjs +2 -0
- package/scripts/section-inventory.ts +209 -0
- package/scripts/select-candidate.mjs +15 -0
- package/scripts/shard-build-pool.d.mts +4 -0
- package/scripts/shard-build-pool.mjs +53 -0
- package/scripts/shard-line-baseline.json +17 -0
- package/scripts/shard-milestones.d.mts +15 -0
- package/scripts/shard-milestones.mjs +105 -0
- package/scripts/shard-output-report.d.mts +9 -0
- package/scripts/shard-output-report.mjs +85 -0
- package/scripts/shard-platform-cli.mjs +93 -0
- package/scripts/shard-progress.mjs +212 -0
- package/scripts/shard-timelapse.py +102 -0
- package/scripts/shardfile-cold-boot.mjs +79 -0
- package/scripts/shardfile-vite.d.mts +4 -0
- package/scripts/shardfile-vite.mjs +20 -0
- package/scripts/simplify-models.mjs +24 -0
- package/scripts/site-facts.mjs +88 -0
- package/scripts/test-template-gate.mjs +44 -0
- package/scripts/test_golden_compare.py +68 -0
- package/scripts/tex-tiers.cache.json +181 -0
- package/scripts/tex-tiers.mjs +240 -0
- package/scripts/texmem-probe.mjs +184 -0
- package/scripts/unused-assets.mjs +173 -0
- package/scripts/vite-tmp.d.mts +23 -0
- package/scripts/vite-tmp.mjs +157 -0
- package/scripts/wave-line-baselines.json +32 -0
- package/scripts/wildshard.d.mts +4 -0
- package/scripts/wildshard.mjs +105 -0
- package/scripts/witness-checkpoints.d.mts +10 -0
- package/scripts/witness-checkpoints.mjs +84 -0
- package/scripts/witness-generation.d.mts +10 -0
- package/scripts/witness-generation.mjs +45 -0
- package/scripts/witness-manifests.d.mts +8 -0
- package/scripts/witness-manifests.mjs +157 -0
- package/scripts/worktree-ignore.d.mts +4 -0
- package/scripts/worktree-ignore.mjs +36 -0
- package/scripts/worktree-reap.mjs +214 -0
- package/scripts/worktree.mjs +396 -0
- package/scripts/worldclaw/capture-front.sh +28 -0
- package/scripts/worldclaw/design-template.md +62 -0
- package/scripts/worldclaw/spec-map.py +92 -0
- package/scripts/worldclaw/spec.ts +96 -0
- package/skills/wildshard/SKILL.md +50 -0
- package/skills/wildshard-goldens/SKILL.md +54 -0
- package/skills/wildshard-mockup-to-model/SKILL.md +56 -0
- package/skills/wildshard-upgrade/SKILL.md +46 -0
- package/src/.oxfmtrc.json +50 -0
- package/src/.oxlintrc.json +173 -0
- package/src/cli/account/account.ts +199 -0
- package/src/cli/account/command.ts +193 -0
- package/src/cli/account/key.ts +154 -0
- package/src/cli/args.ts +97 -0
- package/src/cli/audio/audio.ts +24 -0
- package/src/cli/bin.mjs +8 -0
- package/src/cli/delete/delete.ts +258 -0
- package/src/cli/help.ts +196 -0
- package/src/cli/hero/adopt.ts +103 -0
- package/src/cli/hero/hero.ts +112 -0
- package/src/cli/hero/stamp.ts +298 -0
- package/src/cli/main.ts +292 -0
- package/src/cli/report.ts +16 -0
- package/src/cli/shardfile/command.ts +50 -0
- package/src/cli/shardfile/shardfile.ts +192 -0
- package/src/cli/upload/api.ts +246 -0
- package/src/cli/upload/compress.ts +55 -0
- package/src/cli/upload/hero.ts +62 -0
- package/src/cli/upload/placement.ts +115 -0
- package/src/cli/upload/provenance.ts +192 -0
- package/src/cli/upload/signature.ts +30 -0
- package/src/cli/upload/upload.ts +269 -0
- package/src/cli/upload/validate.ts +74 -0
- package/src/cli/upload/wire.ts +147 -0
- package/src/cli/version.ts +63 -0
- package/src/commons/bake/portableMath.ts +187 -0
- package/src/commons/catalogue.ts +10 -0
- package/src/commons/courseProgram.ts +32 -0
- package/src/commons/practiceCourse.ts +16 -0
- package/src/commons/scripts/abi.as +14 -0
- package/src/commons/scripts/bridge.as +14 -0
- package/src/commons/scripts/course.as +63 -0
- package/src/scripts/ask-new.sh +29 -0
- package/src/scripts/asks.mjs +141 -0
- package/src/scripts/herdr-prompt.sh +34 -0
- package/src/scripts/herdr-question-open.sh +67 -0
- package/src/scripts/md-wrap.mjs +229 -0
- package/src/server/app.ts +19 -0
- package/src/server/serve.ts +49 -0
- package/src/sharddev/admission.ts +7 -0
- package/src/sharddev/arenaView.ts +15 -0
- package/src/sharddev/as/groupBankV2.ts +36 -0
- package/src/sharddev/as/groupStepV2.ts +13 -0
- package/src/sharddev/as/ws.ts +30 -0
- package/src/sharddev/as/wsV2.ts +180 -0
- package/src/sharddev/assemblyscriptCompiler.d.mts +5 -0
- package/src/sharddev/assemblyscriptCompiler.mjs +14 -0
- package/src/sharddev/assetHandle.ts +84 -0
- package/src/sharddev/assetOwner.ts +70 -0
- package/src/sharddev/assetScope.ts +30 -0
- package/src/sharddev/assets.ts +21 -0
- package/src/sharddev/audio.ts +9 -0
- package/src/sharddev/audioEncode.ts +211 -0
- package/src/sharddev/author.ts +3 -0
- package/src/sharddev/authorError.ts +28 -0
- package/src/sharddev/authorManifest.ts +39 -0
- package/src/sharddev/bake/annulus.ts +19 -0
- package/src/sharddev/bake/assemblyscriptMemo.ts +76 -0
- package/src/sharddev/bake/assemblyscriptMemoPort.ts +4 -0
- package/src/sharddev/bake/authoredWorld.ts +201 -0
- package/src/sharddev/bake/basisEncoder.ts +95 -0
- package/src/sharddev/bake/basisGlb.ts +85 -0
- package/src/sharddev/bake/basisTool.ts +74 -0
- package/src/sharddev/bake/basisToolInputs.ts +476 -0
- package/src/sharddev/bake/byteCodec.ts +33 -0
- package/src/sharddev/bake/canvasAtlas.ts +406 -0
- package/src/sharddev/bake/coarseCopy.ts +59 -0
- package/src/sharddev/bake/colliders.ts +87 -0
- package/src/sharddev/bake/compactGlb.ts +224 -0
- package/src/sharddev/bake/compileScript.ts +119 -0
- package/src/sharddev/bake/compileScriptV2.ts +75 -0
- package/src/sharddev/bake/contactRows.ts +84 -0
- package/src/sharddev/bake/creaturePlacement.ts +117 -0
- package/src/sharddev/bake/export.ts +67 -0
- package/src/sharddev/bake/facetedGeometry.ts +379 -0
- package/src/sharddev/bake/farImpostor.ts +120 -0
- package/src/sharddev/bake/forest.ts +100 -0
- package/src/sharddev/bake/format-hook.mjs +2 -0
- package/src/sharddev/bake/generatorGlb.ts +23 -0
- package/src/sharddev/bake/geometryBounds.ts +77 -0
- package/src/sharddev/bake/geometryError.ts +48 -0
- package/src/sharddev/bake/glb.ts +355 -0
- package/src/sharddev/bake/glbCompression.ts +143 -0
- package/src/sharddev/bake/gltfSource.ts +59 -0
- package/src/sharddev/bake/groundMap.ts +142 -0
- package/src/sharddev/bake/image.ts +20 -0
- package/src/sharddev/bake/isleMap.ts +64 -0
- package/src/sharddev/bake/json.mjs +84 -0
- package/src/sharddev/bake/keyedSky.ts +47 -0
- package/src/sharddev/bake/keyedSkyMemo.ts +39 -0
- package/src/sharddev/bake/kinds.ts +137 -0
- package/src/sharddev/bake/lightSources.ts +31 -0
- package/src/sharddev/bake/mapAssembly.ts +84 -0
- package/src/sharddev/bake/mapRaster.ts +173 -0
- package/src/sharddev/bake/mapRest.ts +57 -0
- package/src/sharddev/bake/mapScenes.ts +234 -0
- package/src/sharddev/bake/materialGraph.ts +32 -0
- package/src/sharddev/bake/meadow.ts +27 -0
- package/src/sharddev/bake/meshoptChoiceMemo.ts +34 -0
- package/src/sharddev/bake/nativeInteractionFacts.ts +5 -0
- package/src/sharddev/bake/nativeLattice.ts +178 -0
- package/src/sharddev/bake/nativeRaster.ts +106 -0
- package/src/sharddev/bake/nativeTerrainField.ts +11 -0
- package/src/sharddev/bake/navigation-json.mjs +38 -0
- package/src/sharddev/bake/navigation.ts +113 -0
- package/src/sharddev/bake/navigationAsset.ts +18 -0
- package/src/sharddev/bake/nearPlaceholder.ts +206 -0
- package/src/sharddev/bake/normalizeRig.ts +80 -0
- package/src/sharddev/bake/phoneAstc.ts +93 -0
- package/src/sharddev/bake/placeholders.ts +581 -0
- package/src/sharddev/bake/placement.ts +80 -0
- package/src/sharddev/bake/portableBytes.ts +18 -0
- package/src/sharddev/bake/portableBytesMemo.ts +50 -0
- package/src/sharddev/bake/practiceCourse.ts +49 -0
- package/src/sharddev/bake/primitives.ts +96 -0
- package/src/sharddev/bake/props.ts +443 -0
- package/src/sharddev/bake/questPlacement.ts +98 -0
- package/src/sharddev/bake/rawTexture.ts +26 -0
- package/src/sharddev/bake/riderArms.ts +97 -0
- package/src/sharddev/bake/rig.ts +95 -0
- package/src/sharddev/bake/riggedHullRecipes.ts +40 -0
- package/src/sharddev/bake/signPlacements.ts +25 -0
- package/src/sharddev/bake/simplifier.ts +52 -0
- package/src/sharddev/bake/skinned.ts +312 -0
- package/src/sharddev/bake/slabChunks.ts +149 -0
- package/src/sharddev/bake/slabs.ts +263 -0
- package/src/sharddev/bake/source-loader.mjs +55 -0
- package/src/sharddev/bake/sourceMetadata.ts +54 -0
- package/src/sharddev/bake/species.ts +368 -0
- package/src/sharddev/bake/specimenCatalogue.ts +47 -0
- package/src/sharddev/bake/splatGround.ts +141 -0
- package/src/sharddev/bake/staticMaterials.ts +171 -0
- package/src/sharddev/bake/terrain.ts +195 -0
- package/src/sharddev/bake/texture.ts +33 -0
- package/src/sharddev/bake/textureWasm.ts +81 -0
- package/src/sharddev/bake/tileEncoder.ts +11 -0
- package/src/sharddev/bake/tileGrid.ts +62 -0
- package/src/sharddev/bake/v2Finite.ts +160 -0
- package/src/sharddev/bake/v2Fuel.ts +71 -0
- package/src/sharddev/bake/wholePartition.ts +74 -0
- package/src/sharddev/bake/wholePieceJoin.ts +147 -0
- package/src/sharddev/bake/world.ts +173 -0
- package/src/sharddev/bake/worldCollision.ts +128 -0
- package/src/sharddev/bake/worldGeometry.ts +237 -0
- package/src/sharddev/bake/worldGlb.ts +123 -0
- package/src/sharddev/bake/worldImage.ts +12 -0
- package/src/sharddev/bake/worldLod.ts +128 -0
- package/src/sharddev/bake/worldRows.ts +102 -0
- package/src/sharddev/bake/worldTextureMemo.ts +63 -0
- package/src/sharddev/bake/zstdBytesMemo.ts +52 -0
- package/src/sharddev/bake.ts +193 -0
- package/src/sharddev/bakePublication.ts +31 -0
- package/src/sharddev/behaviourSource.ts +94 -0
- package/src/sharddev/bin/wildshard.mjs +7 -0
- package/src/sharddev/blobBytes.ts +65 -0
- package/src/sharddev/blobs.ts +138 -0
- package/src/sharddev/bootInventory.ts +129 -0
- package/src/sharddev/bossProfiles.ts +18 -0
- package/src/sharddev/buildBehaviour.ts +77 -0
- package/src/sharddev/buildCacheMetrics.ts +17 -0
- package/src/sharddev/buildDecisionScripts.ts +122 -0
- package/src/sharddev/check.ts +117 -0
- package/src/sharddev/checkProject.ts +126 -0
- package/src/sharddev/cli.ts +191 -0
- package/src/sharddev/clientChannels.ts +169 -0
- package/src/sharddev/clientScripts.ts +10 -0
- package/src/sharddev/commons.ts +77 -0
- package/src/sharddev/commonsCosts.ts +11 -0
- package/src/sharddev/compileMovers.ts +11 -0
- package/src/sharddev/configBoundary.ts +6 -0
- package/src/sharddev/cookInput.ts +40 -0
- package/src/sharddev/crowds.ts +6 -0
- package/src/sharddev/decisionBindingMap.ts +11 -0
- package/src/sharddev/decisionScriptBindings.ts +117 -0
- package/src/sharddev/decisionScripts.ts +28 -0
- package/src/sharddev/decisionSource.ts +51 -0
- package/src/sharddev/dev.ts +113 -0
- package/src/sharddev/director.ts +26 -0
- package/src/sharddev/directorAbi.ts +77 -0
- package/src/sharddev/discoveryDocument.ts +97 -0
- package/src/sharddev/draft.ts +11 -0
- package/src/sharddev/eliteEntryRows.ts +29 -0
- package/src/sharddev/entries.ts +76 -0
- package/src/sharddev/entryReads.ts +73 -0
- package/src/sharddev/executeBundle.ts +55 -0
- package/src/sharddev/finds.ts +5 -0
- package/src/sharddev/formatJsonSchema.ts +3 -0
- package/src/sharddev/generationCache.ts +257 -0
- package/src/sharddev/generationRecipe.ts +94 -0
- package/src/sharddev/handwritten.ts +110 -0
- package/src/sharddev/immutable.ts +14 -0
- package/src/sharddev/interactions.ts +38 -0
- package/src/sharddev/kit/bakedGeometry.ts +16 -0
- package/src/sharddev/kit/geometryPack.ts +110 -0
- package/src/sharddev/ledger.ts +13 -0
- package/src/sharddev/looks/tileField.ts +67 -0
- package/src/sharddev/materialGraphFiles.ts +57 -0
- package/src/sharddev/materials.ts +574 -0
- package/src/sharddev/measure.ts +18 -0
- package/src/sharddev/modes.ts +115 -0
- package/src/sharddev/moverPrograms.ts +213 -0
- package/src/sharddev/movers.ts +75 -0
- package/src/sharddev/nativePopulationRows.ts +46 -0
- package/src/sharddev/newProject.ts +247 -0
- package/src/sharddev/noise.ts +54 -0
- package/src/sharddev/outputProduct.ts +188 -0
- package/src/sharddev/outputRuntime.ts +66 -0
- package/src/sharddev/performancePolicy.ts +18 -0
- package/src/sharddev/phasedBoss.ts +34 -0
- package/src/sharddev/physics.ts +194 -0
- package/src/sharddev/platformSections.ts +42 -0
- package/src/sharddev/plumbing.ts +8 -0
- package/src/sharddev/productOutput.ts +128 -0
- package/src/sharddev/project.ts +337 -0
- package/src/sharddev/projectCompilerIdentity.ts +94 -0
- package/src/sharddev/projectDecisions.ts +66 -0
- package/src/sharddev/projectEntryProof.ts +32 -0
- package/src/sharddev/projectGeneration.ts +219 -0
- package/src/sharddev/projectInputFiles.ts +47 -0
- package/src/sharddev/projectManifest.ts +108 -0
- package/src/sharddev/projectMap.ts +35 -0
- package/src/sharddev/projectOutput.ts +242 -0
- package/src/sharddev/projectPolicy.ts +17 -0
- package/src/sharddev/projectSections.ts +27 -0
- package/src/sharddev/questGraph.ts +25 -0
- package/src/sharddev/quests.ts +65 -0
- package/src/sharddev/random.ts +61 -0
- package/src/sharddev/refusals.ts +234 -0
- package/src/sharddev/reportCard.ts +13 -0
- package/src/sharddev/returnProjectionV2.ts +81 -0
- package/src/sharddev/rows.ts +192 -0
- package/src/sharddev/runtimeImports.ts +38 -0
- package/src/sharddev/runtimeMirrors.ts +39 -0
- package/src/sharddev/runtimePerformance.ts +38 -0
- package/src/sharddev/scene.ts +321 -0
- package/src/sharddev/sceneAnimation.ts +54 -0
- package/src/sharddev/sceneAudio.ts +64 -0
- package/src/sharddev/sceneDeclarations.ts +100 -0
- package/src/sharddev/sceneGraph.ts +139 -0
- package/src/sharddev/sceneTransform.ts +12 -0
- package/src/sharddev/schemaValidation.ts +61 -0
- package/src/sharddev/sections.ts +47 -0
- package/src/sharddev/shardSource.ts +59 -0
- package/src/sharddev/sourceReader.ts +26 -0
- package/src/sharddev/spawns.ts +38 -0
- package/src/sharddev/species/clips.ts +24 -0
- package/src/sharddev/species.ts +29 -0
- package/src/sharddev/speciesBrains.ts +19 -0
- package/src/sharddev/synth.ts +66 -0
- package/src/sharddev/test/compileDualScriptV2.ts +71 -0
- package/src/sharddev/test/compileSimV2.ts +21 -0
- package/src/sharddev/test/diskScriptScenario.ts +86 -0
- package/src/sharddev/test/scriptScenario.ts +249 -0
- package/src/sharddev/test/scriptSource.ts +12 -0
- package/src/sharddev/version.ts +4 -0
- package/src/sharddev/weapons/bowProfile.ts +20 -0
- package/src/sharddev/weapons/firearmRows.ts +11 -0
- package/src/sharddev/weapons/meleeProfile.ts +71 -0
- package/src/sharddev/weapons/thrownProfile.ts +10 -0
- package/src/sharddev/worldScenes.ts +308 -0
- package/src/sharddev/worldSource.ts +82 -0
- package/src/shards/_template/README.md +78 -0
- package/src/shards/_template/assets/2bf489fdb15f1734ddb4c4f32d500ec6da85c765ec7a4eb28dc6781160e7ec8c +0 -0
- package/src/shards/_template/assets/97ec4d8f75f5fa6239ee919444d6dc19fd35896bb305930c1f050ac6e0e0e6a6 +1 -0
- package/src/shards/_template/assets/a6a587a31327f936b1b04c05ade818c73fc8964260918662db43539465e27586 +0 -0
- package/src/shards/_template/assets/b4fbde0422e125b498c3dc8b9a5cc2516c8598f09e9d0e5f6b639b32f98179e6 +0 -0
- package/src/shards/_template/assets/bfa4dfc9c18979f904557ee8deab0058b8a399be10266f5fb1578b403f482fd4 +1 -0
- package/src/shards/_template/assets/ef3b7ff4fd22715771cb7d68a3977a903c5e7c3dc293542687d04b3ef3ace2cb +0 -0
- package/src/shards/_template/assets/f2db05998615ce1cb79ea96be32c168842eb6a2b34ec01feb86d36404603ee54 +0 -0
- package/src/shards/_template/assets/fef98ebb7fce6f66b26e78ac699e5c90f9bdcfaf8cabeb2b58125347eea8b4ab +0 -0
- package/src/shards/_template/behaviour/boss.as +39 -0
- package/src/shards/_template/behaviour/door.as +32 -0
- package/src/shards/_template/behaviour/hooks.json +129 -0
- package/src/shards/_template/behaviour/idle.as +75 -0
- package/src/shards/_template/behaviour/items.as +22 -0
- package/src/shards/_template/card/landscape.jpg +0 -0
- package/src/shards/_template/card/portrait.jpg +0 -0
- package/src/shards/_template/card/thumb.jpg +0 -0
- package/src/shards/_template/data/audio.json +45 -0
- package/src/shards/_template/data/bossDecision.json +83 -0
- package/src/shards/_template/data/budgets.json +70 -0
- package/src/shards/_template/data/card.json +281 -0
- package/src/shards/_template/data/clientScripts.json +987 -0
- package/src/shards/_template/data/creatures.json +65 -0
- package/src/shards/_template/data/director.json +39 -0
- package/src/shards/_template/data/encounters.json +96 -0
- package/src/shards/_template/data/items.json +172 -0
- package/src/shards/_template/data/layout.json +66 -0
- package/src/shards/_template/data/ledger.json +32 -0
- package/src/shards/_template/data/look.json +521 -0
- package/src/shards/_template/data/map.json +64 -0
- package/src/shards/_template/data/moves.json +16 -0
- package/src/shards/_template/data/placeholder.json +8 -0
- package/src/shards/_template/data/plumbing.json +32 -0
- package/src/shards/_template/data/quests.json +223 -0
- package/src/shards/_template/data/rows.json +423 -0
- package/src/shards/_template/data/skins.json +66 -0
- package/src/shards/_template/data/spawn.json +6 -0
- package/src/shards/_template/data/targets.json +150 -0
- package/src/shards/_template/data/text.json +12 -0
- package/src/shards/_template/data/ui.json +33 -0
- package/src/shards/_template/data/water.json +13 -0
- package/src/shards/_template/generators/behaviour.ts +34 -0
- package/src/shards/_template/generators/boss.ts +29 -0
- package/src/shards/_template/generators/buildOptions.ts +2 -0
- package/src/shards/_template/generators/cell.ts +224 -0
- package/src/shards/_template/generators/districts.ts +215 -0
- package/src/shards/_template/generators/farLook.ts +15 -0
- package/src/shards/_template/generators/generate.ts +27 -0
- package/src/shards/_template/generators/ground.ts +15 -0
- package/src/shards/_template/generators/kit.ts +69 -0
- package/src/shards/_template/generators/landscape.ts +59 -0
- package/src/shards/_template/generators/landscapeNoise.ts +62 -0
- package/src/shards/_template/generators/mapInputs.ts +10 -0
- package/src/shards/_template/generators/product.ts +100 -0
- package/src/shards/_template/generators/productOutput.ts +18 -0
- package/src/shards/_template/generators/props.ts +9 -0
- package/src/shards/_template/generators/templatePropsSource.ts +58 -0
- package/src/shards/_template/generators/terrain.ts +17 -0
- package/src/shards/_template/generators/world.ts +630 -0
- package/src/shards/_template/hero.json +10 -0
- package/src/shards/_template/look/entry-reads.json +20 -0
- package/src/shards/_template/manifest.json +281 -0
- package/src/shards/_template/shard.config.ts +10 -0
- package/src/shared/health.ts +10 -0
- package/src/tools/build-web.ts +59 -0
- package/src/tsconfig.json +30 -0
- package/src/web/app.tsx +53 -0
- package/src/web/index.html +12 -0
- package/src/web/main.tsx +10 -0
- package/src/web/tsconfig.json +13 -0
- package/tsconfig.author.json +23 -0
- package/tsconfig.commons.json +21 -0
- package/tsconfig.json +47 -0
- package/tsconfig.sharddev.json +20 -0
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
import { Kit, framed } from './kit';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Build-time only (SHARD-PLATFORM SF52, G220 pass 2): the districts that fill the flat plane between Template 1's roads,
|
|
5
|
+
* the second set piece at each entry, and the four copy plots. Jake on the first fill: "needs much more" (no view from the
|
|
6
|
+
* road or the air may read as an empty plane). Each quadrant has a corner district (≈ 105 m square, beyond the hub
|
|
7
|
+
* corners) and two side strips between the spokes and the corner; one strip carries a district, the other a copy plot
|
|
8
|
+
* (a 40 m pad a grid copy fills with its own landmark, `copyIdentity.ts`; in the solo template it stays a marked pad).
|
|
9
|
+
* Nothing is mirrored: every district is its own dev-map vocabulary (measure boxes, panels, gantries, pads, ramps,
|
|
10
|
+
* decks). Spokes (|x| or |z| < 10), the loop band, the hub corners, the entry set pieces and the sockets stay clear, and
|
|
11
|
+
* nothing stands within 10 m of the cell edge. North is +z.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
/** the copy plots' centres (cell-local metres) and their half-size: one per quadrant, rotating round the cell */
|
|
15
|
+
export const COPY_PLOTS: readonly (readonly [number, number])[] = [[66, 162], [-162, 66], [-66, -162], [162, -66]];
|
|
16
|
+
export const PLOT_HALF = 20;
|
|
17
|
+
|
|
18
|
+
/** North-east corner: the hover test course. Kickers, a funbox, a quarter wall, a gap jump and a rail, on a marked pad. */
|
|
19
|
+
export function testCourse(): Kit {
|
|
20
|
+
const kit = new Kit(), cx = 182, cz = 182;
|
|
21
|
+
for (const dx of [-25, 25]) for (const dz of [-25, 25]) kit.box(cx + dx, 0, cz + dz, 49.6, 0.05, 49.6, 2, false);
|
|
22
|
+
// the funbox: a 12 m deck 1.5 m up with a ramp on each side
|
|
23
|
+
kit.box(cx, 0, cz, 12, 1.5, 12, 1, true);
|
|
24
|
+
kit.ramp(cx - 13, 0, cz, 8, 7, 1.5, '+x'); kit.ramp(cx + 13, 0, cz, 8, 7, 1.5, '-x');
|
|
25
|
+
kit.ramp(cx, 0, cz - 13, 8, 7, 1.5, '+z'); kit.ramp(cx, 0, cz + 13, 8, 7, 1.5, '-z');
|
|
26
|
+
// kickers, each facing its own way
|
|
27
|
+
kit.ramp(150, 0, 150, 5, 5, 1.2, '+x'); kit.ramp(214, 0, 152, 5, 5, 1.6, '+z'); kit.ramp(150, 0, 214, 5, 6, 1, '-z');
|
|
28
|
+
// the gap jump: a launch, a 5 m gap and a landing deck with its run-out
|
|
29
|
+
kit.ramp(140, 0, 196, 6, 9, 2.4, '+x');
|
|
30
|
+
kit.box(159, 0, 196, 10, 2.4, 6, 1, true); kit.ramp(164, 2.4, 196, 6, 9, -2.4, '+x');
|
|
31
|
+
// the quarter wall: three stacked slopes against a 6 m wall
|
|
32
|
+
kit.box(230, 0, 196, 2, 6, 30, 1, true);
|
|
33
|
+
kit.ramp(220, 0, 196, 30, 4, 1.2, '+x'); kit.ramp(224, 1.2, 196, 30, 3, 2, '+x'); kit.ramp(227, 3.2, 196, 30, 2, 2.6, '+x');
|
|
34
|
+
// the rail ledge and the start gantry with its board
|
|
35
|
+
kit.box(196, 0, 140, 24, 0.6, 1, 2, true, 'metal');
|
|
36
|
+
for (const x of [168, 184]) kit.box(x, 0, 230, 1, 8, 1, 2, true, 'metal');
|
|
37
|
+
kit.box(176, 8, 230, 18, 2.5, 1, 1, false);
|
|
38
|
+
// course cones (marker blocks) on the infield
|
|
39
|
+
for (let i = 0; i < 6; i++) kit.box(150 + i * 12, 0, 160, 0.8, 0.9, 0.8, 1, true);
|
|
40
|
+
return kit;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** North-west corner: the block district. A 4 × 4 grid of 18 m blocks, 6–30 m tall, with 8 m alleys you can ride through. */
|
|
44
|
+
export function blockDistrict(): Kit {
|
|
45
|
+
const kit = new Kit(), heights = [12, 24, 8, 18, 30, 10, 16, 6, 9, 20, 27, 14, 18, 7, 12, 22];
|
|
46
|
+
for (let i = 0; i < 4; i++) for (let j = 0; j < 4; j++) {
|
|
47
|
+
const x = -226 + i * 26 + 9, z = 134 + j * 26 + 9, h = heights[i * 4 + j] ?? 10;
|
|
48
|
+
kit.box(x, 0, z, 18, h, 18, 1, true);
|
|
49
|
+
kit.box(x, h, z, 19, 0.5, 19, 2, false);
|
|
50
|
+
// setbacks on the tall ones, rooftop plant on the rest
|
|
51
|
+
if (h >= 18) { kit.box(x, h + 0.5, z, 11, h * 0.35, 11, 1, true); kit.box(x, h * 1.35 + 0.5, z, 12, 0.5, 12, 2, false); }
|
|
52
|
+
else kit.box(x + 4, h + 0.5, z - 4, 4, 2, 3, 2, false);
|
|
53
|
+
// ground-floor awnings facing the alley to the east
|
|
54
|
+
kit.box(x + 9.75, 3, z, 1.5, 0.3, 10, 2, false);
|
|
55
|
+
}
|
|
56
|
+
return kit;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/** South-east corner: the ziggurat. Five 3 m tiers with a ramp up each (rotating round the sides) and a beacon mast on top. */
|
|
60
|
+
export function ziggurat(): Kit {
|
|
61
|
+
const kit = new Kit(), cx = 182, cz = -182;
|
|
62
|
+
const climbs = ['+z', '+x', '-z', '-x'] as const;
|
|
63
|
+
for (let t = 0; t < 5; t++) {
|
|
64
|
+
const size = 60 - t * 12, y0 = t * 3;
|
|
65
|
+
kit.box(cx, y0, cz, size, 3, size, t % 2 === 0 ? 1 : 2, true);
|
|
66
|
+
if (t === 4) break;
|
|
67
|
+
// a ramp onto the tier from the one below, against its face (rideable all the way up)
|
|
68
|
+
const climb = climbs[t % 4] ?? '+z', half = size / 2, next = (size - 12) / 2;
|
|
69
|
+
if (climb === '+z') kit.ramp(cx - next + 4, y0 + 3, cz - half + 0.5, 5, 5.5, 3, '+z');
|
|
70
|
+
else if (climb === '+x') kit.ramp(cx - half + 0.5, y0 + 3, cz + next - 4, 5, 5.5, 3, '+x');
|
|
71
|
+
else if (climb === '-z') kit.ramp(cx + next - 4, y0 + 3, cz + half - 0.5, 5, 5.5, 3, '-z');
|
|
72
|
+
else kit.ramp(cx + half - 0.5, y0 + 3, cz - next + 4, 5, 5.5, 3, '-x');
|
|
73
|
+
}
|
|
74
|
+
// the ground ramp onto tier one, from the north
|
|
75
|
+
kit.ramp(cx, 0, cz + 42, 8, 12, 3, '-z');
|
|
76
|
+
kit.box(cx, 15, cz, 2, 14, 2, 1, true, 'metal');
|
|
77
|
+
kit.box(cx, 29, cz, 4, 2, 4, 2, false);
|
|
78
|
+
for (const [dx, dz] of [[-36, -36], [36, -36], [36, 36], [-36, 36]] as const) kit.box(cx + dx, 0, cz + dz, 1, 6, 1, 2, true, 'metal');
|
|
79
|
+
return kit;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/** South-west corner: the overpass. An L of elevated road 6 m up on columns, a ramp at each end and a control tower in the angle. */
|
|
83
|
+
export function overpass(): Kit {
|
|
84
|
+
const kit = new Kit(), y = 6, z0 = -222, x0 = -222;
|
|
85
|
+
// the deck: along x at z0 from x −217 to −140, and along z at x0 from z −217 to −140 (three 25.7 m spans each), meeting
|
|
86
|
+
// the corner square
|
|
87
|
+
const spans = [-204.1667, -178.5, -152.8333], span = 77 / 3;
|
|
88
|
+
for (const c of spans) { kit.box(c, y, z0, span, 0.6, 10, 2, true); kit.box(x0, y, c, 10, 0.6, span, 2, true); } kit.box(x0, y, z0, 10, 0.6, 10, 2, true);
|
|
89
|
+
for (const s of [-1, 1]) for (const c of spans) { kit.box(c, y + 0.6, z0 + s * 4.75, span, 0.9, 0.5, 1, true); kit.box(x0 + s * 4.75, y + 0.6, c, 0.5, 0.9, span, 1, true); }
|
|
90
|
+
for (let k = 0; k < 5; k++) { kit.box(-200 + k * 14, 0, z0, 1.2, y, 1.2, 1, true); kit.box(x0, 0, -200 + k * 14, 1.2, y, 1.2, 1, true); }
|
|
91
|
+
kit.box(x0, 0, z0, 2, y, 2, 1, true);
|
|
92
|
+
// the ramps up at both free ends (climbing toward the deck)
|
|
93
|
+
kit.ramp(-110, 0, z0, 10, 30, y + 0.3, '-x'); kit.ramp(x0, 0, -110, 10, 30, y + 0.3, '-z');
|
|
94
|
+
// the control tower inside the angle, with its cab
|
|
95
|
+
kit.box(-196, 0, -196, 6, 18, 6, 1, true); kit.box(-196, 18, -196, 9, 4, 9, 2, true); kit.box(-196, 22, -196, 10, 0.5, 10, 1, false);
|
|
96
|
+
// a hangar-style shed under the long arm and stacked barriers along the ground road
|
|
97
|
+
kit.box(-156, 0, -206, 20, 4, 10, 1, true);
|
|
98
|
+
for (let k = 0; k < 8; k++) kit.box(-206 + k * 8, 0, -186, 3, 1, 1, 2, true);
|
|
99
|
+
return kit;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/** North-east east strip: the scaffold yard. Six frames with decks at 4 m and 8 m, a ramp onto the low deck. */
|
|
103
|
+
export function scaffoldYard(): Kit {
|
|
104
|
+
const kit = new Kit();
|
|
105
|
+
for (let i = 0; i < 3; i++) for (let j = 0; j < 2; j++) {
|
|
106
|
+
const x = 140 + i * 18, z = 50 + j * 36;
|
|
107
|
+
for (const dx of [-6, 6]) for (const dz of [-6, 6]) kit.box(x + dx, 0, z + dz, 0.4, (i + j) % 2 === 0 ? 12 : 8, 0.4, 2, true, 'metal');
|
|
108
|
+
kit.box(x, 4, z, 12.4, 0.3, 12.4, 1, true, 'wood');
|
|
109
|
+
kit.box(x, 8, z, 12.4, 0.3, 12.4, (i + j) % 2 === 0 ? 1 : 2, true, 'wood');
|
|
110
|
+
if ((i + j) % 2 === 0) kit.box(x, 12, z, 13, 0.4, 13, 2, false);
|
|
111
|
+
}
|
|
112
|
+
kit.ramp(140, 0, 31.8, 8, 12, 4.3, '+z');
|
|
113
|
+
kit.box(176, 0, 100, 10, 3, 6, 1, true); kit.box(176, 3, 100, 11, 0.3, 7, 2, false);
|
|
114
|
+
return kit;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/** North-west north strip: the billboard row. Five big boards on legs facing the north road, a bus shelter and benches. */
|
|
118
|
+
export function billboardRow(): Kit {
|
|
119
|
+
const kit = new Kit();
|
|
120
|
+
for (let k = 0; k < 5; k++) {
|
|
121
|
+
const x = -118 + k * 18, h = 6 + (k % 3) * 3;
|
|
122
|
+
kit.box(x - 4, 0, 168 + (k % 2) * 12, 0.6, h, 0.6, 2, true, 'metal'); kit.box(x + 4, 0, 168 + (k % 2) * 12, 0.6, h, 0.6, 2, true, 'metal');
|
|
123
|
+
kit.box(x, h, 168 + (k % 2) * 12, 14, 6, 0.6, 1, false); kit.box(x, h + 6, 168 + (k % 2) * 12, 14.6, 0.4, 1.2, 2, false);
|
|
124
|
+
}
|
|
125
|
+
kit.box(-40, 0, 140, 12, 0.2, 3, 2, false); kit.box(-40, 3, 140, 13, 0.3, 4, 1, false);
|
|
126
|
+
for (const x of [-46, -34]) kit.box(x, 0, 141.5, 0.3, 3, 0.3, 2, true, 'metal');
|
|
127
|
+
for (const x of [-44, -40, -36]) kit.box(x, 0, 141, 2.4, 0.5, 0.8, 2, true, 'wood');
|
|
128
|
+
return kit;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/** South-west west strip: the hangars. Two open-fronted sheds facing the west road's verge, with a taxi pad between. */
|
|
132
|
+
export function hangars(): Kit {
|
|
133
|
+
const kit = new Kit();
|
|
134
|
+
for (const z of [-52, -100]) {
|
|
135
|
+
const x = -165, w = 30, d = 22, h = 12;
|
|
136
|
+
kit.box(x - w / 2, 0, z, 0.8, h, d, 1, true); // the back wall, west
|
|
137
|
+
kit.box(x, 0, z - d / 2, w, h, 0.8, 1, true); kit.box(x, 0, z + d / 2, w, h, 0.8, 1, true);
|
|
138
|
+
kit.box(x, h, z, w + 1, 1, d + 1, 2, false);
|
|
139
|
+
kit.box(x - 4, 0, z, 10, 2.2, 8, 2, true, 'metal');
|
|
140
|
+
}
|
|
141
|
+
kit.box(-160, 0, -76, 24, 0.05, 20, 2, false);
|
|
142
|
+
kit.box(-140, 0, -76, 1, 10, 1, 2, true, 'metal'); kit.box(-140, 10, -76, 1.5, 3, 1.5, 1, false);
|
|
143
|
+
return kit;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/** South-east south strip: the crate yard. Rows of 2 m crates in stacks of one to three, a forklift block and a weighbridge. */
|
|
147
|
+
export function crateYard(): Kit {
|
|
148
|
+
const kit = new Kit(), stacks = [1, 3, 2, 1, 2, 3, 1, 2, 2, 1, 3, 1];
|
|
149
|
+
for (let i = 0; i < 6; i++) for (let j = 0; j < 2; j++) {
|
|
150
|
+
const high = stacks[i * 2 + j] ?? 1, x = 20 + i * 12, z = -140 - j * 22;
|
|
151
|
+
for (let k = 0; k < high; k++) for (const dx of [0, 2.2]) kit.box(x + dx, k * 2, z, 2, 2, 2, k % 2 === 0 ? 1 : 2, true, 'wood');
|
|
152
|
+
}
|
|
153
|
+
kit.box(100, 0, -150, 3, 2.5, 5, 1, true, 'metal'); kit.box(100, 2.5, -151, 2.5, 1.8, 2, 2, false);
|
|
154
|
+
kit.box(100, 0, -178, 10, 0.4, 18, 2, true, 'metal');
|
|
155
|
+
kit.box(108, 0, -186, 3, 3, 3, 1, true);
|
|
156
|
+
return kit;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/** The halves of the plot strips the copy plot leaves: measure cubes, a car park, an antenna row and a tank pair. */
|
|
160
|
+
export function stripFill(): Kit {
|
|
161
|
+
const kit = new Kit();
|
|
162
|
+
// NE north strip, east of the plot: the measure-cube scale set (1 to 5 m)
|
|
163
|
+
for (let i = 0; i < 5; i++) kit.box(100 + (i % 2) * 10, 0, 140 + i * 11, i + 1, i + 1, i + 1, i % 2 === 0 ? 1 : 2, true);
|
|
164
|
+
// NW west strip, north of the plot: the car park (bays, cars, a booth)
|
|
165
|
+
kit.box(-162, 0, 106, 50, 0.05, 22, 2, false);
|
|
166
|
+
for (let k = 0; k < 8; k++) for (const dz of [-6, 6]) if ((k + (dz > 0 ? 1 : 0)) % 3 !== 0) kit.box(-183 + k * 6, 0, 106 + dz, 2, 1.5, 4.5, 1, true, 'metal');
|
|
167
|
+
kit.box(-134, 0, 106, 3, 3, 3, 1, true); kit.box(-134, 3, 106, 3.6, 0.3, 3.6, 2, false);
|
|
168
|
+
// SW south strip, west of the plot: the antenna row (masts with dish blocks)
|
|
169
|
+
for (let k = 0; k < 4; k++) { const x = -112 + (k % 2) * 8, z = -140 - k * 14, h = 10 + (k % 3) * 4; kit.box(x, 0, z, 0.6, h, 0.6, 2, true, 'metal'); kit.box(x, h - 2, z + 1, 3, 3, 0.6, 1, false); }
|
|
170
|
+
// SE east strip, south of the plot: two tanks with a catwalk and a pipe run on supports
|
|
171
|
+
for (const x of [148, 172]) { kit.box(x, 0, -106, 12, 8, 12, 1, true, 'metal'); kit.box(x, 8, -106, 12.6, 0.4, 12.6, 2, false); }
|
|
172
|
+
kit.box(160, 8, -106, 12, 0.3, 2, 2, true, 'metal');
|
|
173
|
+
kit.box(160, 3, -94, 40, 0.6, 0.6, 2, false); for (const x of [142, 160, 178]) kit.box(x, 0, -94, 0.5, 3, 0.5, 2, true, 'metal');
|
|
174
|
+
return kit;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/** The four copy plots: a 40 m pad, its striped border and a corner post each (a grid copy stands its landmark on it). */
|
|
178
|
+
export function copyPlots(): Kit {
|
|
179
|
+
const kit = new Kit(), s = PLOT_HALF;
|
|
180
|
+
for (const [x, z] of COPY_PLOTS) {
|
|
181
|
+
kit.box(x, 0, z, 2 * s, 0.08, 2 * s, 2, false);
|
|
182
|
+
kit.detail = true;
|
|
183
|
+
for (const side of [-1, 1]) { kit.box(x + side * (s - 0.5), 0.08, z, 1, 0.04, 2 * s, 1, false); kit.box(x, 0.08, z + side * (s - 0.5), 2 * s - 2, 0.04, 1, 1, false); }
|
|
184
|
+
kit.detail = false;
|
|
185
|
+
kit.box(x - s, 0, z - s, 0.5, 3, 0.5, 1, true, 'metal');
|
|
186
|
+
}
|
|
187
|
+
return kit;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/** Each entry's second set piece, further in than the first and each its own: a plaza, a weighbridge, a helipad, a car wash. */
|
|
191
|
+
export function entryExtras(): Kit {
|
|
192
|
+
const kit = new Kit();
|
|
193
|
+
// north: a stepped plaza with flag masts, off the road's right as you drive in
|
|
194
|
+
const n = framed(kit, 'north');
|
|
195
|
+
n(26, 0, 70, 20, 0.6, 20, 2, true); n(26, 0.6, 70, 14, 0.6, 14, 1, true); n(26, 1.2, 70, 8, 0.6, 8, 2, true);
|
|
196
|
+
for (const inward of [58, 82]) n(14, 0, inward, 0.4, 10, 0.4, 2, true, 'metal');
|
|
197
|
+
n(14, 8, 58, 0.2, 2, 3, 1, false); n(14, 8, 82, 0.2, 2, 3, 1, false);
|
|
198
|
+
n(-24, 0, 66, 10, 5, 8, 1, true); n(-24, 5, 66, 11, 0.4, 9, 2, false);
|
|
199
|
+
// south: the weighbridge office and a line of barrier blocks on the left
|
|
200
|
+
const s = framed(kit, 'south');
|
|
201
|
+
s(-22, 0, 66, 12, 6, 8, 1, true); s(-22, 6, 66, 13, 0.4, 9, 2, false); s(-15.5, 2.5, 66, 1, 0.3, 6, 2, false);
|
|
202
|
+
for (let k = 0; k < 5; k++) s(-14, 0, 80 + k * 4, 1, 1, 2.5, 2, true);
|
|
203
|
+
s(26, 0, 72, 16, 3, 3, 1, true);
|
|
204
|
+
// east: a helipad on a deck with a ramp, and a windsock mast
|
|
205
|
+
const e = framed(kit, 'east');
|
|
206
|
+
e(26, 0, 70, 18, 2, 18, 2, true); e(26, 2, 70, 12, 0.1, 12, 1, false);
|
|
207
|
+
kit.ramp(250 - 70, 0, 26 - 9 - 8, 6, 8, 2, '+z');
|
|
208
|
+
e(-22, 0, 64, 0.4, 9, 0.4, 2, true, 'metal'); e(-22, 8, 65.5, 0.6, 0.6, 3, 1, false);
|
|
209
|
+
// west: a car-wash gantry over a side bay and a row of vending blocks
|
|
210
|
+
const w = framed(kit, 'west');
|
|
211
|
+
for (const inward of [62, 74]) { w(18, 0, inward, 1, 5, 1, 2, true, 'metal'); w(30, 0, inward, 1, 5, 1, 2, true, 'metal'); w(24, 5, inward, 13, 1.2, 1.2, 1, false); }
|
|
212
|
+
w(24, 0, 68, 10, 0.05, 20, 2, false);
|
|
213
|
+
for (let k = 0; k < 4; k++) w(-16 - k * 2.5, 0, 64, 1.8, 2.2, 1.2, k % 2 === 0 ? 1 : 2, true);
|
|
214
|
+
return kit;
|
|
215
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Build-time only: the template's far proxy look (SHARD-PLATFORM SF23), read by the far baker
|
|
3
|
+
* (scripts/bake/far-proxies.mjs): the greybox ground faceted in the toon kit's flat greys, the pool (bed −3) a slate blue.
|
|
4
|
+
*/
|
|
5
|
+
export const farLook = {
|
|
6
|
+
family: 'toon',
|
|
7
|
+
colourAt: (x: number, z: number, h: number): [number, number, number] => {
|
|
8
|
+
if (h < -1) return [0.12, 0.2, 0.28];
|
|
9
|
+
const k = 0.94 + 0.06 * Math.sin(x * 0.05) * Math.cos(z * 0.05);
|
|
10
|
+
return [0.36 * k, 0.4 * k, 0.36 * k];
|
|
11
|
+
},
|
|
12
|
+
// G222: its exposed boundary is a darker grey of its own ground (a new shard declares its own rock)
|
|
13
|
+
cliff: { lip: [0.3, 0.32, 0.3], foot: [0.2, 0.21, 0.2] },
|
|
14
|
+
haze: { colour: [0.6, 0.65, 0.7] },
|
|
15
|
+
} as const;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { templateProduct } from './product';
|
|
2
|
+
import { templateTerrain } from './terrain';
|
|
3
|
+
import { templatePropRows } from './props';
|
|
4
|
+
import type { ProjectGenerationContext, GeneratedProject } from '@wildshard/sdk/projectGeneration';
|
|
5
|
+
import { parseShardfile } from '@wildshard/format/shardSchema';
|
|
6
|
+
import { templateBehaviour } from './behaviour';
|
|
7
|
+
import { templateBoss, TEMPLATE_BOSS_INPUTS } from './boss';
|
|
8
|
+
import { templateOutput } from './productOutput';
|
|
9
|
+
import { rasterGroundMap } from '@wildshard/sdk/bake/groundMap';
|
|
10
|
+
import mapSettings from '../data/map.json' with { type: 'json' };
|
|
11
|
+
|
|
12
|
+
// Edit the build-time declaration to author this project's data.
|
|
13
|
+
export async function generate(ctx: ProjectGenerationContext): Promise<GeneratedProject> {
|
|
14
|
+
const behaviour = await templateBehaviour(ctx), boss = await templateBoss(ctx);
|
|
15
|
+
const files = await ctx.cached({ id: 'world-product', inputs: TEMPLATE_BOSS_INPUTS }, async () => {
|
|
16
|
+
const produced = templateTerrain(), { assets, ...terrain } = produced;
|
|
17
|
+
const props = templatePropRows();
|
|
18
|
+
const map = await rasterGroundMap(produced, props, mapSettings.style);
|
|
19
|
+
return new Map([['map.rgba', map.pixels], ['shard.json', new TextEncoder().encode(JSON.stringify(templateProduct(terrain, props, behaviour, boss)))], ...assets, ...props.assets]);
|
|
20
|
+
});
|
|
21
|
+
const metadata = files.get('shard.json');
|
|
22
|
+
if (metadata === undefined) throw new Error('Terrain cache misses shard rows');
|
|
23
|
+
const shard = parseShardfile(JSON.parse(new TextDecoder('utf-8', { fatal: true }).decode(metadata)));
|
|
24
|
+
for (const [hash, bytes] of files) if (hash !== 'shard.json' && hash !== 'map.rgba' && ctx.asset(bytes) !== hash) throw new Error('Terrain asset hash differs');
|
|
25
|
+
const pixels = files.get('map.rgba'); if (pixels === undefined) throw new Error('Missing generated map lattice');
|
|
26
|
+
return { shard, output: templateOutput(boss), map: { pixels, name: 'ui/map' } };
|
|
27
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** The loop road centreline half-size, in metres. */
|
|
2
|
+
export const LOOP = 60;
|
|
3
|
+
/** Asphalt plus edge stripe half-width, in metres. */
|
|
4
|
+
export const ROAD_HALF: number = 8 / 2 + 0.5;
|
|
5
|
+
|
|
6
|
+
const smooth = (edge0: number, edge1: number, x: number): number => { const t = Math.min(1, Math.max(0, (x - edge0) / (edge1 - edge0))); return t * t * (3 - 2 * t); };
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* The terrain finish (generators/terrain.ts and the props bake share it): everything outside the yard (the loop, the
|
|
10
|
+
* roads, the entry plazas, the hub corners and pass 2's districts) is levelled to y = 0, blending back to the authored
|
|
11
|
+
* noise over a few metres just inside the loop. The yard inside the loop is untouched.
|
|
12
|
+
*/
|
|
13
|
+
export function cellGround(x: number, z: number, h: number): number {
|
|
14
|
+
return h * (1 - smooth(LOOP - ROAD_HALF - 9, LOOP - ROAD_HALF - 2, Math.max(Math.abs(x), Math.abs(z))));
|
|
15
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { Group, Mesh, MeshStandardMaterial } from 'three';
|
|
2
|
+
import { measureBox, MOSS, type TemplateWorldPorts } from './world';
|
|
3
|
+
|
|
4
|
+
// the engine types this generator speaks, through world.ts's ports (no new engine edges for one build-time module)
|
|
5
|
+
type Piece = Parameters<TemplateWorldPorts['piece']>[0];
|
|
6
|
+
/** one declared collider shape, as a registry piece carries it */
|
|
7
|
+
export type ColliderDesc = NonNullable<Piece['colliders']>[number];
|
|
8
|
+
/** SF56's measure role: 1 structure (orange in the dev-map look), 2 trim (grey) */
|
|
9
|
+
export type MeasureRole = Parameters<typeof measureBox>[3];
|
|
10
|
+
type Surface = 'stone' | 'metal' | 'wood';
|
|
11
|
+
/** which way a ramp climbs (world axes; north is +z) */
|
|
12
|
+
export type Climb = '+x' | '-x' | '+z' | '-z';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Build-time only (SHARD-PLATFORM SF52, G220): a collider-bearing set of dev-map boxes, built as one registry piece. Every
|
|
16
|
+
* box is a `measureBox` (the G163 dev-map look reads its measure UVs), standing on the flattened cell ground.
|
|
17
|
+
*/
|
|
18
|
+
export class Kit {
|
|
19
|
+
readonly root: Group = new Group();
|
|
20
|
+
readonly colliders: ColliderDesc[] = [];
|
|
21
|
+
/** every buffer and material the kit made, for the caller's scope */
|
|
22
|
+
readonly owned: { dispose: () => void }[] = [];
|
|
23
|
+
/** while set, boxes are named `detail`: drawn near, left out of the coarse tiles and the far proxy (`cellCoarse`) */
|
|
24
|
+
detail = false;
|
|
25
|
+
private mesh(w: number, h: number, d: number, role: MeasureRole): Mesh {
|
|
26
|
+
const geometry = measureBox(w, h, d, role), material = new MeshStandardMaterial({ color: role === 2 ? MOSS : 0x888888, flatShading: true }), mesh = new Mesh(geometry, material);
|
|
27
|
+
this.owned.push(geometry, material);
|
|
28
|
+
if (this.detail) mesh.name = 'detail';
|
|
29
|
+
this.root.add(mesh);
|
|
30
|
+
return mesh;
|
|
31
|
+
}
|
|
32
|
+
/** a w (x) × h × d (z) box standing on `y0` at (x, z); `solid` adds its box collider */
|
|
33
|
+
box(x: number, y0: number, z: number, w: number, h: number, d: number, role: MeasureRole, solid: boolean, surface: Surface = 'stone'): void {
|
|
34
|
+
this.mesh(w, h, d, role).position.set(x, y0 + h / 2, z);
|
|
35
|
+
if (solid) this.colliders.push({ kind: 'box', x, y: y0 + h / 2, z, hx: w / 2, hy: h / 2, hz: d / 2, surface });
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* A rideable slab `w` wide climbing `rise` over a `run` (metres along `climb`) from `y0` at its low end, whose low end
|
|
39
|
+
* starts at (x, z): a 0.3 m sloped deck with its rotated collider (the hoverboard rides up it).
|
|
40
|
+
*/
|
|
41
|
+
ramp(x: number, y0: number, z: number, w: number, run: number, rise: number, climb: Climb, role: MeasureRole = 2, surface: Surface = 'stone'): void {
|
|
42
|
+
const t = 0.3, length = Math.hypot(run, rise), angle = Math.atan2(rise, run), along = climb === '+x' || climb === '+z' ? 1 : -1, alongX = climb === '+x' || climb === '-x';
|
|
43
|
+
const cx = alongX ? x + along * run / 2 : x, cz = alongX ? z : z + along * run / 2, cy = y0 + rise / 2 - (t / 2) * Math.cos(angle);
|
|
44
|
+
const mesh = this.mesh(alongX ? length : w, t, alongX ? w : length, role); mesh.position.set(cx, cy, cz);
|
|
45
|
+
// about z, +angle lifts the +x end; about x, +angle drops the +z end
|
|
46
|
+
let q: { x: number; y: number; z: number; w: number };
|
|
47
|
+
if (alongX) { const a = along * angle; mesh.rotation.z = a; q = { x: 0, y: 0, z: Math.sin(a / 2), w: Math.cos(a / 2) }; }
|
|
48
|
+
else { const a = -along * angle; mesh.rotation.x = a; q = { x: Math.sin(a / 2), y: 0, z: 0, w: Math.cos(a / 2) }; }
|
|
49
|
+
this.colliders.push({ kind: 'box', x: cx, y: cy, z: cz, hx: (alongX ? length : w) / 2, hy: t / 2, hz: (alongX ? w : length) / 2, rot: q, surface });
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/** an entry's edge (north is +z) */
|
|
54
|
+
export type Edge = 'north' | 'south' | 'east' | 'west';
|
|
55
|
+
/**
|
|
56
|
+
* One entry's local frame: `across` is metres to the right of the road as you drive in, `inward` metres in from the edge,
|
|
57
|
+
* `w` across and `d` along.
|
|
58
|
+
*/
|
|
59
|
+
export function framed(kit: Kit, edge: Edge): (across: number, y0: number, inward: number, w: number, h: number, d: number, role: MeasureRole, solid: boolean, surface?: Surface) => void {
|
|
60
|
+
return (across, y0, inward, w, h, d, role, solid, surface) => {
|
|
61
|
+
switch (edge) {
|
|
62
|
+
case 'north': kit.box(-across, y0, 250 - inward, w, h, d, role, solid, surface); return;
|
|
63
|
+
case 'south': kit.box(across, y0, -250 + inward, w, h, d, role, solid, surface); return;
|
|
64
|
+
case 'east': kit.box(250 - inward, y0, across, d, h, w, role, solid, surface); return;
|
|
65
|
+
case 'west': kit.box(-250 + inward, y0, -across, d, h, w, role, solid, surface); return;
|
|
66
|
+
default: throw new Error('cell: unknown edge');
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { roadSocketMetrics } from '@wildshard/sdk/entries';
|
|
2
|
+
import layout from '../data/layout.json' with { type: 'json' };
|
|
3
|
+
import { cellGround } from './ground';
|
|
4
|
+
import { templateNoise } from './landscapeNoise';
|
|
5
|
+
|
|
6
|
+
// Retained authored entry grading: 15 m road, reaching 60 m into the cell.
|
|
7
|
+
const ROAD_WIDTH = 15, ROAD_LENGTH = 60;
|
|
8
|
+
/** Half the 500 m cell, from the platform's road-socket dimensions. */
|
|
9
|
+
const CHUNK_HALF = roadSocketMetrics().half;
|
|
10
|
+
|
|
11
|
+
const smoothstep = (a: number, b: number, x: number): number => {
|
|
12
|
+
const t = Math.min(1, Math.max(0, (x - a) / (b - a)));
|
|
13
|
+
return t * t * (3 - 2 * t);
|
|
14
|
+
};
|
|
15
|
+
const lerp = (a: number, b: number, t: number): number => a + (b - a) * t;
|
|
16
|
+
|
|
17
|
+
function trailDistance(x: number, z: number): number {
|
|
18
|
+
let distance = Infinity;
|
|
19
|
+
for (const poly of layout.TRAIL) for (let i = 0; i < poly.length - 1; i++) {
|
|
20
|
+
const a = poly[i], b = poly[i + 1];
|
|
21
|
+
if (a === undefined || b === undefined) continue;
|
|
22
|
+
const [ax, az] = a, [bx, bz] = b;
|
|
23
|
+
if (ax === undefined || az === undefined || bx === undefined || bz === undefined) throw new Error('Template trail requires coordinate pairs');
|
|
24
|
+
const vx = bx - ax, vz = bz - az, wx = x - ax, wz = z - az;
|
|
25
|
+
const length = vx * vx + vz * vz;
|
|
26
|
+
const t = length > 0 ? Math.min(1, Math.max(0, (wx * vx + wz * vz) / length)) : 0;
|
|
27
|
+
const dx = x - (ax + vx * t), dz = z - (az + vz * t);
|
|
28
|
+
distance = Math.min(distance, dx * dx + dz * dz);
|
|
29
|
+
}
|
|
30
|
+
return Math.sqrt(distance);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** The pond's centre (world.ts `poolMask`, the water's 5 m circle) and its bowl: −3 m at the heart, shelving at 37° so the
|
|
34
|
+
* 257² lattice keeps a beach inside the water's circle (−0.4 m at its edge, shallower than the swim's 1.05 m stand-up). The old
|
|
35
|
+
* cliff at r 5 smeared over a 1.95 m cell into a pit wall past the water's edge, too steep to climb: Jake, 2026-11-12, "glitched
|
|
36
|
+
* into the pond cant use shift to surface". */
|
|
37
|
+
export const POND = { x: 25, z: 20, bed: -3, flat: 1.5, shelf: 0.75 } as const;
|
|
38
|
+
export const pondFloor = (r: number): number => POND.bed + Math.max(0, r - POND.flat) * POND.shelf;
|
|
39
|
+
|
|
40
|
+
/** The retained Template author height law: seeded yard, pool, trail bed, flat roads and entry ramps.
|
|
41
|
+
* No runtime field, registry, render service or captured height grid is read. */
|
|
42
|
+
export function templateHeightAt(seed = 357): (x: number, z: number) => number {
|
|
43
|
+
const noise = templateNoise(seed);
|
|
44
|
+
return (x, z) => {
|
|
45
|
+
let height = Math.min(noise(x * 0.015, z * 0.015) * 0.5, pondFloor(Math.hypot(x - POND.x, z - POND.z)));
|
|
46
|
+
height -= smoothstep(9, 2.5, trailDistance(x, z)) * 0.35;
|
|
47
|
+
height = cellGround(x, z, height);
|
|
48
|
+
const half = ROAD_WIDTH / 2 + 3;
|
|
49
|
+
const along = (a: number, b: number): number => smoothstep(half + 22, half, Math.abs(a))
|
|
50
|
+
* smoothstep(CHUNK_HALF - ROAD_LENGTH - 25, CHUNK_HALF - ROAD_LENGTH + 5, Math.abs(b));
|
|
51
|
+
const road = Math.max(along(x, z), along(z, x));
|
|
52
|
+
if (road > 0) {
|
|
53
|
+
const inward = CHUNK_HALF - Math.max(Math.abs(x), Math.abs(z));
|
|
54
|
+
const ramp = smoothstep(ROAD_LENGTH - 15, ROAD_LENGTH + 30, inward);
|
|
55
|
+
height = lerp(lerp(0, height, ramp), height, 1 - road);
|
|
56
|
+
}
|
|
57
|
+
return height;
|
|
58
|
+
};
|
|
59
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/** Mulberry32 draws used by the authored seed permutation; no session or RNG service is installed. */
|
|
2
|
+
function seededDraw(seed: number): () => number {
|
|
3
|
+
let state = seed >>> 0;
|
|
4
|
+
return () => {
|
|
5
|
+
state = (state + 0x6d2b79f5) >>> 0;
|
|
6
|
+
let t = state;
|
|
7
|
+
t = Math.imul(t ^ (t >>> 15), t | 1);
|
|
8
|
+
t ^= t + Math.imul(t ^ (t >>> 7), t | 61);
|
|
9
|
+
return ((t ^ (t >>> 14)) >>> 0) / 4294967296;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const F2 = 0.5 * (Math.sqrt(3) - 1);
|
|
14
|
+
const G2 = (3 - Math.sqrt(3)) / 6;
|
|
15
|
+
const grad3: readonly (readonly [number, number])[] = [[1, 1], [-1, 1], [1, -1], [-1, -1], [1, 0], [-1, 0], [0, 1], [0, -1]];
|
|
16
|
+
const G_NONE: readonly [number, number] = [0, 0]; // never hit: `% 8` keeps the index in range; satisfies noUncheckedIndexedAccess
|
|
17
|
+
|
|
18
|
+
class SeededNoise {
|
|
19
|
+
private perm = new Uint8Array(512);
|
|
20
|
+
constructor(seed: number) {
|
|
21
|
+
const draw = seededDraw(seed);
|
|
22
|
+
const p = new Uint8Array(256);
|
|
23
|
+
for (let i = 0; i < 256; i++) p[i] = i;
|
|
24
|
+
for (let i = 255; i > 0; i--) { const j = Math.floor(draw() * (i + 1)); [p[i], p[j]] = [p[j] ?? 0, p[i] ?? 0]; }
|
|
25
|
+
for (let i = 0; i < 512; i++) this.perm[i] = p[i & 255] ?? 0;
|
|
26
|
+
}
|
|
27
|
+
/** returns roughly [-1, 1] */
|
|
28
|
+
get(xin: number, yin: number): number {
|
|
29
|
+
const perm = this.perm;
|
|
30
|
+
const s = (xin + yin) * F2;
|
|
31
|
+
const i = Math.floor(xin + s), j = Math.floor(yin + s);
|
|
32
|
+
const t = (i + j) * G2;
|
|
33
|
+
const x0 = xin - (i - t), y0 = yin - (j - t);
|
|
34
|
+
const i1 = x0 > y0 ? 1 : 0, j1 = x0 > y0 ? 0 : 1;
|
|
35
|
+
const x1 = x0 - i1 + G2, y1 = y0 - j1 + G2;
|
|
36
|
+
const x2 = x0 - 1 + 2 * G2, y2 = y0 - 1 + 2 * G2;
|
|
37
|
+
const ii = i & 255, jj = j & 255;
|
|
38
|
+
let n = 0;
|
|
39
|
+
let t0 = 0.5 - x0 * x0 - y0 * y0;
|
|
40
|
+
if (t0 > 0) { const g = grad3[(perm[ii + (perm[jj] ?? 0)] ?? 0) % 8] ?? G_NONE; t0 *= t0; n += t0 * t0 * (g[0] * x0 + g[1] * y0); }
|
|
41
|
+
let t1 = 0.5 - x1 * x1 - y1 * y1;
|
|
42
|
+
if (t1 > 0) { const g = grad3[(perm[ii + i1 + (perm[jj + j1] ?? 0)] ?? 0) % 8] ?? G_NONE; t1 *= t1; n += t1 * t1 * (g[0] * x1 + g[1] * y1); }
|
|
43
|
+
let t2 = 0.5 - x2 * x2 - y2 * y2;
|
|
44
|
+
if (t2 > 0) { const g = grad3[(perm[ii + 1 + (perm[jj + 1] ?? 0)] ?? 0) % 8] ?? G_NONE; t2 *= t2; n += t2 * t2 * (g[0] * x2 + g[1] * y2); }
|
|
45
|
+
return 70 * n;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/** Template uses the seeded simplex height channel, without runtime noise/registry dependencies. */
|
|
50
|
+
export function templateNoise(seed: number): (x: number, z: number) => number {
|
|
51
|
+
const noise = new SeededNoise(seed);
|
|
52
|
+
return (x, z) => noise.get(x, z);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/** The original named cosmetic stream, consumed only for authored scatter placement. */
|
|
56
|
+
export function templateScatterRandom(seed = 357): { range: (a: number, b: number) => number } {
|
|
57
|
+
const name = `${String(seed >>> 0)}:cosmetic`;
|
|
58
|
+
let hash = 0x811c9dc5;
|
|
59
|
+
for (let i = 0; i < name.length; i++) hash = Math.imul(hash ^ (name.codePointAt(i) ?? 0), 0x01000193);
|
|
60
|
+
const draw = seededDraw(hash >>> 0);
|
|
61
|
+
return { range: (a, b) => a + (b - a) * draw() };
|
|
62
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { templateTerrain } from './terrain';
|
|
2
|
+
import { templatePropRows } from './props';
|
|
3
|
+
|
|
4
|
+
/** Map rows and immutable geometry from the SAME producers as the product, with no intermediate file reads. */
|
|
5
|
+
export function templateMapInputs(): ReadonlyMap<string, Uint8Array> {
|
|
6
|
+
const { assets: terrainAssets, ...terrain } = templateTerrain(), { assets: propsAssets, ...props } = templatePropRows();
|
|
7
|
+
const text = new TextEncoder();
|
|
8
|
+
return new Map([['world-terrain', text.encode(JSON.stringify(terrain))], ['world-props', text.encode(JSON.stringify(props))],
|
|
9
|
+
...[...terrainAssets, ...propsAssets].map(([hash, bytes]): [string, Uint8Array] => [`assets/${hash}`, bytes])]);
|
|
10
|
+
}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import TEMPLATE_DIRECTORS from '../data/director.json' with { type: 'json' };
|
|
2
|
+
import { emptyShardfile } from '@wildshard/sdk/author';
|
|
3
|
+
import { parseShardfile, type Shardfile } from '@wildshard/format/shardSchema';
|
|
4
|
+
import type { templateTerrain } from './terrain';
|
|
5
|
+
import type { TemplateBehaviour } from './behaviour';
|
|
6
|
+
import type { BakedProps } from '@wildshard/sdk/bake/props';
|
|
7
|
+
import { TEMPLATE_FLAME, TEMPLATE_LAMP, TEMPLATE_MUSHROOM_CAP, TEMPLATE_STONE, TEMPLATE_TELL } from './templatePropsSource';
|
|
8
|
+
import hooks from '../behaviour/hooks.json' with { type: 'json' };
|
|
9
|
+
import rows from '../data/rows.json' with { type: 'json' };
|
|
10
|
+
import { parseRows } from '@wildshard/sdk/rows';
|
|
11
|
+
import TEMPLATE_PLUMBING from '../data/plumbing.json' with { type: 'json' };
|
|
12
|
+
import ui from '../data/ui.json' with { type: 'json' };
|
|
13
|
+
import text from '../data/text.json' with { type: 'json' };
|
|
14
|
+
import TEMPLATE_LOOK from '../data/look.json' with { type: 'json' };
|
|
15
|
+
import TEMPLATE_WATER from '../data/water.json' with { type: 'json' };
|
|
16
|
+
import CREATURES from '../data/creatures.json' with { type: 'json' };
|
|
17
|
+
import ENCOUNTERS from '../data/encounters.json' with { type: 'json' };
|
|
18
|
+
import TEMPLATE_QUESTS from '../data/quests.json' with { type: 'json' };
|
|
19
|
+
import TEMPLATE_LEDGER from '../data/ledger.json' with { type: 'json' };
|
|
20
|
+
import TEMPLATE_AUDIO from '../data/audio.json' with { type: 'json' };
|
|
21
|
+
import SPAWN from '../data/spawn.json' with { type: 'json' };
|
|
22
|
+
import ITEMS from '../data/items.json' with { type: 'json' };
|
|
23
|
+
import targets from '../data/targets.json' with { type: 'json' };
|
|
24
|
+
import skins from '../data/skins.json' with { type: 'json' };
|
|
25
|
+
import CARD from '../data/card.json' with { type: 'json' };
|
|
26
|
+
import idle from '../data/clientScripts.json' with { type: 'json' };
|
|
27
|
+
|
|
28
|
+
// Skin projections belong to this build-time declaration, with no runtime wrapper.
|
|
29
|
+
const TEMPLATE_SKIN_LOOKS = skins.map(entry => ({ id: entry.look, species: entry.species, recipe: 'platform.skin', material: null, parameters: { skin: entry.skin }, animation: { recipe: 'platform.clips', parameters: { attackSpan: 1 } } }));
|
|
30
|
+
const TEMPLATE_SKIN_FILES = skins.flatMap(entry => entry.files), TEMPLATE_SKIN_LIBRARY = skins.map(entry => entry.skin);
|
|
31
|
+
const LF110_LUT = { hash: 'f2db05998615ce1cb79ea96be32c168842eb6a2b34ec01feb86d36404603ee54', kind: 'binary', compressed: 143_748, decoded: 143_748, gpu: 143_748, triangles: 0, draws: 0, dependencies: [], critical: false } as const;
|
|
32
|
+
const TEMPLATE_SKIN_COST = TEMPLATE_SKIN_FILES.reduce((sum, file) => ({ resident: sum.resident + file.decoded + file.gpu, compressed: sum.compressed + file.compressed }), { resident: 0, compressed: 0 });
|
|
33
|
+
|
|
34
|
+
/** The particle anchors over braziers A, B and C, in `layout.BRAZIERS` order. */
|
|
35
|
+
const BRAZIER_FLAMES = ['template.brazier-a.flame', 'template.brazier-b.flame', 'template.brazier-c.flame'];
|
|
36
|
+
/** MH-3's share of the resident library budget: braziers B and C's particle pools (2 × 2 emitters × 96 live). Measured on the
|
|
37
|
+
* build: the compendium sketch check passes at 100 000 and refuses at 75 000. */
|
|
38
|
+
const MH3_LIBRARY_RESIDENT = 100_000;
|
|
39
|
+
/** MH-4's share: the Warden's ring (12 anchors × 32 live) and core (2 × 64 live) particle pools. Measured on the build:
|
|
40
|
+
* the sketch check passes at 45 000 and refuses at 30 000; 60 000 leaves a margin. */
|
|
41
|
+
const MH4_LIBRARY_RESIDENT = 60_000;
|
|
42
|
+
/** LF1-9: the rim braziers' flame panel and the Warden's tell ring and core panels (props.library). Measured on the build:
|
|
43
|
+
* 63 092 resident, 33 512 compressed (14 244 + 15 116 + 4 152); these leave a margin. */
|
|
44
|
+
const LF19_LIBRARY = { resident: 70_000, compressed: 36_000 } as const;
|
|
45
|
+
// The idle reserve retains three pairs of Wasm pages and six particle slots.
|
|
46
|
+
const TEMPLATE_ROWS = parseRows(rows);
|
|
47
|
+
/** LF1-5: every props GLB names its surface (templatePropsSource.ts). The stone keeps the look's measure `pbr`; the red
|
|
48
|
+
* mushroom caps draw in the look's emissive `mossgate.mushroom-cap` (LF1-2: it keeps its colour under the measure look). */
|
|
49
|
+
const TEMPLATE_PROP_MATERIALS = { [TEMPLATE_STONE]: { id: 'pbr' }, [TEMPLATE_MUSHROOM_CAP]: { id: TEMPLATE_MUSHROOM_CAP }, [TEMPLATE_LAMP]: { id: TEMPLATE_LAMP }, [TEMPLATE_FLAME]: { id: TEMPLATE_FLAME }, [TEMPLATE_TELL]: { id: TEMPLATE_TELL } };
|
|
50
|
+
/** Assemble the original authored product from this build's terrain rows. */
|
|
51
|
+
export function templateProduct(terrain: Omit<ReturnType<typeof templateTerrain>, 'assets'>, props: BakedProps, behaviour: TemplateBehaviour, boss: { compressed: number }): Shardfile {
|
|
52
|
+
const door = behaviour.door, itemModule = behaviour.items.hash;
|
|
53
|
+
const CLIENT_IDLE_HASH = behaviour.idle.hash, CLIENT_IDLE_BYTES = behaviour.idle.compressed;
|
|
54
|
+
const CLIENT_IDLE_RESIDENT = idle.module.resident - idle.module.bytes + CLIENT_IDLE_BYTES;
|
|
55
|
+
const clientScripts = structuredClone(idle.scripts);
|
|
56
|
+
for (const binding of clientScripts.bindings) {
|
|
57
|
+
binding.module = CLIENT_IDLE_HASH;
|
|
58
|
+
// MH-2, MH-3: each brazier's fire rises from its bowl (1.6 m over the pad, just under the use point)
|
|
59
|
+
const site = binding.target.kind === 'particles' ? terrain.sites.braziers[BRAZIER_FLAMES.indexOf(binding.target.id)] : undefined;
|
|
60
|
+
if (site !== undefined) binding.target.at = [site[0], site[1] - 0.1, site[2]];
|
|
61
|
+
}
|
|
62
|
+
// Keep generated door positions and the shared teaching text authoritative.
|
|
63
|
+
const TEMPLATE_UI = [{ ...ui.marker, label: text.hut, at: terrain.sites.door }, ui.oil, ui.jump,
|
|
64
|
+
{ ...ui.notes, tab: { ...ui.notes.tab, title: text.notes }, paragraphs: [text.note] }, ...ENCOUNTERS.ui];
|
|
65
|
+
const TEMPLATE_TARGETS = { ...targets.rows, interactions: [{ ...targets.interaction, at: terrain.sites.door, label: text.door }, ...targets.braziers.map((row, i) => {
|
|
66
|
+
const at = terrain.sites.braziers[i], label = text.braziers[i]; if (at === undefined || label === undefined) throw new Error(`${row.id} needs a pad in layout.BRAZIERS and a label`);
|
|
67
|
+
return { id: row.id, radius: row.radius, scene: row.scene, unless: row.unless, at, label };
|
|
68
|
+
})],
|
|
69
|
+
// MH-5: the Lamplighter (TE-ENG3's `targets.talks`), on the ground east of the spawn-to-hut path; the engine draws its stand-in
|
|
70
|
+
talks: [{ ...targets.talk, at: terrain.sites.lamplighter }] };
|
|
71
|
+
const base = emptyShardfile({ slug: 'template', name: 'Template shard', author: 'Wildshard', revision: 2, seed: 357 });
|
|
72
|
+
const playerHandle = 1106943697; // fnv1a32('actor.player') & 0x7fffffff; admission compares this with the session map.
|
|
73
|
+
const script = { hash: door.hash, kind: 'wasm', compressed: door.compressed, decoded: door.compressed, gpu: 0, triangles: 0, draws: 0, dependencies: [], critical: true };
|
|
74
|
+
const itemScript = { ...script, hash: itemModule, compressed: behaviour.items.compressed, decoded: behaviour.items.compressed };
|
|
75
|
+
const clientScript = { ...script, hash: CLIENT_IDLE_HASH, compressed: CLIENT_IDLE_BYTES, decoded: CLIENT_IDLE_BYTES, critical: false };
|
|
76
|
+
const tiles = terrain.tiles.map((tile) => {
|
|
77
|
+
const addition = props.tiles.find((row) => row.lod === tile.lod && row.x === tile.x && row.z === tile.z);
|
|
78
|
+
if (addition === undefined) return tile;
|
|
79
|
+
return { ...tile, files: [...tile.files, ...addition.files],
|
|
80
|
+
bounds: { min: tile.bounds.min.map((value, axis) => Math.min(value, addition.bounds.min[axis] ?? value)), max: tile.bounds.max.map((value, axis) => Math.max(value, addition.bounds.max[axis] ?? value)) },
|
|
81
|
+
compressed: tile.compressed + addition.compressed, decoded: tile.decoded + addition.decoded, gpu: tile.gpu + addition.gpu, triangles: tile.triangles + addition.triangles, draws: tile.draws + addition.draws };
|
|
82
|
+
});
|
|
83
|
+
// The terrain's draw rows, written out at the platform's defaults: its tiles cast (inside the shadow disc) and receive
|
|
84
|
+
// shadows, and the residency re-centres after the viewer moves 5 m. A ground that wants neither shadow, or a coarser
|
|
85
|
+
// follow, changes these numbers.
|
|
86
|
+
const TERRAIN_DRAW = { shadow: { cast: true, receive: true }, follow: 5 } as const;
|
|
87
|
+
// This declaration is the live source; the manifest supplies only picker metadata.
|
|
88
|
+
// Retain the old producer's JSON boundary, including signed-zero normalization.
|
|
89
|
+
// oxlint-disable-next-line unicorn/prefer-structured-clone -- JSON wire normalization, not cloning: structuredClone retains forbidden signed zero.
|
|
90
|
+
return parseShardfile(JSON.parse(JSON.stringify({ ...base, accent: 'sand', manifest: CARD,
|
|
91
|
+
budgets: { library: { resident: 100_000 + TEMPLATE_SKIN_COST.resident + CLIENT_IDLE_RESIDENT + 2_633_280 + MH3_LIBRARY_RESIDENT + MH4_LIBRARY_RESIDENT + LF19_LIBRARY.resident + LF110_LUT.decoded + LF110_LUT.gpu, compressed: 100_000 + LF110_LUT.compressed + CLIENT_IDLE_BYTES + TEMPLATE_SKIN_COST.compressed + LF19_LIBRARY.compressed }, sim: { resident: 16_000_000, compressed: 1_000_000 - boss.compressed }, overlap: 0 },
|
|
92
|
+
serverBudget: { ...base.serverBudget, tickMicros: 5_000, memory: 16_000_000 },
|
|
93
|
+
look: TEMPLATE_LOOK, spawn: SPAWN, rows: { ...TEMPLATE_ROWS, looks: TEMPLATE_SKIN_LOOKS }, plumbing: TEMPLATE_PLUMBING, ui: TEMPLATE_UI,
|
|
94
|
+
terrain: { ...terrain.terrain, ...TERRAIN_DRAW }, tiles, files: [...terrain.files, ...props.files, ...TEMPLATE_SKIN_FILES, LF110_LUT, script, itemScript, clientScript], edge: terrain.edge,
|
|
95
|
+
library: [...props.library, ...TEMPLATE_SKIN_LIBRARY, CLIENT_IDLE_HASH, LF110_LUT.hash], far: props.far, props: { ...props.props, materials: TEMPLATE_PROP_MATERIALS }, items: ITEMS, targets: TEMPLATE_TARGETS, clientScripts,
|
|
96
|
+
critical: [...terrain.critical, door.hash, itemModule], water: TEMPLATE_WATER, creatures: CREATURES, encounters: ENCOUNTERS.encounters,
|
|
97
|
+
quests: TEMPLATE_QUESTS, directors: TEMPLATE_DIRECTORS, ledger: TEMPLATE_LEDGER, audio: TEMPLATE_AUDIO, state: hooks.state, hooks: hooks.hooks,
|
|
98
|
+
sim: { ...base.sim, scriptTickDivisor: 1, scripts: [door.hash, itemModule], bindings: [{ module: door.hash, entity: playerHandle, actorId: 'actor.player', kind: 'server' }] },
|
|
99
|
+
})));
|
|
100
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { emitPlatformSections } from '@wildshard/sdk/platformSections';
|
|
2
|
+
import type { ProjectOutput } from '@wildshard/sdk/projectOutput';
|
|
3
|
+
import decision from '../data/bossDecision.json' with { type: 'json' };
|
|
4
|
+
import moves from '../data/moves.json' with { type: 'json' };
|
|
5
|
+
|
|
6
|
+
type SectionName = Parameters<typeof emitPlatformSections>[0] extends ReadonlyMap<infer Name, unknown> ? Name : never;
|
|
7
|
+
|
|
8
|
+
/** CLI-only named bytes and section emission. The Template remains runtime-free. */
|
|
9
|
+
export function templateOutput(boss: { hash: string }): ProjectOutput { return {
|
|
10
|
+
blobs: [{ name: 'behaviour/boss.wasm', kind: 'wasm', source: `assets/${boss.hash}`,
|
|
11
|
+
options: { script: { abi: 1, pages: 1 }, critical: true } }],
|
|
12
|
+
platform: emitPlatformSections(new Map<SectionName, unknown>([
|
|
13
|
+
['ui/completion', { doneFlag: 'template.complete', seenFlag: 'template.complete-card', trigger: 'quest', system: 'game.completion', before: ['main.world'], after: [],
|
|
14
|
+
title: 'Template shard', card: { kicker: 'A first adventure · complete', flavour: [] },
|
|
15
|
+
menuSubtitle: 'Your first adventure', toastSuffix: ' complete', safeRadius: 25, pollSeconds: 1, maximumTodo: 7, more: 'more', coveredEvents: [], groups: [], stats: [] }],
|
|
16
|
+
['sim/scripts', [{ ...decision, module: `blobs/wasm/${boss.hash}.wasm` }]], ['actors/moves', moves],
|
|
17
|
+
])),
|
|
18
|
+
}; }
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { bakeProps, type BakedProps } from '@wildshard/sdk/bake/props';
|
|
2
|
+
import { templateProps } from './templatePropsSource';
|
|
3
|
+
|
|
4
|
+
/** The original authored meshes and scatter baked in memory, without publishing intermediate files. */
|
|
5
|
+
export function templatePropRows(): BakedProps {
|
|
6
|
+
const fixture = templateProps(20);
|
|
7
|
+
try { return bakeProps(fixture.source); }
|
|
8
|
+
finally { fixture.dispose(); }
|
|
9
|
+
}
|