@wildshard/engine 0.0.0 → 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 +1304 -4
- 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 -6
|
@@ -0,0 +1,1833 @@
|
|
|
1
|
+
import { app } from '../app/runtime';
|
|
2
|
+
import { engineString } from '../../../shared/engine/strings';
|
|
3
|
+
import { Scope } from '../../../shared/engine/app/scope';
|
|
4
|
+
import { FencedUnits } from '../render/fencedUnits';
|
|
5
|
+
import { FrameDrawRanges, type FrameDrawRange } from '../render/frameDrawRange';
|
|
6
|
+
import { casterOrder, firstViewCut, firstViewOrder } from '../render/firstFrameParts';
|
|
7
|
+
import { installBrowserScopeEnvironment } from '../app/view/scopeEnvironment';
|
|
8
|
+
import {pagePresentation} from '../app/view/presentation';
|
|
9
|
+
import {PresentationLoop} from '../app/view/presentationLoop';
|
|
10
|
+
import { SceneOwnership, sceneResourceOwner } from '../app/sceneOwnership';
|
|
11
|
+
import { UploadOwnership } from '../render/uploadOwnership';
|
|
12
|
+
import { composerAllocations, cachedResourceAllocations, type ResourceAllocation } from '../render/textureBytes';
|
|
13
|
+
import { ViewmodelRoot } from '../render/viewmodel';
|
|
14
|
+
import type { Phase } from '../app/systems';
|
|
15
|
+
import { currentOwner, enterOwner } from '../../../shared/engine/app/ownership';
|
|
16
|
+
import * as THREE from 'three';
|
|
17
|
+
import { createRenderer, type Renderer } from '../render/renderer';
|
|
18
|
+
import { CAMERA_FOV } from '../../../shared/engine/core/config';
|
|
19
|
+
import {
|
|
20
|
+
EffectComposer, type RenderPass, EffectPass, BloomEffect, FXAAEffect, VignetteEffect, ToneMappingEffect,
|
|
21
|
+
ToneMappingMode, BlendFunction, EffectAttribute, GodRaysEffect, LUT3DEffect, KernelSize, ChromaticAberrationEffect, HueSaturationEffect, BrightnessContrastEffect, NoiseEffect,
|
|
22
|
+
type Effect, Pass, MaskPass, ClearMaskPass,
|
|
23
|
+
} from 'postprocessing';
|
|
24
|
+
import type { N8AOPostPass } from 'n8ao';
|
|
25
|
+
import { halfGodRaysMask, ldrOutputBuffer, quarterBloom } from '../render/lighterTargets';
|
|
26
|
+
import { installAoTransparency } from '../render/aoTransparency';
|
|
27
|
+
import { protectDisplayColour, protectDisplayColourAo } from '../render/displayColour';
|
|
28
|
+
import { retried } from '../boot/retry';
|
|
29
|
+
import { RegionCinematic } from '../render/regionCinematic';
|
|
30
|
+
import { prepareWorldLook, CINEMATIC_FX, ENGINE_CHAIN_TUNING, type EngineChainKind, type EngineEffects, type LookComposition, type LookStrategy, type ReplaceLook } from '../render/look';
|
|
31
|
+
import { resolveTierKnobs, type LevelSpec, type TierKnobs } from '../../../shared/engine/level/spec';
|
|
32
|
+
import { installAtmosphere } from '../world/Atmosphere';
|
|
33
|
+
import { installFogPatch } from '../render/fogPatches';
|
|
34
|
+
import { setAnisotropy } from './assets';
|
|
35
|
+
import { SkyRig as Sky } from '../world/skyRig';
|
|
36
|
+
import type { BackdropLayer } from '../world/backdropLayer';
|
|
37
|
+
import { GradeEffect } from './Grade';
|
|
38
|
+
import { VolumetricsEffect, makeNoiseTexture } from './Volumetrics';
|
|
39
|
+
import { TIER, TIER_CONFIG, frameCapFps, gfxPrefs, setMobileFrameCap, type Tier } from './tier';
|
|
40
|
+
import { pacedSkip, slowGpuPacingFor, webglRendererName, type SlowGpuPacing } from './slowGpuPacing';
|
|
41
|
+
import { worldTime } from '../../../shared/engine/core/time';
|
|
42
|
+
import { installViewport, viewportHeight } from './viewport';
|
|
43
|
+
import { FIXED_STEP, MAX_FIXED_STEPS } from '../../../shared/engine/core/fixedStep';
|
|
44
|
+
import { SHADOW_LAYER } from './shadowLayer';
|
|
45
|
+
import { WorldRenderPass } from './worldDepth';
|
|
46
|
+
import { ownComposerDepth } from '../render/composerDepth';
|
|
47
|
+
import { noteDrawnEnvironment } from '../render/drawnEnvironment';
|
|
48
|
+
import { makeSystem, setLoopState, systemFault, type GameSystem } from '../../../shared/engine/core/faults';
|
|
49
|
+
import { frameCost } from '../../../shared/engine/core/frameCost';
|
|
50
|
+
import { sustainedFrames } from './sustainedFrames';
|
|
51
|
+
import { diagnosticNow } from '../../../shared/engine/core/clock';
|
|
52
|
+
import { yieldTask } from '../../../shared/engine/core/workSlice';
|
|
53
|
+
import { buildHeld, heldDrawDeferred, noteFrameDrawn } from '../../../shared/engine/core/framePacing';
|
|
54
|
+
import { isDev, onDev } from './devMode';
|
|
55
|
+
import { activeDevPixels, drawingPixelRatio } from './devPixels';
|
|
56
|
+
import { graphicsMode, lowPowerOn, noteFastFrames, PIXELS_EVENT } from './graphicsMode';
|
|
57
|
+
import { flagOn, frameCapFor, noteShipped, presetLabel, setFrameReadout, type ShippedLook } from './graphicsQuality';
|
|
58
|
+
import { classifyFrames } from '../boot/lowPower';
|
|
59
|
+
import { boundEntryWarmup } from '../render/entryWarmupBound';
|
|
60
|
+
import { dropOutputDepth, installMemorySaver, shadowLights } from '../render/memorySaver';
|
|
61
|
+
import { dropShadowColour } from '../world/shadowVariants';
|
|
62
|
+
import { duringShadowPass } from '../world/cascadeCull';
|
|
63
|
+
import { recordGpuCheckpoint, traceBootPasses } from '../boot/gpuTrace';
|
|
64
|
+
import { exploreEntryPending, recordExploreFrame, recordBootCheckpoint, bootTraceActive } from '../boot/bootTrace';
|
|
65
|
+
import { cullPlaced } from '../models/place';
|
|
66
|
+
|
|
67
|
+
/** the world's pace during a hit-stop (not 0: nothing downstream has to cope with a zero dt) */
|
|
68
|
+
const HIT_STOP_SCALE = 0.04;
|
|
69
|
+
/** the frame cap's tolerance for vsync timestamp jitter (see Game.start) */
|
|
70
|
+
const FRAME_CAP_SLACK_MS = 4;
|
|
71
|
+
/**
|
|
72
|
+
* The frame cap's decision for one animation frame (Game.start's loop): `null` while the next capped frame is not yet
|
|
73
|
+
* due, else the cadence anchor to keep once this frame draws. A frame on time anchors at its own timestamp, as before. A
|
|
74
|
+
* frame drawn late (op-hitch48: a task held the main thread past its vsync) is drawn in its own slot: the anchor stays at
|
|
75
|
+
* `lastDrawn + 1/cap`, so the next frame is due on the old cadence instead of a whole vsync later too: one late frame,
|
|
76
|
+
* never a late frame and a slow one. The anchor stays within 1/cap - slack - one 60 Hz vsync (- 0.5 ms) of `t`, 12 ms
|
|
77
|
+
* at a 30 fps capture cap and nothing at 60, so the next frame can never land on the very next 60 Hz vsync (no
|
|
78
|
+
* 30 <-> 60 judder), and a long stall simply resyncs.
|
|
79
|
+
*/
|
|
80
|
+
export function frameCapAnchor(lastDrawn: number, t: number, cap: number): number | null {
|
|
81
|
+
const step = 1000 / cap, since = t - lastDrawn;
|
|
82
|
+
if (since < step - FRAME_CAP_SLACK_MS) return null;
|
|
83
|
+
if (since <= step + FRAME_CAP_SLACK_MS || !Number.isFinite(lastDrawn)) return t;
|
|
84
|
+
return Math.max(lastDrawn + step, t - Math.max(0, step - FRAME_CAP_SLACK_MS - 1000 / 60 - 0.5));
|
|
85
|
+
}
|
|
86
|
+
/** E153: the boot's warm-up draws of the world, one per quarter-turn (Game.warmTurn) */
|
|
87
|
+
const WARM_TURNS = 4;
|
|
88
|
+
/** LS8 (J188, J204): a first-frame slice whose fence took longer than this narrows every later slice to one new drawable,
|
|
89
|
+
* so a slow GPU (CI's SwiftShader at 4x CPU: 1.7-4.9 s for an eight-drawable slice of Driftwood) reports each pipeline
|
|
90
|
+
* build as it completes. A GPU the shaders step measured slow (`firstFrame`'s `narrow`) starts narrow instead: the slow
|
|
91
|
+
* slice that trips the fallback has already held the bar (Driftwood's fifth, two new materials, 2.3 s). */
|
|
92
|
+
const FIRST_DRAW_NARROW = { afterMs: 400, budget: { drawables: 1, newMaterials: 1, newBindings: 1, bufferBytes: 4_000_000 } } as const;
|
|
93
|
+
/** LS8 (J204, "weight steps by measured cost per kind"): one first-frame unit of each kind, in measured seconds, so the
|
|
94
|
+
* step's bar share follows where its time goes. Driftwood Isle, headless Chromium at 4x CPU (SwiftShader, the calibration
|
|
95
|
+
* profile of loadingPaths.ts), loading-card-proof --throttle --dump, 2026-11-09: 264 world drawables 41.8 s, 25 shadow
|
|
96
|
+
* maps 3.8 s, 5 views 0.96 s, 2 post passes 0.32 s. */
|
|
97
|
+
const FIRST_FRAME_SECONDS = { drawable: 0.158, shadowMap: 0.152, view: 0.192, postPass: 0.158, viewPart: 0.28, mapPart: 0.58 } as const;
|
|
98
|
+
/** LS11 (J204): on a GPU the shaders step measured slow, the first full view after the world's slices still cost one
|
|
99
|
+
* 1.3-1.9 s GPU unit (Driftwood, SwiftShader at 4x CPU, fenced: the same programs and draws, 45 ms when drawn again), so
|
|
100
|
+
* the bar sat still through it. Drawn first as growing prefixes of its draw order, the units were 0.15-0.56 s each and the full
|
|
101
|
+
* view after them 42 ms. The opaque order takes `opaque` parts, then the transparent order `transparent` more: drawn as
|
|
102
|
+
* one part, the transparent tail (the ocean, the shrine pool, flames, particles) was 1.5 s at load 35 and 3.3 s at load
|
|
103
|
+
* 60; in eight parts at load 15 they were 0.12-0.63 s, 2.27 s in all (`viewPart`). */
|
|
104
|
+
const FIRST_VIEW_PARTS = { opaque: 5, transparent: 3 } as const;
|
|
105
|
+
const FIRST_VIEW_UNITS = FIRST_VIEW_PARTS.opaque + FIRST_VIEW_PARTS.transparent;
|
|
106
|
+
/** LS11 (J204): the first full shadow map of the first pose (the CSM's near cascade) was one 1.3-1.5 s unit at load 35-60
|
|
107
|
+
* (the four after it 0.3-0.6 s). On a GPU the shaders step measured slow it is drawn first as growing prefixes of its
|
|
108
|
+
* casters, each a fenced unit, the last being the map itself: in thirds at load 15 the two prefixes took 0.83 s and
|
|
109
|
+
* 0.33 s (`mapPart`, the mean) and the whole map 0.47 s after them. */
|
|
110
|
+
const FIRST_MAP_PARTS = 4;
|
|
111
|
+
/** the three slots of one fixed step, in order: `pre` readies the world, `step` advances it, `post` moves against it */
|
|
112
|
+
export type FixedPhase = 'pre' | 'step' | 'post';
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* E142 (the 30-fps-at-2× lane): the god rays' passes only while the sun can be in the picture. GodRaysEffect.update
|
|
116
|
+
* copies the scene's depth at full size, draws the sun disc + halo into it (depth-tested), blurs that and marches the
|
|
117
|
+
* rays toward the sun's screen point — every frame, though with the sun outside the view the mask is empty and the rays
|
|
118
|
+
* are black, which the SCREEN blend leaves as the image. So: while the sun's bounds are outside the camera's frustum (or
|
|
119
|
+
* it is hidden, or the rays are at 0), the passes are skipped and the rays' target is cleared once. The same picture;
|
|
120
|
+
* −0.06…−0.15 ms on the M5 at 1206×2622 at the six E142 poses (the sun was out of view at all of them).
|
|
121
|
+
*/
|
|
122
|
+
function skipRaysOffscreen(rays: GodRaysEffect, camera: THREE.Camera, disc: THREE.Mesh): void {
|
|
123
|
+
const update = rays.update.bind(rays);
|
|
124
|
+
const frustum = new THREE.Frustum(), m = new THREE.Matrix4(), box = new THREE.Box3(), sphere = new THREE.Sphere(), v = new THREE.Vector3();
|
|
125
|
+
const clearColor = new THREE.Color();
|
|
126
|
+
const target: unknown = Reflect.get(rays, 'renderTargetB'); // the rays' output (`rays.texture`'s target; not in the typings)
|
|
127
|
+
if (!(target instanceof THREE.WebGLRenderTarget)) return;
|
|
128
|
+
let cleared = false;
|
|
129
|
+
const inView = (): boolean => {
|
|
130
|
+
if (!disc.visible || rays.blendMode.opacity.value <= 0) return false;
|
|
131
|
+
// the disc's world bounds, and each child's (the halo sprite faces the camera: its half-diagonal around its centre)
|
|
132
|
+
box.makeEmpty();
|
|
133
|
+
disc.traverseVisible((o) => {
|
|
134
|
+
if (o instanceof THREE.Sprite) {
|
|
135
|
+
o.getWorldPosition(v);
|
|
136
|
+
const e = o.matrixWorld.elements, r = Math.hypot(e[0], e[1], e[2]) * Math.SQRT1_2;
|
|
137
|
+
box.expandByPoint(v.clone().addScalar(r)); box.expandByPoint(v.clone().addScalar(-r));
|
|
138
|
+
} else box.expandByObject(o, false);
|
|
139
|
+
});
|
|
140
|
+
if (box.isEmpty()) return false;
|
|
141
|
+
box.getBoundingSphere(sphere);
|
|
142
|
+
frustum.setFromProjectionMatrix(m.multiplyMatrices(camera.projectionMatrix, camera.matrixWorldInverse));
|
|
143
|
+
return frustum.intersectsSphere(sphere);
|
|
144
|
+
};
|
|
145
|
+
rays.update = (renderer, inputBuffer, deltaTime) => {
|
|
146
|
+
if (inView()) { cleared = false; update(renderer, inputBuffer, deltaTime); return; }
|
|
147
|
+
if (cleared) return;
|
|
148
|
+
const prev = renderer.getRenderTarget(), alpha = renderer.getClearAlpha();
|
|
149
|
+
renderer.getClearColor(clearColor);
|
|
150
|
+
renderer.setRenderTarget(target);
|
|
151
|
+
renderer.setClearColor(0x000000, 0);
|
|
152
|
+
renderer.clear(true, false, false);
|
|
153
|
+
renderer.setClearColor(clearColor, alpha);
|
|
154
|
+
renderer.setRenderTarget(prev);
|
|
155
|
+
cleared = true;
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* An effect whose blend opacity is 0 composites nothing (every blend function mixes by it): its own offscreen passes
|
|
161
|
+
* (`update`: the bloom's luminance and mip chain, the rays' light pass and blur, the volumetric march) wait until it shows
|
|
162
|
+
* again, when its next update runs before the frame composites it. A look that grades in its own passes (Nalati's post
|
|
163
|
+
* graph) keeps the engine chain at opacity 0: its census drew 12 renders a frame, 10 of them full-screen post passes.
|
|
164
|
+
* D178 (G813): while `paused` (a held crossing view) its offscreen passes wait too, and it composites what it last drew:
|
|
165
|
+
* the opacity, and so every program key, stays as it was.
|
|
166
|
+
*/
|
|
167
|
+
function skipWhileTransparent(effect: Effect, paused: () => boolean): void {
|
|
168
|
+
const update = effect.update.bind(effect);
|
|
169
|
+
effect.update = (renderer, inputBuffer, deltaTime) => { if (effect.blendMode.opacity.value > 0 && !paused()) update(renderer, inputBuffer, deltaTime); };
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/** D188 (G815): where a crossing reveals the player (render space) and how far round it the entry prepares first. */
|
|
173
|
+
interface EntryArrival { readonly at: THREE.Vector3; readonly radius: number }
|
|
174
|
+
/** D188: the arrival's radius, the held view's draw range (D175, G813): what the player sees from the entry is drawn
|
|
175
|
+
* before the reveal; beyond it, content waits for the after-reveal warm-up. */
|
|
176
|
+
const ARRIVAL_RADIUS = 125;
|
|
177
|
+
|
|
178
|
+
/** one engine colour chain, built (Game.buildComposer): its effects, in order, and by name */
|
|
179
|
+
interface BuiltChain { clean: boolean; order: Effect[]; fx: Omit<EngineEffects, 'order'> }
|
|
180
|
+
|
|
181
|
+
/** An entered frame's preparation trace (`Game.entryPreparation`): its destination root, owner, running phase, measured
|
|
182
|
+
* work counts and scalar timings. A named type, so consumers of the emitted declarations see it (a private field's type
|
|
183
|
+
* is not emitted). */
|
|
184
|
+
export interface EntryPreparation {
|
|
185
|
+
root: string; owner: string; completed: boolean; phase: string;
|
|
186
|
+
progress: { done: number; total: number; detail: string } | null;
|
|
187
|
+
stages: { phase: string; elapsedMs: number; units: number; endAt: number }[];
|
|
188
|
+
/** D196: the stage a warm-up stall ended the wait in (the entry revealed with what had linked), else absent */
|
|
189
|
+
stalled?: string;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
export class Game {
|
|
193
|
+
private readonly frameDrawRanges: FrameDrawRanges = new FrameDrawRanges();
|
|
194
|
+
/** D178: whether this frame draws a held view (an enabled frame draw range): the post chain's offscreen work pauses. */
|
|
195
|
+
private postHeld = false;
|
|
196
|
+
/** Limit distant ordinary draws only during live presentation; the owning
|
|
197
|
+
* caller enables its range while waiting and disables it before playing. */
|
|
198
|
+
bindFrameDrawRange(owner: Scope, distance: number): FrameDrawRange { return this.frameDrawRanges.bind(owner, distance); }
|
|
199
|
+
/** Hidden owned roots skip only ordinary frame matrix walks. Explicit CPU,
|
|
200
|
+
* offscreen and visible-frame updates retain their original methods. */
|
|
201
|
+
bindHiddenFrameRoot(owner: Scope, root: THREE.Object3D): void { this.frameDrawRanges.trackHiddenRoot(owner, root); }
|
|
202
|
+
readonly app: typeof app = app;
|
|
203
|
+
renderer: Renderer;
|
|
204
|
+
/** The page's one rendered scene: the render pass, AO, shadows, the sky and the leak census read this root. */
|
|
205
|
+
readonly rootScene: THREE.Scene = new THREE.Scene();
|
|
206
|
+
private readonly sceneFrames: { scene: THREE.Scene }[] = [];
|
|
207
|
+
/**
|
|
208
|
+
* Where frame-local content goes: the root scene, or the scene subtree of the regional frame the traveller is in
|
|
209
|
+
* (`bindScene`). Content code adds to `game.scene`; it never needs to know which frame it was built in.
|
|
210
|
+
*/
|
|
211
|
+
get scene(): THREE.Scene { return this.sceneFrames.at(-1)?.scene ?? this.rootScene; }
|
|
212
|
+
/**
|
|
213
|
+
* While `entered` lives (or until the returned leave), `scene` resolves to `frame`, a subtree of the root scene placed
|
|
214
|
+
* at the region's render offset, so a region's content draws in place under the one renderer, camera and sky (the
|
|
215
|
+
* same stack model as `App.bindWater` and `LevelFrameBinding`). The root keeps rendering; nothing else changes.
|
|
216
|
+
*/
|
|
217
|
+
bindScene(frame: THREE.Scene, entered: Scope): () => void {
|
|
218
|
+
if (entered.disposed) throw new Error('Cannot bind a scene frame to a disposed scope');
|
|
219
|
+
if (frame === this.rootScene) throw new Error('The root scene is not a frame');
|
|
220
|
+
const entry = { scene: frame }; this.sceneFrames.push(entry);
|
|
221
|
+
let forget: () => void = () => undefined;
|
|
222
|
+
const leave = (): void => {
|
|
223
|
+
forget();
|
|
224
|
+
const index = this.sceneFrames.indexOf(entry);
|
|
225
|
+
if (index !== -1) this.sceneFrames.splice(index, 1);
|
|
226
|
+
};
|
|
227
|
+
forget = entered.capture('disposers', leave);
|
|
228
|
+
return leave;
|
|
229
|
+
}
|
|
230
|
+
camera: THREE.PerspectiveCamera;
|
|
231
|
+
readonly viewmodel: ViewmodelRoot;
|
|
232
|
+
private _composer: EffectComposer | null = null;
|
|
233
|
+
private compositionChanged = true;
|
|
234
|
+
private readonly compositionObservers = new Set<(bytes: number) => void>();
|
|
235
|
+
/** A budget owner reads actual allocated composer targets after warm-up and resize, without owning the renderer. */
|
|
236
|
+
observeComposerAllocation(read: (bytes: number) => void): () => void {
|
|
237
|
+
if (this._composer === null) throw new Error('Composer allocation observed before build');
|
|
238
|
+
read(this.composerAllocationResources().reduce((sum, row) => sum + row.bytes, 0));
|
|
239
|
+
this.compositionObservers.add(read);
|
|
240
|
+
const scope = this.engineScope.child('composer.allocation');
|
|
241
|
+
scope.onDispose(() => { this.compositionObservers.delete(read); });
|
|
242
|
+
this.levelScope.onDispose(() => { queueMicrotask(() => {
|
|
243
|
+
// All synchronous resource disposers finish first; a retired observer cannot write into another lifetime.
|
|
244
|
+
if (!scope.disposed && this._composer !== null) read(this.composerAllocationResources().reduce((sum, row) => sum + row.bytes, 0));
|
|
245
|
+
}); });
|
|
246
|
+
return () => { scope.dispose(); };
|
|
247
|
+
}
|
|
248
|
+
/** Actual composer target handles and its drawn shared fullscreen attributes. Read-only identities let an
|
|
249
|
+
* independent WebGL census reconcile nested bloom targets without relying on resource names. */
|
|
250
|
+
composerAllocationResources(): readonly ResourceAllocation[] {
|
|
251
|
+
if (this._composer === null) return [];
|
|
252
|
+
const rows = [...composerAllocations(this._composer, this.renderer)];
|
|
253
|
+
// postprocessing shares this one triangle across all passes. Only charge it after this renderer drew it.
|
|
254
|
+
const geometry: unknown = Reflect.get(Pass, 'fullscreenGeometry');
|
|
255
|
+
if (geometry instanceof THREE.BufferGeometry && this.uploads.resources().has(geometry)) {
|
|
256
|
+
rows.push(...cachedResourceAllocations(geometry).filter(row => row.kind === 'gpu'));
|
|
257
|
+
}
|
|
258
|
+
return rows;
|
|
259
|
+
}
|
|
260
|
+
private _sky: Sky | null = null;
|
|
261
|
+
// oxlint-disable-next-line typescript/no-deprecated -- Clock→Timer changes getDelta semantics; migrate separately
|
|
262
|
+
clock: THREE.Clock = new THREE.Clock();
|
|
263
|
+
// Frame phases (PHYSICS P2 / ENGINE-FIT E2): input → fixed steps (pre → step → post, × 0‥3) → update (`onUpdate`) → late → render.
|
|
264
|
+
// Every entry is a GameSystem (src/shared/engine/core/faults.ts, E133): called inside its own try/catch, switched off if it keeps throwing.
|
|
265
|
+
readonly engineScope: Scope = app.engineScope.child('game');
|
|
266
|
+
readonly levelScope: Scope = currentOwner() ?? new Scope('level');
|
|
267
|
+
/** Original player/camera lifetime; scoped world facades cannot replace it with a regional lifetime. */
|
|
268
|
+
readonly playerScope: Scope = this.levelScope;
|
|
269
|
+
get tier(): Tier { return TIER; }
|
|
270
|
+
private ownership: SceneOwnership | null = null;
|
|
271
|
+
private readonly uploads = new UploadOwnership(this.levelScope, app.assets);
|
|
272
|
+
readonly leakBaseline: Scope['census'] = new Scope('baseline').census;
|
|
273
|
+
hudBaseline = 0;
|
|
274
|
+
hudRetained: ReadonlySet<Element> = new Set();
|
|
275
|
+
retainedHudCount(): number {
|
|
276
|
+
return [...document.querySelectorAll('#hud *')].filter((node) => {
|
|
277
|
+
const owner = this.app.ui.hud.ownerOf(node);
|
|
278
|
+
return this.hudRetained.has(node) || (owner !== null && !owner.belongsTo(this.levelScope));
|
|
279
|
+
}).length;
|
|
280
|
+
}
|
|
281
|
+
/** Snapshot the engine rig before any level geometry is built. */
|
|
282
|
+
retainEngineScene(): void {
|
|
283
|
+
this.ownership = new SceneOwnership(this.rootScene, this.levelScope, this.app.assets);
|
|
284
|
+
this.ownership.retain(this.rootScene);
|
|
285
|
+
}
|
|
286
|
+
captureLevelResources(): void { this.ownership?.retainContainer(this._composer, this.engineScope); this.ownership?.capture(); }
|
|
287
|
+
retainKitResources(): void {
|
|
288
|
+
this.ownership?.retain(this.camera);
|
|
289
|
+
this.ownership?.retainContainer(this._composer, this.engineScope);
|
|
290
|
+
this.ownership?.retainContainer(this._sky);
|
|
291
|
+
}
|
|
292
|
+
retainedSceneObjects(): number { return this.ownership?.retainedNodeCount() ?? 0; }
|
|
293
|
+
retainedGpuCounts(): { geometries: number; textures: number; programs: number } {
|
|
294
|
+
const live = this.uploads.resources();
|
|
295
|
+
const textures = new Set<unknown>(), programs = new Set<unknown>();
|
|
296
|
+
let geometries = 0;
|
|
297
|
+
for (const resource of new Set([...this.app.assets.retainedResources(), ...this.app.assets.acquiredResources()])) {
|
|
298
|
+
if (resource instanceof THREE.BufferGeometry && live.has(resource)) geometries++;
|
|
299
|
+
const value: unknown = this.renderer.properties.get(resource);
|
|
300
|
+
if (typeof value !== 'object' || value === null) continue;
|
|
301
|
+
const props = value;
|
|
302
|
+
if (resource instanceof THREE.Texture) {
|
|
303
|
+
const texture: unknown = Reflect.get(props, '__webglTexture'); if (texture !== undefined) textures.add(texture);
|
|
304
|
+
}
|
|
305
|
+
// X22: a retained render target's attachments are retained textures too (three counts each in info.memory.textures);
|
|
306
|
+
// counting only Texture resources charged every page-level target to the level as a leak (12 phone / 20 desktop)
|
|
307
|
+
if (resource instanceof THREE.WebGLRenderTarget) {
|
|
308
|
+
const colour: unknown = Reflect.get(resource, 'textures'), depth: unknown = Reflect.get(resource, 'depthTexture'), attachments: unknown[] = [depth];
|
|
309
|
+
if (Array.isArray(colour)) for (let i = 0; i < colour.length; i++) { const item: unknown = Reflect.get(colour, i); attachments.push(item); }
|
|
310
|
+
for (const attachment of attachments) {
|
|
311
|
+
const state: unknown = attachment instanceof THREE.Texture ? this.renderer.properties.get(attachment) : null;
|
|
312
|
+
const texture: unknown = typeof state === 'object' && state !== null ? Reflect.get(state, '__webglTexture') : undefined;
|
|
313
|
+
if (texture !== undefined) textures.add(texture);
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
if (resource instanceof THREE.Material) {
|
|
317
|
+
const compiled: unknown = Reflect.get(props, 'programs');
|
|
318
|
+
if (compiled instanceof Map) for (const program of compiled.values()) programs.add(program);
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
return { geometries, textures: textures.size, programs: programs.size };
|
|
322
|
+
}
|
|
323
|
+
gpuResourceDiagnostics(): object {
|
|
324
|
+
const retained = new Set<object>([...this.app.assets.retainedResources(), ...this.app.assets.acquiredResources()]);
|
|
325
|
+
const live = this.uploads.resources();
|
|
326
|
+
const read = (value: unknown, key: string): unknown => typeof value === 'object' && value !== null ? Reflect.get(value, key) : undefined;
|
|
327
|
+
return { total: { ...this.renderer.info.memory, programs: this.renderer.info.programs?.length ?? 0 },
|
|
328
|
+
// SF57: the live unowned uploads and those collected without a dispose (UploadOwnership.orphanCensus)
|
|
329
|
+
orphans: this.uploads.orphanCensus(),
|
|
330
|
+
retained: this.retainedGpuCounts(), resources: [...live].map((resource) => {
|
|
331
|
+
const props: unknown = this.renderer.properties.get(resource);
|
|
332
|
+
const compiled = read(props, 'programs'), source = read(resource, 'source'), image = read(source, 'data');
|
|
333
|
+
const owner = sceneResourceOwner(resource);
|
|
334
|
+
return { type: resource.constructor.name, uuid: read(resource, 'uuid'), name: read(resource, 'name'),
|
|
335
|
+
owner: owner === null ? null : { name: owner.name, disposed: owner.disposed, level: owner.belongsTo(this.levelScope) },
|
|
336
|
+
retained: retained.has(resource), texture: read(props, '__webglTexture') !== undefined,
|
|
337
|
+
programs: compiled instanceof Map ? [...compiled.values()].map((p: unknown) => read(p, 'id')) : [],
|
|
338
|
+
source: read(source, 'uuid'), image: { width: read(image, 'width'), height: read(image, 'height'), src: read(image, 'src') },
|
|
339
|
+
allocation: read(resource, '__f8Allocation') };
|
|
340
|
+
}) };
|
|
341
|
+
}
|
|
342
|
+
unloadLevel(): void {
|
|
343
|
+
if (this.levelScope.disposed) return;
|
|
344
|
+
this.captureLevelResources();
|
|
345
|
+
this.app.setState('loading');
|
|
346
|
+
this.frameGate = () => false;
|
|
347
|
+
this.levelScope.dispose();
|
|
348
|
+
this.app.events.emit('level.unloaded', { id: this.levelId });
|
|
349
|
+
}
|
|
350
|
+
registrationScope: Scope = this.engineScope;
|
|
351
|
+
private readonly fixed: Record<FixedPhase, Phase> = { pre: 'fixed.pre', step: 'fixed.step', post: 'fixed.post' };
|
|
352
|
+
/** SF57: each live system's fault record, keyed by the app's own system row, so a retired world's systems (and the closures
|
|
353
|
+
* they hold) go with their row; a re-registered id starts a fresh record. */
|
|
354
|
+
private readonly faultSystems = new WeakMap<object, GameSystem<(dt: number, t: number) => void>>();
|
|
355
|
+
private anonymous = 0;
|
|
356
|
+
/** E357 F2: list order is the execution order; observation never registers a system. */
|
|
357
|
+
systemLabels(): Record<'input' | 'fixed.pre' | 'fixed.step' | 'fixed.post' | 'update' | 'late', string[]> {
|
|
358
|
+
const phases = this.app.systemsByPhase();
|
|
359
|
+
return {
|
|
360
|
+
input: phases.input.map((s) => s.id),
|
|
361
|
+
'fixed.pre': phases['fixed.pre'].map((s) => s.id),
|
|
362
|
+
'fixed.step': phases['fixed.step'].map((s) => s.id),
|
|
363
|
+
'fixed.post': phases['fixed.post'].map((s) => s.id),
|
|
364
|
+
update: phases.update.map((s) => s.id),
|
|
365
|
+
late: phases.late.map((s) => s.id),
|
|
366
|
+
};
|
|
367
|
+
}
|
|
368
|
+
levelSystemIds(): string[] { return this.app.systemIds(this.levelScope); }
|
|
369
|
+
/** The bootstrap boundary: everything registered next belongs to the level. */
|
|
370
|
+
beginLevelSystems(): void {
|
|
371
|
+
this.app.cpu.bind(this.levelScope, this.levelId);
|
|
372
|
+
this.registrationScope = this.levelScope; this.app.levelScope = this.levelScope;
|
|
373
|
+
enterOwner(this.levelScope);
|
|
374
|
+
}
|
|
375
|
+
/** the sky + the draw: core (a throw there that repeats is fatal, faults.ts) */
|
|
376
|
+
private readonly renderSystem = makeSystem(null, 'render', true, 'render');
|
|
377
|
+
/** frames drawn since start() (the fault streak counts in these) */
|
|
378
|
+
private frameNo = 0;
|
|
379
|
+
/** true once a core system died (faults.ts 'fatal'): the loop stops; the fatal modal is up */
|
|
380
|
+
dead = false;
|
|
381
|
+
private fixedAcc = 0;
|
|
382
|
+
private firstFixedStep = true;
|
|
383
|
+
/** 0‥1: how far this frame's render sits past the last fixed step (interpolate anything the fixed step moves) */
|
|
384
|
+
alpha = 0;
|
|
385
|
+
/** fixed steps run this frame (hit-stop does not change simulation time) */
|
|
386
|
+
fixedSteps = 0;
|
|
387
|
+
stats = { fps: 0, frames: 0, acc: 0 };
|
|
388
|
+
/** last 120 frame times in ms (ring; `frameI` is the next slot) — the perf meter reads p50/p95 from it */
|
|
389
|
+
frameMs: Float32Array<ArrayBuffer> = new Float32Array(120); frameI = 0;
|
|
390
|
+
/** the same frames' main-thread time in ms (input → the frame submitted), slot for slot with `frameMs` (src/client/engine/ui/perfProbe.ts) */
|
|
391
|
+
workMs: Float32Array<ArrayBuffer> = new Float32Array(120);
|
|
392
|
+
/** …of which the game logic (input → fixed steps → updaters → late) and the draw's CPU side (sky + composer.render) */
|
|
393
|
+
updateMs: Float32Array<ArrayBuffer> = new Float32Array(120); renderMs: Float32Array<ArrayBuffer> = new Float32Array(120);
|
|
394
|
+
/** frames drawn since start() */
|
|
395
|
+
frameCount = 0;
|
|
396
|
+
/** Browser rAF timestamp of the last completed draw; null for the initial synchronous draw.
|
|
397
|
+
* Cadence reads this delivered-frame clock; callback-start work and polling use separate clocks. */
|
|
398
|
+
frameRafTime: number | null = null;
|
|
399
|
+
/** E357 F2: simulation time observed only on a drawn frame; the wall clock still runs behind menus. */
|
|
400
|
+
private _frameTime = 0;
|
|
401
|
+
get frameTime(): number { return this._frameTime; }
|
|
402
|
+
/** draw calls / triangles of the last whole frame (all composer passes) */
|
|
403
|
+
lastFrame = { calls: 0, triangles: 0 };
|
|
404
|
+
/** WebGL context loss bookkeeping (iOS drops the context in the background); the perf meter shows it */
|
|
405
|
+
gl = { lostAt: 0, restoredAt: 0, events: 0 };
|
|
406
|
+
/** Return false to skip a whole frame (updaters + render): a menu covering the canvas, a still title on a phone. */
|
|
407
|
+
private gate: () => boolean = () => true;
|
|
408
|
+
get frameGate(): () => boolean { return this.gate; }
|
|
409
|
+
set frameGate(gate: () => boolean) { this.gate=gate;pagePresentation.refresh();this.kickLoop(); }
|
|
410
|
+
/** GPU recovery (src/client/engine/core/GpuRecovery.ts): true while the WebGL context is lost or being rebuilt — no tick, no draw, not even a forced frame */
|
|
411
|
+
hold = false;
|
|
412
|
+
/** Re-evaluate presentation after input or ownership changes; a covered world remains parked. Set by start(). */
|
|
413
|
+
kickLoop: () => void = () => undefined;
|
|
414
|
+
/** Request a fresh frame on the next playable turn; covered/hidden worlds stay parked.
|
|
415
|
+
* Explicit, counted loader/title warm-up uses hiddenFrame instead. */
|
|
416
|
+
primeFrame: () => void = () => undefined;
|
|
417
|
+
/**
|
|
418
|
+
* FC2 (frame cost: nothing drawn behind the loader): ONE whole frame (the systems' step and the draw) now, in this task,
|
|
419
|
+
* even with the gate shut. The loader pays the first world frame and its ready frame with it under the opaque card,
|
|
420
|
+
* instead of free-running world frames behind it.
|
|
421
|
+
*/
|
|
422
|
+
hiddenFrame: () => void = () => undefined;
|
|
423
|
+
/**
|
|
424
|
+
* The first frame's view without its draw: ONE systems step and the view's preparation (the player's eye and FOV on the
|
|
425
|
+
* camera, the shard's per-frame look, placed copies culled for the view) now, even with the gate shut and before
|
|
426
|
+
* start(). Until the first step the camera stands at the origin, so a boot warm-up taken after this links what the
|
|
427
|
+
* next frame draws. Nothing is drawn, and the loop itself still starts parked in start().
|
|
428
|
+
*/
|
|
429
|
+
stepFrame(): void {
|
|
430
|
+
if (this.dead || pagePresentation.state === 'hidden') return;
|
|
431
|
+
const frame = this.pageFrame();
|
|
432
|
+
this.stepOnly = true;
|
|
433
|
+
try { frame.draw(undefined, true); } finally { this.stepOnly = false; }
|
|
434
|
+
}
|
|
435
|
+
private stepOnly = false;
|
|
436
|
+
/** FC2: one draw of the world into the composer's input buffer (the real formats, nothing presented): what a live frame
|
|
437
|
+
* would build, upload and link, without a frame on screen. False when there is no composer target yet. */
|
|
438
|
+
offscreenDraw(): boolean {
|
|
439
|
+
const target: unknown = Reflect.get(this.composer, 'inputBuffer');
|
|
440
|
+
if (!(target instanceof THREE.WebGLRenderTarget)) return false;
|
|
441
|
+
const prev = this.renderer.getRenderTarget();
|
|
442
|
+
this.renderer.setRenderTarget(target);
|
|
443
|
+
try { this.renderer.render(this.rootScene, this.camera); }
|
|
444
|
+
finally { this.renderer.setRenderTarget(prev); }
|
|
445
|
+
return true;
|
|
446
|
+
}
|
|
447
|
+
private captures: { maxW: number; resolve: (c: HTMLCanvasElement) => void }[] = [];
|
|
448
|
+
/** A copy of the next rendered frame, at most `maxW` px wide (the review inbox's screenshot, src/client/engine/ui/Feedback.ts). The drawing
|
|
449
|
+
* buffer is not preserved, so the copy is taken in the same task as composer.render(); it resolves on the next frame drawn. */
|
|
450
|
+
captureFrame(maxW: number): Promise<HTMLCanvasElement> { return new Promise((resolve) => { this.captures.push({ maxW, resolve }); }); }
|
|
451
|
+
private flushCaptures(): void {
|
|
452
|
+
const src = this.canvas;
|
|
453
|
+
for (const { maxW, resolve } of this.captures.splice(0)) {
|
|
454
|
+
const k = Math.min(1, maxW / Math.max(1, src.width));
|
|
455
|
+
const c = document.createElement('canvas'); c.width = Math.round(src.width * k); c.height = Math.round(src.height * k);
|
|
456
|
+
c.getContext('2d')?.drawImage(src, 0, 0, c.width, c.height);
|
|
457
|
+
resolve(c);
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
/**
|
|
461
|
+
* A small still of the world as it stands, now: one frame rendered and copied in the same task (the drawing buffer
|
|
462
|
+
* is not preserved). The app-switch resume screen's backdrop, taken as the page hides (E61, GpuRecovery.ts). Null
|
|
463
|
+
* before the composer exists or on a dead context.
|
|
464
|
+
*/
|
|
465
|
+
/** A shard's per-frame render uniforms, re-read for the camera as it stands now: a render outside the loop from a
|
|
466
|
+
* moved camera (Model Explorer's catalog thumbnail) must call it first. Nine Dragon's silk fog is measured from the
|
|
467
|
+
* camera `frame()` saw, so a thumbnail fogged from the turntable's eye came out a white silhouette (E289). */
|
|
468
|
+
shardFrame(): void { this.camera.updateMatrixWorld(); this.lookStrategy?.frame?.(0, this.clock.elapsedTime); }
|
|
469
|
+
|
|
470
|
+
/** The official map bake's world-height override, independent of scene material families.
|
|
471
|
+
* The caller owns disposal; ordinary frames never instantiate this capture-only material. */
|
|
472
|
+
captureHeightMaterial(): THREE.ShaderMaterial {
|
|
473
|
+
return new THREE.ShaderMaterial({
|
|
474
|
+
vertexShader: 'varying float vH; void main(){ vec4 p = vec4(position, 1.0);\n#ifdef USE_INSTANCING\n p = instanceMatrix * p;\n#endif\n vec4 w = modelMatrix * p; vH = w.y; gl_Position = projectionMatrix * viewMatrix * w; }',
|
|
475
|
+
fragmentShader: 'varying float vH; void main(){ float v = clamp((vH + 100.0) / 400.0, 0.0, 1.0) * 65535.0; gl_FragColor = vec4(floor(v / 256.0) / 255.0, mod(floor(v), 256.0) / 255.0, 1.0, 1.0); }',
|
|
476
|
+
side: THREE.DoubleSide, toneMapped: false,
|
|
477
|
+
});
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
snapshot(maxW: number): HTMLCanvasElement | null {
|
|
481
|
+
if (this._composer === null || this.hold || this.renderer.getContext().isContextLost()) return null;
|
|
482
|
+
this.lookStrategy?.frame?.(0, this.clock.elapsedTime);
|
|
483
|
+
this._composer.render(0);
|
|
484
|
+
const src = this.canvas, k = Math.min(1, maxW / Math.max(1, src.width));
|
|
485
|
+
const c = document.createElement('canvas'); c.width = Math.max(1, Math.round(src.width * k)); c.height = Math.max(1, Math.round(src.height * k));
|
|
486
|
+
c.getContext('2d')?.drawImage(src, 0, 0, c.width, c.height);
|
|
487
|
+
return c;
|
|
488
|
+
}
|
|
489
|
+
private renderPass!: RenderPass;
|
|
490
|
+
volumetrics!: VolumetricsEffect;
|
|
491
|
+
/** runtime handles on the colour chain (set by buildComposer) — the day/night clock + weather retune them */
|
|
492
|
+
post: { grade: GradeEffect; saturation: HueSaturationEffect; contrast: BrightnessContrastEffect; bloom: BloomEffect; vignette: VignetteEffect; rays: GodRaysEffect | null; /** the AO pass (null: the tier or level draws none) */ ao: N8AOPostPass | null; tone: ToneMappingEffect } | null = null;
|
|
493
|
+
/** the post chain — set by buildComposer(); resize() and the loop hold the nullable field directly */
|
|
494
|
+
get composer(): EffectComposer { if (this._composer === null) throw new Error('Game.composer read before buildComposer()'); return this._composer; }
|
|
495
|
+
/** whether buildComposer() has run (an early scene-only shader pass runs before it, DL10) */
|
|
496
|
+
get composerBuilt(): boolean { return this._composer !== null; }
|
|
497
|
+
/** the sky — set by buildSky() */
|
|
498
|
+
get sky(): Sky { if (this._sky === null) throw new Error('Game.sky read before buildSky()'); return this._sky; }
|
|
499
|
+
|
|
500
|
+
readonly level: LevelSpec;
|
|
501
|
+
public canvas: HTMLCanvasElement;
|
|
502
|
+
constructor(canvas: HTMLCanvasElement, context: WebGL2RenderingContext, level: LevelSpec) {
|
|
503
|
+
installBrowserScopeEnvironment({ Mesh: THREE.Mesh, InstancedMesh: THREE.InstancedMesh });
|
|
504
|
+
this.canvas = canvas;
|
|
505
|
+
this.level = level;
|
|
506
|
+
this.app.scene = this.rootScene;
|
|
507
|
+
this.app.render = this;
|
|
508
|
+
enterOwner(this.engineScope);
|
|
509
|
+
installAtmosphere(level.atmosphere); // the engine fog (slot 100); a level look's own fog (LookStrategy.fog, slot 300) installs in buildSky, before anything compiles
|
|
510
|
+
installViewport(); // --ws-vh: the real height (an iOS home-screen app reports innerHeight a status bar short — viewport.ts)
|
|
511
|
+
const tracedBoot = bootTraceActive();
|
|
512
|
+
if (tracedBoot) recordBootCheckpoint('renderer:before', { userAgent: navigator.userAgent.slice(0, 250), devicePixelRatio: window.devicePixelRatio });
|
|
513
|
+
try {
|
|
514
|
+
this.renderer = createRenderer(canvas, context, { assets: app.assets, scope: this.engineScope, uploads: this.uploads });
|
|
515
|
+
} catch (error) {
|
|
516
|
+
if (tracedBoot) recordBootCheckpoint('renderer:failed', { message: error instanceof Error ? error.message.slice(0, 250) : String(error).slice(0, 250) });
|
|
517
|
+
throw error;
|
|
518
|
+
}
|
|
519
|
+
if (tracedBoot) recordGpuCheckpoint(this.renderer, 'renderer:created');
|
|
520
|
+
// QA row 25 / MG2: a Developer's screen × density pick (core/devPixels.ts), else a phone's Low graphics
|
|
521
|
+
// (core/graphicsMode.ts), stands in for the tier's cap; either applies live
|
|
522
|
+
this.renderer.setPixelRatio(drawingPixelRatio(window.devicePixelRatio, TIER_CONFIG.dpr, this.phoneGraphics));
|
|
523
|
+
// the new ratio waits for the frame that draws (RT3: never in the task that decided it, whose cleared canvas nothing
|
|
524
|
+
// would replace; under a menu or the title the world stays as it was until play draws again)
|
|
525
|
+
const repixel = (): void => { const ratio = drawingPixelRatio(window.devicePixelRatio, TIER_CONFIG.dpr, this.phoneGraphics); this.pickedRatio = ratio === this.renderer.getPixelRatio() ? null : ratio; this.applyQuality(); };
|
|
526
|
+
this.engineScope.listen(document, PIXELS_EVENT, repixel);
|
|
527
|
+
// MG8 prototype: the player has control, so the boot's shadow draws are done: a no-shadows mode clears the maps once more
|
|
528
|
+
this.engineScope.listen(document, 'ws:control-ready', () => { this.qualityClearedMaps = new WeakSet(); });
|
|
529
|
+
// MG12 prototype: the phone's cap follows the preset and Low Power live (60 only on exactly Low with Low Power off); read
|
|
530
|
+
// off a cached value, refreshed on every PIXELS_EVENT (a control, a preset, a Low Power flip) and the 2 s mode check
|
|
531
|
+
if (this.phoneGraphics) this.engineScope.onDispose(setMobileFrameCap(() => this.qualityCap));
|
|
532
|
+
// MG8 prototype: Settings ▸ Graphics' frame readout (fps over the last half second, the median and slow frames, draws)
|
|
533
|
+
this.engineScope.onDispose(setFrameReadout(() => {
|
|
534
|
+
const ms = [...this.frameMs].filter((v) => v > 0).sort((a, b) => a - b);
|
|
535
|
+
if (ms.length === 0) return '';
|
|
536
|
+
const at = (q: number): number => ms[Math.min(ms.length - 1, Math.floor(ms.length * q))] ?? 0;
|
|
537
|
+
// the cap is the one in force now; the rest is the play before this menu opened (a menu over the world holds its frames)
|
|
538
|
+
const cap = frameCapFps();
|
|
539
|
+
return `Cap now ${cap > 0 ? `${String(cap)} fps` : 'none'}. Last play: ${String(this.stats.fps)} fps · frame ${at(0.5).toFixed(1)} ms, slow ${at(0.95).toFixed(1)} ms · ${String(this.lastFrame.calls)} draws`;
|
|
540
|
+
}));
|
|
541
|
+
// MG3: Low Power Mode is switched in the phone's own settings, away from the page. As the page comes back it counts a second
|
|
542
|
+
// of its frames: faster than 30 Hz proves Low Power off (a busy page cannot prove it on: the idle title reads that). The
|
|
543
|
+
// reading itself lands, lapses or flips on its own clock, so the mode in force is compared every two seconds, and a
|
|
544
|
+
// change tells the page (Settings, the first-play card) and lands in the next drawn frame
|
|
545
|
+
this.engineScope.listen(document, 'visibilitychange', () => {
|
|
546
|
+
if (document.visibilityState !== 'visible') return;
|
|
547
|
+
const stamps: number[] = [];
|
|
548
|
+
const tick = (now: number): void => {
|
|
549
|
+
if (this.engineScope.disposed || document.visibilityState !== 'visible') return;
|
|
550
|
+
stamps.push(now);
|
|
551
|
+
if (now - (stamps[0] ?? now) < 1000) { this.engineScope.raf(tick); return; }
|
|
552
|
+
const frames = classifyFrames(stamps);
|
|
553
|
+
if (frames !== null && !frames.slow) noteFastFrames();
|
|
554
|
+
};
|
|
555
|
+
this.engineScope.raf(tick); repixel();
|
|
556
|
+
});
|
|
557
|
+
let mode = graphicsMode();
|
|
558
|
+
this.engineScope.interval(2000, () => {
|
|
559
|
+
this.qualityCap = this.phoneGraphics ? frameCapFor(presetLabel(), lowPowerOn()) : 30;
|
|
560
|
+
const now = graphicsMode();
|
|
561
|
+
if (now !== mode) { mode = now; document.dispatchEvent(new CustomEvent(PIXELS_EVENT)); }
|
|
562
|
+
});
|
|
563
|
+
this.engineScope.onDispose(onDev(repixel));
|
|
564
|
+
this.renderer.setSize(window.innerWidth, viewportHeight());
|
|
565
|
+
this.renderer.toneMapping = THREE.NoToneMapping; // tone mapping happens in the composer
|
|
566
|
+
this.renderer.outputColorSpace = THREE.SRGBColorSpace;
|
|
567
|
+
this.renderer.shadowMap.enabled = true;
|
|
568
|
+
this.renderer.shadowMap.type = THREE.PCFShadowMap; // r186 removed PCFSoft: it renders PCF anyway, and the type is in every program's cache key
|
|
569
|
+
setAnisotropy(this.renderer);
|
|
570
|
+
installMemorySaver(this.renderer); // SF22d
|
|
571
|
+
// shadow-only casters (shadowLayer.ts): the shadow pass tests layers against the view camera, so the view camera sees
|
|
572
|
+
// SHADOW_LAYER while — and only while — the shadow maps draw. Before this the cabins' depth proxies (PLAY-PERF lever
|
|
573
|
+
// 12, 46868b5) were never drawn: the cabins cast no wall / roof shadow at all.
|
|
574
|
+
const shadowMap = this.renderer.shadowMap, renderShadows = shadowMap.render.bind(shadowMap);
|
|
575
|
+
// D107: one pass's arguments ride in these slots, so the shadow pass makes no closure a frame
|
|
576
|
+
type ShadowArgs = Parameters<typeof renderShadows>;
|
|
577
|
+
let passLights: ShadowArgs[0] | null = null, passScene: ShadowArgs[1] | null = null, passCamera: ShadowArgs[2] | null = null;
|
|
578
|
+
const drawShadows = (): void => { if (passLights !== null && passScene !== null && passCamera !== null) renderShadows(passLights, passScene, passCamera); };
|
|
579
|
+
const dropColour = (rt: THREE.WebGLRenderTarget): void => { dropShadowColour(this.renderer, rt); };
|
|
580
|
+
shadowMap.render = (lights, scene, camera) => {
|
|
581
|
+
// MG8 prototype: Settings ▸ Graphics ▸ Shadows off clears each cascade once (a pass that draws nothing) and then draws
|
|
582
|
+
// none: nothing is shadowed and the shadow pass costs nothing
|
|
583
|
+
if (this.qualityShadowsOff) {
|
|
584
|
+
// Codex review: track the maps cleared, not the calls (a parked draw's stand-in map, or a map three made anew, is not
|
|
585
|
+
// the one a clear covered)
|
|
586
|
+
const shadows: { needsUpdate: boolean; map: object | null }[] = [];
|
|
587
|
+
for (const light of lights) { const shadow: unknown = Reflect.get(light, 'shadow'); if (shadow instanceof THREE.LightShadow) shadows.push(shadow as { needsUpdate: boolean; map: object | null }); }
|
|
588
|
+
if (shadows.every((shadow) => shadow.map !== null && this.qualityClearedMaps.has(shadow.map))) return;
|
|
589
|
+
const held = camera.layers.mask;
|
|
590
|
+
for (const shadow of shadows) shadow.needsUpdate = true;
|
|
591
|
+
camera.layers.disableAll();
|
|
592
|
+
try { renderShadows(lights, scene, camera); } finally { camera.layers.mask = held; }
|
|
593
|
+
for (const shadow of shadows) if (shadow.map !== null) this.qualityClearedMaps.add(shadow.map);
|
|
594
|
+
return;
|
|
595
|
+
}
|
|
596
|
+
const mask = camera.layers.mask;
|
|
597
|
+
camera.layers.enable(SHADOW_LAYER);
|
|
598
|
+
passLights = lights; passScene = scene; passCamera = camera;
|
|
599
|
+
try { duringShadowPass(drawShadows); } finally { camera.layers.mask = mask; passLights = null; passScene = null; passCamera = null; }
|
|
600
|
+
shadowLights(lights, dropColour); // SF22d: three's maps keep their depth only
|
|
601
|
+
};
|
|
602
|
+
this.camera = new THREE.PerspectiveCamera(CAMERA_FOV, window.innerWidth / viewportHeight(), 0.08, 2600);
|
|
603
|
+
this.viewmodel = new ViewmodelRoot();
|
|
604
|
+
this.camera.add(this.viewmodel); this.rootScene.add(this.camera);
|
|
605
|
+
this.engineScope.listen(window, 'resize', () => this.resize());
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
/** the shard's render strategy (ShardManifest.render), loaded by buildSky; null = the engine's chain as it is */
|
|
609
|
+
private lookStrategy: LookStrategy | null = null;
|
|
610
|
+
/** the shard's look strategy once buildSky has loaded it (its terrain painter and grass driver are read by Terrain / Grass) */
|
|
611
|
+
get look(): LookStrategy | null { return this.lookStrategy; }
|
|
612
|
+
private levelId = '';
|
|
613
|
+
/** where the strategy put its passes (asked once, in buildComposer) */
|
|
614
|
+
private composition: LookComposition | null = null;
|
|
615
|
+
|
|
616
|
+
/** `detail` names each stage on the loading card as it starts (DL21: a cold Simulator card sat 1.2 s on the bare step). */
|
|
617
|
+
async buildSky(detail?: (text: string) => void): Promise<Sky> {
|
|
618
|
+
this.levelId = this.level.id;
|
|
619
|
+
const loadLook = this.level.look;
|
|
620
|
+
const render = loadLook === undefined ? null : retried(loadLook); // the render code downloads while the sky builds; buildComposer reads both
|
|
621
|
+
if (render !== null) detail?.('render code');
|
|
622
|
+
this.lookStrategy = await render;
|
|
623
|
+
detail?.('sky and lighting');
|
|
624
|
+
const fog = this.lookStrategy?.fog; // after installAtmosphere (the constructor), before the sky or anything compiles (01 §13.2: its slot)
|
|
625
|
+
if (fog !== undefined) installFogPatch(`level.fog.${this.level.id}`, fog.order, fog.install, this.level.id);
|
|
626
|
+
this._sky = await new Sky(this.rootScene, this.camera, this.renderer).build(this.lookStrategy, { level: this.level, tier: TIER, look: this.level.lookLayer ?? null }); // its lighting, shadows, backdrop and sky dressing
|
|
627
|
+
this.levelScope.onDispose(() => { this.lookStrategy?.dispose?.(); this.lookStrategy = null; });
|
|
628
|
+
detail?.('world look');
|
|
629
|
+
await prepareWorldLook(this.lookStrategy, { renderer: this.renderer, sky: this._sky, scope: this.levelScope });
|
|
630
|
+
return this._sky;
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
/**
|
|
634
|
+
* The colour chain's pass: the engine's cinematic chain — or, with a shard render strategy, the order it composes from
|
|
635
|
+
* the engine's chain (`c.engineChain('clean' | 'cinematic')`, built on its first ask) and its own effects, asked here,
|
|
636
|
+
* once (ShardManifest.LookStrategy.compose).
|
|
637
|
+
*/
|
|
638
|
+
private colourPass(composer: EffectComposer, engineChain: (kind: EngineChainKind) => BuiltChain, aa: Effect | null): { pass: EffectPass; merged: boolean } {
|
|
639
|
+
// FC9: FXAA joins the colour pass, one full-frame pass fewer, where nothing in it is another convolution or moves UVs
|
|
640
|
+
// (postprocessing allows one of either per pass and runs it first, on the pass's input: the lit frame before grading),
|
|
641
|
+
// and only with no shard pass in the composer: around a shard's own passes (Nine's ink graph) the colour pass's input
|
|
642
|
+
// is not the frame the player sees, and a merged FXAA left Nine's wires stair-stepped (art/frame-cost/round-3-fc9-fxaa)
|
|
643
|
+
const pass = (effects: Effect[]): { pass: EffectPass; merged: boolean } => {
|
|
644
|
+
const C = this.composition, shardPasses = C !== null && [C.beforeScene, C.afterScene, C.beforeChain, C.afterChain].some(passes => (passes?.length ?? 0) > 0);
|
|
645
|
+
// G4: an empty chain (a shard's composite drew the frame into the composer's buffer) makes the FXAA pass the colour pass:
|
|
646
|
+
// FXAA alone in it, on that frame, as its own pass would run
|
|
647
|
+
const merged = aa !== null && (effects.length === 0 || !shardPasses && effects.every(effect => (effect.getAttributes() & EffectAttribute.CONVOLUTION) === 0 && !/\bmainUv\b/u.test(effect.getFragmentShader())));
|
|
648
|
+
return { pass: new EffectPass(this.camera, ...(merged && aa !== null ? [aa, ...effects] : effects)), merged };
|
|
649
|
+
};
|
|
650
|
+
const R = this.lookStrategy;
|
|
651
|
+
if (R === null || R.mode === 'replace') return pass(engineChain('cinematic').order); // a 'replace' look never reaches the engine chain (replaceComposer)
|
|
652
|
+
const scope = this.levelScope.child('look');
|
|
653
|
+
const asked: { built: BuiltChain | null } = { built: null };
|
|
654
|
+
const pick = (kind: EngineChainKind): BuiltChain => (asked.built = engineChain(kind));
|
|
655
|
+
if (R.chain !== undefined) pick(R.chain); // the declared kind first: a compose asking the other one throws
|
|
656
|
+
this.composition = R.compose({
|
|
657
|
+
app: this.app, scope, debug: { expose: (name, value) => { scope.onDispose(this.app.debug.scopedExpose(name, value)); } }, renderer: this.renderer, scene: this.rootScene, camera: this.camera, composer, tier: TIER,
|
|
658
|
+
get fx(): EngineEffects { const b = asked.built ?? pick('cinematic'); return { ...b.fx, order: b.order }; },
|
|
659
|
+
engineChain: (kind) => pick(kind).order,
|
|
660
|
+
});
|
|
661
|
+
return pass(this.composition.chain ?? (asked.built ?? pick('cinematic')).order);
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
/** the strategy's passes into their slots around the engine's (ShardManifest.LookComposition): scene → AO → colour → SMAA */
|
|
665
|
+
private placeShardPasses(composer: EffectComposer, colour: EffectPass): void {
|
|
666
|
+
const C = this.composition;
|
|
667
|
+
if (C === null) return;
|
|
668
|
+
const insert = (passes: Pass[] | undefined, at: number): void => { for (const [i, p] of (passes ?? []).entries()) composer.addPass(p, at + i); };
|
|
669
|
+
insert(C.beforeChain, composer.passes.indexOf(colour));
|
|
670
|
+
insert(C.afterChain, composer.passes.indexOf(colour) + 1);
|
|
671
|
+
insert(C.afterScene, composer.passes.indexOf(this.renderPass) + 1);
|
|
672
|
+
insert(C.beforeScene, 0);
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
private renderKnobs(): TierKnobs {
|
|
676
|
+
const kit: TierKnobs = {};
|
|
677
|
+
for (const schema of this.app.levelRegistrations.knobSchemas()) Object.assign(kit, schema.defaults);
|
|
678
|
+
return resolveTierKnobs({ ao: TIER_CONFIG.ao, slices: false, warmTurns: WARM_TURNS }, kit, this.level.tiers, TIER);
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
/**
|
|
682
|
+
* A `mode: 'replace'` look (01 §13.1): one composer (HalfFloat, `multisampling` from the tier's `msaa` knob, clamped to
|
|
683
|
+
* the GPU's samples, 0 while anti-aliasing is off) holding exactly the passes the shard's compose returns, in order.
|
|
684
|
+
*/
|
|
685
|
+
private replaceComposer(R: ReplaceLook): EffectComposer {
|
|
686
|
+
const msaa = TIER_CONFIG.smaa === 'off' ? 0 : this.renderKnobs().msaa ?? 0;
|
|
687
|
+
const composer = new EffectComposer(this.renderer, { frameBufferType: THREE.HalfFloatType, multisampling: Math.min(msaa, this.renderer.capabilities.maxSamples) });
|
|
688
|
+
ownComposerDepth(composer);
|
|
689
|
+
const scope = this.levelScope.child('look');
|
|
690
|
+
const { chain } = R.compose({ app: this.app, scope, debug: { expose: (name, value) => { scope.onDispose(this.app.debug.scopedExpose(name, value)); } }, renderer: this.renderer, scene: this.rootScene, camera: this.camera, composer, tier: TIER });
|
|
691
|
+
for (const p of chain) composer.addPass(p);
|
|
692
|
+
return composer;
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
/** n8ao's pass, fetched by prepareComposer only when this tier and level draw AO (J8: a phone entry loads no AO code) */
|
|
696
|
+
private aoPass: typeof N8AOPostPass | null = null;
|
|
697
|
+
/** Load what buildComposer will build from: the AO module when the tier and level have AO on (null: never fetched). */
|
|
698
|
+
async prepareComposer(): Promise<void> {
|
|
699
|
+
if (this.lookStrategy?.mode === 'replace' || this.aoPass !== null || !(this.renderKnobs().ao ?? TIER_CONFIG.ao)) return;
|
|
700
|
+
this.aoPass = (await import('n8ao')).N8AOPostPass;
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
buildComposer(): void {
|
|
704
|
+
if (this.lookStrategy?.mode === 'replace') { this._composer = this.replaceComposer(this.lookStrategy); return; } // the level look's whole chain
|
|
705
|
+
const { atmosphere: A } = this.level;
|
|
706
|
+
const { grade: G, look } = this.app.gradeFor({ grade: this.level.grade, ...(this.level.lookLayer === undefined ? {} : { look: this.level.lookLayer }) }); // + the look loop's layer (PH-L1 / L4)
|
|
707
|
+
const composer = new EffectComposer(this.renderer, { frameBufferType: THREE.HalfFloatType, multisampling: 0 });
|
|
708
|
+
ownComposerDepth(composer);
|
|
709
|
+
// the scene pass keeps the world's depth for the depth readers below (AO, the volumetric march, the god rays' sun mask):
|
|
710
|
+
// the viewmodels' depth clear used to leave them the weapon alone (worldDepth.ts)
|
|
711
|
+
// E142: on Pine Hollow's phone tier the viewmodels draw into near depth slices instead of clearing, so the world's
|
|
712
|
+
// depth needs no mid-pass copy (worldDepth.ts)
|
|
713
|
+
const knobs = this.renderKnobs();
|
|
714
|
+
const slices = knobs.slices ?? false; // E142 / E189: a level's tier knob (its phone tier's `slices`)
|
|
715
|
+
this.renderPass = new WorldRenderPass(this.rootScene, this.camera, composer, slices);
|
|
716
|
+
composer.addPass(this.renderPass);
|
|
717
|
+
|
|
718
|
+
let aoPass: N8AOPostPass | null = null;
|
|
719
|
+
// A level's tier data can keep its compositor below the transient boot peak.
|
|
720
|
+
if (knobs.ao ?? TIER_CONFIG.ao) {
|
|
721
|
+
const AoPass = this.aoPass;
|
|
722
|
+
if (AoPass === null) throw new Error('Game.buildComposer with AO on before prepareComposer()');
|
|
723
|
+
const ao = new AoPass(this.rootScene, this.camera, window.innerWidth, viewportHeight());
|
|
724
|
+
aoPass = ao;
|
|
725
|
+
// a level's tier knobs may tune it (LF1-4: a shardfile look's `light.ao`)
|
|
726
|
+
const aoRadius = knobs['ao.radius'], aoIntensity = knobs['ao.intensity'];
|
|
727
|
+
ao.configuration.aoRadius = typeof aoRadius === 'number' ? aoRadius : 2.5;
|
|
728
|
+
ao.configuration.distanceFalloff = 1.0;
|
|
729
|
+
ao.configuration.intensity = typeof aoIntensity === 'number' ? aoIntensity : 2.5;
|
|
730
|
+
ao.configuration.halfRes = true;
|
|
731
|
+
ao.configuration.screenSpaceRadius = false;
|
|
732
|
+
ao.configuration.gammaCorrection = false;
|
|
733
|
+
ao.configuration.color = new THREE.Color(0.05, 0.06, 0.05);
|
|
734
|
+
// its transparency pre-passes: without opaque multi-material meshes or depth-free transparents (PH-P2), and not at all
|
|
735
|
+
// when nothing would draw in them (SF69, bit-identical) — aoTransparency.ts
|
|
736
|
+
installAoTransparency(ao, this.rootScene, this.camera, { lean: () => this.aoLeanTransparency, skipEmpty: () => this.aoSkipEmptyTransparency });
|
|
737
|
+
protectDisplayColourAo(ao);
|
|
738
|
+
composer.addPass(ao);
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
const vol = new VolumetricsEffect(this.camera, makeNoiseTexture(), TIER_CONFIG.volumetricSteps, TIER_CONFIG.volumetricScale);
|
|
742
|
+
vol.setSun(this.sky.sunDir, new THREE.Color(...A.volumetricSunColor));
|
|
743
|
+
if (this.rootScene.fog) vol.setFogColor((this.rootScene.fog as THREE.Fog).color);
|
|
744
|
+
if (A.volumetric) vol.setMedium(A.volumetric);
|
|
745
|
+
this.volumetrics = vol;
|
|
746
|
+
// the colour chain, built by a factory: an Effect belongs to one EffectPass, so each chain gets its own instances
|
|
747
|
+
// the tier knobs `aa` and `godRays` (E189, Jake's picks from the before / after boards, progress/282–283, 2026-09-26:
|
|
748
|
+
// "no regression"): a level's phone frame may run one FXAA pass on the graded frame instead of SMAA's three, and leave
|
|
749
|
+
// out the god rays (the warm iPhone's grass frame was 48 ms with the post chain and 17 without)
|
|
750
|
+
// G749 (Jake's pick of the G713 lighter render targets): anti-aliasing is one FXAA pass on the graded frame wherever the
|
|
751
|
+
// tier or level has it on (SMAA's edge and weight targets are gone, E189's phone option for every tier)
|
|
752
|
+
// FC9 / QB20: the phone frame runs no FXAA pass by default (a full 2x-frame read and write, ~47 % of Driftwood's post
|
|
753
|
+
// GPU time); Settings ▸ Graphics ▸ Anti-aliasing On keeps the old look, and an explicit player choice beats a level's
|
|
754
|
+
// MG8: on a phone, Settings ▸ Graphics ▸ Anti-aliasing replaces the boot-time AA pref, so High's AA is the level's own
|
|
755
|
+
const levelAa = knobs.aa ?? (TIER === 'phone' || TIER_CONFIG.smaa === 'off' ? 'off' : 'fxaa');
|
|
756
|
+
const shippedAa = this.phoneGraphics ? levelAa : gfxPrefs.aa === 'on' ? 'fxaa' : gfxPrefs.aa === 'off' ? 'off' : levelAa;
|
|
757
|
+
// G945: the phone's engine chain keeps bloom off; desktop keeps its existing chain.
|
|
758
|
+
this.qualityShipped = { bloom: TIER !== 'phone', rays: knobs.godRays ?? true, aa: shippedAa !== 'off' };
|
|
759
|
+
noteShipped(this.qualityShipped);
|
|
760
|
+
// MG8: on a phone, Settings ▸ Graphics' Bloom, Sun rays and Anti-aliasing decide what the chain holds (since a preset: as
|
|
761
|
+
// shipped); a change rebuilds the chain live (applyQuality → rebuildComposer)
|
|
762
|
+
const chainNow = this.qualityChainWanted();
|
|
763
|
+
this.qualityChainBuilt = chainNow;
|
|
764
|
+
const aa = chainNow.fxaa ? 'fxaa' : 'off';
|
|
765
|
+
const fxaa = aa === 'off' ? null : new FXAAEffect();
|
|
766
|
+
const raysOn = chainNow.rays;
|
|
767
|
+
const bloomOn = chainNow.bloom;
|
|
768
|
+
const chain = (clean: boolean): BuiltChain => {
|
|
769
|
+
const godRays = new GodRaysEffect(this.camera, this.sky.sunDisc, {
|
|
770
|
+
blendFunction: BlendFunction.SCREEN, kernelSize: KernelSize.MEDIUM, density: 0.96, decay: 0.95, weight: 0.5,
|
|
771
|
+
exposure: 0.4, samples: TIER_CONFIG.godRaysSamples, clampMax: 1.0, resolutionScale: TIER_CONFIG.godRaysScale,
|
|
772
|
+
});
|
|
773
|
+
if (knobs.skipRaysOffscreen === true) skipRaysOffscreen(godRays, this.camera, this.sky.sunDisc); // the disc off screen = no rays to draw (E142, E189)
|
|
774
|
+
halfGodRaysMask(godRays); // G749: the rays' light mask at half the frame (lighterTargets.ts)
|
|
775
|
+
const tuning = ENGINE_CHAIN_TUNING[clean ? 'clean' : 'cinematic'];
|
|
776
|
+
const bloom = new BloomEffect({ intensity: G.bloomIntensity, luminanceThreshold: G.bloomThreshold, luminanceSmoothing: tuning.bloomSmoothing, mipmapBlur: true, radius: 0.6, levels: TIER_CONFIG.bloomLevels });
|
|
777
|
+
quarterBloom(bloom); // G749: luminance at a quarter of the frame, its mip chain one level smaller (lighterTargets.ts)
|
|
778
|
+
const held = (): boolean => this.postHeld;
|
|
779
|
+
skipWhileTransparent(bloom, held); skipWhileTransparent(godRays, held); skipWhileTransparent(vol, held);
|
|
780
|
+
const vignette = new VignetteEffect({ offset: 0.32, darkness: tuning.vignette });
|
|
781
|
+
const tone = new ToneMappingEffect({ mode: ToneMappingMode.AGX });
|
|
782
|
+
const grade = new HueSaturationEffect({ saturation: G.saturation });
|
|
783
|
+
const contrast = new BrightnessContrastEffect({ brightness: G.brightness, contrast: G.contrast });
|
|
784
|
+
const split = new GradeEffect(G, look);
|
|
785
|
+
if (!clean) this.grade = split;
|
|
786
|
+
this.post = { grade: split, saturation: grade, contrast, bloom, vignette, rays: raysOn ? godRays : null, ao: aoPass, tone };
|
|
787
|
+
if (!clean) {
|
|
788
|
+
const chroma = new ChromaticAberrationEffect({ offset: new THREE.Vector2(CINEMATIC_FX.chroma, CINEMATIC_FX.chroma), radialModulation: true, modulationOffset: CINEMATIC_FX.chromaModulation });
|
|
789
|
+
const grain = new NoiseEffect({ blendFunction: BlendFunction.OVERLAY, premultiply: true });
|
|
790
|
+
grain.blendMode.opacity.value = CINEMATIC_FX.grain;
|
|
791
|
+
this.sky.attachPost({ vol, rays: godRays, hueSat: grade }); // Pine Hollow's clock (PH-L2) turns the shafts, the rays and the saturation with the hour; a fixed sky ignores it
|
|
792
|
+
// a PBR shard's learned LUT (lut.ts, per shard — PINE-HOLLOW PH-L4) ends its grade, before the grain; no file = no
|
|
793
|
+
// LUT, the chain as before
|
|
794
|
+
const lut = this.sky.lut ? new LUT3DEffect(this.sky.lut, { inputColorSpace: THREE.SRGBColorSpace, tetrahedralInterpolation: true }) : null;
|
|
795
|
+
// one EffectPass for the whole chain: one program and one full-screen pass fewer per frame
|
|
796
|
+
const order: Effect[] = [vol, ...(raysOn ? [godRays] : []), ...(bloomOn ? [bloom] : []), chroma, vignette, tone, grade, contrast, split, ...(lut ? [lut] : []), grain];
|
|
797
|
+
return { clean, order, fx: { ao: aoPass, vol, godRays, bloom, chroma, vignette, tone, saturation: grade, contrast, grade: split, lut, grain } };
|
|
798
|
+
}
|
|
799
|
+
// the clean look (DRIFTWOOD-REMASTER L5): no volumetric haze, grain or fringe washing the toon bands to low
|
|
800
|
+
// contrast — the colour-ramp fog does the aerial perspective; the god rays stay faint, the vignette light
|
|
801
|
+
godRays.blendMode.opacity.value = tuning.rays; // faint (ENGINE_CHAIN_TUNING): looking into a midday sun must not wash the sand and lagoon to white
|
|
802
|
+
// bloom only what is really over 1.0 (the def's threshold): the sun, glints, glyphs, fireflies; the vignette light (both set above from the table)
|
|
803
|
+
// the learned LUT (X1, src/client/engine/world/lut.ts) is the last grade step: the palette fitted to the mockups. Always on — the
|
|
804
|
+
// user locked it in (E85); only Debug ▸ Look ▸ Learned LUT Off (the fit's own captures) builds without it
|
|
805
|
+
const lut = this.sky.lut ? new LUT3DEffect(this.sky.lut, { inputColorSpace: THREE.SRGBColorSpace, tetrahedralInterpolation: true }) : null;
|
|
806
|
+
const order: Effect[] = [...(raysOn ? [godRays] : []), ...(bloomOn ? [bloom] : []), vignette, tone, grade, contrast, split, ...(lut ? [lut] : [])];
|
|
807
|
+
return { clean, order, fx: { ao: aoPass, vol, godRays, bloom, chroma: null, vignette, tone, saturation: grade, contrast, grade: split, lut, grain: null } };
|
|
808
|
+
};
|
|
809
|
+
// the level look picks the chain (a compose may ask the clean L5 chain, E88, the user's Look Lab pick); every other
|
|
810
|
+
// level keeps the original haze + grain + fringe chain. One chain is built: its effects belong to one pass
|
|
811
|
+
let built: BuiltChain | null = null;
|
|
812
|
+
const { pass: colour, merged: fxaaMerged } = this.colourPass(composer, (kind) => {
|
|
813
|
+
built ??= chain(kind === 'clean');
|
|
814
|
+
if (built.clean !== (kind === 'clean')) throw new Error(`[look] the engine chain is already built '${built.clean ? 'clean' : 'cinematic'}'; a compose asks one kind, and reading c.fx before c.engineChain() builds 'cinematic', so a look that wants 'clean' asks c.engineChain('clean') first`);
|
|
815
|
+
return built;
|
|
816
|
+
}, TIER === 'phone' ? fxaa : null);
|
|
817
|
+
protectDisplayColour(colour);
|
|
818
|
+
composer.addPass(colour);
|
|
819
|
+
this.placeShardPasses(composer, colour); // a shard's own passes around the engine's (none without a render strategy)
|
|
820
|
+
// FXAA reads its pass's input image, so outside the phone's merged colour pass it gets a pass of its own on the graded
|
|
821
|
+
// frame (EffectPass orders effects by kind)
|
|
822
|
+
if (fxaa !== null && !fxaaMerged) composer.addPass(new EffectPass(this.camera, fxaa));
|
|
823
|
+
// the depth slices: every depth reader reads the scene target's own depth texture (the world + the weapon, no copy)
|
|
824
|
+
const sceneDepth = composer.inputBuffer.depthTexture;
|
|
825
|
+
if (slices && sceneDepth !== null) for (const p of composer.passes) if (p !== this.renderPass) p.setDepthTexture(sceneDepth);
|
|
826
|
+
dropOutputDepth(composer, this.renderPass); // SF22d: one composer depth buffer
|
|
827
|
+
// G749: with nothing between the scene and the colour pass, the output buffer only ever holds the graded frame
|
|
828
|
+
if (aoPass === null && composer.passes.indexOf(colour) === composer.passes.indexOf(this.renderPass) + 1) ldrOutputBuffer(composer);
|
|
829
|
+
this._composer = composer;
|
|
830
|
+
this.applyQuality();
|
|
831
|
+
}
|
|
832
|
+
|
|
833
|
+
/** MG12 prototype: the phone's frame cap in force (frameCapFor), cached for the loop */
|
|
834
|
+
private qualityCap: 30 | 60 = 30;
|
|
835
|
+
/** MG8 prototype: the shadows-off state (the shadow pass wrapper) and the cascade maps it has cleared */
|
|
836
|
+
private qualityShadowsOff = false;
|
|
837
|
+
private qualityClearedMaps = new WeakSet();
|
|
838
|
+
/** what the level ships (bloom, rays, edges), and what the chain was last built with */
|
|
839
|
+
private qualityShipped: ShippedLook = { bloom: TIER !== 'phone', rays: true, aa: false };
|
|
840
|
+
private qualityChainBuilt: { bloom: boolean; rays: boolean; fxaa: boolean } | null = null;
|
|
841
|
+
/** the chain the controls ask for now (off a phone: as shipped) */
|
|
842
|
+
private qualityChainWanted(): { bloom: boolean; rays: boolean; fxaa: boolean } {
|
|
843
|
+
const S = this.qualityShipped;
|
|
844
|
+
if (!this.phoneGraphics) return { bloom: S.bloom, rays: S.rays, fxaa: S.aa };
|
|
845
|
+
const mode = graphicsMode();
|
|
846
|
+
return { bloom: flagOn('bloom', mode, S.bloom), rays: flagOn('rays', mode, S.rays), fxaa: flagOn('aa', mode, S.aa) };
|
|
847
|
+
}
|
|
848
|
+
/**
|
|
849
|
+
* MG8 (meta MOBILE-GRAPHICS-PLAN MG8): Settings ▸ Graphics' controls, live, on a phone. Shadows through the wrapper above;
|
|
850
|
+
* bloom, sun rays and anti-aliasing (FXAA) by rebuilding the colour chain when what it should hold changes (an effect in the
|
|
851
|
+
* chain at opacity 0 still costs its composite; out of it, nothing). Pixel density follows through drawingPixelRatio. On
|
|
852
|
+
* High every control is as shipped, so this changes nothing.
|
|
853
|
+
*/
|
|
854
|
+
applyQuality(): void {
|
|
855
|
+
if (!this.phoneGraphics) return;
|
|
856
|
+
this.qualityCap = frameCapFor(presetLabel(), lowPowerOn());
|
|
857
|
+
const mode = graphicsMode();
|
|
858
|
+
// cleared again on every apply: the boot's own shadow draws (the loading card's parted map, the warm turns) fill the maps
|
|
859
|
+
// outside this wrapper's frames, so a clear made before them would not hold (and control-ready clears once more)
|
|
860
|
+
this.qualityShadowsOff = !flagOn('shadows', mode, true); this.qualityClearedMaps = new WeakSet();
|
|
861
|
+
const composer = this._composer;
|
|
862
|
+
if (composer === null) return;
|
|
863
|
+
const want = this.qualityChainWanted(), built = this.qualityChainBuilt;
|
|
864
|
+
if (built !== null && (want.bloom !== built.bloom || want.rays !== built.rays || want.fxaa !== built.fxaa)) { this.rebuildComposer(); return; }
|
|
865
|
+
this.kickLoop();
|
|
866
|
+
}
|
|
867
|
+
/** MG8 prototype: the composer again, as the controls now ask (its buffers freed; its effects left to the GC: a look's LUT
|
|
868
|
+
* texture is the sky's, and Effect.dispose would free it) */
|
|
869
|
+
private rebuildComposer(): void {
|
|
870
|
+
const old = this._composer;
|
|
871
|
+
if (old === null) return;
|
|
872
|
+
this._composer = null;
|
|
873
|
+
this.buildComposer();
|
|
874
|
+
(this._composer as EffectComposer | null)?.setSize(window.innerWidth, viewportHeight());
|
|
875
|
+
old.inputBuffer.dispose(); old.outputBuffer.dispose();
|
|
876
|
+
this.compositionChanged = true;
|
|
877
|
+
this.kickLoop();
|
|
878
|
+
}
|
|
879
|
+
|
|
880
|
+
/**
|
|
881
|
+
* Every frame, after the fixed steps. `label` names the system in error reports (default: the function's name); `core`
|
|
882
|
+
* marks one the game cannot run without — if it keeps throwing the loop stops and the fatal modal goes up, where any
|
|
883
|
+
* other system is just switched off (src/shared/engine/core/faults.ts).
|
|
884
|
+
*/
|
|
885
|
+
private register(phase: Phase, fn: (dt: number, t: number) => void, label?: string, core = false, scope = this.registrationScope, content = true): void {
|
|
886
|
+
const id = label === 'main' ? 'main.frame' : label ?? `engine.core.callback.${String(this.anonymous++)}`;
|
|
887
|
+
if (content) this.app.addContentSystem({ id, phase, run: fn, core }, scope);
|
|
888
|
+
else this.app.addSystem({ id, phase, run: fn, core }, scope);
|
|
889
|
+
}
|
|
890
|
+
onUpdate(fn: (dt: number, t: number) => void, label?: string, core = false): void { this.register('update', fn, label, core); }
|
|
891
|
+
/** One player-owned callback survives world-frame changes and ends with the original player scope. */
|
|
892
|
+
onPlayerUpdate(fn: (dt: number, t: number) => void, label: string): void { this.register('update', fn, label, false, this.playerScope, false); }
|
|
893
|
+
/** E357 F2: a temporary harness observer of simulation frames, removed when its walk finishes. */
|
|
894
|
+
watchFrames(fn: (dt: number) => void): () => void {
|
|
895
|
+
const scope = this.levelScope.child('observer');
|
|
896
|
+
this.register('update', fn, 'harness.walk', false, scope, false);
|
|
897
|
+
return () => { scope.dispose(); };
|
|
898
|
+
}
|
|
899
|
+
/** First in the frame: read controls into intents the fixed steps consume (the player's move, a queued jump). */
|
|
900
|
+
onInput(fn: (dt: number) => void, label?: string, core = false): void { this.register('input', fn, label, core); }
|
|
901
|
+
/** Once per fixed step (dt = FIXED_STEP), in phase order. */
|
|
902
|
+
onFixed(phase: FixedPhase, fn: (dt: number) => void, label?: string, core = false): void { this.register(this.fixed[phase], fn, label, core); }
|
|
903
|
+
/** After every updater: things that pose from this frame's final state (the camera from the interpolated player). */
|
|
904
|
+
onLate(fn: (dt: number) => void, label?: string, core = false): void { this.register('late', fn, label, core); }
|
|
905
|
+
|
|
906
|
+
/** a system threw (one try/catch per call, below): count it, report it; a core system that keeps failing stops the loop */
|
|
907
|
+
private fault(s: GameSystem<unknown>, e: unknown): void {
|
|
908
|
+
if (s.label !== 'engine.events') this.app.events.emit('fault', { source: s.label, message: e instanceof Error ? e.message : String(e), error: e });
|
|
909
|
+
if (systemFault(s, e, this.frameNo, diagnosticNow()) === 'fatal' && !this.dead) { this.dead = true; this.app.setState('error'); setLoopState('dead'); }
|
|
910
|
+
}
|
|
911
|
+
/** (a method, not the field: the loop's early-out narrows `this.dead` to false for the rest of the frame) */
|
|
912
|
+
private isDead(): boolean { return this.dead; }
|
|
913
|
+
/** one fixed phase, each system guarded */
|
|
914
|
+
private runPhase(phase: Phase, dt = FIXED_STEP, t = this.clock.elapsedTime): void {
|
|
915
|
+
if (this.app.state === 'paused') return;
|
|
916
|
+
const on = frameCost.on; // the dev fps panel's timing rows (src/shared/engine/core/frameCost.ts): one boolean read while it is closed
|
|
917
|
+
for (const spec of this.app.systemsByPhase()[phase]) {
|
|
918
|
+
let s = this.faultSystems.get(spec);
|
|
919
|
+
if (!s) { s = makeSystem(spec.run, spec.id, spec.core ?? false, spec.id); this.faultSystems.set(spec, s); }
|
|
920
|
+
if (!s.on) continue;
|
|
921
|
+
let t0: number | undefined;
|
|
922
|
+
try {
|
|
923
|
+
// Predicates and schedule lookups belong to the same system as its run.
|
|
924
|
+
// A bookkeeping refusal must not escape and skip the rest of the phase.
|
|
925
|
+
if (spec.when && !spec.when(this.app)) continue;
|
|
926
|
+
const scheduledDt = this.app.scheduler.systemDt(spec, dt);
|
|
927
|
+
if (scheduledDt === 0 && spec.tick && spec.tick !== 'always') continue;
|
|
928
|
+
if (on) t0 = diagnosticNow();
|
|
929
|
+
spec.run(scheduledDt, t);
|
|
930
|
+
} catch (e) { this.fault(s, e); }
|
|
931
|
+
if (t0 !== undefined) frameCost.system(s.label, diagnosticNow() - t0);
|
|
932
|
+
}
|
|
933
|
+
this.flushEvents(phase);
|
|
934
|
+
}
|
|
935
|
+
private readonly eventSystem = makeSystem(null, 'engine.events', false, 'engine.events');
|
|
936
|
+
private flushEvents(phase: Phase): void {
|
|
937
|
+
try { this.app.events.flush(phase); } catch (error) { this.fault(this.eventSystem, error); }
|
|
938
|
+
}
|
|
939
|
+
|
|
940
|
+
/** Run the fixed steps owed by real time; hit-stop only scales presentation. */
|
|
941
|
+
private runFixed(dt: number): void {
|
|
942
|
+
if ('app' in this && this.app.state === 'paused') { this.fixedSteps = 0; return; }
|
|
943
|
+
this.fixedAcc += dt;
|
|
944
|
+
// Loading and the first minimap/UI paint are not simulation time. Start live physics with one tick,
|
|
945
|
+
// even if the first eligible frame arrives late; deterministic capture retains its authored cadence.
|
|
946
|
+
if (this.firstFixedStep && this.app.clock.mode !== 'capture' && this.fixedAcc >= FIXED_STEP) this.fixedAcc = FIXED_STEP;
|
|
947
|
+
let n = 0;
|
|
948
|
+
while (this.fixedAcc >= FIXED_STEP && n < MAX_FIXED_STEPS) {
|
|
949
|
+
this.runPhase(this.fixed.pre);
|
|
950
|
+
this.runPhase(this.fixed.step);
|
|
951
|
+
this.runPhase(this.fixed.post);
|
|
952
|
+
this.fixedAcc -= FIXED_STEP; n++;
|
|
953
|
+
}
|
|
954
|
+
if (n === MAX_FIXED_STEPS && this.fixedAcc >= FIXED_STEP) this.fixedAcc %= FIXED_STEP;
|
|
955
|
+
this.alpha = this.fixedAcc / FIXED_STEP;
|
|
956
|
+
this.fixedSteps = n;
|
|
957
|
+
if (n > 0) this.firstFixedStep = false;
|
|
958
|
+
}
|
|
959
|
+
|
|
960
|
+
private stopLeft = 0;
|
|
961
|
+
/** Visual hit-stop. Presentation reads worldTime.scale; gameplay keeps real deltas and clocks. */
|
|
962
|
+
hitStop(seconds: number): void { this.stopLeft = Math.max(this.stopLeft, seconds); }
|
|
963
|
+
/** skip n8ao's depth-free transparency pre-pass (buildComposer; PH-P2) — a live switch for A/B captures */
|
|
964
|
+
aoLeanTransparency = true;
|
|
965
|
+
/** skip both n8ao transparency pre-passes when nothing would draw in them (aoTransparency.ts; SF69) — a live switch for A/B captures */
|
|
966
|
+
aoSkipEmptyTransparency = true;
|
|
967
|
+
/**
|
|
968
|
+
* A cinematic chain's shafts, fringe and grain for a page that runs another chain (`regionCinematic.ts`; the grid's frame);
|
|
969
|
+
* where this page's own chain leaves its god rays out (its tier's `godRays: false`), god rays built as the chain builds its
|
|
970
|
+
* own, for a region whose chain draws them (G321 part 5), their passes skipped while at 0 or with the sun out of view.
|
|
971
|
+
*/
|
|
972
|
+
regionCinematic(): RegionCinematic {
|
|
973
|
+
const rays = this.post?.rays === null ? new GodRaysEffect(this.camera, this.sky.sunDisc, {
|
|
974
|
+
blendFunction: BlendFunction.SCREEN, kernelSize: KernelSize.MEDIUM, density: 0.96, decay: 0.95, weight: 0.5,
|
|
975
|
+
exposure: 0.4, samples: TIER_CONFIG.godRaysSamples, clampMax: 1.0, resolutionScale: TIER_CONFIG.godRaysScale,
|
|
976
|
+
}) : null;
|
|
977
|
+
if (rays !== null) skipRaysOffscreen(rays, this.camera, this.sky.sunDisc);
|
|
978
|
+
return new RegionCinematic(this.camera, this.renderer, TIER_CONFIG, rays);
|
|
979
|
+
}
|
|
980
|
+
/** the scene pass draws the viewmodels into the depth slices (E142): the scene target's own depth is the world's */
|
|
981
|
+
get depthSlices(): boolean { return this.renderPass instanceof WorldRenderPass && this.renderPass.slices; }
|
|
982
|
+
/** the PBR chain's split-tone / look grade (buildComposer; its uniforms are live — the look loop tunes them in place) */
|
|
983
|
+
grade: GradeEffect | null = null;
|
|
984
|
+
|
|
985
|
+
/**
|
|
986
|
+
* Build every program the first frame would otherwise compile in one stall — the scene's
|
|
987
|
+
* materials, the shadow-depth variants, the sky background and the post chain — with progress
|
|
988
|
+
* (src/engine/boot/precompile.ts). Returns the distinct material count.
|
|
989
|
+
*/
|
|
990
|
+
|
|
991
|
+
/** Warm an attached sky against the allocated composer's actual target before exposing it.
|
|
992
|
+
* Before buildComposer, ordinary boot shader/first-frame stages own preparation; attachment
|
|
993
|
+
* and its environment remain valid without reading the not-yet-created composer. */
|
|
994
|
+
/** G639 frame floor: every attached sky layer's domes under the page's lights now (a grid crossing's settled lighting, a
|
|
995
|
+
* new cell PMREM): a layer prepared under another cell's lights linked its dome again on the road (Pine's sky dome, a
|
|
996
|
+
* 524 ms desktop link at its first road frame). No shader change: the same programs, keyed by the lights they draw under. */
|
|
997
|
+
async warmSkyLayers(): Promise<void> {
|
|
998
|
+
if (this._sky === null) return;
|
|
999
|
+
for (const layer of this._sky.attachedLayers()) {
|
|
1000
|
+
try { await this.warmSkyLayer(layer); } catch (error: unknown) { console.warn('[sky] layer warm-up stopped', error); }
|
|
1001
|
+
}
|
|
1002
|
+
}
|
|
1003
|
+
|
|
1004
|
+
async warmSkyLayer(layer: Pick<BackdropLayer, 'prepare'>): Promise<void> {
|
|
1005
|
+
const composer = this._composer;
|
|
1006
|
+
if (composer === null) return;
|
|
1007
|
+
// A live page spaces the layer's links and uploads by drawn frames, as warmSceneRoots does (sp-o284).
|
|
1008
|
+
if (this.frameCount === 0) { await layer.prepare(this.renderer, this.camera, composer.inputBuffer); return; }
|
|
1009
|
+
const { waitForDrawnFrame, LIVE_UPLOAD_BUDGET } = await import('../render/precompile');
|
|
1010
|
+
const current = (): boolean => !this.levelScope.disposed && this._composer === composer;
|
|
1011
|
+
await layer.prepare(this.renderer, this.camera, composer.inputBuffer, () => waitForDrawnFrame(this.engineScope, () => this.frameCount, current),
|
|
1012
|
+
LIVE_UPLOAD_BUDGET);
|
|
1013
|
+
}
|
|
1014
|
+
|
|
1015
|
+
/** Hide newly constructed models from this owner's asynchronous preparation until entry, on every browser.
|
|
1016
|
+
* The existing whole-world warm-up still sees them under the camera. Early boot has no live composer to draw.
|
|
1017
|
+
* The returned identity group is owned by the supplied scope. (sp-o6: unstaged on Chromium, a region's weapons built
|
|
1018
|
+
* mid-afterKit drew on the live camera between construction tasks, uploading their textures inside a travel frame,
|
|
1019
|
+
* the likely source of the Pine road's 200 ms draw-time upload of two 1024² bitmaps; staged, the warm-up uploads them.) */
|
|
1020
|
+
stageViewmodels(owner: Scope): THREE.Group | null {
|
|
1021
|
+
if (this._composer === null || this.frameCount === 0) return null;
|
|
1022
|
+
return this.viewmodel.stage(owner);
|
|
1023
|
+
}
|
|
1024
|
+
|
|
1025
|
+
/** Prepare newly streamed roots before exposure, using the allocated composer target.
|
|
1026
|
+
* Early boot retains ordinary whole-world preparation. Streamed views share the entered-frame
|
|
1027
|
+
* owner lifetime, so retirement fences every pending draw and link. Opt-in geometry preparation
|
|
1028
|
+
* also first-draws connected, hidden roots through the native parked-draw path before exposure. */
|
|
1029
|
+
async warmSceneRoots(roots: readonly THREE.Object3D[], current: () => boolean, futureLighting?: THREE.Object3D,
|
|
1030
|
+
options?: { readonly drawGeometry: true }): Promise<void> {
|
|
1031
|
+
const composer = this._composer;
|
|
1032
|
+
// Ordinary streaming/equipment keeps its whole-world boot preparation.
|
|
1033
|
+
// Explicit geometry preparation may borrow an already allocated target.
|
|
1034
|
+
if (composer === null) {
|
|
1035
|
+
if (options?.drawGeometry === true) throw new Error('Streamed geometry needs a prepared composer');
|
|
1036
|
+
return;
|
|
1037
|
+
}
|
|
1038
|
+
if (this.frameCount === 0 && options?.drawGeometry !== true) return;
|
|
1039
|
+
const { prepareSceneRoots, waitForDrawnFrame, LIVE_UPLOAD_BUDGET } = await import('../render/precompile');
|
|
1040
|
+
await boundEntryWarmup(this.levelScope, async withinBound => {
|
|
1041
|
+
const live = (): boolean => withinBound() && current() && this._composer === composer;
|
|
1042
|
+
// Forced hidden loader draws also increment frameCount. Only the
|
|
1043
|
+
// opt-in geometry path distinguishes covered work from live draws;
|
|
1044
|
+
// existing shader-only callers keep their original barrier.
|
|
1045
|
+
const pause = options?.drawGeometry === true
|
|
1046
|
+
? (): Promise<void> => this.frameCount > 0 && this.frameGate() && pagePresentation.state === 'play'
|
|
1047
|
+
? waitForDrawnFrame(this.levelScope, () => this.frameCount, live) : yieldTask(this.levelScope)
|
|
1048
|
+
: this.frameCount > 0 ? () => waitForDrawnFrame(this.levelScope, () => this.frameCount, live) : undefined;
|
|
1049
|
+
// before play (no frame drawn yet) the boot's Shaders step builds what the first frame draws and the rest is warmed
|
|
1050
|
+
// in play: a region's own warm-up here keeps only its resources then
|
|
1051
|
+
// DL21: Developer splits a geometry warm into its prepare and its parked draws (the loader's step 27 runs one a slab
|
|
1052
|
+
// part, ~75 ms each on a cold Simulator, serialized)
|
|
1053
|
+
const timed = options?.drawGeometry === true && isDev(), started = timed ? diagnosticNow() : 0;
|
|
1054
|
+
await prepareSceneRoots(this.renderer, this.camera, this.rootScene, composer.inputBuffer, roots, live, pause,
|
|
1055
|
+
LIVE_UPLOAD_BUDGET, this.frameCount > 0 || options?.drawGeometry === true, futureLighting);
|
|
1056
|
+
if (timed) performance.measure('wildshard.warm.geometry-prepare', { start: started, end: diagnosticNow() });
|
|
1057
|
+
if (options?.drawGeometry === true) {
|
|
1058
|
+
const drawsFrom = diagnosticNow();
|
|
1059
|
+
const { warmParkedDraws } = await import('../render/parkedDraws');
|
|
1060
|
+
// Before the first game draw the loading card owns task-paced work.
|
|
1061
|
+
// In play each native geometry draw crosses the completed-draw fence.
|
|
1062
|
+
const drawnPause = pause ?? ((): Promise<void> => yieldTask(this.levelScope));
|
|
1063
|
+
for (const root of roots) {
|
|
1064
|
+
let complete = false;
|
|
1065
|
+
await warmParkedDraws(this.renderer, this.rootScene, this.camera, composer.inputBuffer, root, live, drawnPause,
|
|
1066
|
+
{ budget: { drawables: 1, newMaterials: 1, bufferBytes: 4_000_000 }, onProgress: (done, total) => { complete = done === total; } });
|
|
1067
|
+
// The general parked warmer may leave failed draws to live entry.
|
|
1068
|
+
// A strict streamed publication cannot call that prepared.
|
|
1069
|
+
if (!complete) throw new Error('Streamed geometry preparation did not complete');
|
|
1070
|
+
}
|
|
1071
|
+
if (timed) performance.measure('wildshard.warm.geometry-draws', { start: drawsFrom, end: diagnosticNow() });
|
|
1072
|
+
}
|
|
1073
|
+
});
|
|
1074
|
+
}
|
|
1075
|
+
|
|
1076
|
+
private postPreparation: Promise<void> = Promise.resolve();
|
|
1077
|
+
/** Link an added display transform before publishing its revised live shader. Initial boot uses its ordinary
|
|
1078
|
+
* shader stage. Live additions serialize; entered-frame readiness awaits the latest preparation or its error. */
|
|
1079
|
+
preparePostPass(pass: EffectPass): Promise<void> {
|
|
1080
|
+
const composer = this._composer;
|
|
1081
|
+
if (composer === null || this.frameCount === 0) { pass.recompile(); return Promise.resolve(); }
|
|
1082
|
+
const current = (): boolean => !this.levelScope.disposed && this._composer === composer;
|
|
1083
|
+
const previous = this.postPreparation;
|
|
1084
|
+
const prepare = async (): Promise<void> => {
|
|
1085
|
+
try { await previous; } catch { /* A later addition retries the current effect list. */ }
|
|
1086
|
+
if (!current()) return;
|
|
1087
|
+
const [{ prepareEffectPass, postTriangle }, { runPrecompile, waitForDrawnFrame }] = await Promise.all([
|
|
1088
|
+
import('../render/postPreparation'), import('../render/precompile')]);
|
|
1089
|
+
const geometry = postTriangle(), mesh = new THREE.Mesh(geometry, pass.fullscreenMaterial), scene = new THREE.Scene();
|
|
1090
|
+
const target = pass.renderToScreen ? null : composer.inputBuffer;
|
|
1091
|
+
try {
|
|
1092
|
+
let published = false;
|
|
1093
|
+
while (current() && !published) published = await prepareEffectPass(pass, async material => {
|
|
1094
|
+
mesh.material = material;
|
|
1095
|
+
await runPrecompile(this.renderer, this.camera, [{ label: engineString('s_178612197e2b'), root: mesh, target: scene, rt: target }], 1,
|
|
1096
|
+
undefined, undefined, current, false, () => waitForDrawnFrame(this.engineScope, () => this.frameCount, current));
|
|
1097
|
+
}, material => {
|
|
1098
|
+
mesh.material = material;
|
|
1099
|
+
const prior = this.renderer.getRenderTarget(), face = this.renderer.getActiveCubeFace(), mip = this.renderer.getActiveMipmapLevel();
|
|
1100
|
+
this.renderer.setRenderTarget(target);
|
|
1101
|
+
try { this.renderer.compile(mesh, this.camera, scene); }
|
|
1102
|
+
finally { this.renderer.setRenderTarget(prior, face, mip); }
|
|
1103
|
+
}, current);
|
|
1104
|
+
} finally { geometry.dispose(); }
|
|
1105
|
+
};
|
|
1106
|
+
const work = prepare();
|
|
1107
|
+
this.postPreparation = work;
|
|
1108
|
+
return work;
|
|
1109
|
+
}
|
|
1110
|
+
|
|
1111
|
+
private _entryPreparation: EntryPreparation | null = null;
|
|
1112
|
+
/** S1: the boot's entered roots whose exterior (road) variants wait for play (`warmDeferredEntryRoots`) */
|
|
1113
|
+
private deferredEntryRoots: { readonly owner: Scope; readonly roots: readonly THREE.Object3D[] }[] = [];
|
|
1114
|
+
/** Last entered-frame preparation's running phase, measured work counts and scalar timings. Painted waits are
|
|
1115
|
+
* included; no content resources are retained. The root identifies the exact destination. */
|
|
1116
|
+
get entryPreparation(): Readonly<EntryPreparation> | null { return this._entryPreparation; }
|
|
1117
|
+
|
|
1118
|
+
/** Prepare an entered frame's new world/depth/post programs before its owner publishes readiness.
|
|
1119
|
+
* Initial boot uses the ordinary shaders/firstFrame stages for its final draw. If its composer already exists,
|
|
1120
|
+
* `before` can lend the page compiler a head start; it never adds crossing-only first draws. No simulation tick,
|
|
1121
|
+
* camera turn or caster rechunking runs here; the final zero-delta composer draw warms its real pass targets.
|
|
1122
|
+
* A retained view may supply its whole future root, including sibling authored lights outside the bound scene.
|
|
1123
|
+
* `before` (the caller's last preparation, e.g. a region's sky build) runs first, inside the same owner lifetime:
|
|
1124
|
+
* it may prepare already-built roots while other content constructs, then await that content before returning.
|
|
1125
|
+
* Early roots and whole-page programs share this owner. Final complete inventory gates readiness;
|
|
1126
|
+
* elapsed time cannot reveal an incomplete entry. Real work failures and owner retirement still reject.
|
|
1127
|
+
* D188 (Jake's G815, shipped): `arrivalAt` (where the crossing reveals the player, render space) prepares only
|
|
1128
|
+
* the destination content within ARRIVAL_RADIUS of it before the reveal; the rest sits out live draws (a frame gate)
|
|
1129
|
+
* until `warmArrivalRest` has linked and first-drawn it after the reveal, nearest first. */
|
|
1130
|
+
async warmEnteredFrame(owner: Scope, futureRoot?: THREE.Object3D,
|
|
1131
|
+
before?: (prepare: (roots: readonly THREE.Object3D[], exteriorPrograms?: boolean) => Promise<void>, prepareFrame: (environment?: THREE.Texture | null) => Promise<void>) => Promise<void> | void,
|
|
1132
|
+
arrivalAt?: THREE.Vector3): Promise<void> {
|
|
1133
|
+
const composer = this._composer;
|
|
1134
|
+
const arrival = arrivalAt !== undefined && futureRoot !== undefined && futureRoot !== this.rootScene && this.frameCount > 0
|
|
1135
|
+
? { at: arrivalAt.clone(), radius: ARRIVAL_RADIUS } : undefined;
|
|
1136
|
+
if (composer === null) { await before?.(() => Promise.resolve(), () => Promise.resolve()); return; }
|
|
1137
|
+
const trace: EntryPreparation = { root: (futureRoot ?? this.scene).uuid, owner: owner.name,
|
|
1138
|
+
completed: false, phase: before === undefined ? 'post-preparation' : 'before-warm', progress: null, stages: [] };
|
|
1139
|
+
this._entryPreparation = trace;
|
|
1140
|
+
const enter = (phase: string): void => { trace.phase = phase; trace.progress = null; };
|
|
1141
|
+
await boundEntryWarmup(owner, async current => {
|
|
1142
|
+
if (before !== undefined) {
|
|
1143
|
+
await before(async (roots, exteriorPrograms = true) => {
|
|
1144
|
+
const started = diagnosticNow();
|
|
1145
|
+
enter('early-scene-programs');
|
|
1146
|
+
await this.warmEnteredRoots(owner, composer, roots, futureRoot, current, exteriorPrograms);
|
|
1147
|
+
trace.stages.push({ phase: 'early-scene-programs', elapsedMs: diagnosticNow() - started, units: roots.length, endAt: diagnosticNow() });
|
|
1148
|
+
enter('before-warm');
|
|
1149
|
+
}, async (environment) => {
|
|
1150
|
+
const started = diagnosticNow();
|
|
1151
|
+
enter('early-frame-programs');
|
|
1152
|
+
await this.prepareEnteredPrograms(owner, composer, current, futureRoot, arrival,
|
|
1153
|
+
(phase, elapsedMs, units) => { trace.stages.push({ phase: `early-frame:${phase}`, elapsedMs, units, endAt: diagnosticNow() }); },
|
|
1154
|
+
(done, total, detail) => { trace.progress = { done, total, detail }; }, environment);
|
|
1155
|
+
trace.stages.push({ phase: 'early-frame-programs', elapsedMs: diagnosticNow() - started, units: 1, endAt: diagnosticNow() });
|
|
1156
|
+
enter('before-warm');
|
|
1157
|
+
});
|
|
1158
|
+
if (!current()) throw new Error('Shader warm-up owner left');
|
|
1159
|
+
enter('post-preparation');
|
|
1160
|
+
}
|
|
1161
|
+
// Boot's normal shader/firstFrame stages still own its complete inventory
|
|
1162
|
+
// and first draws. An early composer lends only the compiler above; doing
|
|
1163
|
+
// the crossing warm-up here would add parked/offscreen frame variants.
|
|
1164
|
+
if (this.frameCount === 0) { trace.completed = true; return; }
|
|
1165
|
+
for (;;) {
|
|
1166
|
+
const pending = this.postPreparation;
|
|
1167
|
+
await pending;
|
|
1168
|
+
if (!current()) throw new Error('Shader warm-up owner left');
|
|
1169
|
+
if (this.postPreparation === pending) break;
|
|
1170
|
+
}
|
|
1171
|
+
enter('shaders-and-composer');
|
|
1172
|
+
await this.warmEnteredStages(owner, composer, trace, current, futureRoot, enter, arrival);
|
|
1173
|
+
});
|
|
1174
|
+
}
|
|
1175
|
+
|
|
1176
|
+
/** Early roots share the enclosing entry's owner and cannot publish readiness. */
|
|
1177
|
+
private async warmEnteredRoots(owner: Scope, composer: EffectComposer, roots: readonly THREE.Object3D[],
|
|
1178
|
+
futureLighting: THREE.Object3D | undefined, current: () => boolean, exteriorPrograms = true): Promise<void> {
|
|
1179
|
+
// The installing scene lends its PMREM; program lights/fog come from the page the renderer actually draws.
|
|
1180
|
+
const scene = this.rootScene, futureEnvironment = this.scene.environment;
|
|
1181
|
+
const { prepareSceneRoots, waitForDrawnFrame, LIVE_UPLOAD_BUDGET } = await import('../render/precompile');
|
|
1182
|
+
const live = (): boolean => current() && this._composer === composer;
|
|
1183
|
+
const pause = this.frameCount > 0 ? () => waitForDrawnFrame(owner, () => this.frameCount, live) : undefined;
|
|
1184
|
+
// S1: at boot (no frame yet) the roots' scene programs are the Shaders step's (drawn only) and their exterior (road)
|
|
1185
|
+
// variants, which draw only once the player leaves the cell, link in play (`warmDeferredEntryRoots`, after control)
|
|
1186
|
+
const boot = this.frameCount === 0;
|
|
1187
|
+
if (boot && exteriorPrograms) this.deferredEntryRoots.push({ owner, roots });
|
|
1188
|
+
await prepareSceneRoots(this.renderer, this.camera, scene, composer.inputBuffer, roots, live, pause,
|
|
1189
|
+
LIVE_UPLOAD_BUDGET, !boot, futureLighting, futureEnvironment ?? undefined, exteriorPrograms && !boot);
|
|
1190
|
+
}
|
|
1191
|
+
|
|
1192
|
+
/**
|
|
1193
|
+
* S1: link the exterior (road) variants of the roots the boot's entry left for play (`warmEnteredRoots`), nearest first,
|
|
1194
|
+
* in live slices spaced by drawn frames, as an entered frame's own roots link (G639: without them the first road frame
|
|
1195
|
+
* linked each environment's variant, 150-270 ms each). Roots whose owner has left are dropped. Call once control is up.
|
|
1196
|
+
* Background callers may add an idle opportunity after each required completed draw.
|
|
1197
|
+
*/
|
|
1198
|
+
async warmDeferredEntryRoots(current: () => boolean, idle?: () => Promise<boolean>): Promise<void> {
|
|
1199
|
+
const pending = this.deferredEntryRoots;
|
|
1200
|
+
this.deferredEntryRoots = [];
|
|
1201
|
+
const composer = this._composer;
|
|
1202
|
+
if (composer === null) return;
|
|
1203
|
+
const { prepareSceneRoots, waitForDrawnFrame, LIVE_UPLOAD_BUDGET } = await import('../render/precompile');
|
|
1204
|
+
for (const { owner, roots } of pending) {
|
|
1205
|
+
if (owner.disposed || owner.disposing) continue;
|
|
1206
|
+
const live = (): boolean => current() && !owner.disposed && !owner.disposing && this._composer === composer;
|
|
1207
|
+
if (!live()) return;
|
|
1208
|
+
const pause = async (): Promise<void> => {
|
|
1209
|
+
await waitForDrawnFrame(owner, () => this.frameCount, live);
|
|
1210
|
+
if (idle !== undefined && !await idle()) throw new Error('Shader warm-up owner left');
|
|
1211
|
+
};
|
|
1212
|
+
await prepareSceneRoots(this.renderer, this.camera, this.rootScene, composer.inputBuffer, roots, live,
|
|
1213
|
+
pause, LIVE_UPLOAD_BUDGET, false, undefined, undefined, true,
|
|
1214
|
+
this.camera.getWorldPosition(new THREE.Vector3()));
|
|
1215
|
+
}
|
|
1216
|
+
}
|
|
1217
|
+
|
|
1218
|
+
/**
|
|
1219
|
+
* D188 (G815): after an arrival's reveal, what it left (`rest`, gated out of live draws) is linked and first-drawn
|
|
1220
|
+
* nearest the player first: the whole remaining program inventory under the live slice budget, then the rest's 1×1
|
|
1221
|
+
* draws a live budget a completed frame, each slice released to the live draw as it lands. The owner leaving (or a
|
|
1222
|
+
* failure) releases the gate: the content then draws as before, building on first sight.
|
|
1223
|
+
*/
|
|
1224
|
+
private async warmArrivalRest(owner: Scope, composer: EffectComposer, root: THREE.Object3D, rest: readonly THREE.Object3D[],
|
|
1225
|
+
at: THREE.Vector3, environment: THREE.Texture | null): Promise<void> {
|
|
1226
|
+
const gate = this.frameDrawRanges.gate(owner, rest), started = diagnosticNow();
|
|
1227
|
+
const live = (): boolean => !owner.disposed && !owner.disposing && this._composer === composer;
|
|
1228
|
+
try {
|
|
1229
|
+
const { precompileLevel, waitForDrawnFrame, liveWarmPacing, LIVE_PRECOMPILE_SLICE_MS } = await import('../render/precompile');
|
|
1230
|
+
const { warmParkedDraws, LIVE_PARKED_BUDGET } = await import('../render/parkedDraws');
|
|
1231
|
+
const pause = (): Promise<void> => waitForDrawnFrame(owner, () => this.frameCount, live);
|
|
1232
|
+
while (live() && !root.visible) await pause();
|
|
1233
|
+
if (!live()) return;
|
|
1234
|
+
await precompileLevel(this, undefined, { sliceMs: LIVE_PRECOMPILE_SLICE_MS, current: live, owner, nearest: true, ...liveWarmPacing() });
|
|
1235
|
+
const wanted = new Set(rest);
|
|
1236
|
+
await warmParkedDraws(this.renderer, this.rootScene, this.camera, composer.inputBuffer, root, live, pause,
|
|
1237
|
+
{ budget: LIVE_PARKED_BUDGET, environment, include: object => wanted.has(object), nearest: at, onDrawn: objects => { gate.release(objects); } });
|
|
1238
|
+
if (isDev()) performance.measure('wildshard.arrival-rest', { start: started, end: diagnosticNow() });
|
|
1239
|
+
} catch (error: unknown) {
|
|
1240
|
+
if (live()) console.warn('[arrival] the after-reveal warm-up stopped; the rest draws as it is seen', error);
|
|
1241
|
+
} finally { gate.release(rest); }
|
|
1242
|
+
}
|
|
1243
|
+
|
|
1244
|
+
/** The same complete program inventory may run before content finishes. It never draws or publishes readiness;
|
|
1245
|
+
* final preparation repeats discovery so late play content and changed variants remain mandatory. */
|
|
1246
|
+
private async prepareEnteredPrograms(owner: Scope, composer: EffectComposer, current: () => boolean,
|
|
1247
|
+
futureRoot: THREE.Object3D | undefined, arrival: EntryArrival | undefined, onStage: (phase: string, elapsedMs: number, units: number) => void,
|
|
1248
|
+
progress: (done: number, total: number, detail: string) => void, futureEnvironment: THREE.Texture | null = this.scene.environment): Promise<void> {
|
|
1249
|
+
const futureLighting = futureRoot ?? this.scene;
|
|
1250
|
+
const isolateImageUploads = navigator.userAgent.includes('AppleWebKit') && !/Chrome|Chromium|Edg/.test(navigator.userAgent);
|
|
1251
|
+
const { precompileLevel, waitForDrawnFrame, arrivalPrograms, LIVE_UPLOAD_BUDGET, LIVE_PRECOMPILE_SLICE_MS } = await import('../render/precompile');
|
|
1252
|
+
const live = (): boolean => current() && this._composer === composer;
|
|
1253
|
+
if (this.frameCount === 0) {
|
|
1254
|
+
// Only completed world materials can overlap construction. Post, shadow
|
|
1255
|
+
// and offscreen jobs need the final page state and keep their normal step.
|
|
1256
|
+
// PL6: with what the first frame's warm turns show, so those world programs build here, not in the shader step
|
|
1257
|
+
await precompileLevel(this, progress, {current: live, owner, onStage, chunkCasters: false, sliceMs: 12, sceneOnly: true, drawnOnly: true,
|
|
1258
|
+
turns: this.warmTurnYaws(), futureLighting, ...(futureEnvironment === null ? {} : {futureEnvironment})});
|
|
1259
|
+
return;
|
|
1260
|
+
}
|
|
1261
|
+
const pause = this.frameCount > 0 ? () => waitForDrawnFrame(owner, () => this.frameCount, live) : undefined;
|
|
1262
|
+
const uploadBudget = isolateImageUploads ? LIVE_UPLOAD_BUDGET : undefined;
|
|
1263
|
+
const sliceMs = this.frameCount > 0 ? LIVE_PRECOMPILE_SLICE_MS : undefined;
|
|
1264
|
+
// Camera equipment leaves with its owner, so its road variants are never needed.
|
|
1265
|
+
const leaving = this.viewmodel.staged(owner);
|
|
1266
|
+
await precompileLevel(this, progress, { chunkCasters: false, current: live, owner, futureLighting, isolateImageUploads, onStage, drawnOnly: this.frameCount === 0,
|
|
1267
|
+
...(arrival === undefined || futureRoot === undefined ? {} : { arrival: arrivalPrograms(futureRoot, arrival.at, arrival.radius) }),
|
|
1268
|
+
...(leaving === undefined ? {} : { leaving: [leaving] }), ...(sliceMs === undefined ? {} : { sliceMs }),
|
|
1269
|
+
...(futureEnvironment === null ? {} : { futureEnvironment }), ...(pause === undefined ? {} : { pause }), ...(uploadBudget === undefined ? {} : { uploadBudget }) });
|
|
1270
|
+
}
|
|
1271
|
+
|
|
1272
|
+
private async warmEnteredStages(owner: Scope, composer: EffectComposer, trace: EntryPreparation,
|
|
1273
|
+
current: () => boolean, futureRoot: THREE.Object3D | undefined, enter: (phase: string) => void, arrival?: EntryArrival): Promise<void> {
|
|
1274
|
+
const futureScene = this.scene;
|
|
1275
|
+
const futureEnvironment = futureScene.environment;
|
|
1276
|
+
const progress = (done: number, total: number, detail: string): void => { trace.progress = { done, total, detail }; };
|
|
1277
|
+
const onStage = (phase: string, elapsedMs: number, units: number): void => {
|
|
1278
|
+
trace.stages.push({ phase, elapsedMs, units, endAt: diagnosticNow() });
|
|
1279
|
+
if (phase === 'compile') enter('shader-links');
|
|
1280
|
+
else if (phase === 'link') enter('texture-uploads');
|
|
1281
|
+
};
|
|
1282
|
+
const isolateImageUploads = navigator.userAgent.includes('AppleWebKit') && !/Chrome|Chromium|Edg/.test(navigator.userAgent);
|
|
1283
|
+
const { warmComposerFrame, waitForDrawnFrame, entryFrameExclusions,
|
|
1284
|
+
parkedMatricesFrozen, freezeParkedMatrices } = await import('../render/precompile');
|
|
1285
|
+
// G580 T2 (Developer): the parked destination's static matrices are not recomputed every frame while it waits hidden
|
|
1286
|
+
const thaw = futureRoot !== undefined && futureRoot !== this.rootScene && !futureRoot.visible && parkedMatricesFrozen() ? freezeParkedMatrices(futureRoot, { shown: 'skip' }) : undefined;
|
|
1287
|
+
try {
|
|
1288
|
+
const shaderStart = diagnosticNow();
|
|
1289
|
+
const bootDrawn = this.frameCount === 0;
|
|
1290
|
+
await warmComposerFrame(composer, this.renderer,
|
|
1291
|
+
() => this.prepareEnteredPrograms(owner, composer, current, futureRoot, arrival, onStage, progress), current);
|
|
1292
|
+
onStage('shaders-and-composer', diagnosticNow() - shaderStart, 1);
|
|
1293
|
+
const { warmParkedDraws, warmOffscreenPasses, HELD_PARKED_BUDGET, HELD_WEBKIT_PARKED_BUDGET, LIVE_PARKED_BUDGET } = await import('../render/parkedDraws');
|
|
1294
|
+
// WebKit first draws can block despite cheap JavaScript submissions. Pace cold
|
|
1295
|
+
// bindings one per completed frame; bounded copies share that already-warmed layout.
|
|
1296
|
+
// G808: held at the wall, a WebKit slice may upload 2 MiB of new buffers (same pipeline fences).
|
|
1297
|
+
const drawBudget = isolateImageUploads && this.frameCount > 0 ? { budget: buildHeld() ? HELD_WEBKIT_PARKED_BUDGET : LIVE_PARKED_BUDGET }
|
|
1298
|
+
: buildHeld() ? { budget: HELD_PARKED_BUDGET } : {};
|
|
1299
|
+
// Held, off WebKit (pipelines build outside the main thread): several planned slices may share a completed frame's
|
|
1300
|
+
// draw while held frames keep the 30 fps floor (Pine's afterPlay idled 3.2 s at one slice a frame); WebKit keeps its fences.
|
|
1301
|
+
const widen = !isolateImageUploads && buildHeld() ? { widen: { max: 8, frameMs: 1000 / 30 + 2, bytes: HELD_PARKED_BUDGET.bufferBytes ?? 6 * 1024 * 1024 } } : {};
|
|
1302
|
+
const drawnPause = this.frameCount > 0 ? () => waitForDrawnFrame(owner, () => this.frameCount, current) : (): Promise<void> => new Promise(resolve => { this.engineScope.raf(() => { this.engineScope.timeout(0, resolve); }); });
|
|
1303
|
+
// Camera models live outside the parked world. Compilation linked them, but
|
|
1304
|
+
// their staged group and equipment roots still hide their first buffer draws.
|
|
1305
|
+
const stagedModels = this.viewmodel.staged(owner);
|
|
1306
|
+
if (stagedModels !== undefined) {
|
|
1307
|
+
enter('parked-viewmodels');
|
|
1308
|
+
const start = diagnosticNow();
|
|
1309
|
+
const drawn = await warmParkedDraws(this.renderer, this.rootScene, this.camera, composer.inputBuffer, stagedModels, current,
|
|
1310
|
+
drawnPause, { ...drawBudget, onProgress: (done, total) => { progress(done, total, `${done} / ${total} held models warmed`); }, environment: futureEnvironment, revealChildren: true, ...(futureRoot === undefined ? {} : { lightingRoot: futureRoot }) });
|
|
1311
|
+
onStage('parked-viewmodels', diagnosticNow() - start, drawn);
|
|
1312
|
+
}
|
|
1313
|
+
// op-hitch31: a parked root's first draws (pipelines, buffers) were the entry frame's whole cost (Sky Reach 900 ms
|
|
1314
|
+
// desktop, up to 1011 ms Simulator, in `activate`); draw it a few objects a frame into a 1×1 scissor first.
|
|
1315
|
+
if (futureRoot !== undefined && futureRoot !== this.rootScene && !futureRoot.visible && !bootDrawn) {
|
|
1316
|
+
enter('parked-draws');
|
|
1317
|
+
const start = diagnosticNow();
|
|
1318
|
+
// Every submission waits for a completed game frame; a CPU construction
|
|
1319
|
+
// budget cannot measure pending native pipeline work.
|
|
1320
|
+
// D188: an arrival first-draws only its set now; the rest is gated out of live draws and warmed after the reveal
|
|
1321
|
+
const keep = arrival === undefined ? undefined : (await import('../render/precompile')).arrivalSet(futureRoot, arrival.at, arrival.radius);
|
|
1322
|
+
const drawn = await warmParkedDraws(this.renderer, this.rootScene, this.camera, composer.inputBuffer, futureRoot, current,
|
|
1323
|
+
drawnPause, { ...drawBudget, ...widen, onProgress: (done, total) => { progress(done, total, `${done} / ${total} scene draws warmed`); },
|
|
1324
|
+
onPlan: (original, selected) => { onStage('parked-slices-original', 0, original); onStage('parked-slices-selected', 0, selected); }, environment: futureEnvironment,
|
|
1325
|
+
...(keep === undefined ? {} : { include: keep }) });
|
|
1326
|
+
onStage('parked-draws', diagnosticNow() - start, drawn);
|
|
1327
|
+
if (keep !== undefined && arrival !== undefined) {
|
|
1328
|
+
const rest: THREE.Object3D[] = [];
|
|
1329
|
+
// the parked root itself is hidden while it waits: walk its children, each by its own visibility
|
|
1330
|
+
for (const child of futureRoot.children) child.traverseVisible(object => { if (Reflect.get(object, 'material') !== undefined && !keep(object)) rest.push(object); });
|
|
1331
|
+
onStage('arrival-deferred', 0, rest.length);
|
|
1332
|
+
if (rest.length > 0) void this.warmArrivalRest(owner, composer, futureRoot, rest, arrival.at, futureEnvironment);
|
|
1333
|
+
}
|
|
1334
|
+
}
|
|
1335
|
+
// op-hitch37: a registered offscreen pass (Nalati's look bake) built its casters' pipelines on its first real
|
|
1336
|
+
// update, after entry; draw each once into a 1×1 stand-in of its target first.
|
|
1337
|
+
enter('offscreen-draws');
|
|
1338
|
+
const offscreenStart = diagnosticNow();
|
|
1339
|
+
const passes = await warmOffscreenPasses(this.renderer, this.rootScene, current, drawnPause, entryFrameExclusions(this.rootScene, futureRoot),
|
|
1340
|
+
(done, total) => { progress(done, total, `${done} / ${total} render passes warmed`); }, drawBudget.budget);
|
|
1341
|
+
onStage('offscreen-draws', diagnosticNow() - offscreenStart, passes);
|
|
1342
|
+
trace.completed = true;
|
|
1343
|
+
} finally { thaw?.(); }
|
|
1344
|
+
}
|
|
1345
|
+
|
|
1346
|
+
/** DL23 (J198): the boot shaders step's census, exactly what `firstFrame`'s parked warm will draw (`firstFrameDrawables`
|
|
1347
|
+
* over the same root and camera), so no program of it links synchronously inside a parked draw. */
|
|
1348
|
+
async firstFrameCensus(): Promise<(object: THREE.Object3D) => boolean> {
|
|
1349
|
+
const { firstFrameDrawables } = await import('../render/parkedDraws');
|
|
1350
|
+
return firstFrameDrawables(this.rootScene, this.camera);
|
|
1351
|
+
}
|
|
1352
|
+
|
|
1353
|
+
/**
|
|
1354
|
+
* The first frames, as a step: every visible drawable's first draw (its pipelines, buffers and shadow-depth variants)
|
|
1355
|
+
* a slice at a time into a 1×1 scissor, then the world draw, the warm turns, and the full composer one pass at a time
|
|
1356
|
+
* (screen-quad shaders compileAsync cannot reach). LS7 (J188): each unit is counted only once a GPU fence says the GPU
|
|
1357
|
+
* finished it, so the loading bar moves on completed work; the next unit is already submitted by then (FencedUnits),
|
|
1358
|
+
* so the fences cost the GPU no idle frames (waiting on each one cost about 1.5 s on Sunscar Dunes). Unsplit, the world draw and the
|
|
1359
|
+
* composer draw were each one GPU flush: 2.0 s and 3.3 s on Sunscar Dunes in headless Chromium (SwiftShader), with
|
|
1360
|
+
* the page's main thread blocked in the canvas read-back for both.
|
|
1361
|
+
*/
|
|
1362
|
+
async firstFrame(onProgress?: (done: number, total: number, detail: string) => void, narrow = false): Promise<void> {
|
|
1363
|
+
// every wait here, fence or frame, settles when the game's scope is disposed; the finally releases every queued sync
|
|
1364
|
+
const units = new FencedUnits(this.renderer.getContext(), this.engineScope);
|
|
1365
|
+
try { await this.firstFrameUnits(units, onProgress, narrow); } finally { units.dispose(); }
|
|
1366
|
+
}
|
|
1367
|
+
|
|
1368
|
+
private async firstFrameUnits(units: FencedUnits, onProgress: ((done: number, total: number, detail: string) => void) | undefined, narrow: boolean): Promise<void> {
|
|
1369
|
+
const frame = (): Promise<void> => units.frame(); // rAF alone resumes before the paint
|
|
1370
|
+
// Large instanced worlds may request culling before the first draw and fewer warm views.
|
|
1371
|
+
const tracedBoot = bootTraceActive();
|
|
1372
|
+
const checkpoint = (operation: string): void => { if (tracedBoot) recordGpuCheckpoint(this.renderer, operation); };
|
|
1373
|
+
const warmTurns = this.renderKnobs().warmTurns ?? WARM_TURNS;
|
|
1374
|
+
const passes = this.composer.passes.filter(pass => pass.enabled);
|
|
1375
|
+
const splitPost = !passes.some(pass => pass instanceof MaskPass || pass instanceof ClearMaskPass);
|
|
1376
|
+
const postUnits = splitPost ? passes.length : 1;
|
|
1377
|
+
let draws = 0, credited = 0;
|
|
1378
|
+
// each boot draw is its shadow maps, one a unit, then the view (fencedDraw)
|
|
1379
|
+
const perDraw = this.shadowCasters(this.camera).length + 1;
|
|
1380
|
+
// LS8: the world's first draws count by drawable, each credited when the fence after its slice signals, so a slice
|
|
1381
|
+
// narrowed after a slow one (FIRST_DRAW_NARROW) changes no total. Each unit weighs its kind's measured seconds (J204).
|
|
1382
|
+
const W = FIRST_FRAME_SECONDS, fullDraw = (perDraw - 1) * W.shadowMap + W.view;
|
|
1383
|
+
const firstView = narrow ? FIRST_VIEW_UNITS * W.viewPart : 0, firstMap = narrow && perDraw > 1 ? (FIRST_MAP_PARTS - 1) * W.mapPart : 0;
|
|
1384
|
+
const total = (): number => draws * W.drawable + firstView + firstMap + fullDraw * (1 + warmTurns) + postUnits * W.postPass;
|
|
1385
|
+
const drawUnits = (base: number, label: string) => (done: number, detail: string): void => {
|
|
1386
|
+
onProgress?.(base + Math.min(done, perDraw - 1) * W.shadowMap + (done >= perDraw ? W.view : 0), total(), `${label} · ${detail}`);
|
|
1387
|
+
};
|
|
1388
|
+
await frame();
|
|
1389
|
+
checkpoint('cull:before');
|
|
1390
|
+
if (this.level.boot.cullBeforeFirstDraw === true) this.lookStrategy?.frame?.(0.016, 0);
|
|
1391
|
+
checkpoint('cull:after');
|
|
1392
|
+
// into the composer's input buffer, not the canvas: the canvas target would be a second set of program variants
|
|
1393
|
+
const target = (this.composer as unknown as { inputBuffer?: THREE.WebGLRenderTarget }).inputBuffer ?? null;
|
|
1394
|
+
// The world's first draws, a slice of drawables at a time into a 1×1 scissor: the GPU builds each new pipeline
|
|
1395
|
+
// there, and the full-size draws below only rasterize. The step counts fenced GPU submissions: a slice, a shadow
|
|
1396
|
+
// map, a view or a post pass is one unit, counted once the GPU has completed it.
|
|
1397
|
+
if (target !== null) {
|
|
1398
|
+
const { warmParkedDraws } = await import('../render/parkedDraws');
|
|
1399
|
+
checkpoint(`shadow-maps:allocated:${String(this.allocateShadowMaps(this.camera))}`);
|
|
1400
|
+
let submitted = 0, drew = false;
|
|
1401
|
+
checkpoint('world-pipelines:before');
|
|
1402
|
+
await warmParkedDraws(this.renderer, this.rootScene, this.camera, target, this.rootScene, () => !this.engineScope.disposed,
|
|
1403
|
+
// a pause after a drawn slice fences it; the bounds pauses before the first slice only yield a frame
|
|
1404
|
+
async () => {
|
|
1405
|
+
if (!drew) { await frame(); return; }
|
|
1406
|
+
drew = false;
|
|
1407
|
+
const warmed = submitted;
|
|
1408
|
+
await units.submit(() => {
|
|
1409
|
+
credited = warmed * W.drawable;
|
|
1410
|
+
onProgress?.(credited, total(), `${String(warmed)} / ${String(draws)} draws warmed`);
|
|
1411
|
+
});
|
|
1412
|
+
},
|
|
1413
|
+
// a narrowed plan reports again: the count already credited stands
|
|
1414
|
+
{ onPlan: (_original, selected) => { onProgress?.(credited, total(), `${String(selected)} world slices`); },
|
|
1415
|
+
onProgress: (done, count) => { drew ||= done > submitted; submitted = done; draws = count; },
|
|
1416
|
+
// no widening when narrow: D12 merges slices by new material only, and three new layouts of one material (the
|
|
1417
|
+
// view-model swords and arms) shared one 2.3 s SwiftShader frame
|
|
1418
|
+
...(narrow ? { budget: FIRST_DRAW_NARROW.budget } : { narrow: FIRST_DRAW_NARROW }) });
|
|
1419
|
+
checkpoint('world-pipelines:submitted');
|
|
1420
|
+
}
|
|
1421
|
+
const drawables = draws * W.drawable, world = drawables + firstView + firstMap;
|
|
1422
|
+
if (narrow) {
|
|
1423
|
+
checkpoint('first-view:before');
|
|
1424
|
+
await this.firstViewParts(this.camera, target, units, (k) => {
|
|
1425
|
+
onProgress?.(drawables + k * W.viewPart, total(), `world view ${String(k)} / ${String(FIRST_VIEW_UNITS)}`);
|
|
1426
|
+
});
|
|
1427
|
+
}
|
|
1428
|
+
units.mark(() => { onProgress?.(drawables + firstView, total(), 'world + shadows'); });
|
|
1429
|
+
checkpoint('world:before');
|
|
1430
|
+
await this.fencedDraw(this.camera, target, units, drawUnits(world, 'world + shadows'), firstMap === 0 ? undefined : (k) => {
|
|
1431
|
+
onProgress?.(drawables + firstView + k * W.mapPart, total(), `world + shadows · shadow map 1 part ${String(k)} / ${String(FIRST_MAP_PARTS)}`);
|
|
1432
|
+
});
|
|
1433
|
+
checkpoint('world:submitted');
|
|
1434
|
+
// E153: the world once facing each way, so a turn finds every pipeline built (warmTurn)
|
|
1435
|
+
const yaws = this.warmTurnYaws();
|
|
1436
|
+
for (let k = 1; k <= yaws.length; k++) {
|
|
1437
|
+
const label = `world, turned ${String(k * 360 / WARM_TURNS)}°`;
|
|
1438
|
+
await this.warmTurn(yaws[k - 1] ?? 0, target, units, drawUnits(world + k * fullDraw, label));
|
|
1439
|
+
}
|
|
1440
|
+
const postFrom = world + fullDraw * (1 + warmTurns);
|
|
1441
|
+
this.lookStrategy?.frame?.(0.016, 0);
|
|
1442
|
+
checkpoint('post:before');
|
|
1443
|
+
if (!splitPost) {
|
|
1444
|
+
if (tracedBoot) traceBootPasses(this.composer.passes, checkpoint, () => { this.composer.render(0.016); });
|
|
1445
|
+
else this.composer.render(0.016);
|
|
1446
|
+
checkpoint('post:submitted');
|
|
1447
|
+
await units.submit(() => { onProgress?.(postFrom + W.postPass, total(), 'post chain'); });
|
|
1448
|
+
} else {
|
|
1449
|
+
// EffectComposer.render's own loop (postprocessing 6.39: render, depth blit, swap), a pass per completed fence
|
|
1450
|
+
const composer = this.composer, renderer = this.renderer;
|
|
1451
|
+
let input = composer.inputBuffer, output = composer.outputBuffer;
|
|
1452
|
+
for (const [i, pass] of passes.entries()) {
|
|
1453
|
+
checkpoint(`pass:${String(i)}:${pass.name}:before`);
|
|
1454
|
+
pass.render(renderer, input, output, 0.016, false);
|
|
1455
|
+
if (pass.needsDepthBlit && Reflect.get(composer, 'depthRenderTarget') !== null) {
|
|
1456
|
+
const blit: unknown = Reflect.get(composer, 'blitDepthBuffer');
|
|
1457
|
+
if (typeof blit === 'function') Reflect.apply(blit, composer, [input]);
|
|
1458
|
+
}
|
|
1459
|
+
if (pass.needsSwap) [input, output] = [output, input];
|
|
1460
|
+
checkpoint(`pass:${String(i)}:${pass.name}:submitted`);
|
|
1461
|
+
await units.submit(() => { onProgress?.(postFrom + (i + 1) * W.postPass, total(), `post pass ${String(i + 1)} / ${String(postUnits)} · ${pass.name}`); });
|
|
1462
|
+
}
|
|
1463
|
+
}
|
|
1464
|
+
await units.drain();
|
|
1465
|
+
checkpoint('post:completed');
|
|
1466
|
+
}
|
|
1467
|
+
|
|
1468
|
+
/** The visible shadow-casting lights the next draw from `cam` would render maps for. */
|
|
1469
|
+
private shadowCasters(cam: THREE.Camera): { readonly light: THREE.Light; readonly shadow: THREE.LightShadow }[] {
|
|
1470
|
+
const lights: { readonly light: THREE.Light; readonly shadow: THREE.LightShadow }[] = [], map = this.renderer.shadowMap;
|
|
1471
|
+
if (!map.enabled || (!map.autoUpdate && !map.needsUpdate)) return lights;
|
|
1472
|
+
this.rootScene.traverseVisible(object => {
|
|
1473
|
+
const shadow: unknown = object instanceof THREE.Light && object.castShadow && object.layers.test(cam.layers) ? Reflect.get(object, 'shadow') : null;
|
|
1474
|
+
if (object instanceof THREE.Light && shadow instanceof THREE.LightShadow && (shadow.autoUpdate || shadow.needsUpdate)) lights.push({ light: object, shadow });
|
|
1475
|
+
});
|
|
1476
|
+
return lights;
|
|
1477
|
+
}
|
|
1478
|
+
|
|
1479
|
+
/** LS7: three allocates a light's shadow map only at its first render. Allocate the due maps with no casters (an empty
|
|
1480
|
+
* scene), so the first draws below find them: until then the parked slices had no stand-in to build the casters'
|
|
1481
|
+
* depth pipelines into, and every lit draw was dropped on its unbound shadow sampler (E153), leaving all of it to
|
|
1482
|
+
* the first full draw (1.6 s of one GPU flush on Sunscar Dunes, headless Chromium). The flags are put back. */
|
|
1483
|
+
private allocateShadowMaps(cam: THREE.Camera): number {
|
|
1484
|
+
const casters = this.shadowCasters(cam), missing = casters.filter(({ shadow }) => shadow.map === null);
|
|
1485
|
+
if (missing.length === 0) return 0;
|
|
1486
|
+
const map = this.renderer.shadowMap, mapNeeds = map.needsUpdate;
|
|
1487
|
+
const flags = casters.map(({ shadow }) => ({ shadow, auto: shadow.autoUpdate, needs: shadow.needsUpdate }));
|
|
1488
|
+
try {
|
|
1489
|
+
for (const { shadow } of flags) { shadow.autoUpdate = false; shadow.needsUpdate = shadow.map === null; }
|
|
1490
|
+
map.needsUpdate = true;
|
|
1491
|
+
map.render(missing.map(({ light }) => light), new THREE.Scene(), cam);
|
|
1492
|
+
} finally {
|
|
1493
|
+
for (const { shadow, auto, needs } of flags) { shadow.autoUpdate = auto; shadow.needsUpdate = needs; }
|
|
1494
|
+
map.needsUpdate = mapNeeds;
|
|
1495
|
+
}
|
|
1496
|
+
return missing.length;
|
|
1497
|
+
}
|
|
1498
|
+
|
|
1499
|
+
/**
|
|
1500
|
+
* LS11 (J204): `render` of the root scene from `cam` into the 1×1 scissor of `target` (the canvas when null) with
|
|
1501
|
+
* `hidden` out of it, so it rasterizes nothing of the view but builds and runs what that draw order meets. Visibility,
|
|
1502
|
+
* scissors and the render target are put back; the caller owns the shadow flags.
|
|
1503
|
+
*/
|
|
1504
|
+
private parkedRender(cam: THREE.Camera, target: THREE.WebGLRenderTarget | null, hidden: readonly THREE.Object3D[]): void {
|
|
1505
|
+
const r = this.renderer;
|
|
1506
|
+
const prev = r.getRenderTarget(), face = r.getActiveCubeFace(), mip = r.getActiveMipmapLevel();
|
|
1507
|
+
const scissor = target?.scissor.clone(), scissorTest = target?.scissorTest ?? false;
|
|
1508
|
+
const canvasScissor = r.getScissor(new THREE.Vector4()), canvasScissorTest = r.getScissorTest();
|
|
1509
|
+
try {
|
|
1510
|
+
for (const object of hidden) object.visible = false;
|
|
1511
|
+
if (target !== null) { target.scissor.set(0, 0, 1, 1); target.scissorTest = true; }
|
|
1512
|
+
else { r.setScissor(0, 0, 1, 1); r.setScissorTest(true); }
|
|
1513
|
+
r.setRenderTarget(target);
|
|
1514
|
+
r.render(this.rootScene, cam);
|
|
1515
|
+
} finally {
|
|
1516
|
+
for (const object of hidden) object.visible = true;
|
|
1517
|
+
if (target !== null && scissor !== undefined) { target.scissor.copy(scissor); target.scissorTest = scissorTest; }
|
|
1518
|
+
r.setScissor(canvasScissor); r.setScissorTest(canvasScissorTest);
|
|
1519
|
+
r.setRenderTarget(prev, face, mip);
|
|
1520
|
+
}
|
|
1521
|
+
}
|
|
1522
|
+
|
|
1523
|
+
/**
|
|
1524
|
+
* LS11 (J204): the first full view after the world's slices, drawn as FIRST_VIEW_UNITS growing prefixes of its draw
|
|
1525
|
+
* order (opaque by render order and material, as three sorts them, in `FIRST_VIEW_PARTS.opaque` parts, then the
|
|
1526
|
+
* transparent in `.transparent` more), each into the 1×1 scissor with the shadow maps held and each a fenced unit.
|
|
1527
|
+
* Every draw meets the same draw before it as in the full view, so the GPU's one-time work for that view lands a part at
|
|
1528
|
+
* a time instead of in one unit; the parts hide the rest of the order for their own draw only, and every visibility and
|
|
1529
|
+
* shadow flag is put back.
|
|
1530
|
+
*/
|
|
1531
|
+
private async firstViewParts(cam: THREE.Camera, target: THREE.WebGLRenderTarget | null, units: FencedUnits,
|
|
1532
|
+
onUnit: (done: number) => void): Promise<void> {
|
|
1533
|
+
// three's render poses a root camera before it lists the scene: the order is listed from the same pose
|
|
1534
|
+
if (cam.parent === null && cam.matrixWorldAutoUpdate) cam.updateMatrixWorld();
|
|
1535
|
+
const map = this.renderer.shadowMap, { order, opaque } = firstViewOrder(this.rootScene, cam);
|
|
1536
|
+
for (let k = 1; k <= FIRST_VIEW_UNITS; k++) {
|
|
1537
|
+
const upto = firstViewCut(k, opaque, order.length, FIRST_VIEW_PARTS);
|
|
1538
|
+
const mapAuto = map.autoUpdate, mapNeeds = map.needsUpdate;
|
|
1539
|
+
try {
|
|
1540
|
+
map.autoUpdate = false; map.needsUpdate = false;
|
|
1541
|
+
this.parkedRender(cam, target, order.slice(upto).filter(object => object.visible));
|
|
1542
|
+
} finally { map.autoUpdate = mapAuto; map.needsUpdate = mapNeeds; }
|
|
1543
|
+
await units.submit(() => { onUnit(k); });
|
|
1544
|
+
}
|
|
1545
|
+
}
|
|
1546
|
+
|
|
1547
|
+
/**
|
|
1548
|
+
* LS7: one boot draw of the world split at its real seams, each unit waiting on the GPU fence before the next: every
|
|
1549
|
+
* shadow map the draw is due to render, alone (the view goes into a 1×1 scissor of its target, so it rasterizes
|
|
1550
|
+
* nothing), then the view with those maps held. The same maps and the same view as one `render`; on Sunscar Dunes in
|
|
1551
|
+
* headless Chromium the unsplit first draw was one 1.75–2.1 s GPU flush.
|
|
1552
|
+
* LS11 (J204): with `onMapPart`, the first map is drawn first as FIRST_MAP_PARTS - 1 growing prefixes of the scene's
|
|
1553
|
+
* casters (in the order the shadow pass meets them), each a fenced unit reported to `onMapPart`, then whole as before.
|
|
1554
|
+
*/
|
|
1555
|
+
private async fencedDraw(cam: THREE.Camera, target: THREE.WebGLRenderTarget | null, units: FencedUnits,
|
|
1556
|
+
onUnit: (done: number, detail: string) => void, onMapPart?: (done: number) => void): Promise<void> {
|
|
1557
|
+
const r = this.renderer, map = r.shadowMap;
|
|
1558
|
+
const flags = this.shadowCasters(cam).map(({ shadow }) => ({ shadow, auto: shadow.autoUpdate, needs: shadow.needsUpdate }));
|
|
1559
|
+
const prev = r.getRenderTarget(), face = r.getActiveCubeFace(), mip = r.getActiveMipmapLevel();
|
|
1560
|
+
const mapAuto = map.autoUpdate, mapNeeds = map.needsUpdate;
|
|
1561
|
+
const casters = onMapPart !== undefined && flags.length > 0 ? casterOrder(this.rootScene) : [];
|
|
1562
|
+
// LS11: a map this draw touched (a caster prefix included) stays due again unless the whole draw completes
|
|
1563
|
+
const touched = new Set<THREE.LightShadow>();
|
|
1564
|
+
let drawn = false;
|
|
1565
|
+
try {
|
|
1566
|
+
for (const [i, { shadow }] of flags.entries()) {
|
|
1567
|
+
const drawMap = (hidden: readonly THREE.Object3D[]): void => {
|
|
1568
|
+
for (const other of flags) { other.shadow.autoUpdate = false; other.shadow.needsUpdate = other.shadow === shadow; }
|
|
1569
|
+
map.needsUpdate = true; touched.add(shadow);
|
|
1570
|
+
this.parkedRender(cam, target, hidden);
|
|
1571
|
+
};
|
|
1572
|
+
if (i === 0 && onMapPart !== undefined) {
|
|
1573
|
+
for (let k = 1; k < FIRST_MAP_PARTS; k++) {
|
|
1574
|
+
drawMap(casters.slice(Math.round(casters.length * k / FIRST_MAP_PARTS)).filter(object => object.visible));
|
|
1575
|
+
await units.submit(() => { onMapPart(k); });
|
|
1576
|
+
}
|
|
1577
|
+
}
|
|
1578
|
+
drawMap([]);
|
|
1579
|
+
await units.submit(() => { onUnit(i + 1, `shadow map ${String(i + 1)} / ${String(flags.length)}`); });
|
|
1580
|
+
}
|
|
1581
|
+
// every map due this pose is drawn: the view draws with them held
|
|
1582
|
+
for (const { shadow } of flags) { shadow.autoUpdate = false; shadow.needsUpdate = false; }
|
|
1583
|
+
if (flags.length > 0) { map.autoUpdate = false; map.needsUpdate = false; }
|
|
1584
|
+
r.setRenderTarget(target);
|
|
1585
|
+
r.render(this.rootScene, cam);
|
|
1586
|
+
drawn = true;
|
|
1587
|
+
} finally {
|
|
1588
|
+
r.setRenderTarget(prev, face, mip);
|
|
1589
|
+
for (const { shadow, auto, needs } of flags) { shadow.autoUpdate = auto; shadow.needsUpdate = !drawn && (needs || touched.has(shadow)); }
|
|
1590
|
+
map.autoUpdate = mapAuto; map.needsUpdate = !drawn && (mapNeeds || touched.size > 0);
|
|
1591
|
+
}
|
|
1592
|
+
await units.submit(() => { onUnit(flags.length + 1, 'view'); });
|
|
1593
|
+
}
|
|
1594
|
+
|
|
1595
|
+
/** The yaws (radians, from where the player looks) the first frame's warm turns draw: the boot's shader warm-up links
|
|
1596
|
+
* what they show before the frame (`precompileLevel`'s `turns`). */
|
|
1597
|
+
warmTurnYaws(): number[] {
|
|
1598
|
+
return Array.from({ length: this.renderKnobs().warmTurns ?? WARM_TURNS }, (_, i) => (i + 1) * Math.PI * 2 / WARM_TURNS);
|
|
1599
|
+
}
|
|
1600
|
+
|
|
1601
|
+
/**
|
|
1602
|
+
* E153: one draw of the world turned by `turn` (radians) from where the player looks, through a 100° square view, with
|
|
1603
|
+
* the shadows placed for that view. The precompile links every program, but the GPU builds a program's pipeline for each
|
|
1604
|
+
* target, blend state and vertex layout only at its first draw (Metal: ANGLE's render-pipeline states, WebKit / iOS
|
|
1605
|
+
* build them on the draw). The boot's one frame drew only what faces the spawn, so turning around built the rest in
|
|
1606
|
+
* play — the waterfall behind the pier, a caster's depth variant in a cascade: 25–35 ms hitches on the M5 with a cold
|
|
1607
|
+
* shader cache, several times that on a phone. Four quarter-turns at 100° cover the circle.
|
|
1608
|
+
*/
|
|
1609
|
+
private async warmTurn(turn: number, target: THREE.WebGLRenderTarget | null, units: FencedUnits,
|
|
1610
|
+
onUnit: (done: number, detail: string) => void): Promise<void> {
|
|
1611
|
+
const cam = this.camera, sky = this._sky;
|
|
1612
|
+
const q = cam.quaternion.clone(), fov = cam.fov, aspect = cam.aspect;
|
|
1613
|
+
const yaw = new THREE.Euler().setFromQuaternion(q, 'YXZ').y;
|
|
1614
|
+
try {
|
|
1615
|
+
cam.fov = 100; cam.aspect = 1; cam.updateProjectionMatrix(); sky?.csm.updateFrustums();
|
|
1616
|
+
cam.quaternion.setFromEuler(new THREE.Euler(0, yaw + turn, 0, 'YXZ'));
|
|
1617
|
+
cam.updateMatrixWorld(true);
|
|
1618
|
+
sky?.warmShadows();
|
|
1619
|
+
// the boot's loop has not started: nothing else draws or moves the camera while the turn's units wait on the GPU
|
|
1620
|
+
await this.fencedDraw(cam, target, units, onUnit);
|
|
1621
|
+
} finally {
|
|
1622
|
+
cam.quaternion.copy(q); cam.fov = fov; cam.aspect = aspect; cam.updateProjectionMatrix(); cam.updateMatrixWorld(true);
|
|
1623
|
+
sky?.csm.updateFrustums();
|
|
1624
|
+
sky?.warmShadows();
|
|
1625
|
+
}
|
|
1626
|
+
}
|
|
1627
|
+
|
|
1628
|
+
/** RT3: frame pacing on a slow software rasterizer (slowGpuPacing.ts); null everywhere else. */
|
|
1629
|
+
private slowPacing: SlowGpuPacing | null = null;
|
|
1630
|
+
/** The pending cost probe of the last drawn frame: its start, or null when none is in flight. */
|
|
1631
|
+
private pacedStart: number | null = null;
|
|
1632
|
+
private pacedProbe: MessageChannel | null = null;
|
|
1633
|
+
/** The pacing state on a slow software rasterizer, for proofs; null on any other GPU. */
|
|
1634
|
+
get pacing(): Readonly<SlowGpuPacing> | null { return this.slowPacing; }
|
|
1635
|
+
/** RT3: pace this page's frames to a slow software rasterizer (finish.ts, after its shaders step measured the GPU slow).
|
|
1636
|
+
* A real GPU keeps its tier's scale unpaced (slowGpuPacingFor). Idempotent. */
|
|
1637
|
+
paceSlowGpu(): void {
|
|
1638
|
+
if (this.slowPacing !== null || this.dead) return;
|
|
1639
|
+
const pacing = slowGpuPacingFor(true, webglRendererName(this.renderer.getContext()), this.renderer.getPixelRatio());
|
|
1640
|
+
if (pacing === null) return;
|
|
1641
|
+
const channel = new MessageChannel();
|
|
1642
|
+
this.slowPacing = pacing; this.pacedProbe = channel;
|
|
1643
|
+
// the first task after the frame: the frame's rAF work, its read-back and whatever input it held up have all run
|
|
1644
|
+
channel.port1.onmessage = () => {
|
|
1645
|
+
const start = this.pacedStart;
|
|
1646
|
+
this.pacedStart = null;
|
|
1647
|
+
if (start === null || this.dead || this.app.clock.mode === 'capture') return;
|
|
1648
|
+
pacing.measured(start, diagnosticNow() - start); // a new scale waits for the next drawn frame (takeRatio)
|
|
1649
|
+
};
|
|
1650
|
+
this.engineScope.onDispose(() => { channel.port1.onmessage = null; channel.port1.close(); channel.port2.close(); this.pacedProbe = null; });
|
|
1651
|
+
}
|
|
1652
|
+
private measurePacedFrame(start: number): void {
|
|
1653
|
+
if (this.pacedStart !== null || this.pacedProbe === null) return;
|
|
1654
|
+
this.pacedStart = start;
|
|
1655
|
+
this.pacedProbe.port2.postMessage(0);
|
|
1656
|
+
}
|
|
1657
|
+
|
|
1658
|
+
/** QA row 25: a Developer pixel pick waiting for the next drawn frame */
|
|
1659
|
+
private pickedRatio: number | null = null;
|
|
1660
|
+
/** MG2: Low / High applies to this page: the phone tier with no explicit render scale, as it booted (a render-scale pick
|
|
1661
|
+
* waiting for its reload does not switch Low off early) */
|
|
1662
|
+
// MG8: Settings ▸ Graphics ▸ Pixel density replaces the boot-time render scale on a phone (Jake ~23:45: one pixel control)
|
|
1663
|
+
private readonly phoneGraphics: boolean = TIER === 'phone';
|
|
1664
|
+
resize(): void { this.fitSize(); this.kickLoop(); }
|
|
1665
|
+
private fitSize(): void {
|
|
1666
|
+
const w = window.innerWidth, h = viewportHeight();
|
|
1667
|
+
this.camera.aspect = w / h;
|
|
1668
|
+
this.camera.updateProjectionMatrix();
|
|
1669
|
+
this.renderer.setSize(w, h);
|
|
1670
|
+
this.compositionChanged = true;
|
|
1671
|
+
this._composer?.setSize(w, h); // a resize can land before buildComposer() / buildSky()
|
|
1672
|
+
this._sky?.csm.updateFrustums();
|
|
1673
|
+
}
|
|
1674
|
+
|
|
1675
|
+
/** The page frame (the systems' step and the draw), built once: by start(), or before it by stepFrame (the boot's
|
|
1676
|
+
* shader warm-up poses the view before the loop starts). */
|
|
1677
|
+
private frame: { readonly draw: (now: number | undefined, forced: boolean) => void; readonly parked: () => void } | null = null;
|
|
1678
|
+
private pageFrame(): { readonly draw: (now: number | undefined, forced: boolean) => void; readonly parked: () => void } {
|
|
1679
|
+
if (this.frame !== null) return this.frame;
|
|
1680
|
+
this.app.scheduler.configure(this.level.tiers?.[TIER]?.ticks);
|
|
1681
|
+
const composer = this.composer, sky = this.sky; // both built before the first frame (buildComposer reads the sky)
|
|
1682
|
+
this.clock.start();
|
|
1683
|
+
this.fixedAcc = 0; this.firstFixedStep = true;
|
|
1684
|
+
// (A timer-driven loop was tried for iOS Low Power Mode: timers are throttled to ~30 ms there too. rAF it is.)
|
|
1685
|
+
// PresentationLoop owns the only world request and cancels it while covered.
|
|
1686
|
+
// One chain only: every animation-frame callback of a frame gets the same timestamp, so a second chain (kickLoop
|
|
1687
|
+
// restarting a loop that was merely paused) finds its frame taken and ends there.
|
|
1688
|
+
let lastNow = -1, lastRun = diagnosticNow();
|
|
1689
|
+
// The frame cap (tier.ts frameCapFps; G876: 60 on mobile). The animation frame still comes every vsync; draw only
|
|
1690
|
+
// once 1/cap has passed since the last draw, less a slack under one vsync of the fastest display (4 ms < 8.3 ms
|
|
1691
|
+
// at 120 Hz) to absorb timestamp jitter. Mobile draws every vsync at 60 Hz, every second at 120 Hz, and every
|
|
1692
|
+
// available callback at 30 Hz (iOS Low Power). A skipped vsync does nothing, including the clock: dt and fixed
|
|
1693
|
+
// steps account for the whole interval, and input includes everything since the previous draw.
|
|
1694
|
+
let lastDrawn = -Infinity;
|
|
1695
|
+
const loop = (now:number|undefined, forceFrame:boolean) => {
|
|
1696
|
+
if (now !== undefined) { if (now === lastNow) return; lastNow = now; }
|
|
1697
|
+
if (this.dead) return; // a core system died (faults.ts): the fatal modal is up, nothing more to draw
|
|
1698
|
+
lastRun = diagnosticNow();
|
|
1699
|
+
// RT3: on a GPU the shaders step measured slow, the last frame's spacing (slowGpuPacing.ts) leaves the main thread to
|
|
1700
|
+
// worker messages and input; like a capped vsync, a skipped one does nothing. A capture draws at the tier's own
|
|
1701
|
+
// scale on its own clock: no spacing, and any lowered scale restored
|
|
1702
|
+
const capture = this.app.clock.mode === 'capture';
|
|
1703
|
+
if (capture) this.slowPacing?.restore();
|
|
1704
|
+
const pacing = capture ? null : this.slowPacing;
|
|
1705
|
+
if (pacedSkip(pacing, lastRun, this.pacedStart, forceFrame, buildHeld())) return;
|
|
1706
|
+
// G782: held at a cell's wall with build slices running, skip vsyncs up to the 30 fps held floor (framePacing.ts);
|
|
1707
|
+
// like a capped vsync, a skipped one does nothing, so the drawn frame's dt is the whole interval
|
|
1708
|
+
if (!forceFrame && heldDrawDeferred()) return;
|
|
1709
|
+
const cap = frameCapFps();
|
|
1710
|
+
if (cap > 0 && !forceFrame) {
|
|
1711
|
+
const anchor = frameCapAnchor(lastDrawn, now ?? lastRun, cap);
|
|
1712
|
+
if (anchor === null) return;
|
|
1713
|
+
lastDrawn = anchor;
|
|
1714
|
+
}
|
|
1715
|
+
if (this.hold) { this.clock.getDelta(); return; } // the context is lost / being rebuilt (GpuRecovery.ts): a draw now would re-link every program in one stall
|
|
1716
|
+
if (!forceFrame && !this.frameGate()) { this.clock.getDelta(); return; } // keep the clock moving so the next frame's dt is sane
|
|
1717
|
+
this.renderer.info.reset();
|
|
1718
|
+
const liveDt = Math.min(0.1, this.clock.getDelta());
|
|
1719
|
+
const realDt = this.app.clock.delta(liveDt);
|
|
1720
|
+
const t = this.app.clock.mode === 'capture' ? this.app.clock.real + realDt : this.clock.elapsedTime;
|
|
1721
|
+
// Visual hit-stop never changes simulation clocks, input, fixed steps or gameplay updates.
|
|
1722
|
+
let scale = 1;
|
|
1723
|
+
if (this.stopLeft > 0) { this.stopLeft -= realDt; scale = HIT_STOP_SCALE; }
|
|
1724
|
+
this.app.clock.timeScale = 1;
|
|
1725
|
+
this.app.clock.tick(liveDt);
|
|
1726
|
+
worldTime.scale = scale; worldTime.realDt = realDt; worldTime.t = t;
|
|
1727
|
+
const dt = realDt;
|
|
1728
|
+
this._frameTime += dt;
|
|
1729
|
+
this.frameNo++;
|
|
1730
|
+
this.app.events.beginFrame();
|
|
1731
|
+
this.app.scheduler.beginFrame(this.app.clock.paused ? 0 : dt, this.app.equipmentHost?.player.position);
|
|
1732
|
+
// the dev fps panel's timing rows (src/shared/engine/core/frameCost.ts): each system timed by its label only while the panel is open
|
|
1733
|
+
const on = frameCost.on;
|
|
1734
|
+
if (on) frameCost.begin();
|
|
1735
|
+
this.app.cpu.begin();
|
|
1736
|
+
// each system in its own try/catch (faults.ts): one that throws is counted, reported and, if it keeps at it, switched off
|
|
1737
|
+
this.runPhase('input', dt, t);
|
|
1738
|
+
this.runFixed(dt);
|
|
1739
|
+
this.runPhase('update', dt, t);
|
|
1740
|
+
this.runPhase('late', dt, t);
|
|
1741
|
+
if (this.isDead()) return; // a core system died in this frame's steps
|
|
1742
|
+
const renderAt = diagnosticNow();
|
|
1743
|
+
try {
|
|
1744
|
+
// RT3: a new render scale lands in the frame that draws (stepFrame draws nothing): never in the task that decided it,
|
|
1745
|
+
// whose cleared canvas nothing would replace
|
|
1746
|
+
// QA row 25: a Developer pixel pick (core/devPixels.ts) holds against the software pacing's scale while it is set
|
|
1747
|
+
const paced = this.stepOnly ? null : this.slowPacing?.takeRatio() ?? null, picked = this.stepOnly ? null : this.pickedRatio;
|
|
1748
|
+
if (picked !== null) this.pickedRatio = null;
|
|
1749
|
+
const ratio = picked ?? (paced !== null && activeDevPixels() === null ? paced : null);
|
|
1750
|
+
if (ratio !== null) { this.renderer.setPixelRatio(ratio); this.fitSize(); }
|
|
1751
|
+
sky.update(realDt);
|
|
1752
|
+
// planet + sun disc travel with the camera so they stay "infinitely" far
|
|
1753
|
+
sky.clouds?.position.copy(this.camera.position); sky.planet.position.copy(this.camera.position).addScaledVector(sky.planetDir, 1700); sky.sunDisc.position.copy(this.camera.position).addScaledVector(sky.raysDir, 1500);
|
|
1754
|
+
// FR5 (G869): a rays-only disc is parentless and GodRaysEffect draws it with matrixAutoUpdate off: compose it here,
|
|
1755
|
+
// or the rays come from the world origin (E398's painted sun never reached the rays)
|
|
1756
|
+
sky.sunDisc.updateMatrix();
|
|
1757
|
+
const lookStart = this.app.cpu.enabled ? diagnosticNow() : 0;
|
|
1758
|
+
try { this.lookStrategy?.frame?.(realDt, t); }
|
|
1759
|
+
finally { if (this.app.cpu.enabled && this.lookStrategy?.frame !== undefined) this.app.cpu.record(this.app.cpu.ticket(this.levelScope), diagnosticNow() - lookStart); }
|
|
1760
|
+
cullPlaced(this.camera); // placed models' per-copy culling and LODs for this view (src/client/engine/models/place.ts; nothing when none cull)
|
|
1761
|
+
if (this.stepOnly) { this.app.cpu.end(); if (on) frameCost.end(realDt * 1000, renderAt - lastRun, 0, 0); return; } // stepFrame: no draw
|
|
1762
|
+
// D178 (G813): a held crossing view pauses the post chain: the AO pass sits this draw out, and the bloom, rays and
|
|
1763
|
+
// volumetric effects composite their last frame (skipWhileTransparent); the scene and colour passes, and so every
|
|
1764
|
+
// material's and the colour pass's program keys, are unchanged
|
|
1765
|
+
this.postHeld = this.frameDrawRanges.holding();
|
|
1766
|
+
const ao = this.postHeld ? this.post?.ao ?? null : null, aoOn = ao?.enabled ?? false;
|
|
1767
|
+
if (ao !== null) ao.enabled = false;
|
|
1768
|
+
try { this.frameDrawRanges.draw(this.rootScene, this.camera, composer, realDt); }
|
|
1769
|
+
finally { if (ao !== null) ao.enabled = aoOn; }
|
|
1770
|
+
noteDrawnEnvironment(this.rootScene.environment); // what the frame lit with, for view-root warm-ups (drawnEnvironment.ts)
|
|
1771
|
+
if (this.compositionChanged && this.compositionObservers.size > 0) {
|
|
1772
|
+
const bytes = this.composerAllocationResources().reduce((sum, row) => sum + row.bytes, 0);
|
|
1773
|
+
for (const read of this.compositionObservers) read(bytes);
|
|
1774
|
+
this.compositionChanged = false;
|
|
1775
|
+
}
|
|
1776
|
+
if (exploreEntryPending() && !this.renderer.getContext().isContextLost()) recordExploreFrame();
|
|
1777
|
+
} catch (e) { this.fault(this.renderSystem, e); return; }
|
|
1778
|
+
this.flushEvents('render');
|
|
1779
|
+
if (this.captures.length > 0) this.flushCaptures();
|
|
1780
|
+
const done = diagnosticNow(), work = done - lastRun;
|
|
1781
|
+
noteFrameDrawn(done, now, cap, cap > 0 && Number.isFinite(lastDrawn) ? lastDrawn : undefined); // Builds share the cap recovery deadline; actual rAF still measures display cadence.
|
|
1782
|
+
this.app.cpu.end();
|
|
1783
|
+
if (pacing !== null) this.measurePacedFrame(lastRun);
|
|
1784
|
+
this.workMs[this.frameI] = work;
|
|
1785
|
+
this.frameRafTime = now ?? null;
|
|
1786
|
+
this.frameCount++;
|
|
1787
|
+
this.updateMs[this.frameI] = renderAt - lastRun; this.renderMs[this.frameI] = done - renderAt;
|
|
1788
|
+
if (on) frameCost.end(realDt * 1000, renderAt - lastRun, done - renderAt, cap > 0 ? 1000 / cap : 0);
|
|
1789
|
+
// QA row 31: play's sustained fps (a paused game's frames are not play)
|
|
1790
|
+
if (!this.app.clock.paused) sustainedFrames.frame(done, realDt * 1000, renderAt - lastRun, done - renderAt, cap > 0 ? 1000 / cap : 0);
|
|
1791
|
+
else sustainedFrames.frame(done, Infinity, 0, 0, 0);
|
|
1792
|
+
this.lastFrame.calls = this.renderer.info.render.calls; this.lastFrame.triangles = this.renderer.info.render.triangles;
|
|
1793
|
+
this.frameMs[this.frameI] = realDt * 1000; this.frameI = (this.frameI + 1) % this.frameMs.length;
|
|
1794
|
+
this.stats.frames++; this.stats.acc += realDt;
|
|
1795
|
+
if (this.stats.acc >= 0.5) { this.stats.fps = Math.round(this.stats.frames / this.stats.acc); this.stats.frames = 0; this.stats.acc = 0; }
|
|
1796
|
+
};
|
|
1797
|
+
this.frame = { draw: loop, parked: () => { this.clock.getDelta(); lastDrawn = -Infinity; } };
|
|
1798
|
+
return this.frame;
|
|
1799
|
+
}
|
|
1800
|
+
|
|
1801
|
+
start(): void {
|
|
1802
|
+
const frame = this.pageFrame();
|
|
1803
|
+
this.renderer.info.autoReset = false; // the composer renders several passes per frame: count the whole frame
|
|
1804
|
+
// Returning from the background: draw one frame at once (bypassing the gate). The 1–2 s of black on an
|
|
1805
|
+
// iOS app switch is iOS restoring a suspended standalone web app before any of this runs — investigated
|
|
1806
|
+
// and accepted (overlay / mirror / hidden canvas / wake lock / keep-alive audio made no difference).
|
|
1807
|
+
this.engineScope.listen(this.canvas, 'webglcontextlost', () => { this.gl.lostAt = diagnosticNow(); this.gl.events++; console.warn('[gl] context lost'); });
|
|
1808
|
+
this.engineScope.listen(this.canvas, 'webglcontextrestored', () => { this.gl.restoredAt = diagnosticNow(); console.warn('[gl] context restored after', Math.round(this.gl.restoredAt - this.gl.lostAt), 'ms'); });
|
|
1809
|
+
const driver=new PresentationLoop(this.engineScope,pagePresentation,frame);
|
|
1810
|
+
this.kickLoop=()=>{driver.wake();};
|
|
1811
|
+
this.app.ui.bindPresentation(this.engineScope,this.kickLoop);
|
|
1812
|
+
for(const state of ['play','explore','practice','playground','capture'] as const)this.app.onEnter(state,this.kickLoop,this.engineScope);
|
|
1813
|
+
this.primeFrame=()=>{if(!this.dead)driver.primeFrame();};
|
|
1814
|
+
this.hiddenFrame=()=>{if(!this.dead)driver.hiddenFrame();};
|
|
1815
|
+
this.app.ui.bindStill(this.engineScope,()=>{driver.stillFrame();});
|
|
1816
|
+
setLoopState('running');
|
|
1817
|
+
driver.wake();
|
|
1818
|
+
}
|
|
1819
|
+
|
|
1820
|
+
/** Stop the page engine and release its renderer and scopes. */
|
|
1821
|
+
dispose(): void {
|
|
1822
|
+
this.dead = true;
|
|
1823
|
+
this.levelScope.dispose();
|
|
1824
|
+
this.engineScope.dispose();
|
|
1825
|
+
this.rootScene.traverse((o) => { (o as Partial<THREE.Mesh>).geometry?.dispose(); });
|
|
1826
|
+
try { this._composer?.dispose(); } catch (e) { console.warn('[level] the composer did not dispose', e); }
|
|
1827
|
+
try { this.lookStrategy?.dispose?.(); } catch (e) { console.warn('[level] the render strategy did not dispose', e); }
|
|
1828
|
+
this.renderer.renderLists.dispose();
|
|
1829
|
+
this.renderer.dispose();
|
|
1830
|
+
this.renderer.forceContextLoss();
|
|
1831
|
+
this.rootScene.clear();
|
|
1832
|
+
}
|
|
1833
|
+
}
|