GameProps
Extends
Section titled “Extends”PropsWithChildren
Properties
Section titled “Properties”| Property | Type | Default value | Description |
|---|---|---|---|
defaultVoiceMode? |
VoiceMode |
VoiceMode.PushToTalk |
What a player’s talk key does when she starts, such as VoiceMode.OpenMic for a game played with friends, and what Reset puts back. Her microphone starts off either way. A mode the player saved on this device keeps its value. Read once, when Game mounts. |
defaultVolumes? |
Partial<Pick<PlayerSettings, "masterVolume" | "musicVolume" | "effectsVolume" | "interfaceVolume" | "voiceVolume">> |
music at 60, 20 dB under the effects, and every other volume at 100 |
The game’s own mix: where the player’s volume sliders start, such as { musicVolume: 100 } for music as loud as the effects, and what Reset puts them back to. A volume the player saved on this device keeps its value. Read once, when Game mounts. |
gl? |
RendererFactory | RendererOptions |
fiber’s: a WebGLRenderer with powerPreference: "high-performance", antialias and alpha |
The canvas’s renderer, as fiber’s Canvas takes it: the settings three’s WebGLRenderer is made with, such as { stencil: true } for a portal’s mask or { logarithmicDepthBuffer: true } for a planet’s scale, over fiber’s defaults; or a factory that makes the renderer from the canvas and those defaults, and may return a promise. A factory that returns a WebGPURenderer runs the experimental WebGPU mode, where every engine part that needs WebGL is off and says so once in the console. Settings changed at run time, such as tone mapping, go through useThree. Read once, when Game mounts; a scene mounted headless, as a room’s server and simulate mount it, reads none of it, and its useThree renderer is a stand-in that draws nothing. |
levels? |
Readonly<Record<string, string>> |
none: the game has no levels |
The game’s levels in order, as defineLevels lists them. The engine keeps the player’s progress through them, which useLevels reads, and the player’s save keeps it where save includes levels. Read once, when Game mounts. |
loadingScreen? |
false | LoadingScreenPick |
the engine’s LoadingScreen, undressed |
What covers the game from the page’s first paint until its first playable frame: the engine’s loading screen, dressed with the game’s name, a line, tips and art where given them; a component of the game’s own; or nothing, with false. |
menu? |
boolean |
true |
Whether the engine’s Play menu mounts, which Escape and a fullscreen’s exit open. false for a page that mounts the engine without being a game, such as a model viewer: no menu, and Escape stays the page’s. |
name |
string |
undefined |
The game’s identity. |
onCreated? |
(state) => void |
undefined |
Called once the canvas has made its renderer, scene and camera, before its first frame, with fiber’s state and the renderer the game’s gl made. Read once, when Game mounts. |
physics? |
PhysicsSettings |
every default definePhysics gives |
The game’s physics scene, as src/game.ts exports it from definePhysics: its gravity, its solver’s passes and the height a falling body is destroyed below. The room reads the same settings from the scene’s file, and a page whose settings differ from its room’s is refused at the welcome. Read once, when Game mounts. |
plugins? |
PluginList |
none: the core alone |
The game’s plugins, as src/game.ts exports them: the step runs what they compose around the core, the engine’s plugins among them, and each plugin’s component wraps the scenes and the game’s DOM, in list order. The room reads the same list from the scene’s file. A list of new plugin objects, as a hot update to a plugin’s module makes, makes a new world. |
quality? |
QualityOptions |
the engine's levels and start levels; dynamic resolution on where the main pointer is a finger, between half and the whole pixel ratio |
What the game changes about graphics quality: what each level draws, over the engine’s own, the level each device class starts at under Automatic, and dynamic resolution’s default and bounds. The engine detects the device, picks Automatic’s level and applies it with none. Read once, when Game mounts. |
respawnScreen? |
false | ComponentType<RespawnScreenProps> |
the engine’s RespawnScreen |
What covers the game while the player’s character waits to come back after her health ran out: the engine’s RespawnScreen, with the seconds left; a component of the game’s own; or nothing, with false. The CharacterSpawn’s respawn sets the wait. |
room? |
RoomOptions |
undefined |
The room to play in: the world is then the room’s, streamed to this client, and only the player’s own character steps here. The game mounts Replicas to draw the stream, her own character among it. None plays alone. Read once, when Game mounts. |
save? |
SaveDeclaration |
the listed plugins' saves alone |
What the player’s save keeps, as defineSave declares it in src/save.ts: the engine saves it includes and the game’s own state. Each listed plugin’s save is kept beside it. Read once, when Game mounts. |
shadows? |
false | "basic" | "percentage" | "variance" | ShadowType |
ShadowType.Percentage |
How the shadow map filters a shadow’s edge, false for no shadow map at all, so no light casts one. Read once, when Game mounts. |
start |
string |
undefined |
The scene that opens. |
warmUpMilliseconds? |
number |
6000 |
The milliseconds the warm-up under the loading screen may run. Once the start scene has mounted, it draws the HUD the scene holds and one of each of the engine’s own effects, then each WarmHud in the order they mounted, out of sight, so the browser builds their GPU programs before play rather than in a stalled frame of it. A WarmHud the budget does not reach builds on first use. It runs beside the load, so not all of its time is added to it: on Holdfast it drew in about 2 s and lifted the screen about 1.2 s later on a first visit, and no later on a return visit. The order in the tree is the priority. 0 turns it off. |