Build Options

← Installation | Configuration → | Home

</blockquote>

Quick Reference

Engine Features

OptionDefaultPurpose
TNX_ENABLE_EDITOROFFImGui editor, GPU picking, PIE
TNX_ENABLE_ROLLBACKOFFN-frame rollback for netcode (forces TNX_DETERMINISM)
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 (F5 trigger)
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

<tt>TNX_ENABLE_EDITOR</tt>

Enables the 8-panel ImGui editor (World Outliner, Details, Content Browser, Engine Stats, Log, Node Script, Component Generator, Debugger). Also enables ImGuizmo 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

<tt>TNX_ENABLE_ROLLBACK</tt>

Enables the N-frame rollback ring buffer (Temporal tier) and Jolt physics snapshots for deterministic resimulation. Automatically implies TNX_DETERMINISM and enables JPH_CROSS_PLATFORM_DETERMINISTIC on Jolt.

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

<tt>TNX_DETERMINISM</tt>

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.

<tt>TNX_NET_MODEL</tt>

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

<tt>TNX_TESTING</tt>

Enables the rollback determinism test harness. F5 trigger: backup ECS slab + Jolt state, resimulate N frames, memcmp result against backup, restore. Used to verify byte-perfect determinism.

<tt>TNX_ALIGN_64</tt>

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

<tt>TRACY_PROFILE_LEVEL</tt>

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.

<tt>GENERATE_ASSEMBLY</tt>

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"