EngineConfig struct
#include <Runtime/Core/Public/EngineConfig.h>
Public static variables
- static int Unset constexpr
- Sentinel: field has not been assigned by any config file.
Public static functions
- static auto LoadProjectConfig(const char* projectDir, const char* projectName = nullptr) -> EngineConfig
- Load the cascading game config for
projectDir. - static auto LoadEditorConfig(const char* projectDir, const EngineConfig& gameConfig) -> EngineConfig
- Load the editor config overlay on top of
gameConfig. - static auto LoadFromFile(const char* path) -> EngineConfig
- Load a single INI file into a config struct.
Public functions
- void FillFrom(const EngineConfig& other)
- Copy all
Unsetint fields and empty strings fromotherinto this config. - void ApplyDefaults()
- Replace all remaining
Unset/ empty fields with compiled-in defaults. - auto GetTargetFrameTime() const -> double
- Main-loop target frame time in seconds.
- auto GetFixedStepTime() const -> double
- Fixed simulation step duration in seconds.
- auto GetNetworkStepTime() const -> double
- Network update interval in seconds (time between state-correction sends).
- auto GetInputNetHz() const -> int
- Resolved InputNetHz, falling back to 128 if
Unset. - auto GetInputNetStepTime() const -> double
- Client input packet interval in seconds.
- auto GetSlabUploadInlineThreshold() const -> int
- Dirty entity count below which slab upload runs inline on the render thread (no job dispatch).
- auto GetSlabUploadSingleJobThreshold() const -> int
- Dirty entity count below which a single bundled job uploads all fields.
Public variables
- bool Headless
- No window, renderer, or GPU. Implied by
TNX_NET_MODEL=Server. - bool EnableThreadPinning
- Assign threads to specific cores for reduced jitter. Disable in PIE.
- int MaxFrames
- Exit after this many Sentinel frames. 0 = run indefinitely (CI: set to ~60).
- int TargetFPS
- Main-loop frame rate cap. Cannot be lower than FixedUpdateHz if set.
- int PresentMode
- How game windows (game builds, PIE windows) present. INI: Fifo | Mailbox | Immediate.
- float UIScale
- User UI scale, multiplied into every window's OS display scale (INI: UIScale = 1.25, CLI: –ui-scale 1.25). 0 = unset (1.0). Clamped to 0.5..4.
- bool DevPointerKey
- Let Shift+F1 release the pointer from the game and give it back (INI: DevPointerKey = 1 turns it on). Off by default. See TrinyxEngine::
SetPointerMode. - bool DevInspectorKey
- Let Shift+F2 open and close the UI inspector, a window showing the main window's document (INI: DevInspectorKey = 0 turns it off, for a shipped build). See UIInspector.h.
- bool Inspect
- Open the UI inspector at startup (CLI only: –inspect).
- bool DevConsoleKey
- Let Shift+F3 open and close the console, a window with the log and a command line (INI: DevConsoleKey = 0 turns it off, for a shipped build). See UIConsole.h.
- bool Console
- Open the console at startup (CLI only: –console).
- bool PlatformTest
- Open the platform check window at startup (CLI only: –platform-test). See PlatformProbe.h.
- bool UITest
- Show the UI check document in every window (CLI only: –ui-test). See UIDemo.h.
- bool UIWorkbench
- Show the editor-widget workbench in the main window (CLI only: –ui-workbench). See UIDemo.h.
- bool StatsOverlay
- Show the stats overlay in the main window (CLI only: –stats). See StatsOverlay.h.
- bool LatencyStats
- Log input-to-photon and visual latency once per second (INI: LatencyStats = 1, CLI: –latency).
- int FixedUpdateHz
- Fixed-timestep logic rate (e.g., 128 or 512 Hz).
- int PhysicsUpdateInterval
- Fixed steps per Jolt step. 8 = 64 Hz physics at 512 Hz sim.
- int NetworkUpdateHz
- State-correction send rate ("tick rate"). Lower = less bandwidth.
- int ClockSyncProbes
- RTT probe count during Synchronizing before computing InputLead. Default: 8, range: 1–255.
- int InputPollHz
- Sentinel input-poll rate; higher = lower input latency.
- int InputNetHz
- Rate at which the client sends InputFrame packets to the Authority.
- int InputDelayFrames
- Artificial input delay in sim frames for lockstep/deterministic play.
- int MaxClientInputLead
- Max sim frames the Authority may predict ahead of a client's last received input.
- int MAX_RENDERABLE_ENTITIES
- Arena 1 capacity (Render + Dual partitions). Must be ≤ MAX_CACHED_ENTITIES.
- int MAX_CACHED_ENTITIES
- Max dynamic entities across all arenas combined.
- int MAX_JOLT_BODIES
- Sizes the Jolt body interface, temp allocator, and mapping arrays.
- int TemporalFrameCount
- Temporal ring depth. Min 8, power-of-2. At 512 Hz: 128 frames ≈ 0.25 s of history.
- int JobCacheSize
- Pre-allocated job queue capacity. Exceeding this value will assert.
- int SlabUploadInlineThreshold
- Dirty entity count below which GPU slab upload runs inline on the render thread.
- int SlabUploadSingleJobThreshold
- Dirty entity count below which a single bundled job uploads all fields sequentially.
- char ProjectDir
- Project root directory (set from TNX_PROJECT_DIR or Initialize() argument).
- char DefaultScene
- Scene to load on startup (relative to ProjectDir/content/).
- char DefaultState
- Flow state name to load on startup (e.g., "MainMenu").
- uint16_t NetPort
- GNS connection port (CLI: –port).
- char NetAddress
- Remote address for client connections (CLI: –client <ip>).
- int EngineLogLevel
- Min log level for the engine channel. 0=Trace … 4=Error.
- int GameLogLevel
- Min log level for the game channel. 0=Trace … 4=Error.
- bool NoNagle
- Disable GNS Nagle coalescing for all unreliable sends.
- int SendRateMin
- GNS per-connection send rate floor (bytes/sec). Unset = GNS default (256 KB/s).
- int SendRateMax
- GNS per-connection send rate cap (bytes/sec).
- int AudioUpdateHz
- Sentinel audio update rate (fade processing, stream refill). Default: 250 Hz.
- int MaxAudioVoices
- Maximum simultaneous voices; exceeded voices are stolen by priority.
Function documentation
static EngineConfig EngineConfig:: LoadProjectConfig(const char* projectDir,
const char* projectName = nullptr)
Load the cascading game config for projectDir.
| Parameters | |
|---|---|
| projectDir | |
| projectName | The project's name (its .tnxproject); null or empty: the folder's name. |
Walks {ProjectName}Defaults.ini → TrinyxDefaults.ini → compiled defaults.
static EngineConfig EngineConfig:: LoadEditorConfig(const char* projectDir,
const EngineConfig& gameConfig)
Load the editor config overlay on top of gameConfig.
| Parameters | |
|---|---|
| projectDir | |
| gameConfig | Game config to fall back to for fields not set by editor INI files. |
Walks EditorDefaults.ini (projectDir) → EditorDefaults.ini (engineDir) → gameConfig fills gaps.
static EngineConfig EngineConfig:: LoadFromFile(const char* path)
Load a single INI file into a config struct.
| Returns | Compiled defaults if the file does not exist. |
|---|
double EngineConfig:: GetTargetFrameTime() const
Main-loop target frame time in seconds.
| Returns | 0.0 if uncapped; otherwise 1.0 / min(TargetFPS, FixedUpdateHz) in non-editor builds. |
|---|
Variable documentation
int EngineConfig:: PresentMode
How game windows (game builds, PIE windows) present. INI: Fifo | Mailbox | Immediate.
bool EngineConfig:: LatencyStats
Log input-to-photon and visual latency once per second (INI: LatencyStats = 1, CLI: –latency).
int EngineConfig:: InputDelayFrames
Artificial input delay in sim frames for lockstep/deterministic play.
int EngineConfig:: MaxClientInputLead
Max sim frames the Authority may predict ahead of a client's last received input.
int EngineConfig:: SlabUploadInlineThreshold
Dirty entity count below which GPU slab upload runs inline on the render thread.
int EngineConfig:: SlabUploadSingleJobThreshold
Dirty entity count below which a single bundled job uploads all fields sequentially.
bool EngineConfig:: NoNagle
Disable GNS Nagle coalescing for all unreliable sends.
int EngineConfig:: SendRateMin
GNS per-connection send rate floor (bytes/sec). Unset = GNS default (256 KB/s).