PURPOSE

Barrel re-export file. Preserves the original engine/core/config import path for all existing consumers while the actual constant definitions live in domain-specific files under engine/core/config/. Re-exports every gameplay constant, build version, perf flag, economy table, sprite target, weapon slot rule, XP curve constant, accessibility setting, and debug color used by the game engine.

OWNS

Nothing directly. This file owns only the public surface — the names that other modules import. All values originate in sibling files inside engine/core/config/:

  • BUILD_VERSION — from _version.ts. A version string constant (currently v5.283.0).
  • DEBUG_COLLISION_BOXES, HULL_LIGHT_SHAPE, RARITY_COLORS — from _debug.ts. Boolean debug toggle, per-hull light cone map (empty), and the four-tier rarity color table (green/blue/epic/legend).
  • CFG — from _gameplay.ts. The single gameplay-tuning object holding movement drag, heat thresholds, warp drive parameters, damage multipliers, camera lerp and dynamic BASE_ZOOM, world chunk and belt geometry, entity pool caps (MAX_ENEMIES, MAX_ENEMY_BULLETS, MAX_HORDE_ENEMIES, MAX_STRUCTURES, MAX_JUNK, MAX_PARTICLES, MAX_XP_ORBS, MAX_WARNINGS, MAX_SFX_PER_RAF), pickup magnet tuning, spawner intervals, collision grid size, mission/beacon timers, boss intro/room/enrage/loot parameters, vision defaults, revive parameters, event-system timings, portal-room geometry, and per-mission base timers (MISSION_BASE_TIMERS).
  • ARTIFACT_KPM_LOW, ARTIFACT_KPM_HIGH, ARTIFACT_DROP_MIN_SEC, ARTIFACT_DROP_MAX_SEC, ARTIFACT_DROP_GRACE_SEC, ARTIFACT_KPM_WINDOW_SEC, ARTIFACT_TIER_RAMP_BASE, ARTIFACT_TIER_RAMP_PER_LEVEL — from _artifact-drops.ts. Artifact drop cadence tuning.
  • ECONOMY — from _economy.ts. Currency / shop tuning table.
  • SPRITE_TARGET_PLAYER, SPRITE_TARGET_ENEMY — from _sprites.ts. Canonical sprite render sizes.
  • WEAPON_SLOT_TYPES, MAX_WEAPON_SLOTS, MAX_NON_WEAPON_SLOTS, MAX_TOTAL_SLOTS, WEAPON_BOX_SIT_TIME, XP_BASE, XP_SCALE, LEVEL_UP_CHOICES, SCALING_DIMINISH_K — from _weapons-leveling.ts. Loadout slot rules and XP / level-up curve constants.
  • ACCESSIBILITY — from _accessibility.ts. Accessibility toggles.
  • PERF_FLAGS, PERF_VERSION_TAG — from _perf-flags.ts. URL-param-driven perf toggles, mobile auto-detect, lowPerf resolution (query param → localStorage → mobile heuristic), dprOverride pixel-budget cap (1,500,000 total canvas pixels per frame, hard ceiling at DPR 2.0, floor at 1.0), and the build tag that suffixes BUILD_VERSION with active flag names for telemetry.

READS FROM

Nothing. This file has no imports beyond its own ./config/index re-export.

config/index.ts itself only re-exports from the underscore-prefixed sibling files. Those underlying files read from:

  • engine/core/device-capabilities_gameplay.ts calls isMobile() at module load to set _IS_MOBILE, which is consumed by _perf-flags.ts.
  • window.location.search and window.localStorage_perf-flags.ts parses URL params and reads the lowPerf localStorage key on first load.
  • window.innerWidth, window.innerHeight, window.devicePixelRatio_gameplay.ts (CFG.BASE_ZOOM calculation) and _perf-flags.ts (dprOverride pixel-budget calculation) read viewport dimensions at module load.

PUSHES TO

Nothing at runtime. All exports are plain constants computed once at module load. Consumers import these constants directly.

DOES NOT

  • Does not mutate any constant after module load. All values are frozen the moment the module is first imported (browser context locked in at startup).
  • Does not subscribe to viewport-resize events. BASE_ZOOM and dprOverride capture window.innerWidth / window.innerHeight / devicePixelRatio once and never recompute.
  • Does not call any signal, store, or telemetry function. Pure constant export.
  • Does not contain any logic, function definitions, classes, or side effects of its own. Every line is a re-export.
  • Does not validate or normalize values. Crashes loudly only if _params.get('dpr') is unparseable (NaN propagates).

Signals

None emitted, none consumed. This file participates in no signal bus.

Entry points

  • Imported by every gameplay, rendering, UI, and engine module that needs tuning numbers. CFG is the single most-imported name in the codebase.
  • BUILD_VERSION flows into UI overlays, telemetry payloads, and the perf-test version tag.
  • PERF_FLAGS is read by renderer modules (terrain, nebula, particles, post-fx) at draw time to skip layers; by boss data files via isLowPerfMode(); and by canvas-setup code for dprOverride.
  • PERF_VERSION_TAG is used by telemetry and perf-test harnesses to distinguish runs that have specific flags active.

Pattern notes

  • Barrel-of-barrels. engine/core/config.ts re-exports from engine/core/config/index.ts, which itself re-exports from underscore-prefixed sibling files. The outer barrel preserves the legacy import path while the inner directory splits constants by domain.
  • Module-load capture. Values that depend on window (BASE_ZOOM, dprOverride, lowPerf, all PERF_FLAGS URL params) are computed inside IIFEs at module load. The first import freezes the values for the session — no reactive recomputation, no hot-reload behavior.
  • SSR-safe guards. Every window access is guarded with typeof window === 'undefined' so the file is importable in non-browser contexts; sensible defaults (null, false, base zoom) apply.
  • PERF_FLAGS lock-in. Once read, PERF_VERSION_TAG enumerates every flag whose value is strictly true and appends those keys to BUILD_VERSION with - separators. Numeric flags (dprOverride, devScenario) do not affect the tag.
  • _IS_MOBILE cross-file coupling. _gameplay.ts exports _IS_MOBILE purely so _perf-flags.ts can import the already-computed value rather than re-invoke isMobile(). Both files are guaranteed to see the same boolean.
  • No magic numbers in consumers. Every gameplay-tunable number in the codebase is expected to trace back to a named member of CFG or one of the sibling exports — consumer files should never hardcode tuning values.
  • HULL_LIGHT_SHAPE is intentionally empty. Placeholder scaffold for per-hull directional light cones; no hulls currently author shapes.