@wildshard/engine 0.0.1 → 0.1.15
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/CHANGELOG.md +128 -0
- package/budgets/calibration/m5-2026-10-01T08-07-18-573Z.json +3985 -0
- package/budgets/calibration/m5-2026-10-01T22-02-53-510Z.json +4473 -0
- package/budgets/calibration-reports/README.md +25 -0
- package/budgets/calibration-reports/_template.desktop.json +1994 -0
- package/budgets/calibration-reports/_template.phone.json +2069 -0
- package/budgets/calibration-reports/assessment.json +571 -0
- package/budgets/calibration-reports/driftwood-isle.phone.json +72 -0
- package/budgets/calibration-reports/far-reach.desktop.json +73158 -0
- package/budgets/calibration-reports/far-reach.phone.json +73086 -0
- package/budgets/calibration-reports/nalati-grasslands-x22.desktop.json +19525 -0
- package/budgets/calibration-reports/nalati-grasslands.phone.json +72 -0
- package/budgets/calibration-reports/nine-dragon-stack-g224.desktop.json +146 -0
- package/budgets/calibration-reports/nine-dragon-stack.phone.json +89 -0
- package/budgets/calibration-reports/pine-hollow.desktop.json +54949 -0
- package/budgets/calibration-reports/pine-hollow.phone.json +72 -0
- package/budgets/calibration-reports/sunscar-dunes.desktop.json +7788 -0
- package/budgets/calibration-reports/sunscar-dunes.phone.json +9378 -0
- package/budgets/calibration.json +4473 -0
- package/budgets/ceiling-re-records.json +71 -0
- package/budgets/ceiling-sources.json +5985 -0
- package/budgets/desktop-reference.json +7 -0
- package/budgets/g224-ceiling-re-record.json +15 -0
- package/budgets/grid-strip-room.json +9 -0
- package/budgets/nalati-ceiling-sources.json +44 -0
- package/budgets/shard-size-baseline.json +552 -0
- package/budgets/x22-ceiling-re-record.json +15 -0
- package/budgets/x7-ceiling-sources.json +41 -0
- package/index.html +622 -0
- package/lint/api-undocumented.json +7 -0
- package/lint/authored-html.d.mts +4 -0
- package/lint/authored-html.mjs +313 -0
- package/lint/base64-debt.json +18 -0
- package/lint/class-moves.json +4 -0
- package/lint/client-plan-boundary.d.mts +2 -0
- package/lint/client-plan-boundary.mjs +102 -0
- package/lint/debug-flags.d.mts +5 -0
- package/lint/debug-flags.mjs +190 -0
- package/lint/declaration-config.d.mts +2 -0
- package/lint/declaration-config.mjs +19 -0
- package/lint/edge-exemptions.json +6 -0
- package/lint/engine-internal.json +26 -0
- package/lint/engine-side-edges.json +5 -0
- package/lint/engine-sides.d.mts +30 -0
- package/lint/engine-sides.json +1794 -0
- package/lint/engine-sides.mjs +269 -0
- package/lint/engine-words.json +7 -0
- package/lint/exec-max-buffer.mjs +88 -0
- package/lint/generated-import-debt.json +117 -0
- package/lint/generated-source-debt.json +1029 -0
- package/lint/host-callback-syntax.d.mts +4 -0
- package/lint/host-callback-syntax.mjs +62 -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/host-reviews.json +14 -0
- package/lint/layer-edges.json +15 -0
- package/lint/layer-exports.d.mts +2 -0
- package/lint/layer-exports.mjs +23 -0
- package/lint/legacy-line-basis.json +995 -0
- package/lint/listed-view-code.json +13 -0
- package/lint/manifest-closure-budget.json +6 -0
- package/lint/nine-tiling-baseline.json +35 -0
- package/lint/no-base64.d.mts +19 -0
- package/lint/no-base64.mjs +112 -0
- package/lint/no-binary-json.json +174 -0
- package/lint/no-generated-import.d.mts +22 -0
- package/lint/no-generated-import.mjs +114 -0
- package/lint/page-events.json +895 -0
- package/lint/platform-pending-users.json +2520 -0
- package/lint/platform-pending-users.md +18 -0
- package/lint/ratchet-files.d.mts +2 -0
- package/lint/ratchet-files.mjs +45 -0
- package/lint/ratchet.json +230 -0
- package/lint/ratchet.mjs +212 -0
- package/lint/recorded-debt.mjs +24 -0
- package/lint/row-functions.json +173 -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.json +14 -0
- package/lint/runtime-performance.mjs +184 -0
- package/lint/schema-types.d.mts +9 -0
- package/lint/schema-types.mjs +114 -0
- package/lint/shard-coupling.json +333 -0
- package/lint/shard-imports.d.mts +5 -0
- package/lint/shard-imports.mjs +43 -0
- package/lint/shard-layout.json +64 -0
- package/lint/shard-platform.json +24 -0
- package/lint/shard-words.pin.json +421 -0
- package/lint/shardfile-boundaries.d.mts +10 -0
- package/lint/shardfile-boundaries.mjs +122 -0
- package/lint/sim-closure.d.mts +3 -0
- package/lint/sim-closure.json +3 -0
- package/lint/sim-closure.mjs +112 -0
- package/lint/sim-players.json +17 -0
- package/lint/sim-schema-leaves.json +1 -0
- package/lint/source-stamps.mjs +12 -0
- package/lint/syntax-values.mjs +299 -0
- package/lint/tile-bake-debt.json +556 -0
- package/lint/url-params.json +48 -0
- package/lint/weapon-subclasses.json +4 -0
- package/lint/wildshard-plugin.d.ts +13 -0
- package/lint/wildshard-plugin.js +1196 -0
- package/package.json +1298 -3
- package/scripts/agent-parity.mjs +1524 -0
- package/scripts/agent-sync.mjs +518 -0
- package/scripts/agent-time.py +475 -0
- package/scripts/apfs-clone.mjs +67 -0
- package/scripts/api-origin.d.mts +3 -0
- package/scripts/api-origin.mjs +38 -0
- package/scripts/app-build/appCook.ts +19 -0
- package/scripts/app-build/assetHashes.ts +57 -0
- package/scripts/app-build/assetLimits.d.mts +15 -0
- package/scripts/app-build/assetLimits.mjs +61 -0
- package/scripts/app-build/assetTables.d.mts +19 -0
- package/scripts/app-build/assetTables.mjs +68 -0
- package/scripts/app-build/audioPacks.ts +41 -0
- package/scripts/app-build/bakedTextures.d.mts +2 -0
- package/scripts/app-build/bakedTextures.mjs +59 -0
- package/scripts/app-build/basis.ts +25 -0
- package/scripts/app-build/bootExtras.ts +127 -0
- package/scripts/app-build/bootModules.ts +271 -0
- package/scripts/app-build/bootProductTiers.ts +48 -0
- package/scripts/app-build/bootProducts.ts +67 -0
- package/scripts/app-build/buildIdentity.d.mts +16 -0
- package/scripts/app-build/buildIdentity.mjs +89 -0
- package/scripts/app-build/catalogue.ts +216 -0
- package/scripts/app-build/chunkReport.d.mts +3 -0
- package/scripts/app-build/chunkReport.mjs +29 -0
- package/scripts/app-build/contentBase.d.mts +2 -0
- package/scripts/app-build/contentBase.mjs +34 -0
- package/scripts/app-build/controlChunks.ts +106 -0
- package/scripts/app-build/crossroadsRig.ts +17 -0
- package/scripts/app-build/doctorOutput.mjs +19 -0
- package/scripts/app-build/finalChunkNames.d.mts +3 -0
- package/scripts/app-build/finalChunkNames.mjs +94 -0
- package/scripts/app-build/gen.ts +100 -0
- package/scripts/app-build/gridSeams.d.mts +16 -0
- package/scripts/app-build/gridSeams.mjs +95 -0
- package/scripts/app-build/homeIcons.d.mts +20 -0
- package/scripts/app-build/homeIcons.mjs +64 -0
- package/scripts/app-build/importMap.d.mts +7 -0
- package/scripts/app-build/importMap.mjs +102 -0
- package/scripts/app-build/noTopLevelAwait.d.mts +4 -0
- package/scripts/app-build/noTopLevelAwait.mjs +36 -0
- package/scripts/app-build/outputProducts.d.mts +10 -0
- package/scripts/app-build/outputProducts.mjs +114 -0
- package/scripts/app-build/previousDeploy.d.mts +24 -0
- package/scripts/app-build/previousDeploy.mjs +245 -0
- package/scripts/app-build/serviceWorker.ts +145 -0
- package/scripts/app-build/splitOutput.d.mts +6 -0
- package/scripts/app-build/splitOutput.mjs +98 -0
- package/scripts/app-build/standaloneOutput.d.mts +4 -0
- package/scripts/app-build/standaloneOutput.mjs +31 -0
- package/scripts/app-build/validationReceipts.d.mts +2 -0
- package/scripts/app-build/validationReceipts.mjs +25 -0
- package/scripts/app-build/versionFiles.ts +20 -0
- package/scripts/app-build/worldMapAtlas.ts +62 -0
- package/scripts/app-build/writtenBundle.ts +51 -0
- package/scripts/app-build-pipeline-proof.mjs +67 -0
- package/scripts/app-build-pipeline.mjs +274 -0
- package/scripts/assert-store-layout.mjs +17 -0
- package/scripts/author-bundle-cache.d.mts +1 -0
- package/scripts/author-bundle-cache.mjs +137 -0
- package/scripts/author-bundle-usage.d.mts +3 -0
- package/scripts/author-bundle-usage.mjs +20 -0
- package/scripts/authored-manifest.d.mts +7 -0
- package/scripts/authored-manifest.mjs +217 -0
- package/scripts/authoring-inputs.d.mts +8 -0
- package/scripts/authoring-inputs.mjs +104 -0
- package/scripts/bake-grid-seams.mjs +110 -0
- package/scripts/bake-input-hashes.d.mts +6 -0
- package/scripts/bake-input-hashes.mjs +59 -0
- package/scripts/bake-loader.mjs +105 -0
- package/scripts/bake-output.d.mts +29 -0
- package/scripts/bake-output.mjs +84 -0
- package/scripts/bench-load.mjs +391 -0
- package/scripts/boot-dist-plan.mjs +47 -0
- package/scripts/boot-dist.py +251 -0
- package/scripts/boot-pack-parts.d.mts +2 -0
- package/scripts/boot-pack-parts.mjs +51 -0
- package/scripts/boot-publication-proof.d.mts +2 -0
- package/scripts/boot-publication-proof.mjs +64 -0
- package/scripts/boot-publication.d.mts +19 -0
- package/scripts/boot-publication.generated.json +3684 -0
- package/scripts/boot-publication.mjs +100 -0
- package/scripts/boot-temp-warn.sh +70 -0
- package/scripts/boot-timing-proof.mjs +264 -0
- package/scripts/browser-lane.sh +288 -0
- package/scripts/browser-slot-lock.py +49 -0
- package/scripts/budget-ceilings.mjs +88 -0
- package/scripts/budget-ratchet.d.mts +1 -0
- package/scripts/budget-ratchet.mjs +8 -0
- package/scripts/build-app.mjs +49 -0
- package/scripts/build-cache-report.d.mts +20 -0
- package/scripts/build-cache-report.mjs +104 -0
- package/scripts/build-mirror.d.mts +24 -0
- package/scripts/build-mirror.mjs +387 -0
- package/scripts/build-server.mjs +47 -0
- package/scripts/build-without-browser.mjs +14 -0
- package/scripts/built-product.d.mts +22 -0
- package/scripts/built-product.mjs +187 -0
- package/scripts/calibrate.mjs +43 -0
- package/scripts/capture-main-menu-hero.mjs +457 -0
- package/scripts/catalogue-all-heads.ts +35 -0
- package/scripts/changelog.d.mts +18 -0
- package/scripts/changelog.mjs +129 -0
- package/scripts/chaos-proxy-core.mjs +978 -0
- package/scripts/chaos-proxy-proof.mjs +1130 -0
- package/scripts/chaos-proxy.mjs +68 -0
- package/scripts/chaos-router.mjs +107 -0
- package/scripts/chaos-rules.mjs +197 -0
- package/scripts/check-chunks.d.mts +8 -0
- package/scripts/check-chunks.mjs +143 -0
- package/scripts/check-closed-components.d.mts +7 -0
- package/scripts/check-closed-components.mjs +87 -0
- package/scripts/check-css.mjs +235 -0
- package/scripts/check-custom-sections-zero.d.mts +2 -0
- package/scripts/check-custom-sections-zero.mjs +43 -0
- package/scripts/check-devserver.d.mts +2 -0
- package/scripts/check-devserver.mjs +29 -0
- package/scripts/check-engine-sides.mjs +85 -0
- package/scripts/check-graph.d.mts +9 -0
- package/scripts/check-graph.mjs +217 -0
- package/scripts/check-listeners.mjs +122 -0
- package/scripts/check-model-sources.mjs +106 -0
- package/scripts/check-models.d.mts +22 -0
- package/scripts/check-models.mjs +367 -0
- package/scripts/check-page-events.mjs +386 -0
- package/scripts/check-paths.allow.json +1282 -0
- package/scripts/check-paths.mjs +97 -0
- package/scripts/check-platform-ratchets.d.mts +7 -0
- package/scripts/check-platform-ratchets.mjs +297 -0
- package/scripts/check-shards.d.mts +5 -0
- package/scripts/check-shards.mjs +101 -0
- package/scripts/check-sim-players.mjs +82 -0
- package/scripts/check-spelled-paths.d.mts +1 -0
- package/scripts/check-spelled-paths.mjs +34 -0
- package/scripts/chromium-keychain-check.mjs +140 -0
- package/scripts/chromium-keychain.d.mts +1 -0
- package/scripts/chromium-keychain.mjs +5 -0
- package/scripts/chromium-memory-browser.d.mts +4 -0
- package/scripts/chromium-memory-browser.mjs +52 -0
- package/scripts/ci-bisect.py +91 -0
- package/scripts/ci-browser.sh +45 -0
- package/scripts/ci-checks.d.mts +2 -0
- package/scripts/ci-checks.mjs +94 -0
- package/scripts/ci-disk-census.py +58 -0
- package/scripts/ci-docs-proof.mjs +84 -0
- package/scripts/ci-exact-reuse.d.mts +3 -0
- package/scripts/ci-exact-reuse.mjs +73 -0
- package/scripts/ci-generated-manifest.sh +18 -0
- package/scripts/ci-native-fixtures.mjs +36 -0
- package/scripts/ci-pack.d.mts +14 -0
- package/scripts/ci-pack.mjs +231 -0
- package/scripts/ci-playwright-install.sh +11 -0
- package/scripts/ci-product-cache.d.mts +2 -0
- package/scripts/ci-product-cache.mjs +57 -0
- package/scripts/ci-products.py +285 -0
- package/scripts/ci-proof-jobs.d.mts +3 -0
- package/scripts/ci-proof-jobs.mjs +34 -0
- package/scripts/ci-selection.mjs +63 -0
- package/scripts/ci-shard-wall-proof.mjs +26 -0
- package/scripts/ci-shard-wall.mjs +35 -0
- package/scripts/ci-static.sh +63 -0
- package/scripts/commit.sh +305 -0
- package/scripts/commit_lane.py +42 -0
- package/scripts/committed-fast-checks.mjs +262 -0
- package/scripts/committed-source-tables.mjs +47 -0
- package/scripts/compare-platform-steps.mjs +15 -0
- package/scripts/compiler-code.d.mts +3 -0
- package/scripts/compiler-code.mjs +69 -0
- package/scripts/complete-at-control-snapshot.mjs +297 -0
- package/scripts/complete-at-control.mjs +580 -0
- package/scripts/content-base-proof.mjs +158 -0
- package/scripts/content-sw-proof.mjs +215 -0
- package/scripts/cook-admission-proof.mjs +42 -0
- package/scripts/cook-audit.ts +57 -0
- package/scripts/cook-job.mjs +32 -0
- package/scripts/cook-parts-report.mjs +34 -0
- package/scripts/cook-revision.ts +60 -0
- package/scripts/cook-to-play.mjs +96 -0
- package/scripts/cook-worker.mjs +78 -0
- package/scripts/cook-worker.service +5 -0
- package/scripts/cook.mjs +19 -0
- package/scripts/core-heap-diagnostic.d.mts +21 -0
- package/scripts/core-heap-diagnostic.mjs +52 -0
- package/scripts/cpu-admission-proof.mjs +55 -0
- package/scripts/cpu-admission.mjs +32 -0
- package/scripts/cpu-admission.py +243 -0
- package/scripts/cpu-broker-proof.mjs +96 -0
- package/scripts/cpu-broker.mjs +56 -0
- package/scripts/cpu-broker.py +119 -0
- package/scripts/cpu-census-proof.py +193 -0
- package/scripts/cpu-census.py +374 -0
- package/scripts/crossroads-proof.mjs +32 -0
- package/scripts/crossroads-rig/core.d.ts +16 -0
- package/scripts/crossroads-rig/core.js +417 -0
- package/scripts/crossroads-rig/desktop-probe.mjs +163 -0
- package/scripts/crossroads-rig/index.html +21 -0
- package/scripts/crossroads-rig/phone.js +74 -0
- package/scripts/crossroads-rig/production-probe.mjs +160 -0
- package/scripts/crossroads-rig/production.html +23 -0
- package/scripts/crossroads-rig/production.md +28 -0
- package/scripts/crossroads-rig/rig.js +36 -0
- package/scripts/crossroads-rig/sim-probe.mjs +217 -0
- package/scripts/crossroads-rig/stage.sh +11 -0
- package/scripts/crossroads-smoke.mjs +83 -0
- package/scripts/debug-settings.d.mts +24 -0
- package/scripts/debug-settings.mjs +80 -0
- package/scripts/decision-legacy-lines.d.mts +4 -0
- package/scripts/decision-legacy-lines.mjs +30 -0
- package/scripts/deck-skip-proof.mjs +63 -0
- package/scripts/deny-browser.mjs +11 -0
- package/scripts/docs-inputs-proof.mjs +31 -0
- package/scripts/doctor-proof.mjs +186 -0
- package/scripts/dome-cameras.d.mts +27 -0
- package/scripts/dome-cameras.mjs +77 -0
- package/scripts/download-bench/link.mjs +101 -0
- package/scripts/e2e-client.mjs +153 -0
- package/scripts/e2e-offline.sh +9 -0
- package/scripts/e2e-paths.mjs +31 -0
- package/scripts/e2e-watcher.mjs +191 -0
- package/scripts/e7-doctor-proof.mjs +61 -0
- package/scripts/e7-doctor-request-proof.mjs +179 -0
- package/scripts/e7-doctor-worker-proof.mjs +221 -0
- package/scripts/e7-live-staging-proof.mjs +72 -0
- package/scripts/e7-playtest-table.mjs +67 -0
- package/scripts/e7-records-proof.mjs +17 -0
- package/scripts/e7-voice-staging-proof.mjs +94 -0
- package/scripts/engine-ci-budget.ts +39 -0
- package/scripts/engine-ci-membership-proof.ts +26 -0
- package/scripts/engine-ci-plan.ts +120 -0
- package/scripts/engine-ci-proof.mjs +41 -0
- package/scripts/engine-ci-sequencer.ts +18 -0
- package/scripts/engine-ci-shard.mjs +28 -0
- package/scripts/engine-ci.config.ts +17 -0
- package/scripts/engine-order-proof.mjs +41 -0
- package/scripts/environment-boundary-proof.mjs +28 -0
- package/scripts/fetch-assets.mjs +76 -0
- package/scripts/format-hook.mjs +20 -0
- package/scripts/format-lock.d.mts +6 -0
- package/scripts/format-lock.mjs +120 -0
- package/scripts/format-package.d.mts +4 -0
- package/scripts/format-package.mjs +12 -0
- package/scripts/frame-cost-report.ts +85 -0
- package/scripts/frame-floor-args.d.mts +14 -0
- package/scripts/frame-floor-args.mjs +156 -0
- package/scripts/frame-floor-buffer-pressure.d.mts +3 -0
- package/scripts/frame-floor-buffer-pressure.mjs +91 -0
- package/scripts/frame-floor-draw-report.d.mts +38 -0
- package/scripts/frame-floor-draw-report.mjs +112 -0
- package/scripts/frame-floor-gl-time.d.mts +4 -0
- package/scripts/frame-floor-gl-time.mjs +104 -0
- package/scripts/frame-floor-gpu-bisect.mjs +120 -0
- package/scripts/frame-floor-grid.d.mts +67 -0
- package/scripts/frame-floor-grid.mjs +552 -0
- package/scripts/frame-floor-inventory.d.mts +2 -0
- package/scripts/frame-floor-inventory.mjs +10 -0
- package/scripts/frame-floor-jsc-gc.d.mts +15 -0
- package/scripts/frame-floor-jsc-gc.mjs +122 -0
- package/scripts/frame-floor-native-pressure.d.mts +4 -0
- package/scripts/frame-floor-native-pressure.mjs +78 -0
- package/scripts/frame-floor-native.mjs +108 -0
- package/scripts/frame-floor-navigation.d.mts +12 -0
- package/scripts/frame-floor-navigation.mjs +41 -0
- package/scripts/frame-floor-pause-ablation.d.mts +15 -0
- package/scripts/frame-floor-pause-ablation.mjs +90 -0
- package/scripts/frame-floor-pending.d.mts +16 -0
- package/scripts/frame-floor-pending.mjs +29 -0
- package/scripts/frame-floor-programs.mjs +39 -0
- package/scripts/frame-floor-report-phase.d.mts +10 -0
- package/scripts/frame-floor-report-phase.mjs +41 -0
- package/scripts/frame-floor-script-profile.d.mts +20 -0
- package/scripts/frame-floor-script-profile.mjs +159 -0
- package/scripts/frame-floor-settings.d.mts +6 -0
- package/scripts/frame-floor-settings.mjs +118 -0
- package/scripts/frame-floor-standing.d.mts +4 -0
- package/scripts/frame-floor-standing.mjs +20 -0
- package/scripts/frame-floor-task-clock.d.mts +4 -0
- package/scripts/frame-floor-task-clock.mjs +284 -0
- package/scripts/frame-floor-timeline-session.ts +76 -0
- package/scripts/frame-floor-wasm-constructors.d.mts +6 -0
- package/scripts/frame-floor-wasm-constructors.mjs +37 -0
- package/scripts/frame-floor-wasm-probe.d.mts +2 -0
- package/scripts/frame-floor-wasm-probe.mjs +51 -0
- package/scripts/frame-floor-webkit-timeline.d.mts +26 -0
- package/scripts/frame-floor-webkit-timeline.mjs +285 -0
- package/scripts/frame-floor.mjs +1290 -0
- package/scripts/full-test-log-proof.py +191 -0
- package/scripts/full-test-report.py +154 -0
- package/scripts/function-source.d.mts +3 -0
- package/scripts/function-source.mjs +48 -0
- package/scripts/g571-hosts.d.mts +3 -0
- package/scripts/g571-hosts.mjs +54 -0
- package/scripts/game-plugins.d.mts +22 -0
- package/scripts/gate-related-tests.d.mts +7 -0
- package/scripts/gate-related-tests.mjs +178 -0
- package/scripts/gen-api.d.mts +10 -0
- package/scripts/gen-api.mjs +134 -0
- package/scripts/gen-boot-cache.d.mts +2 -0
- package/scripts/gen-boot-cache.mjs +146 -0
- package/scripts/gen-budget-derivations.d.mts +1 -0
- package/scripts/gen-budget-derivations.mjs +43 -0
- package/scripts/gen-programs.d.mts +8 -0
- package/scripts/gen-programs.mjs +82 -0
- package/scripts/gen-shard-words.d.mts +4 -0
- package/scripts/gen-shard-words.mjs +188 -0
- package/scripts/gen-source.d.mts +4 -0
- package/scripts/gen-source.mjs +73 -0
- package/scripts/gen-starter-arm-clips.d.mts +4 -0
- package/scripts/gen-starter-arm-clips.mjs +17 -0
- package/scripts/gen-starter-bag.d.mts +4 -0
- package/scripts/gen-starter-bag.mjs +16 -0
- package/scripts/gen-starter-effects.d.mts +4 -0
- package/scripts/gen-starter-effects.mjs +16 -0
- package/scripts/gen-starter-weapons.d.mts +4 -0
- package/scripts/gen-starter-weapons.mjs +16 -0
- package/scripts/gen.mjs +6 -0
- package/scripts/generate-title-launch.mjs +55 -0
- package/scripts/generated-files.d.mts +6 -0
- package/scripts/generated-files.mjs +86 -0
- package/scripts/generated-input-reading.d.mts +3 -0
- package/scripts/generated-input-reading.mjs +89 -0
- package/scripts/generated-policy.d.mts +13 -0
- package/scripts/generated-policy.mjs +113 -0
- package/scripts/generated-source.d.mts +11 -0
- package/scripts/generated-source.mjs +214 -0
- package/scripts/generation-cache-prune.d.mts +10 -0
- package/scripts/generation-cache-prune.mjs +128 -0
- package/scripts/gfx-toggle/compare.mjs +133 -0
- package/scripts/git-common.d.mts +1 -0
- package/scripts/git-common.mjs +13 -0
- package/scripts/git-rule-counts.mjs +16 -0
- package/scripts/git-source-view.mjs +225 -0
- package/scripts/goldens/board.py +176 -0
- package/scripts/goldens/capture-inputs.d.mts +4 -0
- package/scripts/goldens/capture-inputs.mjs +35 -0
- package/scripts/goldens/capture.mjs +214 -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-gate/matrix.d.mts +3 -0
- package/scripts/gpu-gate/matrix.mjs +48 -0
- package/scripts/gpu-gate/probe.mjs +30 -0
- package/scripts/gpu-gate/status.d.mts +4 -0
- package/scripts/gpu-gate/status.mjs +112 -0
- package/scripts/gpu-perf/com.wildshard.gpu-perf.plist +11 -0
- package/scripts/gpu-perf/install.sh +31 -0
- package/scripts/gpu-perf/nightly.mjs +216 -0
- package/scripts/gpu-perf/nightly.sh +7 -0
- package/scripts/gpu-perf/report.d.mts +18 -0
- package/scripts/gpu-perf/report.mjs +109 -0
- package/scripts/gpu-perf/timing.sh +17 -0
- package/scripts/gpu-trace-frames.mjs +113 -0
- package/scripts/grid-crossing-walk-proof.mjs +172 -0
- package/scripts/grid-gate-proof.mjs +126 -0
- package/scripts/grid-ready-latches.d.mts +7 -0
- package/scripts/grid-ready-latches.mjs +44 -0
- package/scripts/grid-ready-memory.d.mts +3 -0
- package/scripts/grid-ready-memory.mjs +86 -0
- package/scripts/grid-runtime-evidence.d.mts +4 -0
- package/scripts/grid-runtime-evidence.mjs +107 -0
- package/scripts/grid-spawn-proof.mjs +317 -0
- package/scripts/guard-counts.d.mts +8 -0
- package/scripts/guard-counts.mjs +136 -0
- package/scripts/guard-index-tree.d.mts +2 -0
- package/scripts/guard-index-tree.mjs +19 -0
- package/scripts/heavy-lane-lease.d.mts +2 -0
- package/scripts/heavy-lane-lease.mjs +33 -0
- package/scripts/heavy-lane.py +652 -0
- package/scripts/herdr-prompt.sh +13 -0
- package/scripts/herdr-question-open.sh +22 -0
- package/scripts/hero-shots.mjs +168 -0
- package/scripts/home-icons.mjs +27 -0
- package/scripts/host-activity.ts +41 -0
- package/scripts/hud-worst/chat.ts +33 -0
- package/scripts/hud-worst.mjs +344 -0
- package/scripts/inbox-pull.mjs +129 -0
- package/scripts/inline-shell-css.mjs +30 -0
- package/scripts/input-hash-memo.d.mts +16 -0
- package/scripts/input-hash-memo.mjs +109 -0
- package/scripts/input-snapshot.d.mts +2 -0
- package/scripts/input-snapshot.mjs +45 -0
- package/scripts/ios-memory-watchdog.py +339 -0
- package/scripts/iphone-mem-reading.sh +40 -0
- package/scripts/js-entry-census.mjs +54 -0
- package/scripts/js-payload-heap.mjs +23 -0
- package/scripts/json-declarations.d.mts +3 -0
- package/scripts/json-declarations.mjs +101 -0
- package/scripts/json-output-guard.d.mts +6 -0
- package/scripts/json-output-guard.mjs +50 -0
- package/scripts/ktx2-engine-map.json +156 -0
- package/scripts/ktx2-tables.d.mts +5 -0
- package/scripts/ktx2-tables.mjs +103 -0
- package/scripts/land.d.mts +17 -0
- package/scripts/land.mjs +888 -0
- package/scripts/lane-watchdog.d.mts +11 -0
- package/scripts/lane-watchdog.mjs +256 -0
- package/scripts/latch-grid-evidence.d.mts +1 -0
- package/scripts/latch-grid-evidence.mjs +68 -0
- package/scripts/lift-pending-batches-proof.mjs +135 -0
- package/scripts/lift-pending-batches.mjs +124 -0
- package/scripts/lift-pending-history-proof.mjs +41 -0
- package/scripts/lift-pending-proof.mjs +27 -0
- package/scripts/lift-pending-schedule.mjs +23 -0
- package/scripts/lift-pending.d.mts +1 -0
- package/scripts/lift-pending.mjs +78 -0
- package/scripts/link-node-modules.d.mts +1 -0
- package/scripts/link-node-modules.mjs +291 -0
- package/scripts/lint-all.mjs +50 -0
- package/scripts/lint-cli.mjs +10 -0
- package/scripts/lint-fast.mjs +30 -0
- package/scripts/lint-game-selection-proof.mjs +27 -0
- package/scripts/lint-game.mjs +26 -0
- package/scripts/lint-tools.d.mts +4 -0
- package/scripts/lint-tools.mjs +28 -0
- package/scripts/listed-view-code.d.mts +7 -0
- package/scripts/listed-view-code.mjs +93 -0
- package/scripts/live-prepush.py +352 -0
- package/scripts/load-mem-probe.mjs +248 -0
- package/scripts/loading-bar-rule.mjs +107 -0
- package/scripts/loading-benchmark/accuracy-data.d.mts +12 -0
- package/scripts/loading-benchmark/accuracy-data.mjs +92 -0
- package/scripts/loading-benchmark/cache-bodies.d.mts +14 -0
- package/scripts/loading-benchmark/cache-bodies.mjs +103 -0
- package/scripts/loading-benchmark/catalogue.d.mts +8 -0
- package/scripts/loading-benchmark/catalogue.mjs +41 -0
- package/scripts/loading-benchmark/sim-shard.d.mts +60 -0
- package/scripts/loading-benchmark/sim-shard.mjs +289 -0
- package/scripts/loading-benchmark/transport.d.mts +9 -0
- package/scripts/loading-benchmark/transport.mjs +109 -0
- package/scripts/loading-card-proof.mjs +298 -0
- package/scripts/loading-fence-proof.mjs +67 -0
- package/scripts/loading-flow/analyse.mjs +280 -0
- package/scripts/loading-flow/benchmax.mjs +179 -0
- package/scripts/loading-flow/board.py +104 -0
- package/scripts/loading-flow/drive.mjs +283 -0
- package/scripts/loading-flow/layer-parity-proof.mjs +69 -0
- package/scripts/loading-flow/link-probe.mjs +99 -0
- package/scripts/loading-flow/profile.mjs +54 -0
- package/scripts/loading-flow/run.sh +51 -0
- package/scripts/loading-flow/source-maps-proof.mjs +86 -0
- package/scripts/loading-flow/source-maps.mjs +73 -0
- package/scripts/loading-flow/stalls.d.mts +39 -0
- package/scripts/loading-flow/stalls.mjs +141 -0
- package/scripts/loading-flow/sweep-input-proof.mjs +127 -0
- package/scripts/loading-flow/sweep-input.mjs +70 -0
- package/scripts/loading-flow/sweep-report.mjs +112 -0
- package/scripts/loading-flow/sweep.sh +101 -0
- package/scripts/loading-flow/target-proof.mjs +56 -0
- package/scripts/loading-flow/target.mjs +39 -0
- package/scripts/loading-time-left-proof.mjs +121 -0
- package/scripts/loading-time-left-rule.mjs +49 -0
- package/scripts/look-loop/cameras.d.mts +18 -0
- package/scripts/look-loop/cameras.mjs +109 -0
- package/scripts/look-loop/fit-lut.py +142 -0
- package/scripts/look-loop/palette-delta.py +183 -0
- package/scripts/look-loop/regions/driftwood-isle.json +25 -0
- package/scripts/look-loop/regions/far-reach.json +225 -0
- package/scripts/look-loop/regions/open-plot-night-market.json +855 -0
- package/scripts/look-loop/regions/pine-hollow.json +22 -0
- package/scripts/look-loop/regions/sunscar-dunes.json +281 -0
- package/scripts/look-loop/targets.py +229 -0
- package/scripts/look-loop/test_look_loop.py +133 -0
- package/scripts/look-loop/views.mjs +176 -0
- package/scripts/main-menu-aerial-plan.mjs +8 -0
- package/scripts/main-menu-aerial-poses.ts +292 -0
- package/scripts/main-pull.mjs +84 -0
- package/scripts/main-watch.d.mts +19 -0
- package/scripts/main-watch.mjs +248 -0
- package/scripts/manifest-art-inputs.json +4 -0
- package/scripts/manifest-budget.mjs +44 -0
- package/scripts/manifest-declaration.d.mts +3 -0
- package/scripts/manifest-declaration.mjs +40 -0
- package/scripts/manifest-spawns.mjs +38 -0
- package/scripts/manifest-static-imports.d.mts +2 -0
- package/scripts/manifest-static-imports.mjs +83 -0
- package/scripts/map-hash.d.mts +20 -0
- package/scripts/map-hash.mjs +155 -0
- package/scripts/map-painter.d.mts +13 -0
- package/scripts/map-painter.mjs +97 -0
- package/scripts/map-stylize.py +241 -0
- package/scripts/memory/cpuOwners.d.mts +4 -0
- package/scripts/memory/cpuOwners.mjs +51 -0
- package/scripts/memory/heapReader.d.mts +3 -0
- package/scripts/memory/heapReader.mjs +59 -0
- package/scripts/memory/js-heap-ratchet.json +17 -0
- package/scripts/memory/jsHeap.d.mts +6 -0
- package/scripts/memory/jsHeap.mjs +52 -0
- package/scripts/memory-report-blocks.d.mts +28 -0
- package/scripts/memory-report-blocks.mjs +60 -0
- package/scripts/memory-report-data.d.mts +25 -0
- package/scripts/memory-report-data.mjs +222 -0
- package/scripts/memory-report-graphic.d.mts +5 -0
- package/scripts/memory-report-graphic.mjs +90 -0
- package/scripts/memory-report-snapshot.d.mts +4 -0
- package/scripts/memory-report-snapshot.mjs +13 -0
- package/scripts/memory-report.d.mts +5 -0
- package/scripts/memory-report.mjs +94 -0
- package/scripts/mmo-bots.mjs +241 -0
- package/scripts/mobile-graphics-proof.mjs +120 -0
- package/scripts/model-spin-recording.d.mts +4 -0
- package/scripts/model-spin-recording.mjs +25 -0
- package/scripts/model-spin.mjs +327 -0
- package/scripts/module-cache-proof.mjs +43 -0
- package/scripts/name-prompt-proof.mjs +136 -0
- package/scripts/native-recorder-cache.d.mts +33 -0
- package/scripts/native-recorder-cache.mjs +287 -0
- package/scripts/native-retention-proof.mjs +79 -0
- package/scripts/night-market-kit-budget.d.mts +12 -0
- package/scripts/night-market-kit-budget.mjs +80 -0
- package/scripts/nightly-heads.ts +176 -0
- package/scripts/nightly-model.ts +127 -0
- package/scripts/nightly-tag.d.mts +1 -0
- package/scripts/nightly-tag.mjs +32 -0
- package/scripts/nightly.proof.ts +105 -0
- package/scripts/nightly.ts +43 -0
- package/scripts/nine-sim-memory.mjs +353 -0
- package/scripts/no-binary-json.d.mts +12 -0
- package/scripts/no-binary-json.mjs +270 -0
- package/scripts/non-engine-admission-proof.mjs +27 -0
- package/scripts/number-path-probe.d.mts +7 -0
- package/scripts/number-path-probe.mjs +57 -0
- package/scripts/offline-proof-rules.d.mts +23 -0
- package/scripts/offline-proof-rules.mjs +123 -0
- package/scripts/offline-proof.mjs +498 -0
- package/scripts/online-phone-proof.mjs +330 -0
- package/scripts/online-proof.mjs +150 -0
- package/scripts/online-ride-proof.mjs +74 -0
- package/scripts/online-rig.mjs +114 -0
- package/scripts/page-parity.mjs +99 -0
- package/scripts/page-release/content.d.mts +30 -0
- package/scripts/page-release/content.mjs +299 -0
- package/scripts/page-release/flow.d.mts +60 -0
- package/scripts/page-release/flow.mjs +365 -0
- package/scripts/page-release/hosts/workers.d.mts +8 -0
- package/scripts/page-release/hosts/workers.mjs +160 -0
- package/scripts/page-release/packs.mjs +108 -0
- package/scripts/page-release/redact.d.mts +1 -0
- package/scripts/page-release/redact.mjs +19 -0
- package/scripts/page-release.mjs +101 -0
- package/scripts/page-size.d.mts +13 -0
- package/scripts/page-size.mjs +198 -0
- package/scripts/parallel-fast-lint.d.mts +1 -0
- package/scripts/parallel-fast-lint.mjs +54 -0
- package/scripts/parity/audio-diagnostics.d.mts +5 -0
- package/scripts/parity/audio-diagnostics.mjs +63 -0
- package/scripts/parity/audio-settle.mjs +111 -0
- package/scripts/parity/black-frame.d.mts +11 -0
- package/scripts/parity/black-frame.mjs +58 -0
- package/scripts/parity/boot-smoke.d.mts +47 -0
- package/scripts/parity/boot-smoke.mjs +585 -0
- package/scripts/parity/boot-timing-delay.mjs +54 -0
- package/scripts/parity/browser-escape.d.mts +2 -0
- package/scripts/parity/browser-escape.mjs +50 -0
- package/scripts/parity/budgetCeilings.d.mts +3 -0
- package/scripts/parity/budgetCeilings.mjs +30 -0
- package/scripts/parity/budgets.d.mts +7 -0
- package/scripts/parity/budgets.mjs +73 -0
- package/scripts/parity/cache.d.mts +1 -0
- package/scripts/parity/cache.mjs +40 -0
- package/scripts/parity/canvas-bytes.d.mts +13 -0
- package/scripts/parity/canvas-bytes.mjs +96 -0
- package/scripts/parity/capture-rpc.d.mts +2 -0
- package/scripts/parity/capture-rpc.mjs +41 -0
- package/scripts/parity/capture-trace.d.mts +6 -0
- package/scripts/parity/capture-trace.mjs +63 -0
- package/scripts/parity/clock.d.mts +1 -0
- package/scripts/parity/clock.mjs +89 -0
- package/scripts/parity/combat.d.mts +14 -0
- package/scripts/parity/combat.mjs +81 -0
- package/scripts/parity/compare.d.mts +10 -0
- package/scripts/parity/compare.mjs +177 -0
- package/scripts/parity/explorer-smoke.d.mts +21 -0
- package/scripts/parity/explorer-smoke.mjs +310 -0
- package/scripts/parity/fast-png.d.mts +18 -0
- package/scripts/parity/fast-png.mjs +68 -0
- package/scripts/parity/fingerprint.mjs +8 -0
- package/scripts/parity/fixed-render.d.mts +11 -0
- package/scripts/parity/fixed-render.mjs +79 -0
- package/scripts/parity/frame-budget.d.mts +3 -0
- package/scripts/parity/frame-budget.mjs +39 -0
- package/scripts/parity/frame-bytes.d.mts +8 -0
- package/scripts/parity/frame-bytes.mjs +45 -0
- package/scripts/parity/frames.mjs +8 -0
- package/scripts/parity/glbytes.d.mts +8 -0
- package/scripts/parity/glbytes.mjs +148 -0
- package/scripts/parity/grid-boot-waits.d.mts +13 -0
- package/scripts/parity/grid-boot-waits.mjs +43 -0
- package/scripts/parity/heat-bytes.d.mts +5 -0
- package/scripts/parity/heat-bytes.mjs +32 -0
- package/scripts/parity/hover-touch.mjs +153 -0
- package/scripts/parity/hud.d.mts +4 -0
- package/scripts/parity/hud.mjs +17 -0
- package/scripts/parity/image-routes.d.mts +5 -0
- package/scripts/parity/image-routes.mjs +29 -0
- package/scripts/parity/init.d.mts +15 -0
- package/scripts/parity/init.mjs +63 -0
- package/scripts/parity/lane-browser.mjs +14 -0
- package/scripts/parity/offline.d.mts +5 -0
- package/scripts/parity/offline.mjs +24 -0
- package/scripts/parity/phone-route-browser.d.mts +20 -0
- package/scripts/parity/phone-route-browser.mjs +241 -0
- package/scripts/parity/phone-route-page.d.mts +10 -0
- package/scripts/parity/phone-route-page.mjs +245 -0
- package/scripts/parity/phone-route-runner.d.mts +2 -0
- package/scripts/parity/phone-route-runner.mjs +39 -0
- package/scripts/parity/phone-route.d.mts +43 -0
- package/scripts/parity/phone-route.mjs +212 -0
- package/scripts/parity/pool.d.mts +4 -0
- package/scripts/parity/pool.mjs +74 -0
- package/scripts/parity/poses.d.mts +6 -0
- package/scripts/parity/poses.mjs +57 -0
- package/scripts/parity/probe.d.mts +2 -0
- package/scripts/parity/probe.mjs +13 -0
- package/scripts/parity/profile.d.mts +2 -0
- package/scripts/parity/profile.mjs +52 -0
- package/scripts/parity/record.d.mts +8 -0
- package/scripts/parity/record.mjs +102 -0
- package/scripts/parity/resources.mjs +58 -0
- package/scripts/parity/saves.d.mts +1 -0
- package/scripts/parity/saves.mjs +14 -0
- package/scripts/parity/serve.d.mts +9 -0
- package/scripts/parity/serve.mjs +125 -0
- package/scripts/parity/shader-code.d.mts +2 -0
- package/scripts/parity/shader-code.mjs +10 -0
- package/scripts/parity/ssim.d.mts +4 -0
- package/scripts/parity/ssim.mjs +44 -0
- package/scripts/parity/telemetry.d.mts +1 -0
- package/scripts/parity/telemetry.mjs +19 -0
- package/scripts/parity/timeout.mjs +7 -0
- package/scripts/parity/title-trace.d.mts +13 -0
- package/scripts/parity/title-trace.mjs +59 -0
- package/scripts/parity/value.d.mts +11 -0
- package/scripts/parity/value.mjs +50 -0
- package/scripts/parity/walk.d.mts +10 -0
- package/scripts/parity/walk.mjs +109 -0
- package/scripts/parity.mjs +310 -0
- package/scripts/perf/README.md +47 -0
- package/scripts/perf/cameras24.json +2963 -0
- package/scripts/perf/draw-census-page.d.mts +10 -0
- package/scripts/perf/draw-census-page.mjs +162 -0
- package/scripts/perf/draw-census-poses.d.mts +14 -0
- package/scripts/perf/draw-census-poses.mjs +44 -0
- package/scripts/perf/draw-census-report.d.mts +24 -0
- package/scripts/perf/draw-census-report.mjs +86 -0
- package/scripts/perf/draw-census.mjs +156 -0
- package/scripts/perf/exact-world-capture.mjs +167 -0
- package/scripts/perf/gpu-census-coverage.d.mts +6 -0
- package/scripts/perf/gpu-census-coverage.mjs +47 -0
- package/scripts/perf/gpu-census-overdraw.mjs +105 -0
- package/scripts/perf/gpu-census-page.d.mts +11 -0
- package/scripts/perf/gpu-census-page.mjs +53 -0
- package/scripts/perf/gpu-census-report.d.mts +3 -0
- package/scripts/perf/gpu-census-report.mjs +15 -0
- package/scripts/perf/gpu-census.d.mts +6 -0
- package/scripts/perf/gpu-census.mjs +95 -0
- package/scripts/perf/material-program-loan.d.mts +18 -0
- package/scripts/perf/material-program-loan.mjs +88 -0
- package/scripts/perf/world-pixel-difference.d.mts +5 -0
- package/scripts/perf/world-pixel-difference.mjs +22 -0
- package/scripts/phone-loading/chromium.ts +113 -0
- package/scripts/phone-loading/cpu-profile.ts +47 -0
- package/scripts/phone-loading/fixtures.ts +18 -0
- package/scripts/phone-loading/instrument.ts +219 -0
- package/scripts/phone-loading/link.ts +115 -0
- package/scripts/phone-loading/main.ts +261 -0
- package/scripts/phone-loading/model.ts +123 -0
- package/scripts/phone-loading/native-body.ts +40 -0
- package/scripts/phone-loading/native-sizes.ts +194 -0
- package/scripts/phone-loading/network.ts +167 -0
- package/scripts/phone-loading/play.ts +132 -0
- package/scripts/phone-loading/post-control.ts +22 -0
- package/scripts/phone-loading/recording.ts +28 -0
- package/scripts/phone-loading/shaped-preview.ts +37 -0
- package/scripts/phone-loading/tsconfig.json +11 -0
- package/scripts/physics-baseline.mjs +433 -0
- package/scripts/physics-grid-entry.d.mts +15 -0
- package/scripts/physics-grid-entry.mjs +62 -0
- package/scripts/physics-grid.d.mts +10 -0
- package/scripts/physics-grid.mjs +102 -0
- package/scripts/physics-native.d.mts +6 -0
- package/scripts/physics-native.mjs +81 -0
- package/scripts/physics-route.json +4400 -0
- package/scripts/physics-walk.d.mts +16 -0
- package/scripts/physics-walk.mjs +79 -0
- package/scripts/pid-lock.d.mts +1 -0
- package/scripts/pid-lock.mjs +63 -0
- package/scripts/pin-assets.ts +94 -0
- package/scripts/pin-format.ts +43 -0
- package/scripts/pin-packs.ts +17 -0
- package/scripts/pins-exclude.d.mts +3 -0
- package/scripts/pins-exclude.mjs +54 -0
- package/scripts/pins-reuse.d.mts +27 -0
- package/scripts/pins-reuse.mjs +321 -0
- package/scripts/pins.ts +468 -0
- package/scripts/platform-chargebacks.d.mts +9 -0
- package/scripts/platform-chargebacks.mjs +135 -0
- package/scripts/playground-grapple.mjs +154 -0
- package/scripts/playground-harness.mjs +137 -0
- package/scripts/playground-horse.mjs +106 -0
- package/scripts/prebuilt-output.py +322 -0
- package/scripts/precommit-checks.d.mts +3 -0
- package/scripts/precommit-checks.mjs +115 -0
- package/scripts/precommit-inputs.d.mts +5 -0
- package/scripts/precommit-inputs.mjs +73 -0
- package/scripts/precommit-jobs.d.mts +5 -0
- package/scripts/precommit-jobs.mjs +85 -0
- package/scripts/precommit-source.py +493 -0
- package/scripts/preparation-cache-key.d.mts +2 -0
- package/scripts/preparation-cache-key.mjs +70 -0
- package/scripts/prepush-proof.mjs +36 -0
- package/scripts/preview-encoded-cache.d.mts +7 -0
- package/scripts/preview-encoded-cache.mjs +64 -0
- package/scripts/preview-lag.mjs +80 -0
- package/scripts/preview-server.mjs +256 -0
- package/scripts/preview-telemetry.d.mts +4 -0
- package/scripts/preview-telemetry.mjs +56 -0
- package/scripts/product-build-times.d.mts +3 -0
- package/scripts/product-build-times.mjs +42 -0
- package/scripts/program-discovery.d.mts +5 -0
- package/scripts/program-discovery.mjs +42 -0
- package/scripts/progress-recording.d.mts +6 -0
- package/scripts/progress-recording.mjs +26 -0
- package/scripts/progress-video.sh +27 -0
- package/scripts/proof-run.sh +69 -0
- package/scripts/prune-local-caches.mjs +10 -0
- package/scripts/public-grid.d.mts +11 -0
- package/scripts/public-grid.mjs +56 -0
- package/scripts/push-budget.d.mts +3 -0
- package/scripts/push-budget.mjs +5 -0
- package/scripts/push-cache-git-proof.mjs +32 -0
- package/scripts/push-cache-lease-proof.mjs +22 -0
- package/scripts/push-cache-proof.mjs +29 -0
- package/scripts/push-checks.d.mts +2 -0
- package/scripts/push-checks.mjs +116 -0
- package/scripts/push-cohort-proof.mjs +15 -0
- package/scripts/push-dependencies.mjs +97 -0
- package/scripts/push-dependency-proof.mjs +53 -0
- package/scripts/push-duration-sequencer.ts +26 -0
- package/scripts/push-environment.mjs +21 -0
- package/scripts/push-exclusion-proof.mjs +81 -0
- package/scripts/push-gate-copy.mjs +168 -0
- package/scripts/push-inputs.d.mts +4 -0
- package/scripts/push-inputs.mjs +99 -0
- package/scripts/push-lint-config.d.mts +4 -0
- package/scripts/push-lint-config.mjs +26 -0
- package/scripts/push-local-split.d.mts +15 -0
- package/scripts/push-local-split.mjs +116 -0
- package/scripts/push-loop.py +317 -0
- package/scripts/push-proof-cache.mjs +131 -0
- package/scripts/push-ref-tree-proof.mjs +63 -0
- package/scripts/push-related.mjs +29 -0
- package/scripts/push-selection-dev-proof.mjs +57 -0
- package/scripts/push-selection-proof.mjs +45 -0
- package/scripts/push-selection.d.mts +2 -0
- package/scripts/push-selection.mjs +65 -0
- package/scripts/push-vitest.config.ts +20 -0
- package/scripts/push_input_cache.py +306 -0
- package/scripts/quarantine-placement-proof.mjs +28 -0
- package/scripts/quarantine-renewal-proof.mjs +34 -0
- package/scripts/quarantine-window-proof.mjs +26 -0
- package/scripts/quest-complete-proof.mjs +78 -0
- package/scripts/quiet-cli.mjs +13 -0
- package/scripts/quiet_logs.py +79 -0
- package/scripts/ratchet-approval.d.mts +3 -0
- package/scripts/ratchet-approval.mjs +70 -0
- package/scripts/record-fence-reads.mjs +115 -0
- package/scripts/release-check.mjs +22 -0
- package/scripts/release-proof-proof.mjs +71 -0
- package/scripts/reload-title-proof.mjs +100 -0
- package/scripts/remote-air-proof.mjs +137 -0
- package/scripts/remote-bar-proof.mjs +75 -0
- package/scripts/remote-board-proof.mjs +129 -0
- package/scripts/remote-body-proof.mjs +101 -0
- package/scripts/remote-death-proof.mjs +134 -0
- package/scripts/remote-gait-proof.mjs +139 -0
- package/scripts/remote-held-proof.mjs +155 -0
- package/scripts/remote-hurt-proof.mjs +121 -0
- package/scripts/remote-map-proof.mjs +103 -0
- package/scripts/remote-name-proof.mjs +123 -0
- package/scripts/remote-players-proof.mjs +214 -0
- package/scripts/remote-room.mjs +75 -0
- package/scripts/remote-strike-proof.mjs +148 -0
- package/scripts/renderer-revision-replay.mjs +49 -0
- package/scripts/renderer-revision.d.mts +12 -0
- package/scripts/renderer-revision.mjs +101 -0
- package/scripts/renderer-revision.proof.mjs +71 -0
- package/scripts/repo-size.d.mts +43 -0
- package/scripts/repo-size.mjs +540 -0
- package/scripts/ring-cook.mjs +51 -0
- package/scripts/ring-step.ts +112 -0
- package/scripts/ring1.sh +79 -0
- package/scripts/room-deploy.mjs +130 -0
- package/scripts/room-soak.mjs +40 -0
- package/scripts/runtime_input_copies.py +49 -0
- package/scripts/scorecard.mjs +1156 -0
- package/scripts/script-scenario-metrics.d.mts +10 -0
- package/scripts/script-scenario-metrics.mjs +75 -0
- package/scripts/section-types.d.mts +3 -0
- package/scripts/section-types.mjs +35 -0
- package/scripts/sentry-maps.d.mts +9 -0
- package/scripts/sentry-maps.mjs +94 -0
- package/scripts/serialize-asset-tables.mjs +13 -0
- package/scripts/serve-build.sh +392 -0
- package/scripts/serve-port-lease.py +100 -0
- package/scripts/serve-shared-preview.py +295 -0
- package/scripts/server-origin.mjs +10 -0
- package/scripts/server-release/github.mjs +142 -0
- package/scripts/server-release/publish.d.mts +19 -0
- package/scripts/server-release/publish.mjs +143 -0
- package/scripts/server-release/sign.d.mts +10 -0
- package/scripts/server-release/sign.mjs +75 -0
- package/scripts/shard-component-spans.d.mts +15 -0
- package/scripts/shard-component-spans.mjs +18 -0
- package/scripts/shard-components.d.mts +16 -0
- package/scripts/shard-components.mjs +365 -0
- package/scripts/shard-coupling.d.mts +11 -0
- package/scripts/shard-coupling.mjs +238 -0
- package/scripts/shard-folders.mjs +14 -0
- package/scripts/shard-net-lines.d.mts +13 -0
- package/scripts/shard-net-lines.mjs +62 -0
- package/scripts/shard-output-content.d.mts +4 -0
- package/scripts/shard-output-content.mjs +27 -0
- package/scripts/shard-outputs.d.mts +12 -0
- package/scripts/shard-outputs.mjs +64 -0
- package/scripts/shard-phone-memory.d.mts +37 -0
- package/scripts/shard-phone-memory.mjs +556 -0
- package/scripts/shard-platform-format.d.mts +10 -0
- package/scripts/shard-platform-format.mjs +7 -0
- package/scripts/shard-platform-hosts.d.mts +2 -0
- package/scripts/shard-platform-hosts.mjs +93 -0
- package/scripts/shard-platform-output.d.mts +12 -0
- package/scripts/shard-platform-output.mjs +74 -0
- package/scripts/shard-platform-sections.d.mts +2 -0
- package/scripts/shard-platform-sections.mjs +9 -0
- package/scripts/shard-platform.d.mts +76 -0
- package/scripts/shard-platform.mjs +1072 -0
- package/scripts/shard-public.d.mts +3 -0
- package/scripts/shard-public.mjs +36 -0
- package/scripts/shard-runtime-closure.d.mts +3 -0
- package/scripts/shard-runtime-closure.mjs +30 -0
- package/scripts/shard-size-gate.d.mts +13 -0
- package/scripts/shard-size-gate.mjs +135 -0
- package/scripts/shard-size-watch.d.mts +7 -0
- package/scripts/shard-size-watch.mjs +70 -0
- package/scripts/shard-wire-meter.mjs +107 -0
- package/scripts/shardfile-cache.d.mts +17 -0
- package/scripts/shardfile-cache.mjs +268 -0
- package/scripts/shardfile-inputs.d.mts +19 -0
- package/scripts/shardfile-inputs.mjs +452 -0
- package/scripts/shardfile-validation-revision.d.mts +1 -0
- package/scripts/shardfile-validation-revision.mjs +30 -0
- package/scripts/shards.d.mts +7 -0
- package/scripts/shards.mjs +16 -0
- package/scripts/side-parity.d.mts +8 -0
- package/scripts/side-parity.mjs +220 -0
- package/scripts/sim-boost-lap.mjs +198 -0
- package/scripts/sim-grid-entry.mjs +534 -0
- package/scripts/sim-in-runtime.d.mts +6 -0
- package/scripts/sim-in-runtime.mjs +146 -0
- package/scripts/sim-lane.sh +351 -0
- package/scripts/sim-mem-phases.py +195 -0
- package/scripts/sim-memory.mjs +414 -0
- package/scripts/sim-node-loader.mjs +37 -0
- package/scripts/sim-presentation-proof.py +37 -0
- package/scripts/sim-quiet.py +160 -0
- package/scripts/sim-safari-ready.py +896 -0
- package/scripts/sim-transport.c +93 -0
- package/scripts/slice-inputs.ts +31 -0
- package/scripts/smoke-timings.py +34 -0
- package/scripts/snapshot-admission-proof.mjs +55 -0
- package/scripts/soak/boundary.mjs +110 -0
- package/scripts/soak/inspector.d.mts +18 -0
- package/scripts/soak/inspector.mjs +74 -0
- package/scripts/soak/memory-categories.d.mts +12 -0
- package/scripts/soak/memory-categories.mjs +28 -0
- package/scripts/socket-smoke.mjs +20 -0
- package/scripts/sort-sides.d.mts +33 -0
- package/scripts/sort-sides.mjs +919 -0
- package/scripts/source-generation-outputs.json +11 -0
- package/scripts/source-generators.d.mts +11 -0
- package/scripts/source-generators.mjs +59 -0
- package/scripts/source-input-proof.d.mts +12 -0
- package/scripts/source-input-proof.mjs +106 -0
- package/scripts/source-table-cache.d.mts +2 -0
- package/scripts/source-table-cache.mjs +102 -0
- package/scripts/sp-tools.py +150 -0
- package/scripts/sp-tools.sh +6 -0
- package/scripts/split-repair-data-shard.mjs +98 -0
- package/scripts/split-repair-guardian.mjs +26 -0
- package/scripts/split-repair-hare.mjs +54 -0
- package/scripts/split-repair-held-melee.mjs +41 -0
- package/scripts/split-repair-horse-panic.mjs +45 -0
- package/scripts/split-repair-movers.mjs +92 -0
- package/scripts/split-repair-nalati-signals.mjs +94 -0
- package/scripts/split-repair-perks.mjs +73 -0
- package/scripts/split-repair-pine-writes.mjs +76 -0
- package/scripts/split-repair-proof.mjs +24 -0
- package/scripts/split-repair-sky-trails.mjs +110 -0
- package/scripts/split-repair-stun.mjs +37 -0
- package/scripts/split-repair-wake-loss.mjs +35 -0
- package/scripts/split-repair-whip.mjs +44 -0
- package/scripts/staging-proof-lines.d.mts +8 -0
- package/scripts/staging-proof-lines.mjs +85 -0
- package/scripts/standalone-smoke.mjs +116 -0
- package/scripts/storage-policy.json +89 -0
- package/scripts/temp-janitor.d.mts +6 -0
- package/scripts/temp-janitor.mjs +40 -0
- package/scripts/template-format-proof.mjs +44 -0
- package/scripts/test-amber.d.mts +11 -0
- package/scripts/test-amber.mjs +90 -0
- package/scripts/test-build-tools.ts +24 -0
- package/scripts/test-facade-instancing.mjs +53 -0
- package/scripts/test-ios-memory-watchdog.py +107 -0
- package/scripts/test-products.json +389 -0
- package/scripts/test-quarantine.d.mts +6 -0
- package/scripts/test-quarantine.mjs +132 -0
- package/scripts/test-shard-plan.ts +66 -0
- package/scripts/test-timings.d.mts +14 -0
- package/scripts/test-timings.mjs +174 -0
- package/scripts/test_agent_time.py +155 -0
- package/scripts/test_browser_lane.py +239 -0
- package/scripts/test_lease_order.py +142 -0
- package/scripts/test_partition.py +23 -0
- package/scripts/test_prebuilt_output.py +258 -0
- package/scripts/test_products.py +20 -0
- package/scripts/test_serve_ports.py +645 -0
- package/scripts/test_sim_lane.py +1661 -0
- package/scripts/test_sim_quiet.py +140 -0
- package/scripts/texture-inputs.d.mts +4 -0
- package/scripts/texture-inputs.mjs +16 -0
- package/scripts/tile-bake-policy.d.mts +4 -0
- package/scripts/tile-bake-policy.mjs +43 -0
- package/scripts/tile-bake-report.d.mts +17 -0
- package/scripts/tile-bake-report.mjs +161 -0
- package/scripts/tile-bakes.d.mts +13 -0
- package/scripts/tile-bakes.mjs +100 -0
- package/scripts/timelapse.sh +44 -0
- package/scripts/title-assets.d.mts +6 -0
- package/scripts/title-assets.generated.json +9 -0
- package/scripts/title-assets.mjs +46 -0
- package/scripts/title-exit-proof.mjs +132 -0
- package/scripts/tsconfig.json +576 -0
- package/scripts/typecheck-lint.sh +21 -0
- package/scripts/typecheck-root.d.mts +2 -0
- package/scripts/typecheck-root.mjs +18 -0
- package/scripts/types/wildshard-probe.d.ts +29 -0
- package/scripts/types/worker-page.d.ts +55 -0
- package/scripts/uncatalogued-shard-proof.mjs +48 -0
- package/scripts/vite-tmp.d.mts +23 -0
- package/scripts/vite-tmp.mjs +157 -0
- package/scripts/vitest-bench.py +800 -0
- package/scripts/vitest-ci-files.ts +90 -0
- package/scripts/vitest-ci.config.ts +15 -0
- package/scripts/vitest-cpu.ts +46 -0
- package/scripts/vitest-environments.ts +41 -0
- package/scripts/vitest-fixture-snapshots.config.ts +8 -0
- package/scripts/vitest-lane.ts +53 -0
- package/scripts/vitest-module-cache.ts +49 -0
- package/scripts/vitest-native-escape.config.ts +9 -0
- package/scripts/vitest-plan.ts +94 -0
- package/scripts/vitest-push-guards.config.ts +13 -0
- package/scripts/vitest-push.config.ts +19 -0
- package/scripts/vitest-shard.ts +109 -0
- package/scripts/vitest-timings.ts +32 -0
- package/scripts/vitest-tmp.ts +83 -0
- package/scripts/vitest.sh +5 -0
- package/scripts/vps/dump.sh +50 -0
- package/scripts/vps/harden-apply.sh +490 -0
- package/scripts/vps/harden-caddy.sh +215 -0
- package/scripts/vps/harden.sh +358 -0
- package/scripts/vps/health-stub.mjs +11 -0
- package/scripts/vps/pull.mjs +156 -0
- package/scripts/vps/rebuild.sh +531 -0
- package/scripts/vps/restore-check.sh +35 -0
- package/scripts/vps/setup-state.mjs +121 -0
- package/scripts/vps/setup.sh +442 -0
- package/scripts/vps/uptime.sh +26 -0
- package/scripts/vps/wildshard-agent.pub +1 -0
- package/scripts/vps/wildshard-apply.mjs +127 -0
- package/scripts/vps/wildshard-config +211 -0
- package/scripts/vps-harden-proof.sh +117 -0
- package/scripts/vps-rebuild-proof.sh +170 -0
- package/scripts/warm-native-chrome.d.mts +6 -0
- package/scripts/warm-native-chrome.mjs +75 -0
- package/scripts/webkit-mem-reading.mjs +157 -0
- package/scripts/webkit-render-smoke.mjs +145 -0
- package/scripts/worker-bootstrap-proof.mjs +79 -0
- package/scripts/worker-client-death-return.mjs +97 -0
- package/scripts/worker-client-death.mjs +67 -0
- package/scripts/worker-client-fights.mjs +1438 -0
- package/scripts/worker-client-grid-entry.mjs +239 -0
- package/scripts/worker-client-hurt.mjs +92 -0
- package/scripts/worker-client-moments.mjs +340 -0
- package/scripts/worker-client-partner.mjs +93 -0
- package/scripts/worker-client-pine-durable.mjs +102 -0
- package/scripts/worker-client-pine-grid.mjs +77 -0
- package/scripts/worker-client-pine-import.mjs +93 -0
- package/scripts/worker-client-pine.mjs +114 -0
- package/scripts/worker-client-play.mjs +572 -0
- package/scripts/worker-client-proof.mjs +201 -0
- package/scripts/worker-client-repairs.mjs +108 -0
- package/scripts/worker-client-returns.mjs +51 -0
- package/scripts/worker-client-saves.mjs +146 -0
- package/scripts/worker-client-windup.mjs +50 -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 +339 -0
- package/src/.oxfmtrc.json +48 -0
- package/src/.oxlintrc.json +190 -0
- package/src/cli/main.ts +112 -0
- package/src/cli/version.ts +13 -0
- package/src/client/app/assetTables.ts +68 -0
- package/src/client/app/bootDownloads.ts +43 -0
- package/src/client/app/bootRoute.ts +27 -0
- package/src/client/app/calibrate.ts +9 -0
- package/src/client/app/dropModal.ts +99 -0
- package/src/client/app/entry.ts +439 -0
- package/src/client/app/failScreens.ts +561 -0
- package/src/client/app/identity.ts +10 -0
- package/src/client/app/main.ts +3 -0
- package/src/client/app/pageServices.ts +20 -0
- package/src/client/app/selectedManifests.ts +31 -0
- package/src/client/app/shardSelection.ts +46 -0
- package/src/client/app/titleSettings.ts +15 -0
- package/src/client/app.tsx +53 -0
- package/src/client/engine/ai/view/eliteController.ts +148 -0
- package/src/client/engine/ai/view/eliteEntry.ts +464 -0
- package/src/client/engine/aliasFixture.webp +0 -0
- package/src/client/engine/anim/channel.ts +58 -0
- package/src/client/engine/anim/machine.ts +77 -0
- package/src/client/engine/anim/rig.ts +150 -0
- package/src/client/engine/anim/rigAtlas.ts +73 -0
- package/src/client/engine/anim/rigParser.ts +59 -0
- package/src/client/engine/app/app.ts +262 -0
- package/src/client/engine/app/assets.ts +122 -0
- package/src/client/engine/app/cachedAssets.ts +116 -0
- package/src/client/engine/app/disposalCache.ts +30 -0
- package/src/client/engine/app/runtime.ts +16 -0
- package/src/client/engine/app/sceneOwnership.ts +317 -0
- package/src/client/engine/app/services.ts +20 -0
- package/src/client/engine/app/systems.ts +71 -0
- package/src/client/engine/app/ui.ts +33 -0
- package/src/client/engine/app/view/frameScheduler.ts +65 -0
- package/src/client/engine/app/view/pageActivity.ts +12 -0
- package/src/client/engine/app/view/presentation.ts +41 -0
- package/src/client/engine/app/view/presentationLoop.ts +56 -0
- package/src/client/engine/app/view/scopeEnvironment.ts +39 -0
- package/src/client/engine/app/workerScope.js +20 -0
- package/src/client/engine/audio/AmbienceBeds.ts +197 -0
- package/src/client/engine/audio/Audio.ts +634 -0
- package/src/client/engine/audio/Cues.ts +153 -0
- package/src/client/engine/audio/Music.ts +958 -0
- package/src/client/engine/audio/SetScore.ts +297 -0
- package/src/client/engine/audio/Stems.ts +277 -0
- package/src/client/engine/audio/Voices.ts +299 -0
- package/src/client/engine/audio/aacNative.ts +46 -0
- package/src/client/engine/audio/aacPull.ts +166 -0
- package/src/client/engine/audio/aacSource.ts +122 -0
- package/src/client/engine/audio/aacTrack.ts +115 -0
- package/src/client/engine/audio/aacWindows.ts +66 -0
- package/src/client/engine/audio/activity.ts +70 -0
- package/src/client/engine/audio/activityTimers.ts +37 -0
- package/src/client/engine/audio/ambience.ts +549 -0
- package/src/client/engine/audio/audioLog.ts +22 -0
- package/src/client/engine/audio/codecs.merge.d.ts +9 -0
- package/src/client/engine/audio/credits.ts +48 -0
- package/src/client/engine/audio/cueRouting.ts +93 -0
- package/src/client/engine/audio/declared.ts +95 -0
- package/src/client/engine/audio/declaredAmbience.ts +113 -0
- package/src/client/engine/audio/declaredBank.ts +104 -0
- package/src/client/engine/audio/declaredGameplay.ts +82 -0
- package/src/client/engine/audio/dsp.ts +164 -0
- package/src/client/engine/audio/gen.ts +538 -0
- package/src/client/engine/audio/interactSfx.ts +95 -0
- package/src/client/engine/audio/levelAudio.ts +131 -0
- package/src/client/engine/audio/loopWindow.ts +24 -0
- package/src/client/engine/audio/ownership.ts +16 -0
- package/src/client/engine/audio/playerVoices.ts +278 -0
- package/src/client/engine/audio/preload.ts +166 -0
- package/src/client/engine/audio/score/score.ts +60 -0
- package/src/client/engine/audio/scoreSelection.ts +19 -0
- package/src/client/engine/audio/surface.ts +71 -0
- package/src/client/engine/audio/synth.ts +301 -0
- package/src/client/engine/audio/unlock.ts +104 -0
- package/src/client/engine/audio/util.ts +95 -0
- package/src/client/engine/blocks.ts +6 -0
- package/src/client/engine/boot/audioFiles.ts +9 -0
- package/src/client/engine/boot/audioInventory.ts +34 -0
- package/src/client/engine/boot/audioPack.ts +54 -0
- package/src/client/engine/boot/bakedApi.ts +46 -0
- package/src/client/engine/boot/bakedTextures.ts +114 -0
- package/src/client/engine/boot/bootCache.ts +16 -0
- package/src/client/engine/boot/bootTrace.ts +362 -0
- package/src/client/engine/boot/browserChunkRecovery.ts +136 -0
- package/src/client/engine/boot/bytes.ts +272 -0
- package/src/client/engine/boot/catalog.ts +35 -0
- package/src/client/engine/boot/chunkRecovery.ts +41 -0
- package/src/client/engine/boot/clearDownloads.ts +128 -0
- package/src/client/engine/boot/contentBase.ts +77 -0
- package/src/client/engine/boot/contentRead.ts +151 -0
- package/src/client/engine/boot/diagnostics.ts +195 -0
- package/src/client/engine/boot/download.ts +112 -0
- package/src/client/engine/boot/dropNotice.ts +260 -0
- package/src/client/engine/boot/earlyPrograms.ts +123 -0
- package/src/client/engine/boot/extras.ts +324 -0
- package/src/client/engine/boot/filePolicy.ts +126 -0
- package/src/client/engine/boot/firstPlayMark.ts +43 -0
- package/src/client/engine/boot/gpuFiles.ts +176 -0
- package/src/client/engine/boot/gpuTrace.ts +42 -0
- package/src/client/engine/boot/idle.ts +52 -0
- package/src/client/engine/boot/imageDecode.ts +95 -0
- package/src/client/engine/boot/imageDecode.worker.ts +69 -0
- package/src/client/engine/boot/ktx2.generated.ts +157 -0
- package/src/client/engine/boot/lastEnd.ts +312 -0
- package/src/client/engine/boot/leaveAfterPaint.ts +16 -0
- package/src/client/engine/boot/liveJsonParser.ts +124 -0
- package/src/client/engine/boot/liveJsonParser.worker.ts +22 -0
- package/src/client/engine/boot/loadingDownloadText.ts +54 -0
- package/src/client/engine/boot/loadingPacks.ts +18 -0
- package/src/client/engine/boot/lowPower.ts +96 -0
- package/src/client/engine/boot/manifest.ts +12 -0
- package/src/client/engine/boot/pack.ts +180 -0
- package/src/client/engine/boot/parsedPages.ts +115 -0
- package/src/client/engine/boot/perflog.ts +15 -0
- package/src/client/engine/boot/plan.ts +256 -0
- package/src/client/engine/boot/prefetch.ts +188 -0
- package/src/client/engine/boot/prefetchQuota.ts +84 -0
- package/src/client/engine/boot/readContentResponse.ts +17 -0
- package/src/client/engine/boot/retry.ts +14 -0
- package/src/client/engine/boot/runtime.ts +21 -0
- package/src/client/engine/boot/shardPrefetch.ts +278 -0
- package/src/client/engine/boot/shell.ts +135 -0
- package/src/client/engine/boot/stuck.ts +106 -0
- package/src/client/engine/boot/stuckStep.ts +99 -0
- package/src/client/engine/boot/sw.ts +385 -0
- package/src/client/engine/boot/swGlobal.d.ts +9 -0
- package/src/client/engine/boot/texturePack.ts +182 -0
- package/src/client/engine/boot/timeLeft.ts +106 -0
- package/src/client/engine/boot/titleArrival.ts +101 -0
- package/src/client/engine/boot/weights.ts +21 -0
- package/src/client/engine/boot.ts +51 -0
- package/src/client/engine/build.d.ts +2 -0
- package/src/client/engine/calibrate/entry.ts +29 -0
- package/src/client/engine/calibrate/js.ts +39 -0
- package/src/client/engine/calibrate/math.ts +23 -0
- package/src/client/engine/calibrate/run.ts +93 -0
- package/src/client/engine/calibrate/wasm.ts +154 -0
- package/src/client/engine/combat/EquipmentService.ts +412 -0
- package/src/client/engine/combat/cues.ts +46 -0
- package/src/client/engine/combat/types.ts +21 -0
- package/src/client/engine/combat/view/Bow.ts +462 -0
- package/src/client/engine/combat/view/DropArc.ts +64 -0
- package/src/client/engine/combat/view/EquipmentHost.ts +15 -0
- package/src/client/engine/combat/view/SweptMelee.ts +691 -0
- package/src/client/engine/combat/view/bowProfile.ts +182 -0
- package/src/client/engine/combat/view/brass.ts +65 -0
- package/src/client/engine/combat/view/firearmFx.ts +25 -0
- package/src/client/engine/combat/view/hitscan.ts +29 -0
- package/src/client/engine/combat/view/melee.ts +67 -0
- package/src/client/engine/combat/view/projectedTrail.ts +42 -0
- package/src/client/engine/combat/view/projectile.ts +315 -0
- package/src/client/engine/combat/view/ranged.ts +460 -0
- package/src/client/engine/combat/view/rangedFeel.ts +39 -0
- package/src/client/engine/combat/view/slashTrail.ts +151 -0
- package/src/client/engine/core/Game.ts +1833 -0
- package/src/client/engine/core/GpuRecovery.ts +200 -0
- package/src/client/engine/core/Grade.ts +109 -0
- package/src/client/engine/core/KeepAlive.ts +32 -0
- package/src/client/engine/core/Tour.ts +46 -0
- package/src/client/engine/core/Volumetrics.ts +260 -0
- package/src/client/engine/core/apiOrigin.ts +12 -0
- package/src/client/engine/core/assets.ts +292 -0
- package/src/client/engine/core/bootstrap.ts +175 -0
- package/src/client/engine/core/crashFlag.ts +32 -0
- package/src/client/engine/core/crossroads.ts +4 -0
- package/src/client/engine/core/deflate.ts +110 -0
- package/src/client/engine/core/devMode.ts +49 -0
- package/src/client/engine/core/devPixels.ts +62 -0
- package/src/client/engine/core/drawBudget.ts +48 -0
- package/src/client/engine/core/errorReport.ts +248 -0
- package/src/client/engine/core/gpuOnly.ts +139 -0
- package/src/client/engine/core/graphicsMode.ts +62 -0
- package/src/client/engine/core/graphicsQuality.ts +117 -0
- package/src/client/engine/core/heldTiming.ts +24 -0
- package/src/client/engine/core/ktx2.ts +511 -0
- package/src/client/engine/core/ktx2Sources.ts +22 -0
- package/src/client/engine/core/ktx2Zstd.ts +151 -0
- package/src/client/engine/core/ktx2Zstd.worker.ts +31 -0
- package/src/client/engine/core/practiceRoom.ts +16 -0
- package/src/client/engine/core/reloadGuard.ts +21 -0
- package/src/client/engine/core/scopedCpu.ts +49 -0
- package/src/client/engine/core/scopedWorkerPool.ts +55 -0
- package/src/client/engine/core/shadowLayer.ts +8 -0
- package/src/client/engine/core/slowGpuPacing.ts +118 -0
- package/src/client/engine/core/sustainedFrames.ts +73 -0
- package/src/client/engine/core/tier.ts +126 -0
- package/src/client/engine/core/viewport.ts +130 -0
- package/src/client/engine/core/webglStartup.ts +50 -0
- package/src/client/engine/core/worldDepth.ts +183 -0
- package/src/client/engine/core/zstdFrame.ts +38 -0
- package/src/client/engine/debug/probe.ts +560 -0
- package/src/client/engine/debug/timerBaseline.ts +14 -0
- package/src/client/engine/entities/AnimalFactory.ts +766 -0
- package/src/client/engine/entities/AnimalHerdView.ts +413 -0
- package/src/client/engine/entities/AnimalView.ts +583 -0
- package/src/client/engine/entities/RowBodies.ts +276 -0
- package/src/client/engine/entities/animalMatrices.ts +179 -0
- package/src/client/engine/entities/animalShadow.ts +58 -0
- package/src/client/engine/entities/animalShells.ts +14 -0
- package/src/client/engine/entities/farHerd.ts +469 -0
- package/src/client/engine/entities/lowpoly.ts +155 -0
- package/src/client/engine/entities/species/loft.ts +253 -0
- package/src/client/engine/entities/species/look.ts +122 -0
- package/src/client/engine/events/maps.ts +58 -0
- package/src/client/engine/explore/Compare.ts +126 -0
- package/src/client/engine/explore/Explore.ts +648 -0
- package/src/client/engine/explore/FreeCam.ts +280 -0
- package/src/client/engine/explore/MiniMap.ts +283 -0
- package/src/client/engine/explore/ModelExplorer.ts +1155 -0
- package/src/client/engine/explore/Select.ts +176 -0
- package/src/client/engine/explore/SetExplorer.ts +553 -0
- package/src/client/engine/explore/TouchFly.ts +236 -0
- package/src/client/engine/explore/catalog.ts +159 -0
- package/src/client/engine/explore/diorama.ts +245 -0
- package/src/client/engine/explore/fatLines.ts +47 -0
- package/src/client/engine/explore/img/mockups/nalati-camp-live.jpg +0 -0
- package/src/client/engine/explore/img/mockups/nalati-camp-target.jpg +0 -0
- package/src/client/engine/explore/img/mockups/nalati-gully-live.jpg +0 -0
- package/src/client/engine/explore/img/mockups/nalati-gully-target.jpg +0 -0
- package/src/client/engine/explore/img/mockups/nalati-rail-live.jpg +0 -0
- package/src/client/engine/explore/img/mockups/nalati-rail-target.jpg +0 -0
- package/src/client/engine/explore/img/mockups/nine-gate-live.jpg +0 -0
- package/src/client/engine/explore/img/mockups/nine-gate-target.jpg +0 -0
- package/src/client/engine/explore/img/mockups/nine-stair-live.jpg +0 -0
- package/src/client/engine/explore/img/mockups/nine-stair-target.jpg +0 -0
- package/src/client/engine/explore/pick.ts +120 -0
- package/src/client/engine/explore/registry.ts +16 -0
- package/src/client/engine/explore/setView.ts +222 -0
- package/src/client/engine/explore/tiers.ts +27 -0
- package/src/client/engine/explore/viewPoint.ts +100 -0
- package/src/client/engine/fx/Impacts.ts +154 -0
- package/src/client/engine/fx/LightPool.ts +188 -0
- package/src/client/engine/fx/ParticlePool.ts +76 -0
- package/src/client/engine/fx/SiteLights.ts +119 -0
- package/src/client/engine/fx/effectField.ts +91 -0
- package/src/client/engine/fx/groundFx.ts +144 -0
- package/src/client/engine/fx/groundTell.ts +101 -0
- package/src/client/engine/fx/lightEmitters.ts +35 -0
- package/src/client/engine/input/ControlsPanel.ts +108 -0
- package/src/client/engine/input/InputService.ts +394 -0
- package/src/client/engine/input/bindingTable.ts +124 -0
- package/src/client/engine/input/bindings.ts +101 -0
- package/src/client/engine/input/dom.ts +62 -0
- package/src/client/engine/input/equipmentInput.ts +4 -0
- package/src/client/engine/input/gameplay.ts +36 -0
- package/src/client/engine/input/keycap.ts +25 -0
- package/src/client/engine/input/menuInput.ts +7 -0
- package/src/client/engine/input/platform.ts +36 -0
- package/src/client/engine/input/weaponActions.ts +8 -0
- package/src/client/engine/level/frame.ts +95 -0
- package/src/client/engine/level/installation.ts +107 -0
- package/src/client/engine/level/load.ts +97 -0
- package/src/client/engine/level/registrations.ts +59 -0
- package/src/client/engine/math/color.ts +6 -0
- package/src/client/engine/models/animalGeometry.ts +29 -0
- package/src/client/engine/models/castawayBody.ts +257 -0
- package/src/client/engine/models/colliders.ts +186 -0
- package/src/client/engine/models/creature.ts +66 -0
- package/src/client/engine/models/cull.ts +953 -0
- package/src/client/engine/models/gear.ts +87 -0
- package/src/client/engine/models/geometryPack.ts +14 -0
- package/src/client/engine/models/hoverboard.ts +29 -0
- package/src/client/engine/models/instancedBatch.ts +324 -0
- package/src/client/engine/models/interact.ts +26 -0
- package/src/client/engine/models/live.ts +174 -0
- package/src/client/engine/models/model.ts +449 -0
- package/src/client/engine/models/modelPose.ts +14 -0
- package/src/client/engine/models/nativeGeometry.ts +114 -0
- package/src/client/engine/models/ownedGeometry.ts +294 -0
- package/src/client/engine/models/place.ts +1476 -0
- package/src/client/engine/models/roster.ts +44 -0
- package/src/client/engine/models/sets.ts +74 -0
- package/src/client/engine/models/slots.ts +69 -0
- package/src/client/engine/models/staticSets.ts +119 -0
- package/src/client/engine/models/swimHands.ts +44 -0
- package/src/client/engine/models/trainingDummy.ts +46 -0
- package/src/client/engine/models/trainingDummyFigure.ts +16 -0
- package/src/client/engine/models/weld.ts +260 -0
- package/src/client/engine/net/attackPrediction.ts +38 -0
- package/src/client/engine/net/client.ts +314 -0
- package/src/client/engine/net/heldOnOthers.ts +167 -0
- package/src/client/engine/net/hurtOther.ts +12 -0
- package/src/client/engine/net/interpolator.ts +179 -0
- package/src/client/engine/net/nameTag.ts +88 -0
- package/src/client/engine/net/netClock.ts +90 -0
- package/src/client/engine/net/netPlayer.ts +265 -0
- package/src/client/engine/net/netRecord.ts +43 -0
- package/src/client/engine/net/onRep.ts +75 -0
- package/src/client/engine/net/otherPlayers.ts +239 -0
- package/src/client/engine/net/othersOnMap.ts +80 -0
- package/src/client/engine/net/predictionWorld.ts +100 -0
- package/src/client/engine/net/predictor.ts +233 -0
- package/src/client/engine/net/redial.ts +179 -0
- package/src/client/engine/net/remoteAir.ts +134 -0
- package/src/client/engine/net/remoteBoard.ts +128 -0
- package/src/client/engine/net/remoteDeath.ts +140 -0
- package/src/client/engine/net/remoteGait.ts +114 -0
- package/src/client/engine/net/remoteHurt.ts +123 -0
- package/src/client/engine/net/remoteStrike.ts +160 -0
- package/src/client/engine/net/voiceNear.ts +55 -0
- package/src/client/engine/net/webSocketTransport.ts +91 -0
- package/src/client/engine/physics/active.ts +15 -0
- package/src/client/engine/physics/boxFrame.ts +15 -0
- package/src/client/engine/physics/calibration.ts +31 -0
- package/src/client/engine/physics/debug.ts +68 -0
- package/src/client/engine/physics/navmeshLoad.ts +86 -0
- package/src/client/engine/physics/ragdoll.ts +513 -0
- package/src/client/engine/physics/ropeDeck.ts +112 -0
- package/src/client/engine/player/AimAssist.ts +183 -0
- package/src/client/engine/player/AimTargets.ts +55 -0
- package/src/client/engine/player/CameraFX.ts +89 -0
- package/src/client/engine/player/Hands.ts +216 -0
- package/src/client/engine/player/LockOnTarget.ts +395 -0
- package/src/client/engine/player/Player.ts +678 -0
- package/src/client/engine/player/Skins.ts +109 -0
- package/src/client/engine/player/TouchControls.ts +564 -0
- package/src/client/engine/player/WaterLine.ts +94 -0
- package/src/client/engine/player/WeaponPickup.ts +465 -0
- package/src/client/engine/player/bladeGlow.ts +120 -0
- package/src/client/engine/player/firstPersonArms.ts +384 -0
- package/src/client/engine/player/heldHandParts.ts +91 -0
- package/src/client/engine/player/viewmodelSources.ts +25 -0
- package/src/client/engine/player/viewmodelTextures.ts +261 -0
- package/src/client/engine/player/viewmodelTextures.worker.ts +28 -0
- package/src/client/engine/practice/DummyClips.ts +100 -0
- package/src/client/engine/practice/DummyMotion.ts +287 -0
- package/src/client/engine/practice/DummyStudio.ts +137 -0
- package/src/client/engine/practice/TrainingArena.ts +463 -0
- package/src/client/engine/practice/TrainingDummy.ts +160 -0
- package/src/client/engine/practice/TrainingDummyAssets.ts +80 -0
- package/src/client/engine/practice/arena.css +20 -0
- package/src/client/engine/practice/dummyMetadata.ts +12 -0
- package/src/client/engine/practice/lineup.ts +17 -0
- package/src/client/engine/practice/playground/Playground.ts +52 -0
- package/src/client/engine/practice/playground/catalog.ts +44 -0
- package/src/client/engine/practice/playground/devGrid.ts +173 -0
- package/src/client/engine/practice/playground/hud.ts +80 -0
- package/src/client/engine/practice/playground/load.ts +24 -0
- package/src/client/engine/practice/practiceLoan.ts +52 -0
- package/src/client/engine/practice/targets.ts +15 -0
- package/src/client/engine/pwa/cacheNames.ts +2 -0
- package/src/client/engine/pwa/sw.js +401 -0
- package/src/client/engine/quest/view/replica.ts +88 -0
- package/src/client/engine/quest/view/ui.ts +221 -0
- package/src/client/engine/quest/view.ts +209 -0
- package/src/client/engine/render/allocationBytes.ts +16 -0
- package/src/client/engine/render/allocationJournal.ts +125 -0
- package/src/client/engine/render/aoTransparency.ts +225 -0
- package/src/client/engine/render/budgetReport.ts +53 -0
- package/src/client/engine/render/budgets.ts +72 -0
- package/src/client/engine/render/calibration.ts +32 -0
- package/src/client/engine/render/calibrationGpu.ts +84 -0
- package/src/client/engine/render/changedTextureUploads.ts +118 -0
- package/src/client/engine/render/compileLights.ts +75 -0
- package/src/client/engine/render/compileShadows.ts +29 -0
- package/src/client/engine/render/composerDepth.ts +26 -0
- package/src/client/engine/render/compressedMipmaps.ts +59 -0
- package/src/client/engine/render/compressedTextureRetirement.ts +71 -0
- package/src/client/engine/render/compressedUpload.ts +107 -0
- package/src/client/engine/render/contextErrors.ts +14 -0
- package/src/client/engine/render/dataLook.ts +691 -0
- package/src/client/engine/render/desktopReference.ts +5 -0
- package/src/client/engine/render/diagnosticJournal.ts +23 -0
- package/src/client/engine/render/displayColour.ts +55 -0
- package/src/client/engine/render/doubleElements.ts +33 -0
- package/src/client/engine/render/drawGuards.ts +47 -0
- package/src/client/engine/render/drawHooks.ts +265 -0
- package/src/client/engine/render/drawNeutral.ts +19 -0
- package/src/client/engine/render/drawnEnvironment.ts +35 -0
- package/src/client/engine/render/entryWarmupBound.ts +19 -0
- package/src/client/engine/render/families/emissive.ts +224 -0
- package/src/client/engine/render/families/ground.ts +291 -0
- package/src/client/engine/render/families/measure.ts +191 -0
- package/src/client/engine/render/families/paintedTerrain.ts +388 -0
- package/src/client/engine/render/families/painterly.ts +288 -0
- package/src/client/engine/render/families/pbr.ts +67 -0
- package/src/client/engine/render/families/registry.ts +140 -0
- package/src/client/engine/render/families/toon.ts +193 -0
- package/src/client/engine/render/fencedUnits.ts +115 -0
- package/src/client/engine/render/firstFrameParts.ts +95 -0
- package/src/client/engine/render/fogPatches.ts +56 -0
- package/src/client/engine/render/frameCounter.ts +47 -0
- package/src/client/engine/render/frameDrawRange.ts +120 -0
- package/src/client/engine/render/gltfMaterialOrder.ts +83 -0
- package/src/client/engine/render/gpuClasses.ts +29 -0
- package/src/client/engine/render/gpuLabels.ts +437 -0
- package/src/client/engine/render/graph/colourFunction.ts +83 -0
- package/src/client/engine/render/graph/glsl.ts +1056 -0
- package/src/client/engine/render/graph/glslCodec.ts +48 -0
- package/src/client/engine/render/graph/glslMaterial.ts +463 -0
- package/src/client/engine/render/graph/glslPost.ts +79 -0
- package/src/client/engine/render/graph/glslProgram.ts +698 -0
- package/src/client/engine/render/graph/presets.ts +812 -0
- package/src/client/engine/render/graph/viewRay.ts +28 -0
- package/src/client/engine/render/graphBackend.ts +176 -0
- package/src/client/engine/render/hoverboardGeometry.ts +54 -0
- package/src/client/engine/render/instancedGeometry.ts +28 -0
- package/src/client/engine/render/instancedTwin.ts +40 -0
- package/src/client/engine/render/ktx2Probe.ts +299 -0
- package/src/client/engine/render/layeredMaps.ts +64 -0
- package/src/client/engine/render/lightUniforms.ts +22 -0
- package/src/client/engine/render/lighterTargets.ts +47 -0
- package/src/client/engine/render/lightmaps.ts +36 -0
- package/src/client/engine/render/look.ts +406 -0
- package/src/client/engine/render/lookLight.ts +107 -0
- package/src/client/engine/render/lut.ts +23 -0
- package/src/client/engine/render/memoryImages.ts +31 -0
- package/src/client/engine/render/memorySaver.ts +262 -0
- package/src/client/engine/render/offscreenBuild.ts +184 -0
- package/src/client/engine/render/offscreenPreparation.ts +41 -0
- package/src/client/engine/render/parkedDraws.ts +920 -0
- package/src/client/engine/render/pmremSize.ts +21 -0
- package/src/client/engine/render/postPreparation.ts +67 -0
- package/src/client/engine/render/precompile.ts +1833 -0
- package/src/client/engine/render/programRetention.ts +125 -0
- package/src/client/engine/render/readbackPreparation.ts +23 -0
- package/src/client/engine/render/regionCinematic.ts +212 -0
- package/src/client/engine/render/regionLook.ts +301 -0
- package/src/client/engine/render/releasedArrays.ts +13 -0
- package/src/client/engine/render/renderer.ts +68 -0
- package/src/client/engine/render/scatterInstances.ts +139 -0
- package/src/client/engine/render/scenePreparation.ts +27 -0
- package/src/client/engine/render/shaderPatches.ts +303 -0
- package/src/client/engine/render/shaderText.ts +95 -0
- package/src/client/engine/render/shadowDepthVariants.ts +35 -0
- package/src/client/engine/render/shadowMaterialOwnership.ts +120 -0
- package/src/client/engine/render/skinnedSpheres.ts +30 -0
- package/src/client/engine/render/skyEnvironment.ts +222 -0
- package/src/client/engine/render/staticMatrices.ts +88 -0
- package/src/client/engine/render/streamedInstances.ts +184 -0
- package/src/client/engine/render/textureBytes.ts +185 -0
- package/src/client/engine/render/textureUploadEvents.ts +60 -0
- package/src/client/engine/render/tierBenchmark.ts +54 -0
- package/src/client/engine/render/tierBoot.ts +50 -0
- package/src/client/engine/render/tierSelect.ts +27 -0
- package/src/client/engine/render/tiers.ts +78 -0
- package/src/client/engine/render/uniformCaches.ts +143 -0
- package/src/client/engine/render/uploadOwnership.ts +335 -0
- package/src/client/engine/render/viewmodel.ts +114 -0
- package/src/client/engine/render/viewmodelFeel.ts +374 -0
- package/src/client/engine/saves/indexed.ts +250 -0
- package/src/client/engine/saves/slots.ts +42 -0
- package/src/client/engine/saves/view/storage.ts +11 -0
- package/src/client/engine/script/client.ts +240 -0
- package/src/client/engine/telemetry/bootInbox.ts +18 -0
- package/src/client/engine/telemetry/browserErrors.ts +173 -0
- package/src/client/engine/telemetry/crossroads.ts +26 -0
- package/src/client/engine/telemetry/health.ts +40 -0
- package/src/client/engine/telemetry/model.ts +36 -0
- package/src/client/engine/telemetry/runtime.ts +62 -0
- package/src/client/engine/types/meshopt-simplifier.d.ts +10 -0
- package/src/client/engine/types/n8ao.d.ts +52 -0
- package/src/client/engine/ui/BootSettings.ts +97 -0
- package/src/client/engine/ui/BossBar.ts +141 -0
- package/src/client/engine/ui/Combat.ts +299 -0
- package/src/client/engine/ui/DeathFade.ts +104 -0
- package/src/client/engine/ui/DebugMenu.ts +199 -0
- package/src/client/engine/ui/EliteBar.ts +219 -0
- package/src/client/engine/ui/ErrorModal.ts +309 -0
- package/src/client/engine/ui/Feedback.ts +346 -0
- package/src/client/engine/ui/FirstHints.ts +279 -0
- package/src/client/engine/ui/HUD.ts +714 -0
- package/src/client/engine/ui/HurtArc.ts +102 -0
- package/src/client/engine/ui/ItemCard.ts +95 -0
- package/src/client/engine/ui/KeyHelp.ts +59 -0
- package/src/client/engine/ui/Loading.ts +851 -0
- package/src/client/engine/ui/LockOn.ts +131 -0
- package/src/client/engine/ui/Map.ts +280 -0
- package/src/client/engine/ui/Menu.ts +438 -0
- package/src/client/engine/ui/Minimap.ts +840 -0
- package/src/client/engine/ui/Perf.ts +356 -0
- package/src/client/engine/ui/ReloadPrompt.ts +42 -0
- package/src/client/engine/ui/RotateGate.ts +40 -0
- package/src/client/engine/ui/SavePanel.ts +62 -0
- package/src/client/engine/ui/Settings.ts +277 -0
- package/src/client/engine/ui/SpeedLines.ts +46 -0
- package/src/client/engine/ui/StartTitle.ts +39 -0
- package/src/client/engine/ui/ToastStack.ts +90 -0
- package/src/client/engine/ui/Update.ts +116 -0
- package/src/client/engine/ui/WeaponStrip.ts +272 -0
- package/src/client/engine/ui/WindupWarn.ts +116 -0
- package/src/client/engine/ui/authoredDebugRows.ts +3 -0
- package/src/client/engine/ui/buildCheck.ts +72 -0
- package/src/client/engine/ui/buildRow.ts +71 -0
- package/src/client/engine/ui/cards.ts +41 -0
- package/src/client/engine/ui/debugOptions.ts +230 -0
- package/src/client/engine/ui/declared.ts +89 -0
- package/src/client/engine/ui/devSwitch.ts +48 -0
- package/src/client/engine/ui/developerBanner.ts +32 -0
- package/src/client/engine/ui/diagnosticsCopy.ts +20 -0
- package/src/client/engine/ui/drawBudgetCounter.ts +10 -0
- package/src/client/engine/ui/errorScreen.ts +109 -0
- package/src/client/engine/ui/frameWindow.ts +50 -0
- package/src/client/engine/ui/graphicsBlock.ts +156 -0
- package/src/client/engine/ui/graphicsControls.ts +47 -0
- package/src/client/engine/ui/haptics.ts +28 -0
- package/src/client/engine/ui/hoverBoost.ts +61 -0
- package/src/client/engine/ui/hudAdapters.ts +61 -0
- package/src/client/engine/ui/hudSlots.ts +130 -0
- package/src/client/engine/ui/icons.ts +62 -0
- package/src/client/engine/ui/layers.ts +134 -0
- package/src/client/engine/ui/leaveGuard.ts +64 -0
- package/src/client/engine/ui/loadProgress.ts +67 -0
- package/src/client/engine/ui/loading.css +125 -0
- package/src/client/engine/ui/lookLightOption.ts +22 -0
- package/src/client/engine/ui/mapLabel.ts +18 -0
- package/src/client/engine/ui/mapPainter.ts +395 -0
- package/src/client/engine/ui/menuSettings.ts +188 -0
- package/src/client/engine/ui/namePrompt.ts +138 -0
- package/src/client/engine/ui/offlineDownload.ts +83 -0
- package/src/client/engine/ui/ownership.ts +14 -0
- package/src/client/engine/ui/panel.ts +166 -0
- package/src/client/engine/ui/perf.css +93 -0
- package/src/client/engine/ui/perfDock.ts +61 -0
- package/src/client/engine/ui/perfHud.ts +332 -0
- package/src/client/engine/ui/perfLap.ts +206 -0
- package/src/client/engine/ui/perfLapSummary.ts +92 -0
- package/src/client/engine/ui/perfProbe.ts +280 -0
- package/src/client/engine/ui/pinKeepOut.ts +59 -0
- package/src/client/engine/ui/playerDeath.ts +16 -0
- package/src/client/engine/ui/playerHurt.ts +70 -0
- package/src/client/engine/ui/playerReload.ts +55 -0
- package/src/client/engine/ui/reloadChip.ts +24 -0
- package/src/client/engine/ui/reloadCover.ts +110 -0
- package/src/client/engine/ui/review.ts +158 -0
- package/src/client/engine/ui/roomMap.ts +109 -0
- package/src/client/engine/ui/saveStrings.ts +9 -0
- package/src/client/engine/ui/settingsTabs.ts +249 -0
- package/src/client/engine/ui/styles/base.css +92 -0
- package/src/client/engine/ui/styles/boss.css +97 -0
- package/src/client/engine/ui/styles/combat.css +100 -0
- package/src/client/engine/ui/styles/debug.css +22 -0
- package/src/client/engine/ui/styles/elite.css +87 -0
- package/src/client/engine/ui/styles/explore.css +435 -0
- package/src/client/engine/ui/styles/feedback.css +63 -0
- package/src/client/engine/ui/styles/game.css +290 -0
- package/src/client/engine/ui/styles/gmenu.css +407 -0
- package/src/client/engine/ui/styles/hints.css +26 -0
- package/src/client/engine/ui/styles/itemcard.css +38 -0
- package/src/client/engine/ui/styles/menu.css +129 -0
- package/src/client/engine/ui/styles/minimap.css +87 -0
- package/src/client/engine/ui/styles/namePrompt.css +27 -0
- package/src/client/engine/ui/styles/playgrounds.css +18 -0
- package/src/client/engine/ui/styles/quest.css +65 -0
- package/src/client/engine/ui/styles/rotate.css +55 -0
- package/src/client/engine/ui/styles/touch.css +303 -0
- package/src/client/engine/ui/styles/update.css +27 -0
- package/src/client/engine/ui/tabs.ts +27 -0
- package/src/client/engine/ui/unstuck.ts +38 -0
- package/src/client/engine/ui/voiceSettings.ts +135 -0
- package/src/client/engine/world/Atmosphere.ts +333 -0
- package/src/client/engine/world/BakedSky.ts +155 -0
- package/src/client/engine/world/Boundary.ts +234 -0
- package/src/client/engine/world/Grass.ts +664 -0
- package/src/client/engine/world/Horizon.ts +237 -0
- package/src/client/engine/world/HorizonMatte.ts +399 -0
- package/src/client/engine/world/Terrain.ts +560 -0
- package/src/client/engine/world/TreeFactory.ts +128 -0
- package/src/client/engine/world/backdropLayer.ts +580 -0
- package/src/client/engine/world/blenderArea.ts +23 -0
- package/src/client/engine/world/bounds.ts +57 -0
- package/src/client/engine/world/cascadeCull.ts +251 -0
- package/src/client/engine/world/cascadeLights.ts +29 -0
- package/src/client/engine/world/cloudField.ts +29 -0
- package/src/client/engine/world/coarseTileMask.ts +100 -0
- package/src/client/engine/world/csmLightBlock.ts +23 -0
- package/src/client/engine/world/declaredProps.ts +226 -0
- package/src/client/engine/world/forest/Forest.ts +378 -0
- package/src/client/engine/world/forest/treeSet.ts +140 -0
- package/src/client/engine/world/forest/treeSpecies.ts +17 -0
- package/src/client/engine/world/frameCamera.ts +58 -0
- package/src/client/engine/world/geometryBake.ts +272 -0
- package/src/client/engine/world/geometryBounds.ts +77 -0
- package/src/client/engine/world/geometryKit.ts +163 -0
- package/src/client/engine/world/hiddenFaces.ts +153 -0
- package/src/client/engine/world/interact/Interactables.ts +690 -0
- package/src/client/engine/world/interact/kit.ts +6 -0
- package/src/client/engine/world/lookFlags.ts +15 -0
- package/src/client/engine/world/lowpolyKit.ts +270 -0
- package/src/client/engine/world/lut.ts +45 -0
- package/src/client/engine/world/painterly.ts +109 -0
- package/src/client/engine/world/pointLightSkip.ts +31 -0
- package/src/client/engine/world/pond.ts +184 -0
- package/src/client/engine/world/pondGrid.ts +5 -0
- package/src/client/engine/world/registry.ts +348 -0
- package/src/client/engine/world/shadowCadence.ts +14 -0
- package/src/client/engine/world/shadowChunks.ts +193 -0
- package/src/client/engine/world/shadowFade.ts +190 -0
- package/src/client/engine/world/shadowFilter.ts +117 -0
- package/src/client/engine/world/shadowVariants.ts +115 -0
- package/src/client/engine/world/skyBackdrop.ts +526 -0
- package/src/client/engine/world/skyRig.ts +577 -0
- package/src/client/engine/world/skyTextures.ts +103 -0
- package/src/client/engine/world/terrainTileView.ts +164 -0
- package/src/client/engine/world/tileStreamer.ts +823 -0
- package/src/client/engine/world/voxelAO.ts +338 -0
- package/src/client/engine/world/water/ripplePixels.ts +51 -0
- package/src/client/engine/world/water/ripples.ts +102 -0
- package/src/client/engine/world/weakShaderMap.ts +58 -0
- package/src/client/engine/world/wind.ts +112 -0
- package/src/client/game/Boss.ts +354 -0
- package/src/client/game/Elite.ts +529 -0
- package/src/client/game/Inventory.ts +123 -0
- package/src/client/game/Progress.ts +166 -0
- package/src/client/game/ambient/ambientFlock.ts +71 -0
- package/src/client/game/ambient/crowdDraw.ts +85 -0
- package/src/client/game/ambient/foragerDraw.ts +56 -0
- package/src/client/game/ambient/pageCrowds.ts +81 -0
- package/src/client/game/ambient/wingField.ts +46 -0
- package/src/client/game/animation/limbCollision.ts +46 -0
- package/src/client/game/animation/limbQueryPose.ts +141 -0
- package/src/client/game/animation/limbQueryView.ts +53 -0
- package/src/client/game/animation/limbView.ts +28 -0
- package/src/client/game/audio/cueDirector.ts +157 -0
- package/src/client/game/audio/forestPage.ts +30 -0
- package/src/client/game/audio/sceneDirector.ts +239 -0
- package/src/client/game/audio/sceneEvents.merge.d.ts +9 -0
- package/src/client/game/audio/theme.ts +229 -0
- package/src/client/game/audio/voicePatches.ts +108 -0
- package/src/client/game/bag/BagButton.ts +85 -0
- package/src/client/game/bag/bag.ts +239 -0
- package/src/client/game/bag/equipment.ts +18 -0
- package/src/client/game/bag/tabs.ts +194 -0
- package/src/client/game/boot/audio.generated.ts +9258 -0
- package/src/client/game/boot/bytes.generated.ts +1643 -0
- package/src/client/game/boot/loadingPaths.ts +121 -0
- package/src/client/game/boot/packs.generated.ts +5 -0
- package/src/client/game/boot/spawnDownload.ts +999 -0
- package/src/client/game/boot/versions.generated.ts +868 -0
- package/src/client/game/boss/arenaFire.ts +135 -0
- package/src/client/game/boss/arenaRoom.ts +715 -0
- package/src/client/game/boss/arenaRoomView.ts +530 -0
- package/src/client/game/boss/barFeed.ts +253 -0
- package/src/client/game/boss/encounterView.ts +463 -0
- package/src/client/game/boss/presentation.ts +18 -0
- package/src/client/game/boss/roamingProjection.ts +255 -0
- package/src/client/game/boss/slotRowsView.ts +95 -0
- package/src/client/game/boss/socketRig.ts +129 -0
- package/src/client/game/boss/timedEncounters.ts +83 -0
- package/src/client/game/combat/roamingSession.ts +107 -0
- package/src/client/game/compendium/Journal.ts +85 -0
- package/src/client/game/compendium/compendium.css +135 -0
- package/src/client/game/compendium/install.ts +181 -0
- package/src/client/game/compendium/journalView.ts +224 -0
- package/src/client/game/compendium/keepsakes.ts +169 -0
- package/src/client/game/compendium/keepsakesView.ts +70 -0
- package/src/client/game/complete/ShardComplete.ts +148 -0
- package/src/client/game/complete/complete.css +71 -0
- package/src/client/game/complete/declared.ts +111 -0
- package/src/client/game/cosmetics/bodyShadow.ts +148 -0
- package/src/client/game/cosmetics/cosmetics.ts +119 -0
- package/src/client/game/cosmetics/locker.ts +88 -0
- package/src/client/game/data/pickupCatalogue.json +1008 -0
- package/src/client/game/debug/browser.d.ts +10 -0
- package/src/client/game/draftTitles.ts +26 -0
- package/src/client/game/eliteView.ts +246 -0
- package/src/client/game/engineStrings.ts +12 -0
- package/src/client/game/equipmentTypes.merge.d.ts +10 -0
- package/src/client/game/firstPlay.css +18 -0
- package/src/client/game/firstPlay.ts +94 -0
- package/src/client/game/generators/pickups.ts +92 -0
- package/src/client/game/grapple/fontPreparation.ts +31 -0
- package/src/client/game/grapple/netClaw.ts +61 -0
- package/src/client/game/grapple/ribbon.ts +159 -0
- package/src/client/game/grapple/tool.ts +478 -0
- package/src/client/game/grid/admissionPriority.ts +41 -0
- package/src/client/game/grid/admissionYield.ts +37 -0
- package/src/client/game/grid/approachProductInputs.ts +72 -0
- package/src/client/game/grid/assetResidency.ts +188 -0
- package/src/client/game/grid/borderShimmer.ts +185 -0
- package/src/client/game/grid/budgetOverlay.css +40 -0
- package/src/client/game/grid/budgetOverlay.ts +238 -0
- package/src/client/game/grid/budgetPoints.ts +184 -0
- package/src/client/game/grid/cellChanges.ts +106 -0
- package/src/client/game/grid/cellClip.ts +611 -0
- package/src/client/game/grid/cellCover.ts +58 -0
- package/src/client/game/grid/cellLoading.ts +89 -0
- package/src/client/game/grid/cellPresence.ts +28 -0
- package/src/client/game/grid/cellScreens.ts +83 -0
- package/src/client/game/grid/copyIdentity.ts +98 -0
- package/src/client/game/grid/copyLayout.ts +153 -0
- package/src/client/game/grid/copyPrompts.ts +31 -0
- package/src/client/game/grid/edgeSources.ts +120 -0
- package/src/client/game/grid/enteredEquipment.ts +65 -0
- package/src/client/game/grid/enteredInteract.ts +43 -0
- package/src/client/game/grid/entryDownloads.ts +45 -0
- package/src/client/game/grid/entryReadPrefetch.ts +64 -0
- package/src/client/game/grid/farImpostorDecodeWorker.ts +32 -0
- package/src/client/game/grid/farImpostorPack.ts +18 -0
- package/src/client/game/grid/farImpostorView.ts +130 -0
- package/src/client/game/grid/farView.ts +235 -0
- package/src/client/game/grid/frame.ts +845 -0
- package/src/client/game/grid/frameLook.ts +215 -0
- package/src/client/game/grid/frameModel.ts +126 -0
- package/src/client/game/grid/gridHud.css +47 -0
- package/src/client/game/grid/gridHud.ts +126 -0
- package/src/client/game/grid/hazeBand.ts +77 -0
- package/src/client/game/grid/homeCheckpoint.ts +11 -0
- package/src/client/game/grid/homeMetadata.ts +40 -0
- package/src/client/game/grid/intent.ts +65 -0
- package/src/client/game/grid/live.ts +787 -0
- package/src/client/game/grid/liveSession.ts +969 -0
- package/src/client/game/grid/loadingRings.ts +49 -0
- package/src/client/game/grid/mapAtlas.build.d.ts +4 -0
- package/src/client/game/grid/mapAtlas.ts +33 -0
- package/src/client/game/grid/mapFrame.ts +81 -0
- package/src/client/game/grid/memoryRows.ts +32 -0
- package/src/client/game/grid/memoryWarning.css +11 -0
- package/src/client/game/grid/memoryWarning.ts +81 -0
- package/src/client/game/grid/menu.ts +49 -0
- package/src/client/game/grid/minimapBlend.ts +185 -0
- package/src/client/game/grid/nearGrain.ts +40 -0
- package/src/client/game/grid/nearPlaceholderPlan.ts +60 -0
- package/src/client/game/grid/nearPlaceholderView.ts +182 -0
- package/src/client/game/grid/neighbourLife.ts +151 -0
- package/src/client/game/grid/neighbourPanels.ts +84 -0
- package/src/client/game/grid/neighbourRows.ts +32 -0
- package/src/client/game/grid/oneWayIn.ts +114 -0
- package/src/client/game/grid/pageEntry.ts +234 -0
- package/src/client/game/grid/pageResidency.ts +216 -0
- package/src/client/game/grid/pageShell.ts +67 -0
- package/src/client/game/grid/prefetch.ts +344 -0
- package/src/client/game/grid/prefetchIndex.ts +28 -0
- package/src/client/game/grid/prefetchIndexCore.ts +41 -0
- package/src/client/game/grid/prelinkViews.ts +31 -0
- package/src/client/game/grid/preparationAdmission.ts +34 -0
- package/src/client/game/grid/productInputs.ts +98 -0
- package/src/client/game/grid/productLeases.ts +76 -0
- package/src/client/game/grid/products.ts +350 -0
- package/src/client/game/grid/refusal.ts +73 -0
- package/src/client/game/grid/regionLight.ts +102 -0
- package/src/client/game/grid/regionShell.ts +58 -0
- package/src/client/game/grid/regionSky.ts +104 -0
- package/src/client/game/grid/regionalBuildCheckpoint.ts +19 -0
- package/src/client/game/grid/regionalInputs.ts +34 -0
- package/src/client/game/grid/regionalRuntime.ts +518 -0
- package/src/client/game/grid/regionalView.ts +205 -0
- package/src/client/game/grid/regionalWorld.ts +609 -0
- package/src/client/game/grid/renderResidency.ts +95 -0
- package/src/client/game/grid/reveal.ts +163 -0
- package/src/client/game/grid/roadCull.ts +473 -0
- package/src/client/game/grid/roadGrain.ts +32 -0
- package/src/client/game/grid/roadGrain.worker.ts +20 -0
- package/src/client/game/grid/roadGrainPreparation.ts +45 -0
- package/src/client/game/grid/roadLook.ts +487 -0
- package/src/client/game/grid/roadLookPlatform.ts +196 -0
- package/src/client/game/grid/roadResources.ts +15 -0
- package/src/client/game/grid/roadSign.worker.ts +30 -0
- package/src/client/game/grid/roadSignPaint.ts +38 -0
- package/src/client/game/grid/roadSignPixels.ts +22 -0
- package/src/client/game/grid/roadSignPreparation.ts +45 -0
- package/src/client/game/grid/roadSky.ts +219 -0
- package/src/client/game/grid/roadSolid.ts +227 -0
- package/src/client/game/grid/roadTileArchive.ts +239 -0
- package/src/client/game/grid/roadTileBacking.ts +327 -0
- package/src/client/game/grid/roadTileCapture.worker.ts +14 -0
- package/src/client/game/grid/roadTileCaptureJob.ts +37 -0
- package/src/client/game/grid/roadTileCaptureWorker.ts +104 -0
- package/src/client/game/grid/roadTileCoarse.ts +28 -0
- package/src/client/game/grid/roadTileGeometry.ts +77 -0
- package/src/client/game/grid/roadTilePool.ts +157 -0
- package/src/client/game/grid/roadTileStream.ts +69 -0
- package/src/client/game/grid/roadTileWrite.worker.ts +24 -0
- package/src/client/game/grid/roadTileWriter.ts +67 -0
- package/src/client/game/grid/runtimeCost.ts +44 -0
- package/src/client/game/grid/seamLook.ts +177 -0
- package/src/client/game/grid/session.ts +1235 -0
- package/src/client/game/grid/shardfileFar.ts +88 -0
- package/src/client/game/grid/skinEnvelope.ts +135 -0
- package/src/client/game/grid/softWallLook.ts +116 -0
- package/src/client/game/grid/tileDecodeWorker.ts +24 -0
- package/src/client/game/grid/tileDecoder.ts +102 -0
- package/src/client/game/grid/titleOrder.ts +8 -0
- package/src/client/game/grid/titlePrefetchChoice.ts +35 -0
- package/src/client/game/grid/viewAdmissions.ts +36 -0
- package/src/client/game/grid/voidLook.ts +181 -0
- package/src/client/game/icons.merge.d.ts +49 -0
- package/src/client/game/icons.ts +240 -0
- package/src/client/game/identity.ts +28 -0
- package/src/client/game/inputContexts.ts +33 -0
- package/src/client/game/keyBindings.ts +37 -0
- package/src/client/game/loadout/actors.ts +15 -0
- package/src/client/game/loadout/claims.ts +728 -0
- package/src/client/game/loadout/cosmeticFinishes.ts +217 -0
- package/src/client/game/loadout/effects.ts +97 -0
- package/src/client/game/loadout/finishes.ts +60 -0
- package/src/client/game/loadout/held.ts +207 -0
- package/src/client/game/loadout/rangedPage.ts +142 -0
- package/src/client/game/looks/coverAppearance.ts +101 -0
- package/src/client/game/looks/daySky.ts +110 -0
- package/src/client/game/looks/forestGround.ts +49 -0
- package/src/client/game/looks/forestGroundInputs.ts +27 -0
- package/src/client/game/looks/forestRoofMask.ts +15 -0
- package/src/client/game/looks/forestWeather.ts +26 -0
- package/src/client/game/looks/graphDaySky.ts +245 -0
- package/src/client/game/looks/grassPresentation.ts +334 -0
- package/src/client/game/looks/keyedSky.ts +500 -0
- package/src/client/game/looks/lettering.ts +14 -0
- package/src/client/game/looks/overcast.ts +61 -0
- package/src/client/game/looks/paintedGroundMerge.ts +12 -0
- package/src/client/game/looks/paintedLook.ts +197 -0
- package/src/client/game/looks/painterlyLook.ts +259 -0
- package/src/client/game/looks/posedBufferPool.ts +67 -0
- package/src/client/game/looks/posedInstances.ts +199 -0
- package/src/client/game/looks/postGraphLook.ts +455 -0
- package/src/client/game/looks/riggedHulls.ts +451 -0
- package/src/client/game/looks/scaledPost.ts +236 -0
- package/src/client/game/looks/speciesBook.ts +224 -0
- package/src/client/game/looks/staticCapture.ts +225 -0
- package/src/client/game/looks/streamedCover.ts +330 -0
- package/src/client/game/looks/toonLighting.ts +28 -0
- package/src/client/game/looks/toonLook.ts +69 -0
- package/src/client/game/looks/toonSky.ts +60 -0
- package/src/client/game/looks/vertexWear.ts +49 -0
- package/src/client/game/loot/CoinBurst.ts +19 -0
- package/src/client/game/loot/CoinMotion.ts +169 -0
- package/src/client/game/loot/coinModel.ts +11 -0
- package/src/client/game/loot/coins.ts +21 -0
- package/src/client/game/loot/feed.ts +23 -0
- package/src/client/game/loot/loot.css +19 -0
- package/src/client/game/loot/runtime.ts +243 -0
- package/src/client/game/loot/tables.ts +30 -0
- package/src/client/game/loot/ui/CoinChip.ts +70 -0
- package/src/client/game/loot/ui/ShopPanel.ts +211 -0
- package/src/client/game/loot/ui/shop.css +42 -0
- package/src/client/game/mainMenu.css +177 -0
- package/src/client/game/mainMenu.ts +268 -0
- package/src/client/game/models/binarySource.ts +78 -0
- package/src/client/game/models/collectionDisplay.ts +133 -0
- package/src/client/game/models/collectionWall.ts +236 -0
- package/src/client/game/models/explorerCatalogue.ts +176 -0
- package/src/client/game/models/figureCatalogue.ts +172 -0
- package/src/client/game/models/fixedDraws.ts +178 -0
- package/src/client/game/models/heldGear.ts +76 -0
- package/src/client/game/models/interact.ts +107 -0
- package/src/client/game/models/islandLibrary.ts +179 -0
- package/src/client/game/models/kitFigureCard.ts +77 -0
- package/src/client/game/models/libraryModel.ts +67 -0
- package/src/client/game/models/mountedSpecimen.ts +45 -0
- package/src/client/game/models/pickupRows.ts +12 -0
- package/src/client/game/models/ropeDeckSite.ts +114 -0
- package/src/client/game/models/scenePartSpecimen.ts +102 -0
- package/src/client/game/models/sceneSpecimens.ts +103 -0
- package/src/client/game/models/socketRigCreature.ts +65 -0
- package/src/client/game/models/specimenCatalogue.ts +540 -0
- package/src/client/game/models/treeSet.ts +149 -0
- package/src/client/game/models/worldSceneCatalogue.ts +310 -0
- package/src/client/game/nativeItems.merge.d.ts +6 -0
- package/src/client/game/pageSaveKeys.ts +13 -0
- package/src/client/game/plugin/audio.ts +277 -0
- package/src/client/game/plugin/bakedGeometry.ts +103 -0
- package/src/client/game/plugin/bladeMoves.ts +117 -0
- package/src/client/game/plugin/bossStorm.ts +40 -0
- package/src/client/game/plugin/clientChannelView.ts +135 -0
- package/src/client/game/plugin/context.ts +198 -0
- package/src/client/game/plugin/followedMovers.ts +184 -0
- package/src/client/game/plugin/geometry.ts +2083 -0
- package/src/client/game/plugin/headless.ts +127 -0
- package/src/client/game/plugin/heldEquipment.ts +208 -0
- package/src/client/game/plugin/heldFirearm.ts +395 -0
- package/src/client/game/plugin/heldRecipe.ts +43 -0
- package/src/client/game/plugin/heldTool.ts +166 -0
- package/src/client/game/plugin/moverEvents.merge.d.ts +6 -0
- package/src/client/game/plugin/moverViews.ts +114 -0
- package/src/client/game/plugin/placeholderGeometry.ts +40 -0
- package/src/client/game/plugin/scene.ts +290 -0
- package/src/client/game/plugin/shaderFamily.ts +225 -0
- package/src/client/game/plugin/ui.ts +1511 -0
- package/src/client/game/plugin/weaponFamily.ts +779 -0
- package/src/client/game/population/netCounts.ts +12 -0
- package/src/client/game/population/pageAir.ts +37 -0
- package/src/client/game/population/pageLife.ts +289 -0
- package/src/client/game/population/pageReturns.ts +17 -0
- package/src/client/game/population/productCreatures.ts +71 -0
- package/src/client/game/population/projection.ts +227 -0
- package/src/client/game/population/rowSpecies.ts +15 -0
- package/src/client/game/population/signals.ts +24 -0
- package/src/client/game/population/speciesViewSlots.ts +55 -0
- package/src/client/game/population/wildlifeFeature.ts +208 -0
- package/src/client/game/population.merge.d.ts +9 -0
- package/src/client/game/practice/course.ts +154 -0
- package/src/client/game/practice/numericCourse.ts +35 -0
- package/src/client/game/practice/registration.ts +17 -0
- package/src/client/game/practice/scene.ts +47 -0
- package/src/client/game/quest/carriedProp.ts +113 -0
- package/src/client/game/quest/chapter.ts +355 -0
- package/src/client/game/quest/chapterDirector.ts +255 -0
- package/src/client/game/quest/chapterView.ts +165 -0
- package/src/client/game/quest/continuation.ts +53 -0
- package/src/client/game/quest/contractBoardPage.ts +85 -0
- package/src/client/game/quest/declaredPage.ts +199 -0
- package/src/client/game/quest/elitePage.ts +115 -0
- package/src/client/game/quest/figureOrbit.ts +32 -0
- package/src/client/game/quest/figures.ts +259 -0
- package/src/client/game/quest/finishedAfterSeen.ts +20 -0
- package/src/client/game/quest/hints.ts +90 -0
- package/src/client/game/quest/pageComposition.ts +331 -0
- package/src/client/game/quest/pageDoors.ts +25 -0
- package/src/client/game/quest/pageFacets.ts +76 -0
- package/src/client/game/quest/pageReference.ts +17 -0
- package/src/client/game/quest/presentation.css +4 -0
- package/src/client/game/quest/questPageViews.ts +168 -0
- package/src/client/game/quest/reward.ts +48 -0
- package/src/client/game/quest/story.ts +161 -0
- package/src/client/game/quest/trader.ts +176 -0
- package/src/client/game/riding/client.ts +373 -0
- package/src/client/game/riding/hud.ts +255 -0
- package/src/client/game/riding/mount.ts +317 -0
- package/src/client/game/riding/reins.ts +177 -0
- package/src/client/game/riding/ride.css +70 -0
- package/src/client/game/riding/seatedFigure.ts +78 -0
- package/src/client/game/saves.css +34 -0
- package/src/client/game/savesSettings.ts +189 -0
- package/src/client/game/session/clockSettings.ts +66 -0
- package/src/client/game/session/context.ts +61 -0
- package/src/client/game/session/crashResume.ts +36 -0
- package/src/client/game/session/data.ts +101 -0
- package/src/client/game/session/entryReadiness.ts +13 -0
- package/src/client/game/session/exitToTitle.ts +19 -0
- package/src/client/game/session/finish.ts +414 -0
- package/src/client/game/session/hudAccent.ts +30 -0
- package/src/client/game/session/loadout.ts +176 -0
- package/src/client/game/session/play.ts +824 -0
- package/src/client/game/session/positions.ts +8 -0
- package/src/client/game/session/readyFrame.ts +10 -0
- package/src/client/game/session/session.ts +193 -0
- package/src/client/game/session/settlePrograms.ts +29 -0
- package/src/client/game/session/titlePreparation.ts +43 -0
- package/src/client/game/session/world.ts +168 -0
- package/src/client/game/shard/declaredEntry.ts +44 -0
- package/src/client/game/shard/declaredPlumbing.ts +80 -0
- package/src/client/game/shard/declaredTargets.ts +64 -0
- package/src/client/game/shard/declaredUi.ts +23 -0
- package/src/client/game/shard/discovery.ts +80 -0
- package/src/client/game/shard/list.ts +26 -0
- package/src/client/game/shard/load.ts +94 -0
- package/src/client/game/shard/manifest.ts +910 -0
- package/src/client/game/shard/pageBoot.ts +52 -0
- package/src/client/game/shard/pagePolicy.ts +17 -0
- package/src/client/game/shard/registry.ts +74 -0
- package/src/client/game/shard/retainedHooks.ts +204 -0
- package/src/client/game/shard/scopedRuntime.ts +68 -0
- package/src/client/game/shard/spec.ts +69 -0
- package/src/client/game/shard/titleList.ts +86 -0
- package/src/client/game/shardfile/accent.ts +5 -0
- package/src/client/game/shardfile/assetCache.ts +46 -0
- package/src/client/game/shardfile/audioCatalogue.ts +16 -0
- package/src/client/game/shardfile/bakedKinds.ts +313 -0
- package/src/client/game/shardfile/bakedTiles.ts +253 -0
- package/src/client/game/shardfile/buildingCloud.ts +27 -0
- package/src/client/game/shardfile/calibrationScripts.ts +30 -0
- package/src/client/game/shardfile/caveInterior.ts +162 -0
- package/src/client/game/shardfile/client.ts +671 -0
- package/src/client/game/shardfile/clientAmbientLife.ts +31 -0
- package/src/client/game/shardfile/clientAssets.ts +163 -0
- package/src/client/game/shardfile/clientBossFight.ts +39 -0
- package/src/client/game/shardfile/clientBossTelegraph.ts +43 -0
- package/src/client/game/shardfile/clientCatalogue.ts +44 -0
- package/src/client/game/shardfile/clientCosmeticFinishes.ts +37 -0
- package/src/client/game/shardfile/clientCues.ts +22 -0
- package/src/client/game/shardfile/clientEliteConstruction.ts +44 -0
- package/src/client/game/shardfile/clientEliteEntry.ts +33 -0
- package/src/client/game/shardfile/clientEntryBinds.ts +32 -0
- package/src/client/game/shardfile/clientFinds.ts +20 -0
- package/src/client/game/shardfile/clientForestPage.ts +144 -0
- package/src/client/game/shardfile/clientGraphs.ts +319 -0
- package/src/client/game/shardfile/clientHeldMelee.ts +82 -0
- package/src/client/game/shardfile/clientItems.ts +25 -0
- package/src/client/game/shardfile/clientLibrary.ts +71 -0
- package/src/client/game/shardfile/clientMaterials.ts +296 -0
- package/src/client/game/shardfile/clientMeadow.ts +30 -0
- package/src/client/game/shardfile/clientModules.ts +24 -0
- package/src/client/game/shardfile/clientMoverOwners.ts +80 -0
- package/src/client/game/shardfile/clientNativeBook.ts +38 -0
- package/src/client/game/shardfile/clientPlaceSets.ts +74 -0
- package/src/client/game/shardfile/clientPlan.ts +529 -0
- package/src/client/game/shardfile/clientPlayerEnter.ts +22 -0
- package/src/client/game/shardfile/clientPopulation.ts +49 -0
- package/src/client/game/shardfile/clientPopulationProjection.ts +28 -0
- package/src/client/game/shardfile/clientPost.ts +94 -0
- package/src/client/game/shardfile/clientPropMaterials.ts +100 -0
- package/src/client/game/shardfile/clientQuestComposition.ts +87 -0
- package/src/client/game/shardfile/clientQuestPage.ts +98 -0
- package/src/client/game/shardfile/clientRecipes.ts +76 -0
- package/src/client/game/shardfile/clientResidency.ts +29 -0
- package/src/client/game/shardfile/clientReturnModules.ts +25 -0
- package/src/client/game/shardfile/clientRuntimeHooks.ts +66 -0
- package/src/client/game/shardfile/clientSceneHandles.ts +19 -0
- package/src/client/game/shardfile/clientScripts.ts +100 -0
- package/src/client/game/shardfile/clientSkins.ts +183 -0
- package/src/client/game/shardfile/clientSource.ts +221 -0
- package/src/client/game/shardfile/clientSpeciesProgram.ts +45 -0
- package/src/client/game/shardfile/clientSplatTerrain.ts +99 -0
- package/src/client/game/shardfile/clientStealthEntry.ts +72 -0
- package/src/client/game/shardfile/clientTargets.ts +73 -0
- package/src/client/game/shardfile/clientTimedEncounters.ts +42 -0
- package/src/client/game/shardfile/clientTrails.ts +42 -0
- package/src/client/game/shardfile/clientViewProgram.ts +101 -0
- package/src/client/game/shardfile/clientViews.ts +211 -0
- package/src/client/game/shardfile/clientWater.ts +108 -0
- package/src/client/game/shardfile/clientWaterSurfaces.ts +88 -0
- package/src/client/game/shardfile/clientWorker.ts +621 -0
- package/src/client/game/shardfile/clientWorldAssembly.ts +129 -0
- package/src/client/game/shardfile/constructionCheckpoint.ts +31 -0
- package/src/client/game/shardfile/controlFiles.ts +41 -0
- package/src/client/game/shardfile/controlRefinement.ts +229 -0
- package/src/client/game/shardfile/declaredTalks.ts +114 -0
- package/src/client/game/shardfile/emptyEquipment.ts +19 -0
- package/src/client/game/shardfile/emptyLook.ts +26 -0
- package/src/client/game/shardfile/enteredTileReadout.ts +27 -0
- package/src/client/game/shardfile/entryTransport.ts +222 -0
- package/src/client/game/shardfile/farStandIn.ts +79 -0
- package/src/client/game/shardfile/forestPage.ts +289 -0
- package/src/client/game/shardfile/groundMerge.ts +232 -0
- package/src/client/game/shardfile/heldClaimsEntry.ts +34 -0
- package/src/client/game/shardfile/homeBuildCache.ts +114 -0
- package/src/client/game/shardfile/homeGeometrySnapshot.ts +92 -0
- package/src/client/game/shardfile/hybrid.ts +537 -0
- package/src/client/game/shardfile/hybridPresentation.ts +16 -0
- package/src/client/game/shardfile/islandBook.ts +87 -0
- package/src/client/game/shardfile/itemModels.ts +78 -0
- package/src/client/game/shardfile/legacyAsset.ts +30 -0
- package/src/client/game/shardfile/lentLooks.ts +210 -0
- package/src/client/game/shardfile/lightEmitters.ts +100 -0
- package/src/client/game/shardfile/livingBuildings.ts +202 -0
- package/src/client/game/shardfile/look.ts +23 -0
- package/src/client/game/shardfile/mapImage.ts +49 -0
- package/src/client/game/shardfile/pageItems.ts +57 -0
- package/src/client/game/shardfile/pagePreparation.ts +40 -0
- package/src/client/game/shardfile/pageWater.ts +29 -0
- package/src/client/game/shardfile/paintedWorldStages.ts +132 -0
- package/src/client/game/shardfile/portalRideBinding.ts +62 -0
- package/src/client/game/shardfile/preparationReads.ts +61 -0
- package/src/client/game/shardfile/preparationTiming.ts +115 -0
- package/src/client/game/shardfile/presentation.ts +36 -0
- package/src/client/game/shardfile/product.ts +718 -0
- package/src/client/game/shardfile/productCacheCompletion.ts +53 -0
- package/src/client/game/shardfile/productChecks.ts +40 -0
- package/src/client/game/shardfile/productCost.ts +422 -0
- package/src/client/game/shardfile/productGround.ts +60 -0
- package/src/client/game/shardfile/productNavigation.ts +18 -0
- package/src/client/game/shardfile/productPreflight.ts +12 -0
- package/src/client/game/shardfile/questWorld.ts +17 -0
- package/src/client/game/shardfile/readAsset.ts +44 -0
- package/src/client/game/shardfile/reusableWholeLibrary.ts +102 -0
- package/src/client/game/shardfile/runtimeProduct.ts +396 -0
- package/src/client/game/shardfile/sceneBakeFiles.ts +22 -0
- package/src/client/game/shardfile/sceneBuffers.ts +207 -0
- package/src/client/game/shardfile/sceneDraws.ts +90 -0
- package/src/client/game/shardfile/sceneDressing.ts +456 -0
- package/src/client/game/shardfile/sceneHandles.ts +170 -0
- package/src/client/game/shardfile/sceneInputs.ts +21 -0
- package/src/client/game/shardfile/sceneInstances.ts +67 -0
- package/src/client/game/shardfile/sceneMotion.ts +161 -0
- package/src/client/game/shardfile/scenePools.ts +40 -0
- package/src/client/game/shardfile/sceneProfile.ts +12 -0
- package/src/client/game/shardfile/sceneRigFiles.ts +30 -0
- package/src/client/game/shardfile/sceneScatterPages.ts +47 -0
- package/src/client/game/shardfile/sceneSources.ts +153 -0
- package/src/client/game/shardfile/serverRoute.ts +38 -0
- package/src/client/game/shardfile/skinLayerPlayback.ts +67 -0
- package/src/client/game/shardfile/skinPlayback.ts +138 -0
- package/src/client/game/shardfile/slabLibrary.ts +203 -0
- package/src/client/game/shardfile/stillImage.ts +19 -0
- package/src/client/game/shardfile/streamingView.ts +78 -0
- package/src/client/game/shardfile/tileBufferedDraws.ts +49 -0
- package/src/client/game/shardfile/tileContent.ts +564 -0
- package/src/client/game/shardfile/tileDriver.ts +462 -0
- package/src/client/game/shardfile/tileEntry.ts +18 -0
- package/src/client/game/shardfile/tiledMesh.ts +146 -0
- package/src/client/game/shardfile/water.ts +8 -0
- package/src/client/game/shardfile/weatherFields.ts +31 -0
- package/src/client/game/shardfile/wholeGeometryPieces.ts +101 -0
- package/src/client/game/shardfile/wholeLibrary.ts +47 -0
- package/src/client/game/shardfile/wholeRefinementCover.ts +78 -0
- package/src/client/game/shardfile/wirePage.ts +260 -0
- package/src/client/game/shardfile/worldAssembly.ts +531 -0
- package/src/client/game/shardfile/worldBuildYield.ts +10 -0
- package/src/client/game/shardfile/worldEntry.ts +117 -0
- package/src/client/game/shardfile/worldSceneBatch.ts +105 -0
- package/src/client/game/shardfile/worldSceneGeometry.ts +171 -0
- package/src/client/game/shardfile/worldSceneMaterials.ts +90 -0
- package/src/client/game/shardfile/worldScenePlacement.ts +364 -0
- package/src/client/game/shardfile/worldScenePlacementPages.ts +61 -0
- package/src/client/game/shardfile/worldSceneReads.ts +83 -0
- package/src/client/game/shardfile/worldSceneStepSources.ts +69 -0
- package/src/client/game/shardfile/worldSceneSurface.ts +108 -0
- package/src/client/game/shardfile/worldSceneTextures.ts +134 -0
- package/src/client/game/shardfile/worldSceneUniforms.ts +17 -0
- package/src/client/game/shardfile/worldSceneWeld.ts +339 -0
- package/src/client/game/shardfile/worldScenes.ts +760 -0
- package/src/client/game/shardfile/worldUpdates.ts +149 -0
- package/src/client/game/stealth/controller.ts +115 -0
- package/src/client/game/stealth/stealth.css +70 -0
- package/src/client/game/summary.css +8 -0
- package/src/client/game/summary.ts +67 -0
- package/src/client/game/systems/audio/crossbowSounds.ts +71 -0
- package/src/client/game/systems/audio/firearmSounds.ts +43 -0
- package/src/client/game/systems/audio/meleeSounds.ts +40 -0
- package/src/client/game/systems/audio/silentScore.ts +6 -0
- package/src/client/game/systems/effects/starter.generated.ts +2 -0
- package/src/client/game/systems/effects/status.css +3 -0
- package/src/client/game/systems/effects/view.ts +35 -0
- package/src/client/game/systems/items/declaredSword.ts +149 -0
- package/src/client/game/systems/looks/fogProgram.ts +18 -0
- package/src/client/game/systems/looks/particles.ts +407 -0
- package/src/client/game/systems/looks/rainCurtain.ts +50 -0
- package/src/client/game/systems/looks/surfaceLooks.ts +138 -0
- package/src/client/game/systems/looks/trample.ts +139 -0
- package/src/client/game/systems/looks/waterSurface.ts +179 -0
- package/src/client/game/systems/npc/figureRows.ts +169 -0
- package/src/client/game/systems/npc/figureSkins.ts +130 -0
- package/src/client/game/systems/npc/kitFigure.ts +127 -0
- package/src/client/game/systems/npc/npcRig.ts +217 -0
- package/src/client/game/systems/npc/standingFigure.ts +111 -0
- package/src/client/game/systems/props/interact.ts +236 -0
- package/src/client/game/systems/species/bear.ts +30 -0
- package/src/client/game/systems/species/boar.ts +28 -0
- package/src/client/game/systems/species/install.ts +18 -0
- package/src/client/game/systems/species/view/bear.ts +246 -0
- package/src/client/game/systems/species/view/boar.ts +249 -0
- package/src/client/game/systems/tools/hoverboard.ts +107 -0
- package/src/client/game/systems/viewmodel/armAliases.json +24 -0
- package/src/client/game/systems/viewmodel/armClips.ts +8 -0
- package/src/client/game/systems/viewmodel/armRig.ts +293 -0
- package/src/client/game/systems/viewmodel/clips.generated.ts +2 -0
- package/src/client/game/systems/viewmodel/heldView.ts +458 -0
- package/src/client/game/systems/viewmodel/rigArms.ts +280 -0
- package/src/client/game/titleAssets.ts +9 -0
- package/src/client/game/titleDeck.ts +381 -0
- package/src/client/game/travel/travel.ts +99 -0
- package/src/client/game/ui/dataPanels.ts +95 -0
- package/src/client/game/ui/panelTemplates.ts +71 -0
- package/src/client/game/ui/panels.ts +109 -0
- package/src/client/game/upgrade.css +12 -0
- package/src/client/game/weapons/Bow.ts +14 -0
- package/src/client/game/weapons/Sword.ts +30 -0
- package/src/client/game/weapons/arcPower.ts +203 -0
- package/src/client/game/weapons/heldLauncher.ts +452 -0
- package/src/client/game/weapons/heldPolearm.ts +491 -0
- package/src/client/game/weapons/mountedBlade.ts +122 -0
- package/src/client/game/weather/forest.ts +281 -0
- package/src/client/game/weather/netClimate.ts +88 -0
- package/src/client/game/weather/pageSky.ts +31 -0
- package/src/client/game/weather/rainPresentation.ts +246 -0
- package/src/client/game/weather/weatherEvents.merge.d.ts +8 -0
- package/src/client/game/whatsNew.ts +31 -0
- package/src/client/game/whatsNewBanner.ts +125 -0
- package/src/client/host/online/chatCorner.ts +46 -0
- package/src/client/host/online/chatLines.ts +213 -0
- package/src/client/host/online/doctor.ts +321 -0
- package/src/client/host/online/doctorPage.ts +26 -0
- package/src/client/host/online/doctorView.ts +144 -0
- package/src/client/host/online/linkScreens.ts +300 -0
- package/src/client/host/online/reconnectStrip.ts +26 -0
- package/src/client/host/online/release.ts +28 -0
- package/src/client/host/online/shell.ts +312 -0
- package/src/client/host/online/voice.ts +468 -0
- package/src/client/host/online/voiceUi.ts +186 -0
- package/src/client/host/standalone/shell.ts +169 -0
- package/src/client/index.html +12 -0
- package/src/client/main.tsx +10 -0
- package/src/client/side.ts +2 -0
- package/src/client/tsconfig.json +13 -0
- package/src/cook/game/brotliSizeCache.d.mts +5 -0
- package/src/cook/game/brotliSizeCache.mjs +59 -0
- package/src/cook/game/contentNamed.ts +6 -0
- package/src/cook/game/cookJob.ts +103 -0
- package/src/cook/game/cookWorker.ts +413 -0
- package/src/cook/game/encodedBytes.ts +51 -0
- package/src/cook/game/engineHalf.ts +47 -0
- package/src/cook/game/entryDownloads.ts +36 -0
- package/src/cook/game/entryReadSet.ts +67 -0
- package/src/cook/game/entryTotals.ts +320 -0
- package/src/cook/game/fenceReads.ts +218 -0
- package/src/cook/game/gridCollision.ts +53 -0
- package/src/cook/game/gridEntryDownloads.ts +33 -0
- package/src/cook/game/gridStripPages.ts +239 -0
- package/src/cook/game/installedRuntimeReads.ts +48 -0
- package/src/cook/game/packStore.ts +120 -0
- package/src/cook/game/portableEncode.ts +7 -0
- package/src/cook/game/productTarball.ts +18 -0
- package/src/cook/game/shardCook.ts +350 -0
- package/src/cook/game/spawnParts.ts +294 -0
- package/src/cook/game/stripPack.ts +31 -0
- package/src/cook/side.ts +2 -0
- package/src/e2e/playwright.config.ts +60 -0
- package/src/e2e/smoke/game.ts +217 -0
- package/src/e2e/smoke/page-globals.d.ts +37 -0
- package/src/e2e/smoke/template2.spec.ts +146 -0
- package/src/e2e/status.spec.ts +13 -0
- package/src/scripts/ask-new.sh +29 -0
- package/src/scripts/asks.mjs +142 -0
- package/src/scripts/check-sides.mjs +70 -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/engine/ai/CreatureBrain.ts +23 -0
- package/src/server/engine/ai/bossContenders.ts +101 -0
- package/src/server/engine/ai/burstFlyer.ts +31 -0
- package/src/server/engine/ai/challengeGrazer.ts +31 -0
- package/src/server/engine/ai/eliteContinuation.ts +141 -0
- package/src/server/engine/ai/eliteKernels.ts +187 -0
- package/src/server/engine/ai/eliteLifecycle.ts +126 -0
- package/src/server/engine/ai/eliteRoster.ts +357 -0
- package/src/server/engine/ai/grazer.ts +1360 -0
- package/src/server/engine/ai/guardian.ts +20 -0
- package/src/server/engine/ai/guardianPolicy.ts +264 -0
- package/src/server/engine/ai/herd.ts +17 -0
- package/src/server/engine/ai/hunt.ts +46 -0
- package/src/server/engine/ai/moves.ts +202 -0
- package/src/server/engine/ai/orbitDiver.ts +33 -0
- package/src/server/engine/ai/pack.ts +29 -0
- package/src/server/engine/ai/patrolDiver.ts +31 -0
- package/src/server/engine/ai/perchHunter.ts +20 -0
- package/src/server/engine/ai/phases.ts +121 -0
- package/src/server/engine/ai/platform.ts +140 -0
- package/src/server/engine/ai/ramGrazer.ts +31 -0
- package/src/server/engine/ai/scriptBrain.ts +147 -0
- package/src/server/engine/ai/skirmisher.ts +20 -0
- package/src/server/engine/ai/species.ts +33 -0
- package/src/server/engine/combat/EquipmentPickup.ts +28 -0
- package/src/server/engine/combat/contactWeapon.ts +251 -0
- package/src/server/engine/combat/damageBook.ts +45 -0
- package/src/server/engine/combat/rewind.ts +7 -0
- package/src/server/engine/entities/AnimalManager.ts +752 -0
- package/src/server/engine/entities/bodyClear.ts +47 -0
- package/src/server/engine/entities/creatureRefill.ts +119 -0
- package/src/server/engine/entities/killHeight.ts +18 -0
- package/src/server/engine/level/context.ts +111 -0
- package/src/server/engine/net/chat.ts +97 -0
- package/src/server/engine/net/combatWire.ts +49 -0
- package/src/server/engine/net/commandQueue.ts +95 -0
- package/src/server/engine/net/handles.ts +74 -0
- package/src/server/engine/net/hitHistory.ts +114 -0
- package/src/server/engine/net/ledgerBook.ts +65 -0
- package/src/server/engine/net/room.ts +560 -0
- package/src/server/engine/net/serverClock.ts +43 -0
- package/src/server/engine/net/simWorld.ts +131 -0
- package/src/server/engine/net/tiers.ts +14 -0
- package/src/server/engine/physics/edgeEntries.ts +40 -0
- package/src/server/engine/physics/rapierBindings.ts +4 -0
- package/src/server/engine/saves/forwardedStorage.ts +43 -0
- package/src/server/engine/script/composition.ts +219 -0
- package/src/server/engine/script/decision.ts +573 -0
- package/src/server/engine/script/inputInboxV2.ts +116 -0
- package/src/server/engine/script/lane.ts +185 -0
- package/src/server/engine/script/ownedSimBatchV2.ts +205 -0
- package/src/server/engine/script/queries.ts +37 -0
- package/src/server/engine/script/queriesV2.ts +149 -0
- package/src/server/engine/script/simBatchV2.ts +125 -0
- package/src/server/engine/sim/playerSim.ts +443 -0
- package/src/server/engine/sim/respawn.ts +74 -0
- package/src/server/engine/sim/restore.ts +37 -0
- package/src/server/engine/sim.ts +711 -0
- package/src/server/game/animation/limbPopulation.ts +138 -0
- package/src/server/game/bake/entryways.ts +186 -0
- package/src/server/game/boss/arenaRoomEntry.ts +97 -0
- package/src/server/game/boss/arenaRoomFight.ts +103 -0
- package/src/server/game/boss/arenaRoomNative.ts +142 -0
- package/src/server/game/boss/arenaWords.ts +46 -0
- package/src/server/game/boss/bounty.ts +37 -0
- package/src/server/game/boss/captainNative.ts +122 -0
- package/src/server/game/boss/continuation.ts +37 -0
- package/src/server/game/boss/headlessArenaPose.ts +40 -0
- package/src/server/game/boss/headlessArenaViews.ts +54 -0
- package/src/server/game/boss/headlessCloudBody.ts +93 -0
- package/src/server/game/boss/native.ts +220 -0
- package/src/server/game/boss/nativeArenaSand.ts +93 -0
- package/src/server/game/boss/nativeArenaSeal.ts +26 -0
- package/src/server/game/boss/nativeWake.ts +50 -0
- package/src/server/game/boss/openArenaNative.ts +200 -0
- package/src/server/game/boss/openArenaRoom.ts +69 -0
- package/src/server/game/boss/openArenaState.ts +25 -0
- package/src/server/game/boss/patrolNative.ts +286 -0
- package/src/server/game/boss/roaming.ts +77 -0
- package/src/server/game/boss/slotHeights.ts +103 -0
- package/src/server/game/boss/slotsNative.ts +175 -0
- package/src/server/game/boss/windEliteNative.ts +139 -0
- package/src/server/game/grapple/native.ts +181 -0
- package/src/server/game/grid/durability.ts +166 -0
- package/src/server/game/grid/room.ts +53 -0
- package/src/server/game/grid/roomNet.ts +85 -0
- package/src/server/game/grid/simulation.ts +345 -0
- package/src/server/game/items.merge.d.ts +7 -0
- package/src/server/game/loadout/nativeAmmunition.ts +139 -0
- package/src/server/game/loadout/ownedEffects.ts +68 -0
- package/src/server/game/loot/harvest.ts +43 -0
- package/src/server/game/loot/personal.ts +70 -0
- package/src/server/game/loot/playerOwned.ts +235 -0
- package/src/server/game/plugin/bossPhase.ts +904 -0
- package/src/server/game/plugin/brain.ts +1325 -0
- package/src/server/game/plugin/mover.ts +601 -0
- package/src/server/game/plugin/nativeItems.ts +437 -0
- package/src/server/game/plugin/nativeRewind.ts +37 -0
- package/src/server/game/plugin/nativeSwept.ts +249 -0
- package/src/server/game/plugin/playerSeats.ts +62 -0
- package/src/server/game/plugin/scriptSeats.ts +89 -0
- package/src/server/game/plugin/simulation.ts +1623 -0
- package/src/server/game/population/actorProjectionV2.ts +276 -0
- package/src/server/game/population/actors.ts +136 -0
- package/src/server/game/population/directedLaw.ts +69 -0
- package/src/server/game/population/encounterBook.ts +78 -0
- package/src/server/game/population/encounterIntake.ts +78 -0
- package/src/server/game/population/environment.ts +86 -0
- package/src/server/game/population/mixedRoster.ts +353 -0
- package/src/server/game/population/nativeBake.ts +202 -0
- package/src/server/game/population/nativeManager.ts +426 -0
- package/src/server/game/population/nativeReturns.ts +99 -0
- package/src/server/game/population/perchBody.ts +97 -0
- package/src/server/game/population/projectedSites.ts +41 -0
- package/src/server/game/population/relations.ts +45 -0
- package/src/server/game/population/roster.ts +259 -0
- package/src/server/game/population/scriptStrikes.ts +67 -0
- package/src/server/game/population/shelter.ts +193 -0
- package/src/server/game/population/signals.ts +9 -0
- package/src/server/game/population/spawnScript.ts +797 -0
- package/src/server/game/population/specCatalogue.ts +11 -0
- package/src/server/game/quest/bodyOps.ts +253 -0
- package/src/server/game/quest/chapterRecords.ts +97 -0
- package/src/server/game/quest/eliteDrops.ts +36 -0
- package/src/server/game/quest/eliteFeature.ts +141 -0
- package/src/server/game/quest/killSteps.ts +34 -0
- package/src/server/game/quest/nativeBodyScripts.ts +29 -0
- package/src/server/game/quest/nativeChapter.ts +80 -0
- package/src/server/game/quest/nativeComposition.ts +548 -0
- package/src/server/game/quest/nativeEntry.ts +128 -0
- package/src/server/game/quest/nativeInputs.ts +29 -0
- package/src/server/game/quest/nativeSecret.ts +80 -0
- package/src/server/game/quest/serverChapters.ts +192 -0
- package/src/server/game/quest/serverDoors.ts +89 -0
- package/src/server/game/quest/serverPlaces.ts +32 -0
- package/src/server/game/riding/native.ts +362 -0
- package/src/server/game/riding/nativePopulation.ts +384 -0
- package/src/server/game/riding/nativeTaming.ts +331 -0
- package/src/server/game/riding/pastureController.ts +131 -0
- package/src/server/game/riding/roster.ts +108 -0
- package/src/server/game/riding/wildRefill.ts +37 -0
- package/src/server/game/roomRespawn.ts +60 -0
- package/src/server/game/shard/declaredEncounters.ts +22 -0
- package/src/server/game/shard/manifest-closure.generated.json +683 -0
- package/src/server/game/shard/portShares.generated.ts +2 -0
- package/src/server/game/shard/world.ts +5 -0
- package/src/server/game/shardfile/borrowedDecisions.ts +281 -0
- package/src/server/game/shardfile/bossRow.ts +236 -0
- package/src/server/game/shardfile/brainRuntime.ts +162 -0
- package/src/server/game/shardfile/decisions.ts +597 -0
- package/src/server/game/shardfile/declaredClimate.ts +22 -0
- package/src/server/game/shardfile/declaredKitItems.ts +243 -0
- package/src/server/game/shardfile/declaredTalks.ts +52 -0
- package/src/server/game/shardfile/groupRuntime.ts +302 -0
- package/src/server/game/shardfile/homeKeeper.ts +565 -0
- package/src/server/game/shardfile/nativeAssembly.ts +102 -0
- package/src/server/game/shardfile/nativeAssemblyHosts.ts +301 -0
- package/src/server/game/shardfile/nativeAssemblyInput.ts +68 -0
- package/src/server/game/shardfile/nativePlan.ts +28 -0
- package/src/server/game/shardfile/nativeRuntimeLoans.ts +52 -0
- package/src/server/game/shardfile/phasedBossRoaming.ts +427 -0
- package/src/server/game/shardfile/portalLinkProof.ts +66 -0
- package/src/server/game/shardfile/scriptComposition.ts +57 -0
- package/src/server/game/shardfile/scripts.ts +56 -0
- package/src/server/game/shardfile/statusEffects.ts +68 -0
- package/src/server/game/stealth/nativeStealth.ts +74 -0
- package/src/server/game/weapons/nativeHeld.ts +333 -0
- package/src/server/game/weather/continuation.ts +97 -0
- package/src/server/game/weather/reactions.ts +219 -0
- package/src/server/game/weather/wire.ts +42 -0
- package/src/server/host/bake/headlessWorker.ts +132 -0
- package/src/server/host/dedicated/cellHost.ts +171 -0
- package/src/server/host/dedicated/cellProtocol.ts +64 -0
- package/src/server/host/dedicated/cellWorker.ts +33 -0
- package/src/server/host/dedicated/crossing.ts +44 -0
- package/src/server/host/dedicated/dedicatedRoom.ts +419 -0
- package/src/server/host/dedicated/doorTrust.ts +55 -0
- package/src/server/host/dedicated/gridCells.ts +53 -0
- package/src/server/host/dedicated/main.ts +134 -0
- package/src/server/host/dedicated/packReader.ts +68 -0
- package/src/server/host/dedicated/playerDoc.ts +96 -0
- package/src/server/host/dedicated/playerSaves.ts +62 -0
- package/src/server/host/dedicated/playerStore.ts +82 -0
- package/src/server/host/dedicated/playtest.ts +41 -0
- package/src/server/host/dedicated/releaseFile.ts +71 -0
- package/src/server/host/dedicated/roadRoom.ts +151 -0
- package/src/server/host/dedicated/saves/database.ts +15 -0
- package/src/server/host/dedicated/saves/migrate.ts +26 -0
- package/src/server/host/dedicated/saves/migrations/0001-saves.sql +48 -0
- package/src/server/host/dedicated/saves/migrations/0002-report-delivery.sql +3 -0
- package/src/server/host/dedicated/saves/migrations/0003-place.sql +11 -0
- package/src/server/host/dedicated/saves/migrations/0004-names.sql +4 -0
- package/src/server/host/dedicated/saves/migrations/0005-profile.sql +41 -0
- package/src/server/host/dedicated/saves/names.ts +56 -0
- package/src/server/host/dedicated/saves/pgDatabase.ts +43 -0
- package/src/server/host/dedicated/saves/profile.ts +44 -0
- package/src/server/host/dedicated/saves/reportQueue.ts +49 -0
- package/src/server/host/dedicated/saves/saveStore.ts +117 -0
- package/src/server/host/dedicated/saves/writeQueue.ts +94 -0
- package/src/server/host/dedicated/seats.ts +12 -0
- package/src/server/host/dedicated/serverReports.ts +81 -0
- package/src/server/host/dedicated/serverSentry.ts +124 -0
- package/src/server/host/dedicated/shopGate.ts +36 -0
- package/src/server/host/dedicated/socketPump.ts +74 -0
- package/src/server/host/dedicated/socketTransport.ts +123 -0
- package/src/server/host/dedicated/voiceRelay.ts +138 -0
- package/src/server/host/dedicated/workerTable.ts +29 -0
- package/src/server/host/dedicated/world.ts +428 -0
- package/src/server/host/headless.ts +280 -0
- package/src/server/host/headlessProduct.ts +52 -0
- package/src/server/host/headlessRuntime.ts +354 -0
- package/src/server/host/ropeDecks.ts +69 -0
- package/src/server/host/standalone/cellWorld.ts +188 -0
- package/src/server/host/standalone/continuation.ts +58 -0
- package/src/server/host/standalone/fallFloor.ts +83 -0
- package/src/server/host/standalone/gridServer.ts +282 -0
- package/src/server/host/standalone/ledgerFilings.ts +33 -0
- package/src/server/host/standalone/progressWatch.ts +90 -0
- package/src/server/host/standalone/roadWorld.ts +49 -0
- package/src/server/host/standalone/serverHost.ts +132 -0
- package/src/server/host/standalone/serverProduct.ts +149 -0
- package/src/server/host/standalone/serverRuntime.ts +43 -0
- package/src/server/host/standalone/serverWorker.ts +22 -0
- package/src/server/host/tickWorkerHost.ts +250 -0
- package/src/server/host/tickWorkerLoop.ts +123 -0
- package/src/server/serve.ts +49 -0
- package/src/server/side.ts +2 -0
- package/src/shared/engine/ai/BossBrain.ts +287 -0
- package/src/shared/engine/ai/GroupBrain.ts +152 -0
- package/src/shared/engine/ai/ambientFlight.ts +60 -0
- package/src/shared/engine/ai/ambientFlock.ts +297 -0
- package/src/shared/engine/ai/ambientForager.ts +289 -0
- package/src/shared/engine/ai/bossScale.ts +8 -0
- package/src/shared/engine/ai/director.ts +94 -0
- package/src/shared/engine/ai/diver.ts +540 -0
- package/src/shared/engine/ai/eliteScript.ts +85 -0
- package/src/shared/engine/ai/encounters.ts +124 -0
- package/src/shared/engine/ai/flight.ts +69 -0
- package/src/shared/engine/ai/flock.ts +334 -0
- package/src/shared/engine/ai/hfsm.ts +51 -0
- package/src/shared/engine/ai/huntPattern.ts +987 -0
- package/src/shared/engine/ai/inspect.ts +6 -0
- package/src/shared/engine/ai/pinning.ts +13 -0
- package/src/shared/engine/ai/reach.ts +19 -0
- package/src/shared/engine/ai/stalker.ts +1502 -0
- package/src/shared/engine/ai/strikeRows.ts +17 -0
- package/src/shared/engine/ai/strikeState.ts +19 -0
- package/src/shared/engine/ai/strikes.ts +199 -0
- package/src/shared/engine/ai/weighted.ts +27 -0
- package/src/shared/engine/app/identity.ts +66 -0
- package/src/shared/engine/app/ownership.ts +155 -0
- package/src/shared/engine/app/pageSeat.ts +12 -0
- package/src/shared/engine/app/resources.ts +7 -0
- package/src/shared/engine/app/scheduler.ts +162 -0
- package/src/shared/engine/app/scope.ts +557 -0
- package/src/shared/engine/app/scopeEnvironment.ts +27 -0
- package/src/shared/engine/app/scopedProperty.ts +38 -0
- package/src/shared/engine/audio/audioProfiles.ts +161 -0
- package/src/shared/engine/audio/bootAudio.ts +316 -0
- package/src/shared/engine/boot/loadingWaits.ts +62 -0
- package/src/shared/engine/boot/serverProgress.ts +27 -0
- package/src/shared/engine/boot/steps.ts +63 -0
- package/src/shared/engine/boot/tables.ts +48 -0
- package/src/shared/engine/boot/timeline.ts +189 -0
- package/src/shared/engine/boot/timing.ts +96 -0
- package/src/shared/engine/boot/waits.ts +114 -0
- package/src/shared/engine/boot/workerTiming.ts +74 -0
- package/src/shared/engine/combat/Equipment.ts +66 -0
- package/src/shared/engine/combat/Firearm.ts +200 -0
- package/src/shared/engine/combat/Melee.ts +46 -0
- package/src/shared/engine/combat/Tool.ts +8 -0
- package/src/shared/engine/combat/Weapon.ts +133 -0
- package/src/shared/engine/combat/ammo.ts +17 -0
- package/src/shared/engine/combat/blocks/ads.ts +5 -0
- package/src/shared/engine/combat/blocks/melee.ts +19 -0
- package/src/shared/engine/combat/bowDraw.ts +140 -0
- package/src/shared/engine/combat/bowLaw.ts +54 -0
- package/src/shared/engine/combat/effects/EffectService.ts +216 -0
- package/src/shared/engine/combat/effects/types.ts +47 -0
- package/src/shared/engine/combat/health.ts +92 -0
- package/src/shared/engine/combat/impact.ts +8 -0
- package/src/shared/engine/combat/itemFamilies.ts +34 -0
- package/src/shared/engine/combat/items.ts +147 -0
- package/src/shared/engine/combat/lungeTarget.ts +42 -0
- package/src/shared/engine/combat/meleeProfile.ts +48 -0
- package/src/shared/engine/combat/pipeline.ts +157 -0
- package/src/shared/engine/combat/projectileContact.ts +275 -0
- package/src/shared/engine/combat/projectileFlight.ts +89 -0
- package/src/shared/engine/combat/projectileLaw.ts +148 -0
- package/src/shared/engine/combat/shotSpread.ts +38 -0
- package/src/shared/engine/combat/sweptBasePose.ts +75 -0
- package/src/shared/engine/combat/sweptBlade.ts +108 -0
- package/src/shared/engine/combat/sweptMeleeCore.ts +223 -0
- package/src/shared/engine/combat/targets.ts +20 -0
- package/src/shared/engine/core/clock.ts +57 -0
- package/src/shared/engine/core/config.ts +66 -0
- package/src/shared/engine/core/faults.ts +129 -0
- package/src/shared/engine/core/fixedStep.ts +5 -0
- package/src/shared/engine/core/frameCost.ts +227 -0
- package/src/shared/engine/core/framePacing.ts +179 -0
- package/src/shared/engine/core/harnessTap.ts +15 -0
- package/src/shared/engine/core/memoryAttribution.ts +137 -0
- package/src/shared/engine/core/memoryResources.ts +20 -0
- package/src/shared/engine/core/noise.ts +53 -0
- package/src/shared/engine/core/perfLap.ts +37 -0
- package/src/shared/engine/core/portableMath.ts +204 -0
- package/src/shared/engine/core/portableMathFirst.ts +4 -0
- package/src/shared/engine/core/practiceRoomState.ts +3 -0
- package/src/shared/engine/core/rng.ts +101 -0
- package/src/shared/engine/core/time.ts +8 -0
- package/src/shared/engine/core/workSlice.ts +111 -0
- package/src/shared/engine/entities/AnimalSim.ts +390 -0
- package/src/shared/engine/entities/animalPose.ts +401 -0
- package/src/shared/engine/entities/animalRig.ts +76 -0
- package/src/shared/engine/entities/animalStates.ts +2 -0
- package/src/shared/engine/entities/creatureFloor.ts +13 -0
- package/src/shared/engine/entities/eliteBrain.ts +36 -0
- package/src/shared/engine/entities/fightRules.ts +80 -0
- package/src/shared/engine/entities/ids.ts +18 -0
- package/src/shared/engine/entities/poseCadence.ts +9 -0
- package/src/shared/engine/entities/species/registry.ts +382 -0
- package/src/shared/engine/entities/species/rigs.ts +53 -0
- package/src/shared/engine/events/events.ts +107 -0
- package/src/shared/engine/input/commands.ts +34 -0
- package/src/shared/engine/input/netButtons.ts +4 -0
- package/src/shared/engine/level/data.ts +163 -0
- package/src/shared/engine/level/selection.ts +44 -0
- package/src/shared/engine/level/spec.ts +132 -0
- package/src/shared/engine/net/acts.ts +48 -0
- package/src/shared/engine/net/animalNet.ts +43 -0
- package/src/shared/engine/net/bits.ts +104 -0
- package/src/shared/engine/net/chatFilter.ts +40 -0
- package/src/shared/engine/net/chatWire.ts +18 -0
- package/src/shared/engine/net/chatWords.ts +7 -0
- package/src/shared/engine/net/command.ts +96 -0
- package/src/shared/engine/net/encounterNet.ts +32 -0
- package/src/shared/engine/net/frame.ts +159 -0
- package/src/shared/engine/net/identity.ts +40 -0
- package/src/shared/engine/net/ledgerWire.ts +24 -0
- package/src/shared/engine/net/measurements.ts +14 -0
- package/src/shared/engine/net/messages.ts +213 -0
- package/src/shared/engine/net/netSchemas.ts +38 -0
- package/src/shared/engine/net/playerNet.ts +80 -0
- package/src/shared/engine/net/schema.ts +157 -0
- package/src/shared/engine/net/shardNet.ts +25 -0
- package/src/shared/engine/net/socketFrames.ts +84 -0
- package/src/shared/engine/net/transport.ts +19 -0
- package/src/shared/engine/net/wireFrames.ts +123 -0
- package/src/shared/engine/net/wireMessages.ts +115 -0
- package/src/shared/engine/net/wireValues.ts +142 -0
- package/src/shared/engine/physics/CharacterMotor.ts +429 -0
- package/src/shared/engine/physics/Physics.ts +211 -0
- package/src/shared/engine/physics/bodies.ts +600 -0
- package/src/shared/engine/physics/box.ts +42 -0
- package/src/shared/engine/physics/creatures.ts +188 -0
- package/src/shared/engine/physics/declaredProps.ts +26 -0
- package/src/shared/engine/physics/entrySockets.ts +44 -0
- package/src/shared/engine/physics/frame.ts +39 -0
- package/src/shared/engine/physics/gridBorders.ts +38 -0
- package/src/shared/engine/physics/groups.ts +64 -0
- package/src/shared/engine/physics/heightPatch.ts +49 -0
- package/src/shared/engine/physics/meshCollision.ts +84 -0
- package/src/shared/engine/physics/mover.ts +60 -0
- package/src/shared/engine/physics/navmesh.ts +206 -0
- package/src/shared/engine/physics/navmeshUrl.ts +8 -0
- package/src/shared/engine/physics/nearColliders.ts +55 -0
- package/src/shared/engine/physics/overlap.ts +26 -0
- package/src/shared/engine/physics/paths.ts +135 -0
- package/src/shared/engine/physics/pieces.ts +139 -0
- package/src/shared/engine/physics/query.ts +161 -0
- package/src/shared/engine/physics/queryBatchV2.ts +118 -0
- package/src/shared/engine/physics/rapier-bg.d.ts +5 -0
- package/src/shared/engine/physics/rapier.ts +34 -0
- package/src/shared/engine/physics/readinessWalls.ts +49 -0
- package/src/shared/engine/physics/ropeChain.ts +128 -0
- package/src/shared/engine/physics/stripColliders.ts +21 -0
- package/src/shared/engine/physics/surface.ts +31 -0
- package/src/shared/engine/physics/terrain.ts +155 -0
- package/src/shared/engine/physics/terrainTiles.ts +20 -0
- package/src/shared/engine/physics/trainingTargets.ts +51 -0
- package/src/shared/engine/physics/transferWalls.ts +84 -0
- package/src/shared/engine/physics/wasmUrl.ts +3 -0
- package/src/shared/engine/player/MeleeSweep.ts +50 -0
- package/src/shared/engine/player/board.ts +129 -0
- package/src/shared/engine/player/combatMotion.ts +5 -0
- package/src/shared/engine/player/dash.ts +60 -0
- package/src/shared/engine/player/dodge.ts +14 -0
- package/src/shared/engine/player/fall.ts +29 -0
- package/src/shared/engine/player/hoverSpeed.ts +22 -0
- package/src/shared/engine/player/impulse.ts +30 -0
- package/src/shared/engine/player/jump.ts +30 -0
- package/src/shared/engine/player/lockOrbit.ts +72 -0
- package/src/shared/engine/player/modes.ts +239 -0
- package/src/shared/engine/player/motion.ts +391 -0
- package/src/shared/engine/player/motionState.ts +84 -0
- package/src/shared/engine/player/shove.ts +27 -0
- package/src/shared/engine/player/swim.ts +196 -0
- package/src/shared/engine/player/walk.ts +25 -0
- package/src/shared/engine/quest/core.ts +174 -0
- package/src/shared/engine/quest/dialogueClock.ts +191 -0
- package/src/shared/engine/quest/discovery.ts +42 -0
- package/src/shared/engine/quest/lastPlace.ts +80 -0
- package/src/shared/engine/quest/players.ts +162 -0
- package/src/shared/engine/quest/progress.ts +25 -0
- package/src/shared/engine/quest/viewPort.ts +22 -0
- package/src/shared/engine/saves/environment.ts +13 -0
- package/src/shared/engine/saves/legacy.ts +65 -0
- package/src/shared/engine/saves/runtime.ts +28 -0
- package/src/shared/engine/saves/saves.lock.json +551 -0
- package/src/shared/engine/saves/shape.ts +157 -0
- package/src/shared/engine/saves/store.ts +423 -0
- package/src/shared/engine/script/checkpointBytes.ts +18 -0
- package/src/shared/engine/script/decisionModule.ts +158 -0
- package/src/shared/engine/script/effects.ts +111 -0
- package/src/shared/engine/script/fixedMemory.ts +92 -0
- package/src/shared/engine/script/groupBankV2.ts +376 -0
- package/src/shared/engine/script/groupStepV2.ts +987 -0
- package/src/shared/engine/script/host.ts +443 -0
- package/src/shared/engine/script/moduleV2.ts +160 -0
- package/src/shared/engine/script/observationColumnsV2.ts +431 -0
- package/src/shared/engine/script/observationsV2.ts +139 -0
- package/src/shared/engine/script/state.ts +183 -0
- package/src/shared/engine/script/strings.ts +5 -0
- package/src/shared/engine/script/viewLane.ts +335 -0
- package/src/shared/engine/script/viewProgram.ts +315 -0
- package/src/shared/engine/sim/actRoutes.ts +72 -0
- package/src/shared/engine/sim/apiVersion.ts +2 -0
- package/src/shared/engine/sim/bands.ts +174 -0
- package/src/shared/engine/sim/cableTraversal.ts +356 -0
- package/src/shared/engine/sim/dayClock.ts +76 -0
- package/src/shared/engine/sim/edgeProfiles.ts +123 -0
- package/src/shared/engine/sim/encounterRows.ts +49 -0
- package/src/shared/engine/sim/leadPlayer.ts +16 -0
- package/src/shared/engine/sim/moverLifecycle.ts +80 -0
- package/src/shared/engine/sim/moverMotion.ts +130 -0
- package/src/shared/engine/sim/nearPlayer.ts +21 -0
- package/src/shared/engine/sim/netMotion.ts +17 -0
- package/src/shared/engine/sim/readiness.ts +77 -0
- package/src/shared/engine/sim/seamError.ts +100 -0
- package/src/shared/engine/sim/seamGeometry.ts +365 -0
- package/src/shared/engine/sim/seamLattice.ts +127 -0
- package/src/shared/engine/sim/shardRows.ts +106 -0
- package/src/shared/engine/sim/shore.ts +14 -0
- package/src/shared/engine/sim/snapshot.ts +482 -0
- package/src/shared/engine/sim/snapshotBase64.ts +25 -0
- package/src/shared/engine/sim/snapshotData.ts +460 -0
- package/src/shared/engine/sim/snapshotPhysics.ts +163 -0
- package/src/shared/engine/sim/snapshotReferenceMemo.ts +271 -0
- package/src/shared/engine/sim/strips.ts +134 -0
- package/src/shared/engine/strings.ts +751 -0
- package/src/shared/engine/world/BakedTerrain.ts +131 -0
- package/src/shared/engine/world/Heightfield.ts +129 -0
- package/src/shared/engine/world/bakedTerrainField.ts +85 -0
- package/src/shared/engine/world/dayCycle.ts +198 -0
- package/src/shared/engine/world/easedFields.ts +32 -0
- package/src/shared/engine/world/forest/placement.ts +391 -0
- package/src/shared/engine/world/forest/treeSpec.ts +15 -0
- package/src/shared/engine/world/groundField.ts +21 -0
- package/src/shared/engine/world/interact/barrel.ts +114 -0
- package/src/shared/engine/world/interact/flags.ts +229 -0
- package/src/shared/engine/world/interact/pickup.ts +22 -0
- package/src/shared/engine/world/interact/prompts.ts +47 -0
- package/src/shared/engine/world/interact/types.ts +327 -0
- package/src/shared/engine/world/interact/validate.ts +67 -0
- package/src/shared/engine/world/scalarChannel.ts +146 -0
- package/src/shared/engine/world/steppeWind.ts +193 -0
- package/src/shared/engine/world/terrainField.ts +217 -0
- package/src/shared/engine/world/terrainHeight.ts +19 -0
- package/src/shared/engine/world/water/body.ts +88 -0
- package/src/shared/engine/world/water/declared.ts +106 -0
- package/src/shared/engine/world/waves.ts +57 -0
- package/src/shared/engine/world/weather.ts +166 -0
- package/src/shared/engine/world/weatherContinuation.ts +121 -0
- package/src/shared/engine/world/windField.ts +49 -0
- package/src/shared/engine/world/windStrength.ts +6 -0
- package/src/shared/engine/world/yawFrame.ts +38 -0
- package/src/shared/game/achievements.ts +140 -0
- package/src/shared/game/ambient/flock.ts +374 -0
- package/src/shared/game/animation/limbBlend.ts +70 -0
- package/src/shared/game/animation/limbRig.ts +208 -0
- package/src/shared/game/bag/findsCatalogue.ts +58 -0
- package/src/shared/game/bag/itemCatalog.ts +18 -0
- package/src/shared/game/bag/items.ts +5 -0
- package/src/shared/game/bag/starter.generated.ts +3 -0
- package/src/shared/game/bag/starterItems.json +62 -0
- package/src/shared/game/boss/arenaAnswers.ts +49 -0
- package/src/shared/game/boss/arenaCollision.ts +16 -0
- package/src/shared/game/boss/arenaGround.ts +121 -0
- package/src/shared/game/boss/arenaPortal.ts +63 -0
- package/src/shared/game/boss/arenaRoomRows.ts +403 -0
- package/src/shared/game/boss/arenaWhirls.ts +88 -0
- package/src/shared/game/boss/jointTargets.ts +41 -0
- package/src/shared/game/boss/lane.ts +62 -0
- package/src/shared/game/boss/openArenaFight.ts +644 -0
- package/src/shared/game/boss/patrolLaw.ts +136 -0
- package/src/shared/game/boss/slotLaw.ts +173 -0
- package/src/shared/game/boss/wake.ts +60 -0
- package/src/shared/game/compendium/finds.ts +49 -0
- package/src/shared/game/compendium/registry.ts +28 -0
- package/src/shared/game/compendium/rules.ts +136 -0
- package/src/shared/game/compendium/state.ts +23 -0
- package/src/shared/game/compendium/tracker.ts +138 -0
- package/src/shared/game/compendium/types.ts +115 -0
- package/src/shared/game/eliteSystem.ts +349 -0
- package/src/shared/game/grapple/course.ts +14 -0
- package/src/shared/game/grapple/feed.ts +27 -0
- package/src/shared/game/grapple/sim.ts +352 -0
- package/src/shared/game/grid/allocator.ts +479 -0
- package/src/shared/game/grid/assembly.ts +73 -0
- package/src/shared/game/grid/catalogue.ts +197 -0
- package/src/shared/game/grid/catalogueDocument.ts +6 -0
- package/src/shared/game/grid/catalogueSlot.ts +53 -0
- package/src/shared/game/grid/cellEvents.ts +37 -0
- package/src/shared/game/grid/collisionStrips.ts +18 -0
- package/src/shared/game/grid/compiledStrips.ts +282 -0
- package/src/shared/game/grid/continuations.ts +43 -0
- package/src/shared/game/grid/crossing.ts +143 -0
- package/src/shared/game/grid/edgeProfiles.ts +31 -0
- package/src/shared/game/grid/farProxy.ts +302 -0
- package/src/shared/game/grid/ghosts.ts +42 -0
- package/src/shared/game/grid/gridAssetBytes.ts +59 -0
- package/src/shared/game/grid/gridCollision.ts +37 -0
- package/src/shared/game/grid/instances.ts +9 -0
- package/src/shared/game/grid/pageMode.ts +32 -0
- package/src/shared/game/grid/platformInputs.ts +11 -0
- package/src/shared/game/grid/postPairs.ts +40 -0
- package/src/shared/game/grid/readinessEdges.ts +13 -0
- package/src/shared/game/grid/recovery.ts +221 -0
- package/src/shared/game/grid/roadLayout.ts +169 -0
- package/src/shared/game/grid/roadRecovery.ts +99 -0
- package/src/shared/game/grid/rules.ts +45 -0
- package/src/shared/game/grid/runtimeCheckpoint.ts +58 -0
- package/src/shared/game/grid/seamData.ts +74 -0
- package/src/shared/game/grid/seamGeometry.ts +219 -0
- package/src/shared/game/grid/singleplayer.json +701 -0
- package/src/shared/game/grid/travellerCombat.ts +34 -0
- package/src/shared/game/grid/wallet.ts +104 -0
- package/src/shared/game/harvest.ts +16 -0
- package/src/shared/game/instanceSaves.ts +14 -0
- package/src/shared/game/inventoryLaw.ts +131 -0
- package/src/shared/game/ledger.ts +188 -0
- package/src/shared/game/loadout/itemCatalogue.ts +44 -0
- package/src/shared/game/loadout/persistence.ts +20 -0
- package/src/shared/game/loadout/pouch.ts +46 -0
- package/src/shared/game/localSaveKeys.ts +9 -0
- package/src/shared/game/looks/dayClock.ts +112 -0
- package/src/shared/game/looks/dayLookPresets.ts +75 -0
- package/src/shared/game/looks/keyedSkyClock.ts +15 -0
- package/src/shared/game/loot/Bounty.ts +49 -0
- package/src/shared/game/loot/Owned.ts +112 -0
- package/src/shared/game/loot/Purse.ts +94 -0
- package/src/shared/game/loot/coinAmounts.ts +17 -0
- package/src/shared/game/loot/coinBurstState.ts +23 -0
- package/src/shared/game/loot/deaths.ts +14 -0
- package/src/shared/game/loot/exchange.ts +71 -0
- package/src/shared/game/loot/ownedRows.ts +24 -0
- package/src/shared/game/loot/tableRows.ts +11 -0
- package/src/shared/game/newGame.ts +56 -0
- package/src/shared/game/plugin/animation.ts +618 -0
- package/src/shared/game/plugin/bodyBoss.ts +119 -0
- package/src/shared/game/plugin/borrowed.ts +62 -0
- package/src/shared/game/plugin/bossRecord.ts +28 -0
- package/src/shared/game/plugin/channelPrograms.ts +307 -0
- package/src/shared/game/plugin/channels.ts +355 -0
- package/src/shared/game/plugin/creatureFrame.ts +46 -0
- package/src/shared/game/plugin/director.ts +435 -0
- package/src/shared/game/plugin/moduleHash.ts +49 -0
- package/src/shared/game/plugin/quests.ts +450 -0
- package/src/shared/game/plugin/runtimeRows.ts +288 -0
- package/src/shared/game/population/census.ts +67 -0
- package/src/shared/game/population/groupNotices.ts +34 -0
- package/src/shared/game/population/pageHomes.ts +125 -0
- package/src/shared/game/population/pageRows.ts +20 -0
- package/src/shared/game/population/perchRoot.ts +17 -0
- package/src/shared/game/population/respawn.ts +89 -0
- package/src/shared/game/population/returnProgram.ts +448 -0
- package/src/shared/game/population/returnProjectionV2.ts +203 -0
- package/src/shared/game/population/wildlifeOwner.ts +20 -0
- package/src/shared/game/quest/boundState.ts +55 -0
- package/src/shared/game/quest/carriedRound.ts +59 -0
- package/src/shared/game/quest/chapterBindings.ts +64 -0
- package/src/shared/game/quest/chapterClock.ts +56 -0
- package/src/shared/game/quest/chapterDecision.ts +31 -0
- package/src/shared/game/quest/chapterFlow.ts +54 -0
- package/src/shared/game/quest/chapterLeads.ts +10 -0
- package/src/shared/game/quest/contractBoard.ts +108 -0
- package/src/shared/game/quest/contracts.ts +145 -0
- package/src/shared/game/quest/declared.ts +152 -0
- package/src/shared/game/quest/effectPresentation.ts +23 -0
- package/src/shared/game/quest/effects.ts +61 -0
- package/src/shared/game/quest/eliteDecisions.ts +123 -0
- package/src/shared/game/quest/eliteStreams.ts +7 -0
- package/src/shared/game/quest/featCounters.ts +41 -0
- package/src/shared/game/quest/flagGates.ts +103 -0
- package/src/shared/game/quest/interactionRows.ts +214 -0
- package/src/shared/game/quest/ledger.ts +23 -0
- package/src/shared/game/quest/legacyRecords.ts +17 -0
- package/src/shared/game/quest/nativeProps.ts +117 -0
- package/src/shared/game/quest/pagePersistence.ts +91 -0
- package/src/shared/game/quest/pageReads.ts +39 -0
- package/src/shared/game/quest/pageResources.ts +19 -0
- package/src/shared/game/quest/pageState.ts +66 -0
- package/src/shared/game/quest/persistence.ts +110 -0
- package/src/shared/game/quest/questObservation.ts +50 -0
- package/src/shared/game/quest/steps.ts +116 -0
- package/src/shared/game/quest/storyLaw.ts +17 -0
- package/src/shared/game/riding/bindingTypes.ts +43 -0
- package/src/shared/game/riding/companions.ts +135 -0
- package/src/shared/game/riding/entered.ts +21 -0
- package/src/shared/game/riding/pagePopulation.ts +28 -0
- package/src/shared/game/riding/pastureCues.ts +24 -0
- package/src/shared/game/riding/physics.ts +691 -0
- package/src/shared/game/riding/presentation.ts +27 -0
- package/src/shared/game/riding/taming.ts +164 -0
- package/src/shared/game/rng.merge.d.ts +10 -0
- package/src/shared/game/saves.ts +90 -0
- package/src/shared/game/shard/api.ts +2 -0
- package/src/shared/game/shard/declaredRows.ts +121 -0
- package/src/shared/game/shard/enteredServices.ts +14 -0
- package/src/shared/game/shard/runtime.ts +90 -0
- package/src/shared/game/shard/slug.ts +9 -0
- package/src/shared/game/shard/terrainBake.ts +12 -0
- package/src/shared/game/shardfile/aimTargetFilter.ts +12 -0
- package/src/shared/game/shardfile/bakedPlacementPoses.ts +25 -0
- package/src/shared/game/shardfile/buildingDoor.ts +52 -0
- package/src/shared/game/shardfile/clientGround.ts +86 -0
- package/src/shared/game/shardfile/clientState.ts +133 -0
- package/src/shared/game/shardfile/collisionBindings.ts +31 -0
- package/src/shared/game/shardfile/contentHash.ts +7 -0
- package/src/shared/game/shardfile/crowdRuntime.ts +254 -0
- package/src/shared/game/shardfile/customSchema.ts +57 -0
- package/src/shared/game/shardfile/dataCreaturePorts.ts +239 -0
- package/src/shared/game/shardfile/entryOwners.ts +153 -0
- package/src/shared/game/shardfile/fileInputs.ts +21 -0
- package/src/shared/game/shardfile/identity.ts +18 -0
- package/src/shared/game/shardfile/items.ts +180 -0
- package/src/shared/game/shardfile/ktx2Targets.ts +62 -0
- package/src/shared/game/shardfile/ladder.ts +137 -0
- package/src/shared/game/shardfile/liftRider.ts +62 -0
- package/src/shared/game/shardfile/logicalState.ts +57 -0
- package/src/shared/game/shardfile/movers.ts +14 -0
- package/src/shared/game/shardfile/namedJsonChecks.ts +12 -0
- package/src/shared/game/shardfile/outputChecksNode.ts +11 -0
- package/src/shared/game/shardfile/outputDescriptor.ts +317 -0
- package/src/shared/game/shardfile/outputIndexChecks.ts +8 -0
- package/src/shared/game/shardfile/packReads.ts +93 -0
- package/src/shared/game/shardfile/playArea.ts +42 -0
- package/src/shared/game/shardfile/portalRide.ts +170 -0
- package/src/shared/game/shardfile/portalTraversal.ts +49 -0
- package/src/shared/game/shardfile/productData.ts +22 -0
- package/src/shared/game/shardfile/props.ts +11 -0
- package/src/shared/game/shardfile/resourceRole.ts +14 -0
- package/src/shared/game/shardfile/runtimeState.ts +69 -0
- package/src/shared/game/shardfile/schemaReferences.ts +33 -0
- package/src/shared/game/shardfile/scriptNotice.ts +38 -0
- package/src/shared/game/shardfile/serverPack.ts +23 -0
- package/src/shared/game/shardfile/shardProduct.ts +206 -0
- package/src/shared/game/shardfile/spawnManifest.ts +126 -0
- package/src/shared/game/shardfile/talks.ts +22 -0
- package/src/shared/game/shardfile/targets.ts +11 -0
- package/src/shared/game/shardfile/tileOrder.ts +64 -0
- package/src/shared/game/shardfile/walkInPortalRide.ts +160 -0
- package/src/shared/game/shardfile/wholeInputs.ts +18 -0
- package/src/shared/game/shardfile/wirePrompts.ts +35 -0
- package/src/shared/game/shardfile/worldActionsV2.ts +113 -0
- package/src/shared/game/shardfile/worldTargets.ts +71 -0
- package/src/shared/game/stealth/stealthLaw.ts +120 -0
- package/src/shared/game/strings.ts +88 -0
- package/src/shared/game/systems/cellField.ts +144 -0
- package/src/shared/game/systems/effects/starterEffects.ts +20 -0
- package/src/shared/game/systems/effects/starterRows.json +98 -0
- package/src/shared/game/systems/looks/grassField.ts +249 -0
- package/src/shared/game/systems/looks/trampleField.ts +263 -0
- package/src/shared/game/weapons/heldBowBase.ts +15 -0
- package/src/shared/game/weapons/heldDecision.ts +20 -0
- package/src/shared/game/weapons/javelinFlight.ts +139 -0
- package/src/shared/game/weapons/launcherSpring.ts +11 -0
- package/src/shared/game/weapons/mountedPass.ts +70 -0
- package/src/shared/game/weapons/polearmContact.ts +73 -0
- package/src/shared/game/weapons/polearmDecision.ts +152 -0
- package/src/shared/game/weapons/starter.generated.ts +2 -0
- package/src/shared/game/weapons/starterBow.json +21 -0
- package/src/shared/game/weapons/starterBowProfile.ts +17 -0
- package/src/shared/game/weapons/starterCombat.ts +19 -0
- package/src/shared/game/weapons/starterGlyphs.ts +9 -0
- package/src/shared/game/weapons/starterMeleeProfile.ts +67 -0
- package/src/shared/game/weapons/starterMoves.ts +101 -0
- package/src/shared/game/weather/feed.ts +57 -0
- package/src/shared/health.ts +10 -0
- package/src/shared/host/author.ts +14 -0
- package/src/shared/host/formatJsonSchema.ts +1114 -0
- package/src/shared/host/headlessJourney.ts +152 -0
- package/src/shared/host/headlessObservation.ts +16 -0
- package/src/shared/host/headlessSections.ts +18 -0
- package/src/shared/host/headlessTape.ts +99 -0
- package/src/shared/host/headlessTapeParts.ts +35 -0
- package/src/shared/host/immutable.ts +14 -0
- package/src/shared/host/releaseRows.ts +23 -0
- package/src/shared/host/shardfile.ts +23 -0
- package/src/shared/host/standalone/harnessPlace.ts +23 -0
- package/src/shared/host/standalone/heldReads.ts +45 -0
- package/src/shared/host/standalone/netInput.ts +112 -0
- package/src/shared/host/standalone/workerLoopback.ts +51 -0
- package/src/shared/host/tickProtocol.ts +246 -0
- package/src/shared/side.ts +2 -0
- package/src/test/engine/FakeGame.ts +123 -0
- package/src/test/engine/creatureStride.ts +29 -0
- package/src/test/engine/declarationConsumer.ts +24 -0
- package/src/test/engine/linkedGl.ts +7 -0
- package/src/test/engine/manager.ts +58 -0
- package/src/test/engine/nativeBytes.ts +5 -0
- package/src/test/engine/netLoopback.ts +64 -0
- package/src/test/engine/realGc.ts +34 -0
- package/src/test/engine/terrain.ts +32 -0
- package/src/test/engine/textureUploadRenderer.ts +34 -0
- package/src/test/engine/weaponParity.ts +119 -0
- package/src/test/engine/world.ts +48 -0
- package/src/test/game/creatureRecipe.ts +11 -0
- package/src/test/helpers/git.ts +94 -0
- package/src/test/tsconfig.app.json +28 -0
- package/src/test/tsconfig.engine.json +27 -0
- package/src/test/tsconfig.game.json +28 -0
- package/src/test/tsconfig.host.json +27 -0
- package/src/tools/build-web.ts +58 -0
- package/src/tsconfig.json +39 -0
- package/tsconfig.app.json +32 -0
- package/tsconfig.engine.json +22 -0
- package/tsconfig.game.json +34 -0
- package/tsconfig.host.json +33 -0
- package/tsconfig.json +54 -0
- package/tsconfig.layers.json +35 -0
- package/types/format-standards.d.ts +19 -0
- package/vite/rapier.ts +35 -0
- package/README.md +0 -8
|
@@ -0,0 +1,1325 @@
|
|
|
1
|
+
import { sha256 } from '../../../shared/game/plugin/moduleHash';
|
|
2
|
+
import { emitFault } from '@wildshard/engine/core/faults';
|
|
3
|
+
import { BorrowedDecisionSchema, type BorrowedDecision } from '@wildshard/format/decisionScripts';
|
|
4
|
+
import type { CombatTag } from '@wildshard/engine/combat/pipeline';
|
|
5
|
+
import { CreatureBrain } from '@wildshard/engine/ai/CreatureBrain';
|
|
6
|
+
import { StalkerBrain } from "@wildshard/engine/ai/stalker";
|
|
7
|
+
import { HURT_ARC, type HuntBody, type HuntGround, type HuntNav, type HuntConfig, type HuntSpecies } from "@wildshard/engine/ai/hunt";
|
|
8
|
+
import { bindPlayerImpulse } from '../../../shared/game/shardfile/dataCreaturePorts';
|
|
9
|
+
import type { AnimalSimSpec, AnimalSim } from "@wildshard/engine/entities/AnimalSim";
|
|
10
|
+
import type { SimStrike, SimValue, SimHost } from "@wildshard/engine/sim";
|
|
11
|
+
import { type StrikeSpec, StrikeRunner, type StrikeContext } from "@wildshard/engine/ai/strikes";
|
|
12
|
+
import type { ShardRows } from "@wildshard/format/rows";
|
|
13
|
+
import { parseScriptSpecies, type ScriptSpeciesSchema, type ScriptSpeciesData } from "@wildshard/format/speciesScripts";
|
|
14
|
+
import { parseEliteScript, type EliteScriptData } from "@wildshard/format/eliteScripts";
|
|
15
|
+
import * as v from "valibot";
|
|
16
|
+
import { ScriptHost, type ScriptSnapshot } from "@wildshard/engine/script/host";
|
|
17
|
+
import { SCRIPT_PARAMETER_QUERY } from '@wildshard/format/scriptAbi';
|
|
18
|
+
import { ScriptWorld, SCRIPT_OP, type EffectTransaction, type ScriptEffect } from "@wildshard/engine/script/effects";
|
|
19
|
+
import { readStrikeState } from "@wildshard/engine/ai/strikeState";
|
|
20
|
+
import { Vector3 } from "three";
|
|
21
|
+
import type { SpeciesRow } from "@wildshard/engine/ai/species";
|
|
22
|
+
import type { Animal } from "@wildshard/engine/entities/AnimalView";
|
|
23
|
+
import type { ThinkCtx } from "@wildshard/engine/entities/species/registry";
|
|
24
|
+
import { SkirmisherBrain, type SkirmisherPorts } from "@wildshard/engine/ai/skirmisher";
|
|
25
|
+
import { GuardianBrain, type GuardianPorts } from "@wildshard/engine/ai/guardian";
|
|
26
|
+
import { PerchHunterBrain } from "@wildshard/engine/ai/perchHunter";
|
|
27
|
+
import { strikeFromData, type StrikeData } from "@wildshard/engine/ai/strikeRows";
|
|
28
|
+
import { RamGrazerBrain } from "@wildshard/engine/ai/ramGrazer";
|
|
29
|
+
import { OrbitDiverBrain } from "@wildshard/engine/ai/orbitDiver";
|
|
30
|
+
import { BurstFlyerBrain } from "@wildshard/engine/ai/burstFlyer";
|
|
31
|
+
import { ChallengeGrazerBrain } from "@wildshard/engine/ai/challengeGrazer";
|
|
32
|
+
import { PatrolDiverBrain } from "@wildshard/engine/ai/patrolDiver";
|
|
33
|
+
import { CreatureBodyRecipeSchema, CreatureHomeSchema, CreatureStrikeSchema, type CreatureBodyRecipe, type CreatureMemoryActions } from "@wildshard/format/creatures";
|
|
34
|
+
import { canReach } from "@wildshard/engine/ai/reach";
|
|
35
|
+
import type { SimSnapshot } from "@wildshard/engine/sim/snapshot";
|
|
36
|
+
import { parseGrazer, grazerPreset, type GrazerSchema, parseChallengeGrazer, type ChallengeGrazerSchema, type ShardChallengeGrazer, type ShardRamGrazer } from "@wildshard/format/grazers";
|
|
37
|
+
import { parseDiver, diverPreset, type DiverSchema, parsePatrolDiver, type PatrolDiverSchema, type ShardPatrolDiver, type ShardOrbitDiver, type ShardBurstFlyer } from "@wildshard/format/flyers";
|
|
38
|
+
import { creatureFloor, installHomeKeeper, type HomeKeeperSpec, type KeptBossBody, type KeptHome, type KeptPolicy } from "../shardfile/homeKeeper";
|
|
39
|
+
import { type StalkerSchema, parseStalker, stalkerPreset, type GuardianPatternsSchema, guardianPreset, parseGuardianPattern, parseSkirmisher, parseGuardian, parsePerchHunter, type SkirmisherSchema, type GuardianSchema, type PerchHunterSchema, type ShardSkirmisher, type ShardGuardian, type ShardPerchHunter } from "@wildshard/format/brains";
|
|
40
|
+
|
|
41
|
+
type Rng = ReturnType<SimHost['rng']['stream']>;
|
|
42
|
+
|
|
43
|
+
/** Plain actor-memory gates for ordered body-step effects; clocks and saved fields remain actor-owned. */
|
|
44
|
+
export interface MemoryActionRows {
|
|
45
|
+
readonly stateKey: string; readonly states: readonly string[];
|
|
46
|
+
readonly cadence?: 'body' | 'decision';
|
|
47
|
+
readonly actions: readonly {
|
|
48
|
+
readonly state: number; readonly phase: number; readonly effect: string;
|
|
49
|
+
readonly once: { readonly key: string; readonly value: number; readonly test: 'falsy' | 'not-value' };
|
|
50
|
+
readonly when?: { readonly key: string; readonly test: 'truthy' | 'falsy' };
|
|
51
|
+
}[];
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Bind an existing decision to inspectable states and preflighted, ordered memory-action gates.
|
|
56
|
+
* A due action claims its existing once field before the borrowed effect, including misses and throws.
|
|
57
|
+
* This owns no clock, random stream, contact solver or save envelope; act may run before the first think.
|
|
58
|
+
*/
|
|
59
|
+
export function createMemoryActionBrain<A extends AnimalSim, C>(actor: A, rows: MemoryActionRows, ports: {
|
|
60
|
+
readonly decide: (actor: A, context: C) => void;
|
|
61
|
+
readonly effects: ReadonlyMap<string, (actor: A, context: C) => void>;
|
|
62
|
+
readonly beforeAct?: (actor: A, context: C) => void;
|
|
63
|
+
readonly threshold?: (actor: A, context: C, phase: number) => number;
|
|
64
|
+
}): CreatureBrain<string, A, C> & { snapshot: () => boolean; restore: (value: unknown) => void } {
|
|
65
|
+
const validKey = (key: string): boolean => /^[a-zA-Z][a-zA-Z0-9._-]{0,63}$/u.test(key)
|
|
66
|
+
&& key !== 'constructor' && key !== 'prototype' && key !== '__proto__';
|
|
67
|
+
if (!validKey(rows.stateKey) || rows.states.length === 0 || rows.states.length > 32
|
|
68
|
+
|| new Set(rows.states).size !== rows.states.length || rows.states.some(state => !validKey(state)) || rows.actions.length > 16
|
|
69
|
+
|| (rows.cadence !== undefined && !['body', 'decision'].includes(rows.cadence))) throw new Error('Invalid memory-action states');
|
|
70
|
+
const states = [...rows.states], stateKey = rows.stateKey, decisionStep = rows.cadence === 'decision';
|
|
71
|
+
const actions = rows.actions.map(row => {
|
|
72
|
+
const run = ports.effects.get(row.effect);
|
|
73
|
+
if (!Number.isInteger(row.state) || row.state < 0 || row.state >= states.length || !Number.isFinite(row.phase) || row.phase < 0 || row.phase > 1
|
|
74
|
+
|| !validKey(row.once.key) || !Number.isFinite(row.once.value) || !['falsy', 'not-value'].includes(row.once.test)
|
|
75
|
+
|| (row.when !== undefined && (!validKey(row.when.key) || !['truthy', 'falsy'].includes(row.when.test))) || run === undefined) throw new Error('Invalid or unbound memory action');
|
|
76
|
+
return { ...row, once: { ...row.once }, when: row.when === undefined ? undefined : { ...row.when }, run };
|
|
77
|
+
});
|
|
78
|
+
class BoundMemoryBrain extends CreatureBrain<string, A, C> {
|
|
79
|
+
private pending = false;
|
|
80
|
+
private badThresholds: Set<(typeof actions)[number]> | undefined;
|
|
81
|
+
override think(context: C): void {
|
|
82
|
+
ports.decide(actor, context);
|
|
83
|
+
this.pending = decisionStep;
|
|
84
|
+
const state = states[actor.mem[stateKey] ?? 0];
|
|
85
|
+
if (state !== undefined) this.transition(state);
|
|
86
|
+
}
|
|
87
|
+
override act(context: C): void {
|
|
88
|
+
ports.beforeAct?.(actor, context);
|
|
89
|
+
if (decisionStep) { if (!this.pending) return; this.pending = false; }
|
|
90
|
+
const phase = actor.attackPhase;
|
|
91
|
+
if (phase < 0) return;
|
|
92
|
+
for (const action of actions) {
|
|
93
|
+
if (actor.mem[stateKey] !== action.state) continue;
|
|
94
|
+
const threshold = ports.threshold?.(actor, context, action.phase) ?? action.phase;
|
|
95
|
+
if (!Number.isFinite(threshold) || threshold < 0 || threshold > 1) {
|
|
96
|
+
const reported = this.badThresholds ??= new Set();
|
|
97
|
+
if (!reported.has(action)) {
|
|
98
|
+
reported.add(action);
|
|
99
|
+
emitFault({system: 'ai.memory-action', error: new Error(`Invalid memory-action threshold: ${action.effect}`), verdict: 'retry'});
|
|
100
|
+
}
|
|
101
|
+
continue;
|
|
102
|
+
}
|
|
103
|
+
if (!(phase >= threshold)) continue;
|
|
104
|
+
if (action.when !== undefined && Boolean(actor.mem[action.when.key]) !== (action.when.test === 'truthy')) continue;
|
|
105
|
+
const once = actor.mem[action.once.key];
|
|
106
|
+
if (action.once.test === 'falsy' ? Boolean(once) : once === action.once.value) continue;
|
|
107
|
+
actor.mem[action.once.key] = action.once.value;
|
|
108
|
+
action.run(actor, context);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
snapshot(): boolean { return this.pending; }
|
|
112
|
+
restore(value: unknown): void { if (typeof value !== 'boolean') throw new Error('Invalid memory-action continuation'); this.pending = value; }
|
|
113
|
+
}
|
|
114
|
+
return new BoundMemoryBrain(actor, states);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/** An authored creature pose, without behaviour, RNG or a save owner. */
|
|
118
|
+
export interface CreatureSpawnRow {
|
|
119
|
+
readonly kind: string; readonly x: number; readonly z: number; readonly yaw: number;
|
|
120
|
+
readonly variant?: string | null;
|
|
121
|
+
}
|
|
122
|
+
/** Ordered manager-owned creature materialization and retirement. */
|
|
123
|
+
export interface CreatureSpawner<A> {
|
|
124
|
+
spawn: (kind: string, x: number, z: number, yaw: number, variant?: string) => A;
|
|
125
|
+
group: <R extends CreatureSpawnRow>(kind: string, at: { readonly x: number; readonly z: number }, rows: readonly R[], joined?: (actor: A, row: R) => void) => A[];
|
|
126
|
+
place: <R extends CreatureSpawnRow & { readonly herd: number }>(centres: readonly { readonly x: number; readonly z: number }[], kinds: readonly string[], rows: readonly R[],
|
|
127
|
+
joined?: (actor: A, row: R) => void, grouped?: (kind: string, index: number) => void) => void;
|
|
128
|
+
dispose: () => void;
|
|
129
|
+
/** G598: `dispose` one retired actor a step (a sliced retirement); `dispose` drains it */
|
|
130
|
+
retireSteps: () => Generator<undefined, void>;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Materialize authored creature groups in order through the caller's actual manager.
|
|
135
|
+
* Owns only spawned actor retirement and herd membership; placement RNG, effects and saves stay borrowed.
|
|
136
|
+
* Group batches preflight all centres and row membership before their first spawn.
|
|
137
|
+
*/
|
|
138
|
+
export function createCreatureSpawner<A extends { herd: number }>(ports: {
|
|
139
|
+
spawn: (kind: string, x: number, z: number, yaw: number, variant?: string) => A;
|
|
140
|
+
retire: (actor: A) => void;
|
|
141
|
+
addHerd: (kind: string, x: number, z: number) => number;
|
|
142
|
+
readonly herds: readonly { readonly members: A[] }[];
|
|
143
|
+
}): CreatureSpawner<A> {
|
|
144
|
+
interface Point { readonly x: number; readonly z: number }
|
|
145
|
+
const owned = new Set<A>(); let disposed = false;
|
|
146
|
+
const validPoint = (at: Point): boolean => Number.isFinite(at.x) && Number.isFinite(at.z);
|
|
147
|
+
const validRow = (row: CreatureSpawnRow): boolean => row.kind.length > 0 && validPoint(row) && Number.isFinite(row.yaw);
|
|
148
|
+
const spawn = (kind: string, x: number, z: number, yaw: number, variant?: string): A => {
|
|
149
|
+
if (disposed) throw new Error('Creature spawner is disposed');
|
|
150
|
+
const actor = ports.spawn(kind, x, z, yaw, variant); owned.add(actor); return actor;
|
|
151
|
+
};
|
|
152
|
+
const group = <R extends CreatureSpawnRow>(kind: string, at: Point, rows: readonly R[], joined?: (actor: A, row: R) => void): A[] => {
|
|
153
|
+
if (disposed || kind.length === 0 || !validPoint(at) || rows.length > 1024 || rows.some(row => row.kind !== kind || !validRow(row))) throw new Error('Invalid creature group');
|
|
154
|
+
const herd = ports.addHerd(kind, at.x, at.z), members = ports.herds[herd]?.members;
|
|
155
|
+
if (!Number.isSafeInteger(herd) || herd < 0 || members === undefined) throw new Error('Unbound creature herd');
|
|
156
|
+
const actors: A[] = [];
|
|
157
|
+
for (const row of rows) {
|
|
158
|
+
const actor = spawn(row.kind, row.x, row.z, row.yaw, row.variant ?? undefined);
|
|
159
|
+
actor.herd = herd; members.push(actor); actors.push(actor); joined?.(actor, row);
|
|
160
|
+
}
|
|
161
|
+
return actors;
|
|
162
|
+
};
|
|
163
|
+
const place = <R extends CreatureSpawnRow & { readonly herd: number }>(centres: readonly Point[], kinds: readonly string[], rows: readonly R[],
|
|
164
|
+
joined?: (actor: A, row: R) => void, grouped?: (kind: string, index: number) => void): void => {
|
|
165
|
+
if (disposed || centres.length > 1024 || rows.length > 1024 || centres.length !== kinds.length
|
|
166
|
+
|| centres.some((at, i) => !validPoint(at) || !kinds[i])
|
|
167
|
+
|| rows.some(row => !validRow(row) || !Number.isSafeInteger(row.herd) || row.herd < -1 || row.herd >= centres.length
|
|
168
|
+
|| (row.herd >= 0 && row.kind !== kinds[row.herd]))) throw new Error('Invalid creature placement');
|
|
169
|
+
for (const [index, at] of centres.entries()) {
|
|
170
|
+
const kind = kinds[index]; if (kind === undefined) throw new Error('Missing creature herd kind');
|
|
171
|
+
group(kind, at, rows.filter(row => row.herd === index), joined); grouped?.(kind, index);
|
|
172
|
+
}
|
|
173
|
+
};
|
|
174
|
+
function* retireSteps(): Generator<undefined, void> {
|
|
175
|
+
if (disposed) return;
|
|
176
|
+
disposed = true;
|
|
177
|
+
for (const actor of owned) { owned.delete(actor); ports.retire(actor); yield; }
|
|
178
|
+
}
|
|
179
|
+
const dispose = (): void => { const steps = retireSteps(); while (steps.next().done !== true) { /* every actor at once */ } };
|
|
180
|
+
return { spawn, group, place, dispose, retireSteps };
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/** Bounded radial or indexed creature placement over an existing stream and ground owner. A radial source draws a math
|
|
184
|
+
* angle (x = cos, z = sin) or a compass bearing (x = sin, z = cos), scaled per axis for an elliptical region. */
|
|
185
|
+
export interface CreatureGroupSpec<K extends string = string> {
|
|
186
|
+
readonly kind: K; readonly count: number; readonly herd: number; readonly variant: string | null;
|
|
187
|
+
readonly firstVariant?: string | null; readonly variants?: readonly (string | null)[];
|
|
188
|
+
/** a fixed yaw, or a point every sample faces; omitted, each yaw is a draw after its point */
|
|
189
|
+
readonly yaw?: number; readonly face?: { readonly x: number; readonly z: number };
|
|
190
|
+
readonly source: { readonly kind: 'indexed'; readonly points: readonly { readonly x: number; readonly z: number }[] }
|
|
191
|
+
| { readonly kind: 'radial'; readonly centre: { readonly x: number; readonly z: number }; readonly radius: readonly [number, number];
|
|
192
|
+
readonly axes?: readonly [number, number]; readonly bearing?: 'math' | 'compass';
|
|
193
|
+
readonly firstAtCentre?: boolean; readonly radiusLaw?: 'linear' | 'area'; readonly attempts?: number; readonly fallback?: 'skip' | 'centre' };
|
|
194
|
+
/** Data rejection of a candidate: outside a distance band to a point, inside a clear circle, past a square bound
|
|
195
|
+
* (|x| or |z|), or ground below `minHeight` (read through the ground owner). */
|
|
196
|
+
readonly accept?: {
|
|
197
|
+
readonly band?: { readonly x: number; readonly z: number; readonly min: number; readonly max: number };
|
|
198
|
+
readonly clear?: readonly { readonly x: number; readonly z: number; readonly r: number }[];
|
|
199
|
+
readonly bound?: number; readonly minHeight?: number;
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
/** Generated pose rows retain their authored kind, variant and herd; materialization remains borrowed. */
|
|
203
|
+
export interface CreatureGroupSample<K extends string = string> { readonly kind: K; readonly variant: string | null; readonly herd: number; readonly x: number; readonly z: number; readonly yaw: number }
|
|
204
|
+
/** The engine services a group samples through: the caller's random stream and its ground (what `accept.minHeight` reads). */
|
|
205
|
+
export type CreatureGroupStream = Pick<Rng, 'next'>;
|
|
206
|
+
export type CreatureGroupGround = Pick<HuntGround, 'heightAt'>;
|
|
207
|
+
/** Sample in order from the caller's stream; rejection precedes yaw. */
|
|
208
|
+
export function sampleCreatureGroup<K extends string>(row: CreatureGroupSpec<K>, rng: CreatureGroupStream, ground?: CreatureGroupGround): CreatureGroupSample<K>[] {
|
|
209
|
+
const point = (p: { readonly x: number; readonly z: number }): boolean => Number.isFinite(p.x) && Number.isFinite(p.z);
|
|
210
|
+
const variant = (value: string | null): boolean => value === null || value.length > 0 && value.length <= 128;
|
|
211
|
+
const gate = row.accept, band = gate?.band, clear = gate?.clear ?? [], bound = gate?.bound, minHeight = gate?.minHeight;
|
|
212
|
+
if (!row.kind || row.kind.length > 128 || !Number.isSafeInteger(row.count) || row.count < 0 || row.count > 16 || !Number.isSafeInteger(row.herd) || row.herd < -1
|
|
213
|
+
|| !variant(row.variant) || row.firstVariant !== undefined && !variant(row.firstVariant) || row.yaw !== undefined && !Number.isFinite(row.yaw)
|
|
214
|
+
|| row.face !== undefined && (row.yaw !== undefined || !point(row.face))
|
|
215
|
+
|| row.variants !== undefined && (row.variants.length !== row.count || row.variants.some(value => !variant(value)))
|
|
216
|
+
|| band !== undefined && (!point(band) || !Number.isFinite(band.min) || !Number.isFinite(band.max) || band.min < 0 || band.max < band.min)
|
|
217
|
+
|| clear.length > 16 || clear.some(c => !point(c) || !Number.isFinite(c.r) || c.r < 0)
|
|
218
|
+
|| bound !== undefined && !(bound > 0) || minHeight !== undefined && (!Number.isFinite(minHeight) || ground === undefined)) throw new Error('Invalid creature sampling group');
|
|
219
|
+
const source = row.source;
|
|
220
|
+
let attempts = 1, ax = 1, az = 1, compass = false;
|
|
221
|
+
switch (source.kind) {
|
|
222
|
+
case 'indexed':
|
|
223
|
+
if (source.points.length > 1024 || source.points.length < row.count || source.points.some(p => !point(p))) throw new Error('Invalid indexed creature group');
|
|
224
|
+
break;
|
|
225
|
+
case 'radial':
|
|
226
|
+
attempts = source.attempts ?? 1; [ax, az] = source.axes ?? [1, 1]; compass = source.bearing === 'compass';
|
|
227
|
+
if (!point(source.centre) || !Number.isFinite(source.radius[0]) || !Number.isFinite(source.radius[1]) || source.radius[0] < 0 || source.radius[1] < source.radius[0]
|
|
228
|
+
|| !Number.isSafeInteger(attempts) || attempts < 1 || attempts > 40 || !['linear', 'area'].includes(source.radiusLaw ?? 'linear')
|
|
229
|
+
|| !['skip', 'centre'].includes(source.fallback ?? 'skip') || source.radiusLaw === 'area' && source.radius[0] !== 0
|
|
230
|
+
|| !['math', 'compass'].includes(source.bearing ?? 'math') || !Number.isFinite(ax) || !Number.isFinite(az) || !(ax > 0) || !(az > 0)) throw new Error('Invalid radial creature group');
|
|
231
|
+
break;
|
|
232
|
+
default: throw new Error('Unknown creature sampling source');
|
|
233
|
+
}
|
|
234
|
+
const accepts = (x: number, z: number): boolean => {
|
|
235
|
+
if (band !== undefined) { const d = Math.hypot(x - band.x, z - band.z); if (d < band.min || d > band.max) return false; }
|
|
236
|
+
for (const c of clear) if (Math.hypot(x - c.x, z - c.z) < c.r) return false;
|
|
237
|
+
if (bound !== undefined && (Math.abs(x) > bound || Math.abs(z) > bound)) return false;
|
|
238
|
+
return minHeight === undefined || ground === undefined || !(ground.heightAt(x, z) < minHeight);
|
|
239
|
+
};
|
|
240
|
+
const samples: CreatureGroupSample<K>[] = [];
|
|
241
|
+
for (let index = 0; index < 16; index++) {
|
|
242
|
+
if (index >= row.count) break;
|
|
243
|
+
let x = 0, z = 0, accepted = false;
|
|
244
|
+
for (let attempt = 0; attempt < 40; attempt++) {
|
|
245
|
+
if (attempt >= attempts) break;
|
|
246
|
+
if (source.kind === 'indexed') {
|
|
247
|
+
const p = source.points[index]; if (p === undefined) throw new Error('Missing indexed creature point'); x = p.x; z = p.z;
|
|
248
|
+
} else {
|
|
249
|
+
const [r0, r1] = source.radius, angle = Math.PI * 2 * rng.next();
|
|
250
|
+
const radius = source.firstAtCentre === true && index === 0 && attempt === 0 ? 0 : source.radiusLaw === 'area' ? Math.sqrt(rng.next()) * r1 : r0 + (r1 - r0) * rng.next();
|
|
251
|
+
x = source.centre.x + (compass ? Math.sin(angle) : Math.cos(angle)) * ax * radius;
|
|
252
|
+
z = source.centre.z + (compass ? Math.cos(angle) : Math.sin(angle)) * az * radius;
|
|
253
|
+
}
|
|
254
|
+
if (!Number.isFinite(x) || !Number.isFinite(z)) throw new Error('Invalid sampled creature point');
|
|
255
|
+
if (accepts(x, z)) { accepted = true; break; }
|
|
256
|
+
}
|
|
257
|
+
if (!accepted) { if (source.kind !== 'radial' || source.fallback !== 'centre') continue; x = source.centre.x; z = source.centre.z; }
|
|
258
|
+
const yaw = row.face !== undefined ? Math.atan2(row.face.x - x, row.face.z - z) : row.yaw ?? Math.PI * 2 * rng.next();
|
|
259
|
+
if (!Number.isFinite(yaw)) throw new Error('Invalid sampled creature yaw');
|
|
260
|
+
samples.push({ kind: row.kind, variant: row.variants === undefined ? index === 0 && row.firstVariant !== undefined ? row.firstVariant : row.variant : row.variants[index] ?? null, x, z, yaw, herd: row.herd });
|
|
261
|
+
}
|
|
262
|
+
return samples;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
/**
|
|
266
|
+
* Rank at most 1024 borrowed sites, keeping source order on tied scores. Range admission precedes the caller's
|
|
267
|
+
* score callback; greedy spacing follows ranking. Null rejects a site. No random stream or actor is owned here.
|
|
268
|
+
*/
|
|
269
|
+
export function selectCreatureSites<T extends { readonly x: number; readonly z: number } | { readonly position: { readonly x: number; readonly z: number } }>(sites: readonly T[],
|
|
270
|
+
options: { readonly count: number; readonly origin?: { readonly x: number; readonly z: number }; readonly minDistance?: number; readonly maxDistance?: number; readonly separation?: number },
|
|
271
|
+
score: (site: T, index: number, distance: number) => number | null): { readonly site: T; readonly index: number }[] {
|
|
272
|
+
const point = (site: T): { readonly x: number; readonly z: number } => 'position' in site ? site.position : site;
|
|
273
|
+
const min = options.minDistance ?? 0, max = options.maxDistance ?? Infinity, gap = options.separation ?? 0, origin = options.origin;
|
|
274
|
+
if (sites.length > 1024 || !Number.isSafeInteger(options.count) || options.count < 0 || options.count > 16
|
|
275
|
+
|| !Number.isFinite(min) || min < 0 || (options.maxDistance !== undefined && !Number.isFinite(max)) || max < min || !Number.isFinite(gap) || gap < 0
|
|
276
|
+
|| (origin === undefined && (options.minDistance !== undefined || options.maxDistance !== undefined))
|
|
277
|
+
|| (origin !== undefined && (!Number.isFinite(origin.x) || !Number.isFinite(origin.z)))
|
|
278
|
+
|| sites.some(site => { const p = point(site); return !Number.isFinite(p.x) || !Number.isFinite(p.z); })) throw new RangeError('Invalid creature site selection');
|
|
279
|
+
const ranked: { site: T; index: number; score: number }[] = [];
|
|
280
|
+
for (let i = 0; i < 1024; i++) {
|
|
281
|
+
const site = sites[i]; if (site === undefined) break;
|
|
282
|
+
const p = point(site), distance = origin === undefined ? 0 : Math.hypot(p.x - origin.x, p.z - origin.z);
|
|
283
|
+
if (distance < min || distance > max) continue;
|
|
284
|
+
const value = score(site, i, distance);
|
|
285
|
+
if (value === null) continue;
|
|
286
|
+
if (!Number.isFinite(value)) throw new RangeError('Invalid creature site score');
|
|
287
|
+
ranked.push({ site, index: i, score: value });
|
|
288
|
+
}
|
|
289
|
+
ranked.sort((a, b) => b.score - a.score || a.index - b.index);
|
|
290
|
+
const selected: { site: T; index: number }[] = [];
|
|
291
|
+
for (let i = 0; i < 1024 && selected.length < options.count; i++) {
|
|
292
|
+
const row = ranked[i]; if (row === undefined) break;
|
|
293
|
+
const p = point(row.site);
|
|
294
|
+
if (selected.some(other => { const q = point(other.site); return Math.hypot(q.x - p.x, q.z - p.z) < gap; })) continue;
|
|
295
|
+
selected.push({ site: row.site, index: row.index });
|
|
296
|
+
}
|
|
297
|
+
return selected;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
/** Resolve both species and variant, preserving authored health and gameplay multipliers. */
|
|
301
|
+
export function speciesResolver(rows: ShardRows): (speciesId: string, variantId: string) => AnimalSimSpec {
|
|
302
|
+
const catalogue = new Map(rows.species.map((row) => [row.id, row]));
|
|
303
|
+
return (speciesId, variantId) => {
|
|
304
|
+
const row = catalogue.get(speciesId), selected = row?.variants.find((variantRow) => variantRow.id === variantId);
|
|
305
|
+
if (row === undefined || selected === undefined) throw new Error('Unresolved declared species/variant');
|
|
306
|
+
return { kind: row.kind, label: selected.label, variant: selected.id, rarity: selected.rarity, hp: selected.hp, aggressive: row.aggressive, lockable: row.lockable,
|
|
307
|
+
dims: { ...row.dims, feet: row.dims.feet.map(([x, z]) => [x, z]) }, mods: { ...selected.mods }, ...(row.flight === undefined ? {} : { flight: { ...row.flight } }) };
|
|
308
|
+
};
|
|
309
|
+
}
|
|
310
|
+
/** Numeric strike rows feed the authoritative sim without a score callback. */
|
|
311
|
+
export function simStrikes(rows: ShardRows): ReadonlyMap<string, SimStrike> {
|
|
312
|
+
return new Map(rows.strikes.map(({ weight: _weight, speed, ...row }) => [row.id, { ...row, motion: { speed } }]));
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
/**
|
|
316
|
+
* Admitted AssemblyScript species brains (SHARD-PLATFORM SF27): a species row's `brain: { archetype: 'script', data }`
|
|
317
|
+
* names a module the game admits on its own ScriptHost under the unchanged ABI-v0 fuel, memory, event, query and failure
|
|
318
|
+
* ceilings (as the shard directors and the weapon hooks). Each decision is a pure call: the module's memory and globals
|
|
319
|
+
* return to their admitted state after it, and the creature's state lives in the host as declared numeric slots, so a
|
|
320
|
+
* policy's continuation is its slots and its strike clock, never module memory.
|
|
321
|
+
*
|
|
322
|
+
* The call's input slots (f64): 0 the call's tick, 1 dt, 2 the phase (1 think, 2 act), 3 the module's entity, 4 alive,
|
|
323
|
+
* 5 calm, 6 the clock, 7 the horizontal distance to the player, 8 the yaw toward the player, 9-10 the player's x z,
|
|
324
|
+
* 11-12 the actor's x z, 13 its yaw, 14 its seed hash (`seedHash`), 15 its strike phase (0 idle, 1 windup, 2 active,
|
|
325
|
+
* 3 recover, 4 cooldown), 16 strike busy, 17… its `slots` in order, then its declared `memory` fields' values. The
|
|
326
|
+
* answer is field records on the entity — 1… the new slots, 21… new memory values, 31-33 a steer (yaw, speed, turn rate,
|
|
327
|
+
* speed and turn within the declared bounds) — and at most one declared strike event (trigonometry goes through the math
|
|
328
|
+
* query, `SPECIES_MATH_QUERY`, so it matches the host's Math exactly): the host then asks reach, then an
|
|
329
|
+
* attack token, then picks the strike from the declared catalogue (the trusted StrikeRunner owns windup, contact, damage
|
|
330
|
+
* and cooldown). A trap, a fuel overrun or an undeclared record refuses the call (the body stands still that step).
|
|
331
|
+
*/
|
|
332
|
+
|
|
333
|
+
/**
|
|
334
|
+
* The math query (kind 1): `[op, kx, x, ky, y, 0, 0, 0]` answers `[f(kx * 8192 + x, ky * 8192 + y)]` with the host's own
|
|
335
|
+
* Math (op 1 sin, 2 cos, 3 atan2), so a module's trigonometry is bit-identical to the TypeScript policies' in every
|
|
336
|
+
* client; a large argument is split into an exact multiple of 8192 and a remainder, inside the query's ±10,000 inputs.
|
|
337
|
+
*/
|
|
338
|
+
export const SPECIES_MATH_QUERY = 1;
|
|
339
|
+
/** The math query's answer for one request (`SPECIES_MATH_QUERY`). */
|
|
340
|
+
export function speciesMath(request: readonly number[]): number {
|
|
341
|
+
const [op, kx = 0, x = 0, ky = 0, y = 0] = request, a = kx * 8192 + x, b = ky * 8192 + y;
|
|
342
|
+
if (op === 1) return Math.sin(a);
|
|
343
|
+
if (op === 2) return Math.cos(a);
|
|
344
|
+
if (op === 3) return Math.atan2(a, b);
|
|
345
|
+
throw new Error('Unknown species math operation');
|
|
346
|
+
}
|
|
347
|
+
/** The phase selector in input slot 2. */
|
|
348
|
+
export const SPECIES_SCRIPT_PHASE: Readonly<{ think: 1; act: 2; }> = Object.freeze({ think: 1, act: 2 });
|
|
349
|
+
const speciesScriptsENTITY = 1, speciesScriptsSLOT = 1, MEMORY = 21, STEER = 31, INPUT_SLOTS = 17;
|
|
350
|
+
const PHASES = ['idle', 'windup', 'active', 'recover', 'cooldown'] as const;
|
|
351
|
+
|
|
352
|
+
/** A module's bytes from the base64 its bake wrote (a trusted runtime imports them as data, so admission stays synchronous). */
|
|
353
|
+
export function moduleBytes(base64: string): Uint8Array { return Uint8Array.from(atob(base64), char => char.codePointAt(0) ?? 0); }
|
|
354
|
+
/** A stable per-actor hash of its seed (an integer below 43,759): `seedHash(seed) % n` is its slot of n. */
|
|
355
|
+
export function seedHash(seed: number): number { return Math.floor(Math.abs(Math.sin(seed * 12.9898 + 1.7) * 43758.5)); }
|
|
356
|
+
|
|
357
|
+
class SpeciesScriptWorld extends ScriptWorld {
|
|
358
|
+
private readonly data: ScriptSpeciesData;
|
|
359
|
+
constructor(data: ScriptSpeciesData) {
|
|
360
|
+
const fields: Record<number, readonly [number, number]> = { [STEER]: [-1000, 1000], [STEER + 1]: [0, data.maxSpeed], [STEER + 2]: [0, data.maxTurnRate] };
|
|
361
|
+
data.slots.forEach((_, i) => { fields[speciesScriptsSLOT + i] = [-1e9, 1e9]; });
|
|
362
|
+
data.memory.forEach((_, i) => { fields[MEMORY + i] = [-1e6, 1e6]; });
|
|
363
|
+
super({ fields, archetypes: [], events: data.strikes.map(s => s.event), maxEntities: 1 },
|
|
364
|
+
[{ id: speciesScriptsENTITY, name: data.id, position: [0, 0, 0], fields: {}, frozen: false, interactive: true }]);
|
|
365
|
+
this.data = data;
|
|
366
|
+
}
|
|
367
|
+
override prepare(effects: readonly ScriptEffect[], self: number, spawns: number, events: number): EffectTransaction {
|
|
368
|
+
if (self !== speciesScriptsENTITY || effects.filter(e => e.op === SCRIPT_OP.event).length > 1
|
|
369
|
+
|| effects.some(e => (e.op !== SCRIPT_OP.field && e.op !== SCRIPT_OP.event) || (e.op === SCRIPT_OP.event && !this.data.strikes.some(s => s.event === e.a)))) throw new Error('Invalid species script answer');
|
|
370
|
+
return super.prepare(effects, self, spawns, events);
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
/** One call's decoded answer. */
|
|
375
|
+
export interface SpeciesScriptAnswer { readonly slots: ReadonlyMap<number, number>; readonly memory: ReadonlyMap<number, number>; readonly steer: readonly [number, number, number] | null; readonly strike: string | null }
|
|
376
|
+
|
|
377
|
+
/** One admitted species module: `decide(phase, observations)` answers one pure call. */
|
|
378
|
+
export class SpeciesScriptLane {
|
|
379
|
+
readonly data: ScriptSpeciesData;
|
|
380
|
+
private readonly host: ScriptHost;
|
|
381
|
+
private readonly admitted: ScriptSnapshot;
|
|
382
|
+
private tick = 0;
|
|
383
|
+
constructor(data: ScriptSpeciesData, bytes: Uint8Array) {
|
|
384
|
+
this.data = parseScriptSpecies(data);
|
|
385
|
+
if (sha256(bytes) !== this.data.module) throw new Error('Species script module hash mismatch');
|
|
386
|
+
this.host = new ScriptHost({ world: new SpeciesScriptWorld(this.data), query: (kind, request, self) => {
|
|
387
|
+
if (self !== speciesScriptsENTITY || request.length !== 8) throw new Error('Species scripts query as their entity');
|
|
388
|
+
if (kind === SPECIES_MATH_QUERY) return [speciesMath(request)];
|
|
389
|
+
if (kind !== SCRIPT_PARAMETER_QUERY || request.some(value => value !== 0)) throw new Error('Species scripts query only their parameters and the math query');
|
|
390
|
+
return [...this.data.parameters];
|
|
391
|
+
} });
|
|
392
|
+
this.host.install(this.data.module, Uint8Array.from(bytes));
|
|
393
|
+
this.admitted = this.host.snapshot(this.data.module);
|
|
394
|
+
}
|
|
395
|
+
/** Calls made so far (each is its own script tick). */
|
|
396
|
+
get calls(): number { return this.tick; }
|
|
397
|
+
/** One pure call; null when the module refused it (a trap, fuel, an undeclared record). */
|
|
398
|
+
decide(phase: number, observations: readonly number[]): SpeciesScriptAnswer | null {
|
|
399
|
+
this.host.beginTick(++this.tick);
|
|
400
|
+
const call = this.host.call(this.data.module, speciesScriptsENTITY, [this.tick, ...observations.slice(1)]);
|
|
401
|
+
if (call.ok) this.host.rewind(this.data.module, this.admitted);
|
|
402
|
+
else { if (!call.disabled) this.host.resume(this.data.module, speciesScriptsENTITY); return null; }
|
|
403
|
+
const slots = new Map<number, number>(), memory = new Map<number, number>(), steer: number[] = [];
|
|
404
|
+
let strike: string | null = null;
|
|
405
|
+
for (const effect of call.effects) {
|
|
406
|
+
if (effect.op === SCRIPT_OP.event) { strike = this.data.strikes.find(s => s.event === effect.a)?.strike ?? null; continue; }
|
|
407
|
+
if (effect.a >= STEER) steer[effect.a - STEER] = effect.b;
|
|
408
|
+
else if (effect.a >= MEMORY) memory.set(effect.a - MEMORY, effect.b);
|
|
409
|
+
else slots.set(effect.a - speciesScriptsSLOT, effect.b);
|
|
410
|
+
}
|
|
411
|
+
const [yaw, speed, turn] = steer;
|
|
412
|
+
if (phase !== SPECIES_SCRIPT_PHASE.think && phase !== SPECIES_SCRIPT_PHASE.act) throw new Error('Unknown species script phase');
|
|
413
|
+
return { slots, memory, strike, steer: yaw === undefined || speed === undefined || turn === undefined ? null : [yaw, speed, turn] };
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
/** What a script species policy observes (the browser's ThinkCtx and the headless HomeObservation both satisfy it). */
|
|
418
|
+
export interface ScriptSpeciesPorts<A extends AnimalSim> {
|
|
419
|
+
dt: number; t: number; player: A['position']; calm: boolean;
|
|
420
|
+
reach: (actor: A) => boolean; claim: (actor: A) => boolean; hurt: (damage: number) => void;
|
|
421
|
+
steer: (actor: A, yaw: number, speed: number, turn: number) => void;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
const speciesScriptsSaved = v.strictObject({ version: v.literal(1), actor: v.string(), slots: v.array(v.pipe(v.number(), v.finite())), strikes: v.unknown() });
|
|
425
|
+
|
|
426
|
+
/** Existing player contact authority; no callback is authored by a species row. */
|
|
427
|
+
export interface SpeciesContactPorts<A extends AnimalSim> {
|
|
428
|
+
readonly player: A['position']; reach: (actor: A) => boolean; hurt: (damage: number) => void;
|
|
429
|
+
}
|
|
430
|
+
/** Cached actual-body contact packet shared by script and memory-action policies. */
|
|
431
|
+
class SpeciesContact<A extends AnimalSim> {
|
|
432
|
+
private ports: SpeciesContactPorts<A> | null = null;
|
|
433
|
+
private readonly packet: { actor: A; target: A['position']; canReach: () => boolean; hit: (spec: StrikeSpec) => void };
|
|
434
|
+
constructor(actor: A) {
|
|
435
|
+
this.packet = { actor, target: actor.position, canReach: () => this.ports?.reach(actor) === true,
|
|
436
|
+
hit: spec => { this.ports?.hurt(spec.damage); } };
|
|
437
|
+
}
|
|
438
|
+
context(ports: SpeciesContactPorts<A>): StrikeContext {
|
|
439
|
+
this.ports = ports; this.packet.target = ports.player; return this.packet;
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
/** One body's script policy: its slots, its strike clock and the shared admitted lane. */
|
|
444
|
+
export class ScriptSpeciesPolicy<A extends AnimalSim> {
|
|
445
|
+
private readonly actor: A;
|
|
446
|
+
private readonly lane: SpeciesScriptLane;
|
|
447
|
+
private readonly catalogue: readonly StrikeSpec[];
|
|
448
|
+
private readonly strikes = new StrikeRunner();
|
|
449
|
+
private readonly slots: number[];
|
|
450
|
+
private readonly input: number[];
|
|
451
|
+
private readonly contact: SpeciesContact<A>;
|
|
452
|
+
constructor(actor: A, lane: SpeciesScriptLane, catalogue: readonly StrikeSpec[]) {
|
|
453
|
+
this.actor = actor; this.lane = lane; this.catalogue = catalogue;
|
|
454
|
+
this.slots = [...lane.data.slots]; this.input = Array.from({ length: INPUT_SLOTS + this.slots.length + lane.data.memory.length }, () => 0);
|
|
455
|
+
for (const row of lane.data.memory) actor.mem[row.field] = row.initial;
|
|
456
|
+
this.contact = new SpeciesContact(actor);
|
|
457
|
+
}
|
|
458
|
+
/** The policy's current slot values (a witness; the continuation is `snapshot`). */
|
|
459
|
+
get state(): readonly number[] { return this.slots; }
|
|
460
|
+
private context(ports: ScriptSpeciesPorts<A>): StrikeContext { return this.contact.context(ports); }
|
|
461
|
+
private call(phase: number, ports: ScriptSpeciesPorts<A>): void {
|
|
462
|
+
const a = this.actor, input = this.input, dx = ports.player.x - a.position.x, dz = ports.player.z - a.position.z;
|
|
463
|
+
input[1] = ports.dt; input[2] = phase; input[4] = a.alive ? 1 : 0; input[5] = ports.calm ? 1 : 0; input[6] = ports.t;
|
|
464
|
+
input[7] = Math.hypot(dx, dz); input[8] = Math.atan2(dx, dz); input[9] = ports.player.x; input[10] = ports.player.z;
|
|
465
|
+
input[11] = a.position.x; input[12] = a.position.z; input[13] = a.yaw; input[14] = seedHash(a.seed);
|
|
466
|
+
input[15] = PHASES.indexOf(this.strikes.state); input[16] = this.strikes.busy ? 1 : 0;
|
|
467
|
+
this.slots.forEach((value, i) => { input[INPUT_SLOTS + i] = value; });
|
|
468
|
+
this.lane.data.memory.forEach((row, i) => { input[INPUT_SLOTS + this.slots.length + i] = a.mem[row.field] ?? 0; });
|
|
469
|
+
const answer = this.lane.decide(phase, input);
|
|
470
|
+
if (answer === null) { ports.steer(a, a.yaw, 0, 0); return; }
|
|
471
|
+
answer.slots.forEach((value, i) => { if (i < this.slots.length) this.slots[i] = value; });
|
|
472
|
+
answer.memory.forEach((value, i) => { const row = this.lane.data.memory[i]; if (row !== undefined) a.mem[row.field] = value; });
|
|
473
|
+
if (answer.steer !== null) ports.steer(a, answer.steer[0], answer.steer[1], answer.steer[2]);
|
|
474
|
+
if (answer.strike !== null && !this.strikes.busy && ports.reach(a) && ports.claim(a)) {
|
|
475
|
+
const pick = this.strikes.pick(this.catalogue, this.context(ports)); if (pick) this.strikes.start(pick, a, ports.player);
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
/** A decision (the module's think phase). */
|
|
479
|
+
think(ports: ScriptSpeciesPorts<A>): void { this.call(SPECIES_SCRIPT_PHASE.think, ports); }
|
|
480
|
+
/** A movement step: the strike clock advances while alive, then the module's act phase. */
|
|
481
|
+
act(ports: ScriptSpeciesPorts<A>): void {
|
|
482
|
+
if (this.actor.alive) this.strikes.update(ports.dt, this.context(ports));
|
|
483
|
+
this.call(SPECIES_SCRIPT_PHASE.act, ports);
|
|
484
|
+
}
|
|
485
|
+
/** Complete continuation: the slots and the strike clock; no decision, motion or strike runs on restore. */
|
|
486
|
+
snapshot(): SimValue { return JSON.stringify({ version: 1, actor: this.actor.entityId, slots: this.slots, strikes: this.strikes.snapshot() }); }
|
|
487
|
+
restore(input: SimValue): void {
|
|
488
|
+
if (typeof input !== 'string') throw new Error('Invalid script species continuation');
|
|
489
|
+
const parsed: unknown = JSON.parse(input), value = v.parse(speciesScriptsSaved, parsed);
|
|
490
|
+
if (value.actor !== this.actor.entityId || value.slots.length !== this.slots.length) throw new Error('Incompatible script species continuation');
|
|
491
|
+
this.strikes.restore(readStrikeState(value.strikes, this.catalogue), this.catalogue);
|
|
492
|
+
value.slots.forEach((slot, i) => { this.slots[i] = slot; });
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
|
|
497
|
+
/**
|
|
498
|
+
* Admitted AssemblyScript elite fight scripts (SHARD-PLATFORM SF27): a named elite's fight — the moves it picks, its clocks
|
|
499
|
+
* and its tells — is a module the game admits on its own ScriptHost under the unchanged ABI-v0 ceilings (as the species
|
|
500
|
+
* scripts, the directors and the weapon hooks). The game's elite rules (lair, aware / engaged / leash, phase 2, respawn) and
|
|
501
|
+
* the trusted strike runners stay the host's; each engaged step is one pure call (the module returns to its admitted memory
|
|
502
|
+
* after it) whose state lives in the host as declared numeric `slots`, so the elite's continuation is its slots.
|
|
503
|
+
*
|
|
504
|
+
* The call's inputs (f64): 0 the call's tick, 1 dt, 2 the clock, 3 the module's entity, 4 the elite's mode (its index in
|
|
505
|
+
* `modes`), 5 the mode's seconds, 6 phase 2, 7 the horizontal distance and 8 the yaw to the player, 9-10 the player's x z,
|
|
506
|
+
* 11-12 the body's x z, 13 its seed, 14 its last hit time (never under -1e9), 15 god mode, 16-18 lane 0's state (0 none,
|
|
507
|
+
* 1 tell, 2 run, 3 skid), clock and busy, 19-20 two shard-defined host values, 21… the slots in order. Before the call, the
|
|
508
|
+
* ring tell's clock moves to the frame's, then a lane whose `lanes` row names the current mode steps on the body clock (its
|
|
509
|
+
* hit hurts the player, then shakes by `trauma`).
|
|
510
|
+
*
|
|
511
|
+
* The answer is an ordered command stream: field records 1… are the new slots, 41-42 two argument registers, and each
|
|
512
|
+
* event is one verb applied in order with its value and the registers (`ELITE_VERB`). Trigonometry and hypot go through
|
|
513
|
+
* the math query (kind 1: op 1 sin, 2 cos, 3 atan2, 4 hypot on the host's Math), so a module matches the TypeScript goal
|
|
514
|
+
* it replaces bit for bit; kind 2 draws the elite's own seeded stream. A trap, a fuel overrun or an undeclared record
|
|
515
|
+
* refuses the call (the body stands still that step).
|
|
516
|
+
*/
|
|
517
|
+
|
|
518
|
+
/** The verbs an elite script's events name (event id → verb). */
|
|
519
|
+
export const ELITE_VERB: Readonly<{
|
|
520
|
+
/** value: the new mode's index (its clock restarts) */
|
|
521
|
+
mode: 1;
|
|
522
|
+
/** value: yaw; registers: speed, turn rate (inside the declared bounds) */
|
|
523
|
+
steer: 2;
|
|
524
|
+
/** value: look weight; registers: the target's height over the player, 1 to aim at the player (0 keeps the target) */
|
|
525
|
+
look: 3;
|
|
526
|
+
/** value: the voice's index */
|
|
527
|
+
voice: 4;
|
|
528
|
+
/** the elite's signature flash */
|
|
529
|
+
signature: 5;
|
|
530
|
+
/** value: the lane; registers: tell seconds, speed multiplier (aimed through the player) */
|
|
531
|
+
lane: 6;
|
|
532
|
+
/** value: the contact's index */
|
|
533
|
+
contact: 7;
|
|
534
|
+
/** value: the shake */
|
|
535
|
+
trauma: 8;
|
|
536
|
+
/** value: the body's attack seconds */
|
|
537
|
+
attack: 9;
|
|
538
|
+
/** value: the ring tell's radius round the body; register: its opacity */
|
|
539
|
+
ring: 10;
|
|
540
|
+
/** the ring tell off */
|
|
541
|
+
ringHide: 11;
|
|
542
|
+
/** value: the shard action's index */
|
|
543
|
+
action: 12; }> = Object.freeze({
|
|
544
|
+
/** value: the new mode's index (its clock restarts) */
|
|
545
|
+
mode: 1,
|
|
546
|
+
/** value: yaw; registers: speed, turn rate (inside the declared bounds) */
|
|
547
|
+
steer: 2,
|
|
548
|
+
/** value: look weight; registers: the target's height over the player, 1 to aim at the player (0 keeps the target) */
|
|
549
|
+
look: 3,
|
|
550
|
+
/** value: the voice's index */
|
|
551
|
+
voice: 4,
|
|
552
|
+
/** the elite's signature flash */
|
|
553
|
+
signature: 5,
|
|
554
|
+
/** value: the lane; registers: tell seconds, speed multiplier (aimed through the player) */
|
|
555
|
+
lane: 6,
|
|
556
|
+
/** value: the contact's index */
|
|
557
|
+
contact: 7,
|
|
558
|
+
/** value: the shake */
|
|
559
|
+
trauma: 8,
|
|
560
|
+
/** value: the body's attack seconds */
|
|
561
|
+
attack: 9,
|
|
562
|
+
/** value: the ring tell's radius round the body; register: its opacity */
|
|
563
|
+
ring: 10,
|
|
564
|
+
/** the ring tell off */
|
|
565
|
+
ringHide: 11,
|
|
566
|
+
/** value: the shard action's index */
|
|
567
|
+
action: 12,
|
|
568
|
+
});
|
|
569
|
+
const VERBS: readonly number[] = Object.values(ELITE_VERB);
|
|
570
|
+
/** The random query (kind 2): one draw of the elite's own seeded stream. */
|
|
571
|
+
export const ELITE_RANDOM_QUERY = 2;
|
|
572
|
+
const eliteScriptsENTITY = 1, eliteScriptsSLOT = 1, ARG = 41, SLOTS_AT = 21;
|
|
573
|
+
const HYPOT = 4;
|
|
574
|
+
|
|
575
|
+
/** The math query's answer: the species math ops plus 4, hypot (`Math.hypot(a, b)`). */
|
|
576
|
+
export function eliteMath(request: readonly number[]): number {
|
|
577
|
+
const [op, kx = 0, x = 0, ky = 0, y = 0] = request;
|
|
578
|
+
return op === HYPOT ? Math.hypot(kx * 8192 + x, ky * 8192 + y) : speciesMath(request);
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
class EliteScriptWorld extends ScriptWorld {
|
|
582
|
+
private readonly slotCount: number;
|
|
583
|
+
constructor(data: EliteScriptData) {
|
|
584
|
+
const fields: Record<number, readonly [number, number]> = { [ARG]: [-1e9, 1e9], [ARG + 1]: [-1e9, 1e9] };
|
|
585
|
+
data.slots.forEach((_, i) => { fields[eliteScriptsSLOT + i] = [-1e9, 1e9]; });
|
|
586
|
+
super({ fields, archetypes: [], events: [...VERBS], maxEntities: 1 },
|
|
587
|
+
[{ id: eliteScriptsENTITY, name: data.id, position: [0, 0, 0], fields: {}, frozen: false, interactive: true }]);
|
|
588
|
+
this.slotCount = data.slots.length;
|
|
589
|
+
}
|
|
590
|
+
override prepare(effects: readonly ScriptEffect[], self: number, spawns: number, events: number): EffectTransaction {
|
|
591
|
+
if (self !== eliteScriptsENTITY || effects.some(e => (e.op !== SCRIPT_OP.field && e.op !== SCRIPT_OP.event)
|
|
592
|
+
|| (e.op === SCRIPT_OP.field && e.a > this.slotCount && e.a !== ARG && e.a !== ARG + 1))) throw new Error('Invalid elite script answer');
|
|
593
|
+
return super.prepare(effects, self, spawns, events);
|
|
594
|
+
}
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
/** One verb of an answer, with its value and the argument registers as they stood. */
|
|
598
|
+
export interface EliteCommand { readonly verb: number; readonly value: number; readonly args: readonly [number, number] }
|
|
599
|
+
|
|
600
|
+
/** One admitted elite module over one elite's slots and seeded stream: `decide(inputs)` answers one pure call. */
|
|
601
|
+
export class EliteScriptLane {
|
|
602
|
+
readonly data: EliteScriptData;
|
|
603
|
+
private readonly host: ScriptHost;
|
|
604
|
+
private readonly admitted: ScriptSnapshot;
|
|
605
|
+
private readonly values: number[];
|
|
606
|
+
private tick = 0;
|
|
607
|
+
constructor(data: EliteScriptData, bytes: Uint8Array, random: () => number) {
|
|
608
|
+
this.data = parseEliteScript(data);
|
|
609
|
+
if (sha256(bytes) !== this.data.module) throw new Error('Elite script module hash mismatch');
|
|
610
|
+
this.values = this.data.slots.map(s => s.initial);
|
|
611
|
+
this.host = new ScriptHost({ world: new EliteScriptWorld(this.data), query: (kind, request, self) => {
|
|
612
|
+
if (self !== eliteScriptsENTITY || request.length !== 8) throw new Error('Elite scripts query as their entity');
|
|
613
|
+
if (kind === SPECIES_MATH_QUERY) return [eliteMath(request)];
|
|
614
|
+
if (kind === ELITE_RANDOM_QUERY && request.every(value => value === 0)) return [random()];
|
|
615
|
+
if (kind !== SCRIPT_PARAMETER_QUERY || request.some(value => value !== 0)) throw new Error('Elite scripts query only their parameters, the math and their stream');
|
|
616
|
+
return [...this.data.parameters];
|
|
617
|
+
} });
|
|
618
|
+
this.host.install(this.data.module, Uint8Array.from(bytes));
|
|
619
|
+
this.admitted = this.host.snapshot(this.data.module);
|
|
620
|
+
}
|
|
621
|
+
/** A slot's value by its declared field. */
|
|
622
|
+
slot(field: string): number {
|
|
623
|
+
const i = this.data.slots.findIndex(s => s.field === field), value = this.values[i];
|
|
624
|
+
if (value === undefined) throw new Error(`Elite script ${this.data.id} has no slot ${field}`);
|
|
625
|
+
return value;
|
|
626
|
+
}
|
|
627
|
+
/** Set a slot (a restore, a dev move). */
|
|
628
|
+
setSlot(field: string, value: number): void {
|
|
629
|
+
const i = this.data.slots.findIndex(s => s.field === field);
|
|
630
|
+
if (i === -1 || !Number.isFinite(value)) throw new Error(`Elite script ${this.data.id} cannot set ${field}`);
|
|
631
|
+
this.values[i] = value;
|
|
632
|
+
}
|
|
633
|
+
/** One pure call over inputs 1-20 (`observations[0]` and [3] are the host's); null when the module refused it. */
|
|
634
|
+
decide(observations: readonly number[]): readonly EliteCommand[] | null {
|
|
635
|
+
this.host.beginTick(++this.tick);
|
|
636
|
+
const input = observations.slice(0, SLOTS_AT);
|
|
637
|
+
input[0] = this.tick; input.push(...this.values);
|
|
638
|
+
const call = this.host.call(this.data.module, eliteScriptsENTITY, input);
|
|
639
|
+
if (call.ok) this.host.rewind(this.data.module, this.admitted);
|
|
640
|
+
else { if (!call.disabled) this.host.resume(this.data.module, eliteScriptsENTITY); return null; }
|
|
641
|
+
const out: EliteCommand[] = [], args: [number, number] = [0, 0];
|
|
642
|
+
for (const effect of call.effects) {
|
|
643
|
+
if (effect.op === SCRIPT_OP.event) { out.push({ verb: effect.a, value: effect.c, args: [args[0], args[1]] }); continue; }
|
|
644
|
+
if (effect.a === ARG) args[0] = effect.b;
|
|
645
|
+
else if (effect.a === ARG + 1) args[1] = effect.b;
|
|
646
|
+
else this.values[effect.a - eliteScriptsSLOT] = effect.b;
|
|
647
|
+
}
|
|
648
|
+
return out;
|
|
649
|
+
}
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
|
|
653
|
+
|
|
654
|
+
/**
|
|
655
|
+
* A species row's declared brain (SHARD-PLATFORM SF27): a platform archetype and its data, resolved the same way by the
|
|
656
|
+
* browser client (`SpeciesBrains.bind`) and the headless host (`installSpeciesHomes`). A challenge grazer's circling
|
|
657
|
+
* phase is the actor seed's slot in `[0, phaseSlots)` (`seedSlot`), so a pack spreads round its home. A `decision` brain lends its body
|
|
658
|
+
* to an admitted guest while the existing encounter owns its memory marks.
|
|
659
|
+
*/
|
|
660
|
+
export type SpeciesBrain =
|
|
661
|
+
| { readonly archetype: 'grazer'; readonly data: Extract<v.InferInput<typeof GrazerSchema>, { pattern: 'wander-ram' }> }
|
|
662
|
+
| { readonly archetype: 'grazer'; readonly data: Extract<v.InferInput<typeof GrazerSchema>, { pattern: 'circle-challenge' }>; readonly phaseSlots: number }
|
|
663
|
+
| { readonly archetype: 'diver'; readonly data: v.InferInput<typeof DiverSchema> }
|
|
664
|
+
| { readonly archetype: 'decision'; readonly data: BorrowedDecision }
|
|
665
|
+
| { readonly archetype: 'challenge-grazer'; readonly data: v.InferInput<typeof ChallengeGrazerSchema>; readonly phaseSlots: number }
|
|
666
|
+
| { readonly archetype: 'patrol-diver'; readonly data: v.InferInput<typeof PatrolDiverSchema> }
|
|
667
|
+
| { readonly archetype: 'script'; readonly data: v.InferInput<typeof ScriptSpeciesSchema> }
|
|
668
|
+
| { readonly archetype: 'stalker'; readonly data: v.InferInput<typeof StalkerSchema> }
|
|
669
|
+
| { readonly archetype: 'skirmisher'; readonly data: v.InferInput<typeof SkirmisherSchema> }
|
|
670
|
+
| { readonly archetype: 'guardian'; readonly data: v.InferInput<typeof GuardianSchema> | v.InferInput<typeof GuardianPatternsSchema> }
|
|
671
|
+
| { readonly archetype: 'perch-hunter'; readonly data: v.InferInput<typeof PerchHunterSchema> };
|
|
672
|
+
/** A species' gameplay data with an optional declared brain; a row without one keeps its runtime's own policy. */
|
|
673
|
+
export type BrainedSpecies = Omit<SpeciesRow, 'parent' | 'think' | 'act'> & { readonly brain?: SpeciesBrain; readonly body?: CreatureBodyRecipe };
|
|
674
|
+
|
|
675
|
+
/** Existing grounded observations lent by the page or native species owner. */
|
|
676
|
+
export type SpeciesActionPorts<A extends AnimalSim> = SkirmisherPorts<A> & GuardianPorts<A> & SpeciesContactPorts<A>;
|
|
677
|
+
const actionContact = new StrikeRunner();
|
|
678
|
+
function speciesActions<A extends AnimalSim>(actor: A, brain: Admitted, rows: CreatureMemoryActions,
|
|
679
|
+
strikes: ReadonlyMap<string, StrikeSpec>, existing?: SkirmisherBrain<A> | GuardianBrain<A>): SpeciesPolicy<SpeciesActionPorts<A>> {
|
|
680
|
+
const policy = existing ?? (brain.archetype === 'skirmisher' ? new SkirmisherBrain(actor, brain.data)
|
|
681
|
+
: brain.archetype === 'guardian' ? new GuardianBrain(actor, brain.data) : null);
|
|
682
|
+
if (policy === null) throw new Error('Memory actions require a grounded declared policy');
|
|
683
|
+
const contact = new SpeciesContact(actor);
|
|
684
|
+
const actions = rows.actions.map((row, index) => ({ ...row, effect: String(index) }));
|
|
685
|
+
const effects = new Map(actions.map(row => {
|
|
686
|
+
const base = strikeOf(strikes, row.strike, actor.kind), spec = { ...base, shape: { ...base.shape } };
|
|
687
|
+
return [row.effect, (_body: A, ports: SpeciesActionPorts<A>): void => {
|
|
688
|
+
if (row.damage === 'charge') spec.damage = actor.mods.chargeDamage;
|
|
689
|
+
if (row.radiusScale !== undefined && spec.shape.kind === 'point' && base.shape.kind === 'point')
|
|
690
|
+
spec.shape.radius = base.shape.radius * Math.max(row.radiusScale.minimum, actor.scale * row.radiusScale.factor);
|
|
691
|
+
if (actionContact.contact(spec, contact.context(ports)) && row.sound !== undefined) ports.sound(row.sound);
|
|
692
|
+
}] as const;
|
|
693
|
+
}));
|
|
694
|
+
const bound = createMemoryActionBrain<A, SpeciesActionPorts<A>>(actor, { stateKey: rows.stateKey, states: rows.states, actions },
|
|
695
|
+
{ decide: (_body, ports) => { policy.think(ports); }, effects });
|
|
696
|
+
return { think: ports => { bound.think(ports); }, act: ports => { bound.act(ports); },
|
|
697
|
+
snapshot: () => policy.snapshot(), restore: saved => { policy.restore(saved); } };
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
/** A finite circular home supplied by the actual owning body before its policy initializes. */
|
|
701
|
+
export interface SpeciesBodyHome { readonly x: number; readonly z: number; readonly r: number; readonly y: number }
|
|
702
|
+
/** Resolve each browser body's existing home; this callback never allocates a body or draws random numbers. */
|
|
703
|
+
export type SpeciesBodyHomes = (actor: Animal) => SpeciesBodyHome;
|
|
704
|
+
|
|
705
|
+
/** Native policies require explicit live home/RNG (ram), attack permission/flight (orbit), or flight/player shove (burst), plus reach/claim/hurt. */
|
|
706
|
+
export type SpeciesDecision<A extends AnimalSim> =
|
|
707
|
+
| { readonly archetype: 'ram-grazer'; readonly policy: RamGrazerBrain<A> }
|
|
708
|
+
| { readonly archetype: 'orbit-diver'; readonly policy: OrbitDiverBrain<A> }
|
|
709
|
+
| { readonly archetype: 'burst-flyer'; readonly policy: BurstFlyerBrain<A> }
|
|
710
|
+
| { readonly archetype: 'skirmisher'; readonly policy: SkirmisherBrain<A> }
|
|
711
|
+
| { readonly archetype: 'guardian'; readonly policy: GuardianBrain<A> }
|
|
712
|
+
| { readonly archetype: 'perch-hunter'; readonly policy: PerchHunterBrain<A> };
|
|
713
|
+
/** A trusted browser body adapter, constructed once at the first think/act without advancing policy or RNG.
|
|
714
|
+
* The optional third argument lends that first callback context; subsequent callbacks keep their own live context. */
|
|
715
|
+
export type SpeciesNativeFactory = (actor: Animal, decision: SpeciesDecision<Animal>, firstContext?: ThinkCtx) => {
|
|
716
|
+
think: (context: ThinkCtx) => void; act: (context: ThinkCtx) => void;
|
|
717
|
+
};
|
|
718
|
+
|
|
719
|
+
/** One policy's continuation-bearing surface: decisions, movement, and its exact snapshot / restore. */
|
|
720
|
+
export interface SpeciesPolicy<P> { think: (ports: P) => void; act: (ports: P) => void; snapshot: () => SimValue; restore: (value: SimValue) => void }
|
|
721
|
+
|
|
722
|
+
/**
|
|
723
|
+
* What one home body's policy observes in the headless host, allocated once at its spawn and refreshed each call: the
|
|
724
|
+
* union of every archetype's ports (and a runtime's own policies'), the host's player, attack tokens, reach and contact.
|
|
725
|
+
*/
|
|
726
|
+
export interface HomeObservation {
|
|
727
|
+
dt: number; t: number; player: Vector3; calm: boolean; phaseOffset: number;
|
|
728
|
+
reach: (actor: AnimalSim) => boolean; claim: (actor: AnimalSim) => boolean; hurt: (damage: number) => void;
|
|
729
|
+
steer: (actor: AnimalSim, yaw: number, speed: number, turn: number) => void;
|
|
730
|
+
flight: { steer: (actor: AnimalSim, yaw: number, speed: number, altitude: number, turn: number) => void };
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
type Admitted =
|
|
734
|
+
| { readonly archetype: 'ram-grazer'; readonly data: ShardRamGrazer; readonly strike: StrikeSpec }
|
|
735
|
+
| { readonly archetype: 'orbit-diver'; readonly data: ShardOrbitDiver; readonly strike: StrikeSpec }
|
|
736
|
+
| { readonly archetype: 'burst-flyer'; readonly data: ShardBurstFlyer; readonly strike: StrikeSpec }
|
|
737
|
+
| { readonly archetype: 'challenge-grazer'; readonly data: ShardChallengeGrazer; readonly phaseSlots: number; readonly charge: StrikeSpec; readonly close: StrikeSpec }
|
|
738
|
+
| { readonly archetype: 'patrol-diver'; readonly data: ShardPatrolDiver; readonly strike: StrikeSpec }
|
|
739
|
+
| { readonly archetype: 'decision'; readonly data: BorrowedDecision }
|
|
740
|
+
| { readonly archetype: 'script'; readonly data: ScriptSpeciesData; readonly lane: SpeciesScriptLane; readonly catalogue: readonly StrikeSpec[] }
|
|
741
|
+
| { readonly archetype: 'skirmisher'; readonly data: ShardSkirmisher }
|
|
742
|
+
| { readonly archetype: 'guardian'; readonly data: ShardGuardian }
|
|
743
|
+
| { readonly archetype: 'perch-hunter'; readonly data: ShardPerchHunter };
|
|
744
|
+
|
|
745
|
+
/** A stable small integer per actor (its seed hashed) in `[0, n)`: the slot a pack member takes round a ring. */
|
|
746
|
+
export function seedSlot(seed: number, n: number): number { return Math.floor(Math.abs(Math.sin(seed * 12.9898 + 1.7) * 43758.5)) % n; }
|
|
747
|
+
|
|
748
|
+
/** Ordered browser metadata bindings; held preparation uses the same admitted binding and actual body. */
|
|
749
|
+
export interface SpeciesPageCatalogue {
|
|
750
|
+
readonly rows: readonly SpeciesRow[];
|
|
751
|
+
prepareHeld: (kind: string, actor: Animal) => HeldSpeciesControl | null;
|
|
752
|
+
}
|
|
753
|
+
/** Browser catalogue authority, lent by its existing owner. Actual body homes supersede these fallbacks. */
|
|
754
|
+
export interface SpeciesCataloguePorts { readonly homes?: Readonly<Record<string, SpeciesBodyHome>>; readonly held?: SpeciesHeldPorts; readonly decisions?: SpeciesDecisionAuthority }
|
|
755
|
+
|
|
756
|
+
/** The admitted brains of a species catalogue, by kind: the browser rows, the live witness and the headless policies. */
|
|
757
|
+
export interface SpeciesBrains {
|
|
758
|
+
/** The kinds that run a declared brain. */
|
|
759
|
+
readonly kinds: ReadonlySet<string>;
|
|
760
|
+
/**
|
|
761
|
+
* The browser callbacks of a declared kind: `think` / `act` bound to one policy per animal, spread onto its species
|
|
762
|
+
* row (`{ ...ROW, ...brains.bind(kind) }`). Each call binds a fresh policy table; a kind without a brain refuses.
|
|
763
|
+
*/
|
|
764
|
+
bind: (kind: string, native?: SpeciesNativeFactory, homes?: SpeciesBodyHomes, held?: SpeciesHeldPorts, decisions?: SpeciesDecisionAuthority) => SpeciesBinding;
|
|
765
|
+
/** Bind original metadata in authored order without constructing a body or advancing its policy. */
|
|
766
|
+
catalogue: (rows: readonly SpeciesRow[], ports?: SpeciesCataloguePorts) => SpeciesPageCatalogue;
|
|
767
|
+
/** Lend a browser body's actual finite home before its first decision; no policy or random draw is created. */
|
|
768
|
+
home: (kind: string, actor: Animal, at: SpeciesBodyHome) => void;
|
|
769
|
+
/** The controller prepared by this catalogue's body binding; lookup never advances perception, movement or RNG. */
|
|
770
|
+
held: (kind: string, actor: AnimalSim) => HeldSpeciesControl | null;
|
|
771
|
+
/** Interpret declared body action rows on the actor's existing grounded observations. */
|
|
772
|
+
actions: <A extends AnimalSim>(kind: string, actor: A) => SpeciesPolicy<SpeciesActionPorts<A>> | null;
|
|
773
|
+
/** Construct a decision-only family for a trusted native body adapter; refuses self-contained policy kinds. */
|
|
774
|
+
decision: <A extends AnimalSim>(kind: string, actor: A, home?: SpeciesBodyHome) => SpeciesDecision<A>;
|
|
775
|
+
/** The archetype a live browser animal runs (null when it runs none of these rows' brains). */
|
|
776
|
+
witness: (actor: Animal) => string | null;
|
|
777
|
+
/** A fresh headless policy for one body of a declared kind, or null when the kind declares no brain. */
|
|
778
|
+
policy: (kind: string, actor: AnimalSim) => SpeciesPolicy<HomeObservation> | null;
|
|
779
|
+
/** Bind a declared native recipe to an already-owned body, refusing missing motor, home or attack authority. */
|
|
780
|
+
body: (kind: string, actor: AnimalSim, ports: SpeciesBodyPorts) => KeptPolicy | null;
|
|
781
|
+
/** The headless phase offset of one body (its challenge grazer's seed slot, else 0). */
|
|
782
|
+
phase: (kind: string, actor: AnimalSim) => number;
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
/** Trusted held-body authority supplies player impulses; rows select only admitted numeric recipes. */
|
|
786
|
+
export interface SpeciesHeldPorts { readonly shove: (yaw: number, speed: number, lift: number) => void }
|
|
787
|
+
/** A held encounter drives its existing body, with read-only strike observations for presentation. */
|
|
788
|
+
export interface HeldSpeciesControl {
|
|
789
|
+
phase: number; fighting: boolean; restart: () => void;
|
|
790
|
+
readonly current: StrikeSpec | null; readonly windup: number; readonly aim: number;
|
|
791
|
+
snapshot: () => SimValue; restore: (saved: SimValue) => void;
|
|
792
|
+
|
|
793
|
+
}
|
|
794
|
+
/** Existing contact observations refreshed by the body's actual page/native owner. */
|
|
795
|
+
export type SpeciesDecisionObservation = Pick<SpeciesBodyObservation, 'calm' | 'reach' | 'claim' | 'hurt'> & Partial<Pick<SpeciesBodyObservation, 'shove'>>;
|
|
796
|
+
export interface BorrowedSpeciesControl extends HeldSpeciesControl { observe: (ports: SpeciesDecisionObservation) => void }
|
|
797
|
+
/** Internal game authority; authored rows carry only the admitted selection and numeric recipes. */
|
|
798
|
+
export interface SpeciesDecisionAuthority { bind: (actor: AnimalSim, row: BorrowedDecision, body?: CreatureBodyRecipe) => BorrowedSpeciesControl }
|
|
799
|
+
/** Preparing a held controller constructs it once without advancing perception, movement or a clock. */
|
|
800
|
+
export interface SpeciesBinding extends Required<Pick<SpeciesRow, 'think' | 'act'>> { control?: (actor: Animal) => HeldSpeciesControl }
|
|
801
|
+
|
|
802
|
+
function strikeOf(strikes: ReadonlyMap<string, StrikeSpec>, id: string, kind: string): StrikeSpec {
|
|
803
|
+
const strike = strikes.get(id); if (strike === undefined) throw new Error(`Species ${kind}'s brain names an undeclared strike ${id}`); return strike;
|
|
804
|
+
}
|
|
805
|
+
function admit(brain: SpeciesBrain, kind: string, strikes: ReadonlyMap<string, StrikeSpec>, modules: ReadonlyMap<string, Uint8Array>): Admitted {
|
|
806
|
+
switch (brain.archetype) {
|
|
807
|
+
case 'grazer': {
|
|
808
|
+
const data = grazerPreset(parseGrazer(brain.data));
|
|
809
|
+
if (data.kind === 'ram-grazer') return { archetype: data.kind, data, strike: strikeOf(strikes, data.strike, kind) };
|
|
810
|
+
if (!('phaseSlots' in brain)) throw new Error(`Species ${kind}'s challenge grazer requires phase slots`);
|
|
811
|
+
return admit({ archetype: 'challenge-grazer', data, phaseSlots: brain.phaseSlots }, kind, strikes, modules);
|
|
812
|
+
}
|
|
813
|
+
case 'diver': {
|
|
814
|
+
const data = diverPreset(parseDiver(brain.data));
|
|
815
|
+
if (data.kind === 'orbit-diver') return { archetype: data.kind, data, strike: strikeOf(strikes, data.strike, kind) };
|
|
816
|
+
if (data.kind === 'burst-flyer') return { archetype: data.kind, data, strike: strikeOf(strikes, data.strike, kind) };
|
|
817
|
+
return admit({ archetype: 'patrol-diver', data }, kind, strikes, modules);
|
|
818
|
+
}
|
|
819
|
+
case 'stalker': return { archetype: 'skirmisher', data: stalkerPreset(parseStalker(brain.data)) };
|
|
820
|
+
case 'skirmisher': return { archetype: brain.archetype, data: parseSkirmisher(brain.data) };
|
|
821
|
+
case 'guardian': {
|
|
822
|
+
const data = 'pattern' in brain.data ? guardianPreset(parseGuardianPattern(brain.data)) : parseGuardian(brain.data);
|
|
823
|
+
return data.kind === 'guardian' ? { archetype: 'guardian', data } : { archetype: 'perch-hunter', data };
|
|
824
|
+
}
|
|
825
|
+
case 'perch-hunter': return { archetype: brain.archetype, data: parsePerchHunter(brain.data) };
|
|
826
|
+
case 'challenge-grazer': {
|
|
827
|
+
const data = parseChallengeGrazer(brain.data);
|
|
828
|
+
if (!Number.isInteger(brain.phaseSlots) || brain.phaseSlots < 1 || brain.phaseSlots > 64) throw new Error(`Species ${kind}'s phase slots must be an integer in 1..64`);
|
|
829
|
+
return { archetype: brain.archetype, data, phaseSlots: brain.phaseSlots, charge: strikeOf(strikes, data.charge, kind), close: strikeOf(strikes, data.close, kind) };
|
|
830
|
+
}
|
|
831
|
+
case 'patrol-diver': { const data = parsePatrolDiver(brain.data); return { archetype: brain.archetype, data, strike: strikeOf(strikes, data.strike, kind) }; }
|
|
832
|
+
case 'decision': return { archetype: 'decision', data: v.parse(BorrowedDecisionSchema, brain.data) };
|
|
833
|
+
case 'script': {
|
|
834
|
+
const data = parseScriptSpecies(brain.data), bytes = modules.get(data.module);
|
|
835
|
+
if (bytes === undefined) throw new Error(`Species ${kind}'s brain module ${data.module} was not supplied`);
|
|
836
|
+
return { archetype: brain.archetype, data, lane: new SpeciesScriptLane(data, bytes), catalogue: data.strikes.map(row => strikeOf(strikes, row.strike, kind)) };
|
|
837
|
+
}
|
|
838
|
+
default: throw new Error(`Species ${kind} declares an unknown brain archetype`);
|
|
839
|
+
}
|
|
840
|
+
}
|
|
841
|
+
type Callbacks = SpeciesBinding;
|
|
842
|
+
|
|
843
|
+
/** Lazily bind one real species policy on its first callback, retaining live context and inspection ownership. */
|
|
844
|
+
export function bindCreatureBrain(create: (actor: Animal, context: ThinkCtx) => ReturnType<SpeciesNativeFactory>): {
|
|
845
|
+
readonly callbacks: Pick<SpeciesBinding, 'think' | 'act'>; readonly live: (actor: Animal) => boolean;
|
|
846
|
+
} {
|
|
847
|
+
const live = new WeakMap<Animal, ReturnType<SpeciesNativeFactory>>();
|
|
848
|
+
const of = (actor: Animal, context: ThinkCtx): ReturnType<SpeciesNativeFactory> => {
|
|
849
|
+
let value = live.get(actor);
|
|
850
|
+
if (value === undefined) { value = create(actor, context); live.set(actor, value); }
|
|
851
|
+
return value;
|
|
852
|
+
};
|
|
853
|
+
return { live: actor => live.has(actor), callbacks: { think: (actor, context) => { of(actor, context).think(context); },
|
|
854
|
+
act: (actor, context) => { of(actor, context).act(context); } } };
|
|
855
|
+
}
|
|
856
|
+
/** Browser callbacks bound to one policy per animal (built at its first decision); `live` answers the witness. */
|
|
857
|
+
function browserCallbacks(brain: Admitted, native?: SpeciesNativeFactory, homes?: SpeciesBodyHomes,
|
|
858
|
+
held?: Partial<SpeciesHeldPorts> & { register: (actor: AnimalSim, controller: HeldSpeciesControl) => void; occupied: (actor: AnimalSim) => boolean; kind: string }, decisions?: SpeciesDecisionAuthority, body?: CreatureBodyRecipe): { callbacks: Callbacks; live: (actor: Animal) => boolean } {
|
|
859
|
+
switch (brain.archetype) {
|
|
860
|
+
case 'decision': {
|
|
861
|
+
if (held === undefined || decisions === undefined) throw new Error('Decision species requires its existing body authority');
|
|
862
|
+
const live = new WeakMap<Animal, BorrowedSpeciesControl>();
|
|
863
|
+
const of = (actor: Animal): BorrowedSpeciesControl => {
|
|
864
|
+
if (actor.kind !== held.kind) throw new Error('Decision species requires its declared live body');
|
|
865
|
+
let value = live.get(actor);
|
|
866
|
+
if (value === undefined) { value = decisions.bind(actor, brain.data, body); held.register(actor, value); live.set(actor, value); }
|
|
867
|
+
return value;
|
|
868
|
+
};
|
|
869
|
+
const observe = (actor: Animal, context: ThinkCtx): void => { of(actor).observe({ calm: context.calm, reach: () => context.reach(actor), claim: () => context.claim(actor), hurt: context.hurt, ...(held.shove === undefined ? {} : { shove: held.shove }) }); };
|
|
870
|
+
return { live: actor => live.has(actor), callbacks: { think: observe, act: observe, control: of } };
|
|
871
|
+
}
|
|
872
|
+
case 'ram-grazer': case 'orbit-diver': case 'burst-flyer': case 'skirmisher': case 'guardian': case 'perch-hunter': {
|
|
873
|
+
let adapter = native;
|
|
874
|
+
if (adapter === undefined && (brain.archetype === 'ram-grazer' || brain.archetype === 'orbit-diver' || brain.archetype === 'burst-flyer')) {
|
|
875
|
+
if (homes === undefined || (brain.archetype === 'burst-flyer' && held?.shove === undefined)) throw new Error('Species requires its trusted home and body authority');
|
|
876
|
+
adapter = (actor, decision) => {
|
|
877
|
+
if (actor.kind !== held?.kind && held !== undefined) throw new Error('Species requires its declared live body');
|
|
878
|
+
if (decision.archetype === 'ram-grazer') return {
|
|
879
|
+
think: context => { decision.policy.think({ ...context, home: homes(actor) }); },
|
|
880
|
+
act: context => { decision.policy.act({ ...context, home: homes(actor) }); },
|
|
881
|
+
};
|
|
882
|
+
if (decision.archetype === 'orbit-diver') return {
|
|
883
|
+
think: context => { decision.policy.think(context); }, act: context => { decision.policy.act(context); },
|
|
884
|
+
};
|
|
885
|
+
if (decision.archetype === 'burst-flyer' && held?.shove !== undefined) {
|
|
886
|
+
const shove = held.shove;
|
|
887
|
+
return { think: context => { decision.policy.think({ ...context, shove }); },
|
|
888
|
+
act: context => { decision.policy.act({ ...context, shove }); } };
|
|
889
|
+
}
|
|
890
|
+
throw new Error('Species requires its matching declared body policy');
|
|
891
|
+
};
|
|
892
|
+
}
|
|
893
|
+
if (adapter === undefined) throw new Error(`Species ${brain.archetype} requires a trusted native body adapter`);
|
|
894
|
+
if ((brain.archetype === 'orbit-diver' || brain.archetype === 'burst-flyer') && homes === undefined) throw new Error(`Species ${brain.archetype} requires its native body home`);
|
|
895
|
+
return bindCreatureBrain((actor, context) => adapter(actor, decisionOf(brain, actor, homes?.(actor)), context));
|
|
896
|
+
}
|
|
897
|
+
case 'challenge-grazer': {
|
|
898
|
+
const live = new WeakMap<Animal, ChallengeGrazerBrain<Animal>>(), slots = brain.phaseSlots;
|
|
899
|
+
const of = (a: Animal): ChallengeGrazerBrain<Animal> => { let value = live.get(a); if (value === undefined) { value = new ChallengeGrazerBrain(a, brain.data, brain.charge, brain.close); live.set(a, value); } return value; };
|
|
900
|
+
return { live: a => live.has(a), callbacks: {
|
|
901
|
+
think: (a, c) => { of(a).think({ ...c, phaseOffset: seedSlot(a.seed, slots) }); }, act: (a, c) => { of(a).act({ ...c, phaseOffset: seedSlot(a.seed, slots) }); } } };
|
|
902
|
+
}
|
|
903
|
+
case 'patrol-diver': {
|
|
904
|
+
return bindCreatureBrain(actor => new PatrolDiverBrain(actor, brain.data, brain.data.home, brain.strike));
|
|
905
|
+
}
|
|
906
|
+
case 'script': {
|
|
907
|
+
const live = new WeakMap<Animal, ScriptSpeciesPolicy<Animal>>();
|
|
908
|
+
const of = (a: Animal): ScriptSpeciesPolicy<Animal> => { let value = live.get(a); if (value === undefined) { value = new ScriptSpeciesPolicy(a, brain.lane, brain.catalogue); live.set(a, value); } return value; };
|
|
909
|
+
return { live: a => live.has(a), callbacks: { think: (a, c) => { of(a).think(c); }, act: (a, c) => { of(a).act(c); } } };
|
|
910
|
+
}
|
|
911
|
+
default: throw new Error('Unknown admitted brain archetype');
|
|
912
|
+
}
|
|
913
|
+
}
|
|
914
|
+
|
|
915
|
+
function decisionOf<A extends AnimalSim>(brain: Admitted, actor: A, home?: SpeciesBodyHome): SpeciesDecision<A> {
|
|
916
|
+
switch (brain.archetype) {
|
|
917
|
+
case 'ram-grazer': return { archetype: brain.archetype, policy: new RamGrazerBrain(actor, brain.data, brain.strike) };
|
|
918
|
+
case 'orbit-diver': {
|
|
919
|
+
if (home === undefined) throw new Error('Species orbit-diver requires its native body home');
|
|
920
|
+
const data = { ...brain.data, home };
|
|
921
|
+
return { archetype: brain.archetype, policy: new OrbitDiverBrain(actor, data, home, brain.strike) };
|
|
922
|
+
}
|
|
923
|
+
case 'burst-flyer': {
|
|
924
|
+
if (home === undefined) throw new Error('Species burst-flyer requires its native body home');
|
|
925
|
+
const data = { ...brain.data, home };
|
|
926
|
+
return { archetype: brain.archetype, policy: new BurstFlyerBrain(actor, data, home, brain.strike) };
|
|
927
|
+
}
|
|
928
|
+
case 'skirmisher': return { archetype: brain.archetype, policy: new SkirmisherBrain(actor, brain.data) };
|
|
929
|
+
case 'guardian': return { archetype: brain.archetype, policy: new GuardianBrain(actor, brain.data) };
|
|
930
|
+
case 'perch-hunter': return { archetype: brain.archetype, policy: new PerchHunterBrain(actor, brain.data) };
|
|
931
|
+
case 'challenge-grazer': case 'patrol-diver': case 'decision': case 'script':
|
|
932
|
+
throw new Error(`Species ${brain.archetype} is not a native decision family`);
|
|
933
|
+
default: throw new Error('Unknown admitted brain archetype');
|
|
934
|
+
}
|
|
935
|
+
}
|
|
936
|
+
|
|
937
|
+
/** The actual owning host, creature stream and attack authority; a recipe never manufactures any of them. */
|
|
938
|
+
export interface SpeciesBodyPorts {
|
|
939
|
+
readonly host: SimHost; readonly stream: Rng; readonly home?: SpeciesBodyHome; readonly decisions?: SpeciesDecisionAuthority;
|
|
940
|
+
readonly attacks: { readonly kind: 'keeper'; readonly claim: (actor: AnimalSim) => boolean }
|
|
941
|
+
| { readonly kind: 'unlimited'; readonly limit: number };
|
|
942
|
+
}
|
|
943
|
+
/** Once-allocated observations shared by the existing ground, flight and scripted policies. */
|
|
944
|
+
export interface SpeciesBodyObservation extends HomeObservation {
|
|
945
|
+
/** Native flight may omit its turn override, retaining the motor's default as the browser does. */
|
|
946
|
+
flight: { steer: (actor: AnimalSim, yaw: number, speed: number, altitude: number, turn?: number) => void };
|
|
947
|
+
readonly rng: Rng; readonly mayAttack: (actor: AnimalSim) => boolean;
|
|
948
|
+
readonly shove: (yaw: number, speed: number, lift: number) => void;
|
|
949
|
+
}
|
|
950
|
+
/** Bind an admitted body recipe to its existing policy; no roster, clock, RNG draw or continuation is added. */
|
|
951
|
+
export function bindSpeciesBody(actor: AnimalSim, input: CreatureBodyRecipe, shared: SpeciesBodyPorts,
|
|
952
|
+
create: (ports: SpeciesBodyObservation) => SpeciesPolicy<SpeciesBodyObservation>, phaseOffset = 0): KeptPolicy {
|
|
953
|
+
const recipe = v.parse(CreatureBodyRecipeSchema, input), { host, attacks } = shared;
|
|
954
|
+
if (host.entities.get(actor.entityId) !== actor || (recipe.motion === 'flight') !== actor.flying)
|
|
955
|
+
throw new Error('Species body requires its actual host and declared motor');
|
|
956
|
+
if (recipe.attack !== attacks.kind || attacks.kind === 'unlimited' && attacks.limit !== Infinity)
|
|
957
|
+
throw new Error('Species body requires its actual attack authority');
|
|
958
|
+
const player = host.playerFocus, point = new Vector3(), dir = new Vector3(), from = new Vector3();
|
|
959
|
+
const impulse = bindPlayerImpulse(velocity => { host.nearestPlayer(actor.position).addImpulse(velocity); });
|
|
960
|
+
const tags: readonly `${string}.${string}`[] = [`creature.${actor.kind}`, 'feel.blow', 'cover.checked'];
|
|
961
|
+
const reach = (body: AnimalSim): boolean => canReach(body, player, host.physics);
|
|
962
|
+
const claim = attacks.kind === 'keeper' ? attacks.claim : (): boolean => true;
|
|
963
|
+
const hurt = (damage: number): void => {
|
|
964
|
+
let rel = Math.atan2(player.x - actor.position.x, player.z - actor.position.z) - actor.yaw;
|
|
965
|
+
rel = Math.atan2(Math.sin(rel), Math.cos(rel));
|
|
966
|
+
if (Math.abs(rel) > recipe.contact.halfArc || !reach(actor)) return;
|
|
967
|
+
if (recipe.contact.kind === 'environment') {
|
|
968
|
+
host.combat.hit({ source: 'env', sourceTags: tags, target: host.nearestPlayer(actor.position).health, amount: damage,
|
|
969
|
+
point: actor.position.clone(), dir: new Vector3(), cause: { kind: actor.kind, label: actor.label } });
|
|
970
|
+
} else {
|
|
971
|
+
point.copy(actor.position); dir.subVectors(player, actor.position).normalize(); from.copy(actor.position);
|
|
972
|
+
host.combat.hit({ source: actor.combatActor(), sourceTags: tags, target: host.nearestPlayer(actor.position).health, amount: damage,
|
|
973
|
+
point, dir, from, moveId: recipe.contact.move });
|
|
974
|
+
}
|
|
975
|
+
};
|
|
976
|
+
const ports: SpeciesBodyObservation = { dt: 0, t: 0, player, calm: false, phaseOffset, rng: shared.stream, reach, claim, mayAttack: claim, hurt,
|
|
977
|
+
steer: (body, yaw, speed, turn) => { body.setMotion(yaw, speed, turn); },
|
|
978
|
+
flight: { steer: (body, yaw, speed, altitude, turn) => { body.fly(yaw, speed, altitude, turn); } },
|
|
979
|
+
shove: impulse.directed };
|
|
980
|
+
const brain = create(ports), observe = (dt: number): void => { ports.dt = dt; ports.t = host.clock.now; };
|
|
981
|
+
return {
|
|
982
|
+
decide: dt => {
|
|
983
|
+
if (recipe.stunned === 'look-hold' && actor.stunned) {
|
|
984
|
+
actor.setMotion(actor.yaw, 0, 1); actor.lookTarget.copy(player); actor.lookWeight = 1; return;
|
|
985
|
+
}
|
|
986
|
+
observe(dt); brain.think(ports);
|
|
987
|
+
},
|
|
988
|
+
move: dt => { observe(dt); brain.act(ports); },
|
|
989
|
+
snapshot: () => brain.snapshot(), restore: value => { brain.restore(value); },
|
|
990
|
+
};
|
|
991
|
+
}
|
|
992
|
+
function bodyPolicy<P>(policy: SpeciesPolicy<P>, ports: P): SpeciesPolicy<SpeciesBodyObservation> {
|
|
993
|
+
return { think: () => { policy.think(ports); }, act: () => { policy.act(ports); },
|
|
994
|
+
snapshot: () => policy.snapshot(), restore: value => { policy.restore(value); } };
|
|
995
|
+
}
|
|
996
|
+
function homePolicy(brain: Admitted, actor: AnimalSim): SpeciesPolicy<HomeObservation> {
|
|
997
|
+
switch (brain.archetype) {
|
|
998
|
+
case 'challenge-grazer': return new ChallengeGrazerBrain(actor, brain.data, brain.charge, brain.close);
|
|
999
|
+
case 'patrol-diver': return new PatrolDiverBrain(actor, brain.data, brain.data.home, brain.strike);
|
|
1000
|
+
case 'script': return new ScriptSpeciesPolicy(actor, brain.lane, brain.catalogue);
|
|
1001
|
+
case 'ram-grazer': case 'orbit-diver': case 'burst-flyer': case 'decision': case 'skirmisher': case 'guardian': case 'perch-hunter':
|
|
1002
|
+
throw new Error(`Species ${actor.kind} requires a trusted native body adapter`);
|
|
1003
|
+
default: throw new Error('Unknown admitted brain archetype');
|
|
1004
|
+
}
|
|
1005
|
+
}
|
|
1006
|
+
|
|
1007
|
+
/**
|
|
1008
|
+
* Admit a species catalogue's declared brains (SF27) against its strike rows: every brain's data passes its archetype's
|
|
1009
|
+
* strict schema and every strike it names resolves, before any row, policy or actor exists; a script brain's module
|
|
1010
|
+
* (`modules`, by hash) is checked against its hash and admitted on its own ScriptHost. Duplicate kinds refuse.
|
|
1011
|
+
*/
|
|
1012
|
+
export function admitSpeciesBrains(species: readonly BrainedSpecies[], strikeRows: readonly StrikeData[], modules: ReadonlyMap<string, Uint8Array> = new Map()): SpeciesBrains {
|
|
1013
|
+
const strikes = new Map(strikeRows.map(row => [row.id, strikeFromData(row)] as const));
|
|
1014
|
+
if (strikes.size !== strikeRows.length || new Set(species.map(row => row.kind)).size !== species.length) throw new Error('Duplicate species kind or strike id');
|
|
1015
|
+
const admitted = new Map(species.flatMap(row => row.brain === undefined ? [] : [[row.kind, admit(row.brain, row.kind, strikes, modules)] as const]));
|
|
1016
|
+
const bodies = new Map(species.flatMap(row => row.body === undefined ? [] : [[row.kind, v.parse(CreatureBodyRecipeSchema, row.body)] as const]));
|
|
1017
|
+
for (const [kind, body] of bodies) {
|
|
1018
|
+
const brain = admitted.get(kind);
|
|
1019
|
+
if (brain === undefined || brain.archetype === 'perch-hunter'
|
|
1020
|
+
|| ((brain.archetype === 'skirmisher' || brain.archetype === 'guardian') && bodies.get(kind)?.actions === undefined))
|
|
1021
|
+
throw new Error(`Species ${kind} has no admitted native body protocol`);
|
|
1022
|
+
if (body.offset !== undefined && brain.archetype !== 'decision') throw new Error('Body offset requires its declared decision owner');
|
|
1023
|
+
}
|
|
1024
|
+
for (const [kind, body] of bodies) if (body.actions !== undefined) {
|
|
1025
|
+
const brain = admitted.get(kind), rows = body.actions;
|
|
1026
|
+
if (brain?.archetype !== 'skirmisher' && brain?.archetype !== 'guardian' && brain?.archetype !== 'decision') throw new Error('Unsupported memory-action policy');
|
|
1027
|
+
if (brain.archetype === 'decision' && rows.actions.length > 0) throw new Error('Decision body states cannot own a second strike clock');
|
|
1028
|
+
if ((brain.archetype !== 'decision' && new Set(rows.states).size !== rows.states.length) || rows.actions.some(row => row.state >= rows.states.length)) throw new Error('Invalid memory-action state');
|
|
1029
|
+
for (const row of rows.actions) {
|
|
1030
|
+
const strike = strikeOf(strikes, row.strike, kind);
|
|
1031
|
+
if (row.radiusScale !== undefined && strike.shape.kind !== 'point') throw new Error('Scaled contact requires a point strike');
|
|
1032
|
+
}
|
|
1033
|
+
}
|
|
1034
|
+
const witnesses: { archetype: string; live: (actor: Animal) => boolean }[] = [];
|
|
1035
|
+
const bodyHomes = new WeakMap<Animal, SpeciesBodyHome>();
|
|
1036
|
+
const heldControls = new WeakMap<AnimalSim, { kind: string; controller: HeldSpeciesControl }>();
|
|
1037
|
+
const registerHeld = (kind: string, actor: AnimalSim, controller: HeldSpeciesControl): void => {
|
|
1038
|
+
if (actor.kind !== kind || heldControls.has(actor)) throw new Error('Held species already has an owning controller');
|
|
1039
|
+
heldControls.set(actor, { kind, controller });
|
|
1040
|
+
};
|
|
1041
|
+
const bind: SpeciesBrains['bind'] = (kind, native, homes, held, decisions) => {
|
|
1042
|
+
const brain = admitted.get(kind);
|
|
1043
|
+
if (brain === undefined) throw new Error(`Species ${kind} declares no brain`);
|
|
1044
|
+
const resolveHome = homes === undefined ? undefined : (actor: Animal): SpeciesBodyHome => bodyHomes.get(actor) ?? homes(actor);
|
|
1045
|
+
const actions = bodies.get(kind)?.actions;
|
|
1046
|
+
const adapter: SpeciesNativeFactory | undefined = native ?? (actions === undefined || brain.archetype === 'decision' ? undefined : (actor, decision) => {
|
|
1047
|
+
if (decision.archetype !== 'skirmisher' && decision.archetype !== 'guardian') throw new Error('Memory actions require their grounded policy');
|
|
1048
|
+
return speciesActions(actor, brain, actions, strikes, decision.policy);
|
|
1049
|
+
});
|
|
1050
|
+
const bound = browserCallbacks(brain, adapter, resolveHome, { ...held, kind,
|
|
1051
|
+
occupied: actor => heldControls.has(actor),
|
|
1052
|
+
register: (actor, controller) => { registerHeld(kind, actor, controller); } }, decisions, bodies.get(kind));
|
|
1053
|
+
witnesses.push({ archetype: brain.archetype, live: bound.live }); return bound.callbacks;
|
|
1054
|
+
};
|
|
1055
|
+
return {
|
|
1056
|
+
kinds: new Set(admitted.keys()), bind,
|
|
1057
|
+
catalogue: (rows, ports = {}) => {
|
|
1058
|
+
if (rows.length > 1024 || new Set(rows.map(row => row.kind)).size !== rows.length) throw new Error('Invalid species catalogue order');
|
|
1059
|
+
for (const row of rows) {
|
|
1060
|
+
const brain = admitted.get(row.kind), home = ports.homes?.[row.kind];
|
|
1061
|
+
if (brain === undefined) throw new Error(`Species ${row.kind} declares no brain`);
|
|
1062
|
+
if (home !== undefined) v.parse(CreatureHomeSchema, home);
|
|
1063
|
+
if (brain.archetype === 'decision' && ports.decisions === undefined) throw new Error('Held species requires its trusted body authority');
|
|
1064
|
+
if ((brain.archetype === 'ram-grazer' || brain.archetype === 'orbit-diver' || brain.archetype === 'burst-flyer')
|
|
1065
|
+
&& (home === undefined || (brain.archetype === 'burst-flyer' && ports.held === undefined))) throw new Error('Species requires its trusted home and body authority');
|
|
1066
|
+
if ((brain.archetype === 'skirmisher' || brain.archetype === 'guardian' || brain.archetype === 'perch-hunter') && bodies.get(row.kind)?.actions === undefined) throw new Error('Species catalogue requires declared body authority');
|
|
1067
|
+
}
|
|
1068
|
+
const bindings = new Map<string, SpeciesBinding>();
|
|
1069
|
+
const bound = rows.map(row => {
|
|
1070
|
+
const home = ports.homes?.[row.kind], binding = bind(row.kind, undefined, home === undefined ? undefined : () => home, ports.held, ports.decisions);
|
|
1071
|
+
bindings.set(row.kind, binding); return { ...row, ...binding };
|
|
1072
|
+
});
|
|
1073
|
+
return { rows: bound, prepareHeld: (kind, actor) => {
|
|
1074
|
+
const binding = bindings.get(kind);
|
|
1075
|
+
if (binding === undefined || actor.kind !== kind) throw new Error('Held species requires its declared live body');
|
|
1076
|
+
return binding.control?.(actor) ?? null;
|
|
1077
|
+
} };
|
|
1078
|
+
},
|
|
1079
|
+
home: (kind, actor, at) => {
|
|
1080
|
+
if (!admitted.has(kind) || actor.kind !== kind || ![at.x, at.y, at.z, at.r].every(Number.isFinite) || at.r <= 0)
|
|
1081
|
+
throw new Error('Species requires its declared finite body home');
|
|
1082
|
+
bodyHomes.set(actor, at);
|
|
1083
|
+
},
|
|
1084
|
+
held: (kind, actor) => {
|
|
1085
|
+
if (actor.kind !== kind) throw new Error('Held species requires its declared live body');
|
|
1086
|
+
const registered = heldControls.get(actor); return registered?.kind === kind ? registered.controller : null;
|
|
1087
|
+
},
|
|
1088
|
+
actions: (kind, actor) => {
|
|
1089
|
+
const rows = bodies.get(kind)?.actions, brain = admitted.get(kind);
|
|
1090
|
+
if (rows === undefined) return null;
|
|
1091
|
+
if (brain === undefined || actor.kind !== kind) throw new Error('Memory actions require their actual declared body');
|
|
1092
|
+
return speciesActions(actor, brain, rows, strikes);
|
|
1093
|
+
},
|
|
1094
|
+
decision: (kind, actor, home) => {
|
|
1095
|
+
const brain = admitted.get(kind);
|
|
1096
|
+
if (brain === undefined) throw new Error(`Species ${kind} declares no brain`);
|
|
1097
|
+
return decisionOf(brain, actor, home);
|
|
1098
|
+
},
|
|
1099
|
+
witness: actor => witnesses.find(entry => entry.live(actor))?.archetype ?? null,
|
|
1100
|
+
policy: (kind, actor) => {
|
|
1101
|
+
const brain = admitted.get(kind);
|
|
1102
|
+
if (brain === undefined) return null;
|
|
1103
|
+
return homePolicy(brain, actor);
|
|
1104
|
+
},
|
|
1105
|
+
body: (kind, actor, shared) => {
|
|
1106
|
+
const recipe = bodies.get(kind), brain = admitted.get(kind);
|
|
1107
|
+
if (recipe === undefined) return null;
|
|
1108
|
+
if (brain === undefined || actor.kind !== kind) throw new Error(`Species ${kind} requires its declared live body`);
|
|
1109
|
+
if (shared.home !== undefined) v.parse(CreatureHomeSchema, shared.home);
|
|
1110
|
+
const home = shared.home;
|
|
1111
|
+
if ((brain.archetype === 'ram-grazer' || brain.archetype === 'orbit-diver' || brain.archetype === 'burst-flyer') && home === undefined)
|
|
1112
|
+
throw new Error(`Species ${kind} requires its actual body home`);
|
|
1113
|
+
return bindSpeciesBody(actor, recipe, shared, ports => {
|
|
1114
|
+
if (brain.archetype === 'decision') {
|
|
1115
|
+
if (shared.decisions === undefined) throw new Error('Missing native decision authority');
|
|
1116
|
+
const controller = shared.decisions.bind(actor, brain.data, recipe); registerHeld(kind, actor, controller);
|
|
1117
|
+
controller.observe(ports);
|
|
1118
|
+
return { think: observation => { controller.observe(observation); }, act: observation => { controller.observe(observation); }, snapshot: controller.snapshot, restore: controller.restore };
|
|
1119
|
+
}
|
|
1120
|
+
if (brain.archetype === 'ram-grazer') {
|
|
1121
|
+
if (home === undefined) throw new Error('Missing admitted ram home');
|
|
1122
|
+
return bodyPolicy(new RamGrazerBrain(actor, brain.data, brain.strike), Object.assign(ports, { home }));
|
|
1123
|
+
}
|
|
1124
|
+
if (brain.archetype === 'orbit-diver') {
|
|
1125
|
+
if (home === undefined) throw new Error('Missing admitted orbit home');
|
|
1126
|
+
const data = { ...brain.data, home }; return new OrbitDiverBrain(actor, data, home, brain.strike);
|
|
1127
|
+
}
|
|
1128
|
+
if (brain.archetype === 'burst-flyer') {
|
|
1129
|
+
if (home === undefined) throw new Error('Missing admitted burst home');
|
|
1130
|
+
const data = { ...brain.data, home }; return new BurstFlyerBrain(actor, data, home, brain.strike);
|
|
1131
|
+
}
|
|
1132
|
+
return homePolicy(brain, actor);
|
|
1133
|
+
}, brain.archetype === 'challenge-grazer' ? seedSlot(actor.seed, brain.phaseSlots) : 0);
|
|
1134
|
+
},
|
|
1135
|
+
phase: (kind, actor) => { const brain = admitted.get(kind); return brain?.archetype === 'challenge-grazer' ? seedSlot(actor.seed, brain.phaseSlots) : 0; },
|
|
1136
|
+
};
|
|
1137
|
+
}
|
|
1138
|
+
|
|
1139
|
+
/** A declared catalogue's homes on the platform's renderer-free keeper (`installHomeKeeper`), each body bound to its row. */
|
|
1140
|
+
export interface SpeciesHomesSpec extends Omit<HomeKeeperSpec, 'scales' | 'policy'> {
|
|
1141
|
+
/** The catalogue's rows (each kind's scale range is its first variant's). */
|
|
1142
|
+
readonly species: readonly BrainedSpecies[];
|
|
1143
|
+
/** The catalogue's admitted brains (`admitSpeciesBrains` over the same rows). */
|
|
1144
|
+
readonly brains: SpeciesBrains;
|
|
1145
|
+
/** Each body's actual home by its declared id (an island or a flying circle), for the home-bound archetypes. */
|
|
1146
|
+
readonly home?: (id: string) => SpeciesBodyHome;
|
|
1147
|
+
/** Actual body homes and world-floor ray starts; selects the existing floor query without a private placement callback. */
|
|
1148
|
+
readonly placement?: { readonly fallback: number; readonly rows: readonly { readonly id: string; readonly fromY: number; readonly home: SpeciesBodyHome }[] };
|
|
1149
|
+
/** Memory holds run in authored order at the keeper's original beforeStep phase. */
|
|
1150
|
+
readonly holds?: readonly { readonly home: number; readonly field: string; readonly until: string }[];
|
|
1151
|
+
/** The runtime's own body for a kind its rows bind no body recipe (a unique boss), on the same shared ports. */
|
|
1152
|
+
readonly decisions?: SpeciesDecisionAuthority;
|
|
1153
|
+
readonly custom?: (kind: string, actor: AnimalSim, shared: SpeciesBodyPorts) => KeptPolicy;
|
|
1154
|
+
}
|
|
1155
|
+
|
|
1156
|
+
/** Each species' scale range by kind: its first variant's, the creature manager's first draw (a species without one refuses). */
|
|
1157
|
+
export function speciesScales(species: readonly { readonly kind: string; readonly variants: readonly { readonly scale: readonly [number, number] }[] }[]): ReadonlyMap<string, readonly [number, number]> {
|
|
1158
|
+
return new Map(species.map(row => {
|
|
1159
|
+
const variant = row.variants[0]; if (variant === undefined) throw new Error(`Species ${row.kind} has no variant`);
|
|
1160
|
+
return [row.kind, variant.scale] as const;
|
|
1161
|
+
}));
|
|
1162
|
+
}
|
|
1163
|
+
/**
|
|
1164
|
+
* Declared homes whose policies come from their species rows (SF27): the keeper's stream, tokens, respawn clocks and
|
|
1165
|
+
* exact restore (`installHomeKeeper`), each body bound to its row's native recipe (`SpeciesBrains.body`) on the keeper's
|
|
1166
|
+
* own stream, its home and the keeper's attack authority (its tokens; an uncapped keeper grants every attack).
|
|
1167
|
+
*/
|
|
1168
|
+
export function installSpeciesHomes(host: SimHost, spec: SpeciesHomesSpec, saved?: Readonly<Omit<SimSnapshot, 'physics'>>): { settle: () => void; homes: () => readonly KeptHome[]; boss: KeptBossBody | null } {
|
|
1169
|
+
const { species, brains, home, custom, placement, holds, decisions, ...keeper } = spec;
|
|
1170
|
+
const declared = new Map<string, { readonly at: readonly [number, number] }>(spec.homes.map(row => [row.id, row]));
|
|
1171
|
+
if (spec.boss !== undefined) declared.set(spec.boss.id, spec.boss);
|
|
1172
|
+
const placed = new Map<string, { readonly fromY: number; readonly home: SpeciesBodyHome }>();
|
|
1173
|
+
if (placement !== undefined) {
|
|
1174
|
+
if (home !== undefined || spec.place !== undefined || spec.adopt !== undefined || !Number.isFinite(placement.fallback)
|
|
1175
|
+
|| placement.rows.length !== declared.size) throw new Error('Species placement requires one declared floor authority');
|
|
1176
|
+
for (const row of placement.rows) {
|
|
1177
|
+
if (!declared.has(row.id) || placed.has(row.id) || !Number.isFinite(row.fromY)) throw new Error('Invalid declared species placement');
|
|
1178
|
+
v.parse(CreatureHomeSchema, row.home);
|
|
1179
|
+
// Preserve authored property order: native continuation records serialize the original home.
|
|
1180
|
+
placed.set(row.id, { fromY: row.fromY, home: row.home });
|
|
1181
|
+
}
|
|
1182
|
+
}
|
|
1183
|
+
if (holds !== undefined && (holds.length > 1024 || holds.some(row => !Number.isInteger(row.home) || row.home < 0 || row.home >= spec.homes.length
|
|
1184
|
+
|| row.field.length === 0 || row.until.length === 0))) throw new Error('Invalid declared species hold');
|
|
1185
|
+
const floor = placement === undefined ? undefined : creatureFloor(host, () => placement.fallback);
|
|
1186
|
+
const prepared = floor === undefined ? keeper : { ...keeper,
|
|
1187
|
+
place: (id: string) => {
|
|
1188
|
+
const row = declared.get(id), at = placed.get(id);
|
|
1189
|
+
if (row === undefined || at === undefined) throw new Error('Missing declared species placement');
|
|
1190
|
+
return floor(row.at[0], row.at[1], at.fromY);
|
|
1191
|
+
},
|
|
1192
|
+
adopt: (actor: AnimalSim) => { actor.groundHeight = (x, z, fromY) => floor(x, z, fromY).y; },
|
|
1193
|
+
};
|
|
1194
|
+
return installHomeKeeper(host, { ...prepared, ...(holds === undefined ? {} : { beforeStep: (kept: readonly KeptHome[]) => {
|
|
1195
|
+
for (const row of holds) { const actor = kept[row.home]?.actor; if (actor !== null && actor !== undefined) actor.mem[row.field] = host.flags.has(row.until) ? 0 : 1; }
|
|
1196
|
+
keeper.beforeStep?.(kept);
|
|
1197
|
+
} }), scales: speciesScales(species), policy: (kind, actor, claim, stream) => {
|
|
1198
|
+
const at = placed.get(actor.entityId)?.home ?? home?.(actor.entityId);
|
|
1199
|
+
const shared: SpeciesBodyPorts = { host, stream, ...(decisions === undefined ? {} : { decisions }), ...(at === undefined ? {} : { home: at }),
|
|
1200
|
+
attacks: spec.attackers === Infinity ? { kind: 'unlimited', limit: Infinity } : { kind: 'keeper', claim } };
|
|
1201
|
+
const body = brains.body(kind, actor, shared);
|
|
1202
|
+
if (body !== null) return body;
|
|
1203
|
+
if (custom === undefined) throw new Error(`Species ${kind} has no declared body policy`);
|
|
1204
|
+
return custom(kind, actor, shared);
|
|
1205
|
+
} }, saved);
|
|
1206
|
+
}
|
|
1207
|
+
|
|
1208
|
+
const bakedFinite = v.pipe(v.number(), v.finite());
|
|
1209
|
+
/** One baked native simulation spec, strictly: an unknown or missing field refuses the bake rather than defaulting. */
|
|
1210
|
+
const BakedSpec = v.strictObject({ kind: v.string(), label: v.string(), variant: v.string(), rarity: v.picklist(['common', 'uncommon', 'rare', 'legendary']),
|
|
1211
|
+
hp: bakedFinite, aggressive: v.boolean(), lockable: v.optional(v.boolean()),
|
|
1212
|
+
dims: v.strictObject({ bodyY: bakedFinite, bodyHalfLen: bakedFinite, bodyRadius: bakedFinite, headRadius: bakedFinite, legLen: bakedFinite, feet: v.array(v.tuple([bakedFinite, bakedFinite])), halfWidth: bakedFinite }),
|
|
1213
|
+
mods: v.strictObject({ speed: bakedFinite, chargeDist: bakedFinite, damageTaken: bakedFinite, chargeDamage: bakedFinite, relentless: v.boolean() }),
|
|
1214
|
+
flight: v.optional(v.strictObject({ altitude: bakedFinite, above: v.optional(v.picklist(['ground', 'world'])), climbRate: bakedFinite, diveRate: bakedFinite, lockRange: v.optional(bakedFinite), bank: v.optional(bakedFinite) })) });
|
|
1215
|
+
|
|
1216
|
+
/** One baked native spec (a shard's physics bake writes it), admitted strictly; an absent optional stays absent. */
|
|
1217
|
+
export function bakedSpec(input: unknown): AnimalSimSpec {
|
|
1218
|
+
const { flight, lockable, ...rest } = v.parse(BakedSpec, input);
|
|
1219
|
+
return { ...rest, ...(lockable === undefined ? {} : { lockable }),
|
|
1220
|
+
...(flight === undefined ? {} : { flight: { altitude: flight.altitude, climbRate: flight.climbRate, diveRate: flight.diveRate,
|
|
1221
|
+
...(flight.above === undefined ? {} : { above: flight.above }), ...(flight.lockRange === undefined ? {} : { lockRange: flight.lockRange }),
|
|
1222
|
+
...(flight.bank === undefined ? {} : { bank: flight.bank }) } }) };
|
|
1223
|
+
}
|
|
1224
|
+
|
|
1225
|
+
/**
|
|
1226
|
+
* A physics bake's actors as native specs by kind (SHARD-PLATFORM SF72, the headless runtimes' recipes): every body of a
|
|
1227
|
+
* kind shares one recipe, so a divergent one refuses, as does a row whose declared `kind` differs from its spec's.
|
|
1228
|
+
*/
|
|
1229
|
+
export function bakedSpecs(actors: readonly { readonly kind?: string; readonly spec: unknown }[]): ReadonlyMap<string, AnimalSimSpec> {
|
|
1230
|
+
const specs = new Map<string, AnimalSimSpec>();
|
|
1231
|
+
for (const actor of actors) {
|
|
1232
|
+
const spec = bakedSpec(actor.spec), kind = actor.kind ?? spec.kind, known = specs.get(kind);
|
|
1233
|
+
if (spec.kind !== kind || (known !== undefined && JSON.stringify(known) !== JSON.stringify(spec))) throw new Error(`Divergent native spec ${kind}`);
|
|
1234
|
+
specs.set(kind, spec);
|
|
1235
|
+
}
|
|
1236
|
+
return specs;
|
|
1237
|
+
}
|
|
1238
|
+
|
|
1239
|
+
/** A population's authored catalogue and verified script modules; admission creates no actor or tick. */
|
|
1240
|
+
export interface SpeciesProgramRows {
|
|
1241
|
+
readonly species: readonly BrainedSpecies[];
|
|
1242
|
+
readonly strikes: readonly unknown[];
|
|
1243
|
+
readonly modules?: Readonly<Record<string, string>>;
|
|
1244
|
+
}
|
|
1245
|
+
/** Admit the same strict strike, brain and module rows for browser and native populations. */
|
|
1246
|
+
export function admitSpeciesProgram(rows: SpeciesProgramRows): SpeciesBrains {
|
|
1247
|
+
return admitSpeciesBrains(rows.species, rows.strikes.map(row => v.parse(CreatureStrikeSchema, row)),
|
|
1248
|
+
new Map(Object.entries(rows.modules ?? {}).map(([hash, base64]) => [hash, moduleBytes(base64)] as const)));
|
|
1249
|
+
}
|
|
1250
|
+
|
|
1251
|
+
/** Authored native hunting setup on the existing sim and stalker owners. */
|
|
1252
|
+
export interface NativeHuntRow {
|
|
1253
|
+
readonly limit: number;
|
|
1254
|
+
readonly fight: HuntConfig['fight']; readonly tuning?: ReturnType<HuntConfig['faunaTuning']>;
|
|
1255
|
+
readonly player: 'host' | 'origin';
|
|
1256
|
+
/** Null retains an already installed built-in body scheduler. */
|
|
1257
|
+
readonly bands: { readonly states: readonly string[]; readonly scripted?: boolean; readonly legacyKinds: readonly string[] } | null;
|
|
1258
|
+
readonly hit: { readonly namespace: string; readonly tags: readonly CombatTag[] };
|
|
1259
|
+
}
|
|
1260
|
+
/** Keep the native manager's existing clocks, charge source, navigation and terrain cadence. */
|
|
1261
|
+
export function createNativeHunt(host: SimHost, row: NativeHuntRow, ports: {
|
|
1262
|
+
readonly rng: Rng; readonly ground: HuntGround; readonly nav: HuntNav | null;
|
|
1263
|
+
/** Each kind's species row, as data: a kind missing from the table refuses at its first read. */
|
|
1264
|
+
readonly species: ReadonlyMap<string, HuntSpecies>;
|
|
1265
|
+
readonly wanderGoal?: (herd: number) => { x: number; z: number; r: number } | null;
|
|
1266
|
+
readonly present?: (actor: AnimalSim) => boolean;
|
|
1267
|
+
}): { readonly hunt: StalkerBrain<HuntBody>; readonly reach: (actor: HuntBody, point: Vector3) => boolean } {
|
|
1268
|
+
if (!Number.isInteger(row.limit) || row.limit < 1 || row.limit > 1024 || (row.bands !== null && (row.bands.states.length > 32 || row.bands.legacyKinds.length > 32))) throw new Error('Invalid native hunt bound');
|
|
1269
|
+
const bands = row.bands;
|
|
1270
|
+
if (bands !== null) host.useBodyBands({ rate: body => body.driven || (bands.scripted === true && body.scripted) || bands.states.includes(body.state) ? 'always'
|
|
1271
|
+
: bands.legacyKinds.includes(body.kind) ? 'legacy' : 'ai', ...(ports.present === undefined ? {} : { present: ports.present }) });
|
|
1272
|
+
const reach = (actor: HuntBody, point: Vector3): boolean => canReach(actor, point, host.physics);
|
|
1273
|
+
const hunt = new StalkerBrain<HuntBody>({ pattern: 'hunt', config: { rng: ports.rng, fight: row.fight, faunaTuning: () => row.tuning, species: kind => {
|
|
1274
|
+
const known = ports.species.get(kind); if (known === undefined) throw new Error(`Native hunt has no species row '${kind}'`); return known; } },
|
|
1275
|
+
ports: { ground: ports.ground, nav: () => ports.nav, reach, wanderGoal: actor => ports.wanderGoal?.(actor.herd) ?? null, unaware: () => false,
|
|
1276
|
+
now: () => host.clock.now * 1000, sound: () => undefined,
|
|
1277
|
+
charge: (actor, damage) => { host.combat.hit({ source: 'env', sourceTags: [`${row.hit.namespace}.${actor.kind}`, ...row.hit.tags], target: host.nearestPlayer(actor.position).health,
|
|
1278
|
+
amount: damage, point: actor.position.clone(), dir: new Vector3(), cause: { kind: actor.kind, label: actor.label } }); } },
|
|
1279
|
+
player: row.player === 'host' ? host.playerFocus : new Vector3(), sampleTerrain: actor => { actor.sampleTerrain(); } });
|
|
1280
|
+
return { hunt, reach };
|
|
1281
|
+
}
|
|
1282
|
+
/** Native species observations over an existing body and hunt owner. Policy and continuation remain caller-owned.
|
|
1283
|
+
* The context allocates once per body; each policy call refreshes only its dt and the actual host clock. */
|
|
1284
|
+
export function createNativeSpeciesContext<W, A extends HuntBody = HuntBody>(shared: {
|
|
1285
|
+
readonly host: SimHost; readonly hunt: StalkerBrain<A>; readonly rng: Rng;
|
|
1286
|
+
readonly world: W; readonly heightAt: (x: number, z: number) => number; readonly waterLevel: number;
|
|
1287
|
+
}, actor: A, herd: readonly A[] | null, label: string = actor.label): {
|
|
1288
|
+
observation: {
|
|
1289
|
+
dt: number; t: number; player: Vector3; playerSpeed: number; calm: boolean; rng: Rng;
|
|
1290
|
+
herd: readonly A[] | null; world: W; heightAt: (x: number, z: number) => number; waterLevel: () => number;
|
|
1291
|
+
attackRandom: { range: (min: number, max: number) => number };
|
|
1292
|
+
hurt: (damage: number) => void; sound: (name: string) => void;
|
|
1293
|
+
steer: (body: A, yaw: number, speed: number, turn: number) => void;
|
|
1294
|
+
confine: (body: A) => void; reach: (body: A) => boolean;
|
|
1295
|
+
claim: (body: A) => boolean; mayAttack: (body: A) => boolean;
|
|
1296
|
+
};
|
|
1297
|
+
bind: <P extends { dt: number; t: number }>(observation: P,
|
|
1298
|
+
brain: { think: (ports: P) => void; act: (ports: P) => void },
|
|
1299
|
+
policy: { snapshot: () => SimValue; restore: (value: SimValue) => void }) => KeptPolicy;
|
|
1300
|
+
} {
|
|
1301
|
+
const { host, hunt } = shared;
|
|
1302
|
+
if (host.entities.get(actor.entityId) !== actor) throw new Error('Native species context requires its actual host body');
|
|
1303
|
+
const player = host.playerFocus, dir = new Vector3(), attackRandom = host.rng.stream('ai');
|
|
1304
|
+
const tags: readonly CombatTag[] = [`creature.${actor.kind}`, 'feel.blow', 'cover.checked'], cause = { kind: actor.kind, label };
|
|
1305
|
+
const reach = (body: A): boolean => canReach(body, player, host.physics);
|
|
1306
|
+
const observation = {
|
|
1307
|
+
dt: 0, t: 0, player, playerSpeed: 0, calm: false, rng: shared.rng, herd, world: shared.world,
|
|
1308
|
+
heightAt: shared.heightAt, waterLevel: (): number => shared.waterLevel,
|
|
1309
|
+
attackRandom: { range: (min: number, max: number): number => attackRandom.range(min, max) },
|
|
1310
|
+
hurt: (damage: number): void => {
|
|
1311
|
+
if (!hunt.facing(actor, player, HURT_ARC) || !reach(actor)) return;
|
|
1312
|
+
host.combat.hit({ source: 'env', sourceTags: tags, target: host.nearestPlayer(actor.position).health, amount: damage,
|
|
1313
|
+
point: actor.position.clone(), dir, cause });
|
|
1314
|
+
},
|
|
1315
|
+
sound: (_name: string): void => undefined,
|
|
1316
|
+
steer: (body: A, yaw: number, speed: number, turn: number): void => { hunt.steerAny(body, yaw, speed, turn); },
|
|
1317
|
+
confine: (body: A): void => { hunt.confine(body); }, reach,
|
|
1318
|
+
claim: (body: A): boolean => hunt.tokens.take(body), mayAttack: (body: A): boolean => hunt.tokens.free(body),
|
|
1319
|
+
};
|
|
1320
|
+
return { observation, bind: (ports, brain, policy) => ({
|
|
1321
|
+
decide: dt => { ports.dt = dt; ports.t = host.clock.now; brain.think(ports); },
|
|
1322
|
+
move: dt => { ports.dt = dt; ports.t = host.clock.now; brain.act(ports); },
|
|
1323
|
+
snapshot: () => policy.snapshot(), restore: value => { policy.restore(value); },
|
|
1324
|
+
}) };
|
|
1325
|
+
}
|