@modoki/engine / index / GameConfig
Interface: GameConfig
Game Definition & Services
assetBaseUrl?
optionalassetBaseUrl?:string
OTA Phase 4 — origin to resolve scenePath against, for a sub-game bundle whose files live in a separately-staged native folder rather than the shell's own served webroot (Capacitor.convertFileSrc() of the staged bundle root). Root-relative build output like /assets/main-<hash>.json otherwise 404s — it resolves against the SHELL's origin, not the bundle's. Unset for the shell's own (baked) game. Set by app/subgameLoader.ts, consumed by App.tsx's scene-boot-path resolution. See docs/ota-subgame-modules.md §3.
assetManifest?
optionalassetManifest?:string
Asset manifest path (relative to public/)
disable3D?
optionaldisable3D?:boolean
Disable the Three.js 3D renderer for this game (frees GPU memory).
initWorld
initWorld: () =>
void
Initialize ECS world: spawn starting entities, load models. Called only if no scenePath is set or the scene file doesn't exist.
Returns
void
name
name:
string
Human-readable game name
nameTransform?
optionalnameTransform?: (name) =>string
Transform entity names for display (e.g., Russian→English mapping)
Parameters
name
string
Returns
string
preferWebGPU?
optionalpreferWebGPU?:"auto"|"force"
Renderer preference. 'auto' (default) uses WebGPU when supported and falls back to legacy WebGLRenderer. 'force' always returns a WebGPURenderer (which itself has an internal WebGL2 fallback), required for TSL / NodeMaterial workflows like NPR post-processing.
scenePath?
optionalscenePath?:string
Path to the default scene file (e.g., "/scenes/scene.json"). If set, the editor loads this scene on startup instead of calling initWorld().
sceneSetup
sceneSetup: (
scene) =>void
Setup scene: lighting, environment, background color
Parameters
scene
Scene
Returns
void