API ReferenceGE Extensionscore
Metrics
ImGui-based performance metrics overlay. Displays FPS, frame times, GPU wait times, and detailed rendering statistics with three display modes.
ImGui-based performance metrics overlay. Displays FPS, frame times, GPU wait times, and detailed rendering statistics with three display modes.
Public Functions
| Function | Signature | Description |
|---|---|---|
M.toggle | () | Cycles through display modes: 0 (off) → 1 (minimal) → 2 (simple) → 3 (full) → 0 |
M.onUpdate | (dtReal, dtSim, dtRaw) | Renders the metrics overlay each frame |
M.onInit | () | Sets extension to manual unload mode |
M.onSerialize | () → table | Saves current display mode |
M.onDeserialized | (d) | Restores display mode |
Module State
| Field | Type | Description |
|---|---|---|
M.currentMode | number | Display mode: 0=off, 1=minimal, 2=simple, 3=full |
M.dependencies | Table. Required extensions: {'ui_imgui', 'ui_visibility'} | |
dependencies | table | {"ui_imgui", "ui_visibility"} |
currrentMode | varies | d.currentMode |
Display Modes
| Mode | Content |
|---|---|
| 0 | Hidden (extension unloads itself) |
| 1 | Single line: FPS instant/avg/min/max |
| 2 | Table with FPS + DT rows, percentile stats (p90/p95/p99), GPU wait, framerate managers |
| 3 | Mode 2 plus GFX stats, terrain cells, ground cover, forest, shadow, light manager, deferred lights |
Console Variables Read
| Variable | Description |
|---|---|
fps::instantaneous | Current frame rate |
fps::avg | Average frame rate |
fps::min / fps::max | Min/max frame rates |
fps::p90 / fps::p95 / fps::p99 | Percentile frame rates |
fps::instantaneousUncap | Uncapped frame rate |
fps::waitForGPU | GPU wait time in ms |
$GFXDeviceStatistics::* | Draw calls, poly count, state changes |
$TerrainBlock::* | Terrain rendering stats |
$Forest::* | Forest cell rendering stats |
$ShadowStats::* | Shadow map stats |
Usage Example
-- Toggle metrics overlay
core_metrics.toggle()
-- Check current mode
if core_metrics.currentMode > 0 then
print("Metrics overlay is visible")
endDependencies
ui_imgui- ImGui renderingui_visibility- Checks if ImGui is visible; falls back todebugDrawertext
Notes
- When ImGui is not visible, metrics are drawn using
debugDrawer:drawTextAdvanced. - The Performance Graph can be opened from mode 2+ via a button (
CTRL+SHIFT+F). - FPS limiter randomness is displayed as a warning when active.
- Window is non-dockable, auto-sized, and anchored to the top-left corner.
See Also
- globals -
settings.getValue,getConsoleVariable
Load Map Command
Handles deep-link/startup commands to load a specific map with optional camera position. Parses level paths and camera transforms from structured command data.
Mod Manager
Core mod management system. Discovers, validates, mounts, activates/deactivates, packs/unpacks mod ZIP files and unpacked mod directories. Persists mod state in `mods/db.json`.