Build Options

← Installation | Configuration → | Home


Quick Reference

Engine Features

OptionDefaultPurpose
TNX_ENABLE_EDITOROFFEditor, GPU picking, PIE
TNX_ENABLE_ROLLBACKOFFN-frame rollback history (independent of TNX_DETERMINISM; forced on by the editor)
TNX_DETERMINISMOFFCross-platform determinism: Fixed32 math, disables defrag
TNX_ENABLE_NETWORKONGNS + Protobuf — disable for offline-only builds
TNX_NET_MODELClientPIE / Server / Client — baked into build
TNX_GPU_PICKINGOFFGPU click-to-select (auto-ON with editor)
TNX_GPU_PICKING_FASTOFFPer-frame picking (auto-ON with editor)
TNX_TESTINGOFFRollback determinism test harness
TNX_DETAILED_METRICSOFFPer-frame latency breakdown logging
TNX_ALIGN_64OFF64-byte vs 32-byte field array alignment

Profiling & Analysis

OptionDefaultPurpose
ENABLE_TRACYONTracy profiler integration
TRACY_PROFILE_LEVEL31=coarse (~1%), 2=medium (~5%), 3=per-entity (~50%+)
ENABLE_AVX2ON-march=native on GCC/Clang, /arch:AVX2 on MSVC
GENERATE_ASSEMBLYOFFEmit .s / .cod for vectorization inspection
VECTORIZATION_REPORTSOFFCompiler loop-vectorization diagnostics

Engine Feature Details

Enables the editor (World Outliner, Details, Content Browser, Engine Stats, Log, Component Generator, Debugger, and the Construct, Entity and Prefab editors), its transform gizmo, and GPU picking. Forces TNX_NET_MODEL=PIE.

When to enable: content authoring, scene editing, PIE testing.

cmake -B build-editor -DTNX_ENABLE_EDITOR=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo

Enables the N-frame rollback ring buffer (Temporal tier) and Jolt physics snapshots for resimulation. Independent of TNX_DETERMINISM: without it, resimulation is reproducible on the same machine and binary (enough for server-side reconciliation and editor history); cross-machine bit-identical results also need TNX_DETERMINISM, which enables Fixed32 math and JPH_CROSS_PLATFORM_DETERMINISTIC on Jolt. Forced on in editor builds.

When disabled: Temporal components are treated as Volatile (3-frame buffer). Games that don't need rollback pay zero memory cost.

cmake -B build-netcode -DTNX_ENABLE_ROLLBACK=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo

Switches SimFloat from float to Fixed32 (int32, 0.1mm precision). Disables defrag for live authoritative entities to keep EntityCacheIndex stable across rollback windows. Enables deterministic deferred-destruction ordering.

Bakes the networking role into the binary. Three options:

ValueRoleWhen
PIEAuthority + Owner in one process (loopback)Editor builds, auto-set with TNX_ENABLE_EDITOR=ON
ServerAuthority-only (headless)Dedicated server builds
ClientOwner-onlyDefault; standard client build

Enables the rollback determinism test harness: back up the ECS slab and Jolt state, resimulate N frames, memcmp the result against the backup, restore. Used to verify byte-perfect determinism. A project starts it with LogicThreadBase::RequestRollbackTest(); the engine binds no key to it (the Testbed's Rollback_Determinism test calls it).

SettingAlignmentPerformanceMemory overhead
OFF (default)32-byte~0.02–0.18ms penalty at 100K–1M entities (~25% of loads cross cache lines)~15 bytes avg padding per field array
ON64-byte (cache line)Zero cache line splits~31 bytes avg padding per field array (~2MB per 100K entities)

Use default unless profiling identifies cache line splits as a bottleneck.


Profiling Details

LevelZones enabledOverhead
1TNX_ZONE_COARSE() — frame/system level~1–2%
2+ TNX_ZONE_MEDIUM() — per-chunk~5–10%
3+ TNX_ZONE_FINE() — per-entity~50%+

Use level 1 or 2 for normal development. Level 3 only when profiling specific hot paths.

CompilerOutput location
MSVCbuild/TrinyxEngine.dir/Debug/TrinyxEngine.cod
GCC/Clangbuild/*.s files

Use to verify that hot loops vectorize and to understand register allocation.


Common Configurations

Editor Development

cmake -B build-editor \
      -DTNX_ENABLE_EDITOR=ON \
      -DENABLE_TRACY=ON \
      -DTRACY_PROFILE_LEVEL=1 \
      -DCMAKE_BUILD_TYPE=RelWithDebInfo
cmake --build build-editor

Networked + Rollback

cmake -B build-netcode \
      -DTNX_ENABLE_ROLLBACK=ON \
      -DENABLE_TRACY=ON \
      -DTRACY_PROFILE_LEVEL=1 \
      -DCMAKE_BUILD_TYPE=RelWithDebInfo
cmake --build build-netcode

Deep Performance Analysis

cmake -B build-perf \
      -DENABLE_TRACY=ON \
      -DTRACY_PROFILE_LEVEL=3 \
      -DVECTORIZATION_REPORTS=ON \
      -DGENERATE_ASSEMBLY=ON \
      -DENABLE_AVX2=ON \
      -DCMAKE_BUILD_TYPE=RelWithDebInfo
cmake --build build-perf

Release

cmake -B build-release \
      -DENABLE_TRACY=OFF \
      -DENABLE_AVX2=ON \
      -DCMAKE_BUILD_TYPE=Release
cmake --build build-release

IDE Integration

CLion / Rider

Settings → Build, Execution, Deployment → CMake → CMake options:

-DTNX_ENABLE_EDITOR=ON -DENABLE_TRACY=ON -DTRACY_PROFILE_LEVEL=1

VS Code

.vscode/settings.json:

{
    "cmake.configureArgs": [
        "-DTNX_ENABLE_EDITOR=ON",
        "-DENABLE_TRACY=ON",
        "-DTRACY_PROFILE_LEVEL=1"
    ]
}

Visual Studio

Project → CMake Settings → check/uncheck options → Ctrl+S to regenerate.


Inspecting Current Options

# All cache variables
cmake -L build

# Custom options only
cmake -L build | grep -E "TNX_|TRACY|ENABLE|GENERATE"

# Or read directly
cat build/CMakeCache.txt | grep -E "TNX_|TRACY"