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 (currentlyv5.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 dynamicBASE_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,lowPerfresolution (query param →localStorage→ mobile heuristic),dprOverridepixel-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 suffixesBUILD_VERSIONwith 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.tscallsisMobile()at module load to set_IS_MOBILE, which is consumed by_perf-flags.ts.window.location.searchandwindow.localStorage—_perf-flags.tsparses URL params and reads thelowPerflocalStorage key on first load.window.innerWidth,window.innerHeight,window.devicePixelRatio—_gameplay.ts(CFG.BASE_ZOOMcalculation) and_perf-flags.ts(dprOverridepixel-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_ZOOManddprOverridecapturewindow.innerWidth/window.innerHeight/devicePixelRatioonce 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.
CFGis the single most-imported name in the codebase. BUILD_VERSIONflows into UI overlays, telemetry payloads, and the perf-test version tag.PERF_FLAGSis read by renderer modules (terrain, nebula, particles, post-fx) at draw time to skip layers; by boss data files viaisLowPerfMode(); and by canvas-setup code fordprOverride.PERF_VERSION_TAGis used by telemetry and perf-test harnesses to distinguish runs that have specific flags active.
Pattern notes
- Barrel-of-barrels.
engine/core/config.tsre-exports fromengine/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
windowaccess is guarded withtypeof 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_TAGenumerates every flag whose value is strictlytrueand appends those keys toBUILD_VERSIONwith-separators. Numeric flags (dprOverride,devScenario) do not affect the tag. _IS_MOBILEcross-file coupling._gameplay.tsexports_IS_MOBILEpurely so_perf-flags.tscan import the already-computed value rather than re-invokeisMobile(). 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
CFGor one of the sibling exports — consumer files should never hardcode tuning values. HULL_LIGHT_SHAPEis intentionally empty. Placeholder scaffold for per-hull directional light cones; no hulls currently author shapes.