Co-Authored-By: Claude Opus 5.5 <[email protected]> git-subtree-dir: native/fps-overlay git-subtree-mainline:9dbee00d1fgit-subtree-split:1c69d4ffc9
FPS Counter (Horizon native mod)
Horizon's official FPS counter: frames per second in a box in a corner of the screen, and, if you like, the slowest frame and the 1% low of the last 5 seconds. Its settings page (Options > Mods > FPS Counter > Settings) picks the corner and the lows.
It is a horizon-mixins bundle (mixins/fps_overlay/) that the Horizon
launcher builds into the game. It replaces the WebAssembly FPS Counter 1.x and keeps its settings: the same files (horizon-mods/.horizon-mod-data/fps_overlay/corner, lows).
Install
In the Horizon launcher: Mods → FPS Counter → Install, then Settings → Game → Native mods (experimental) → Build. The launcher downloads its own Rust and builds the game with your native mods; see Horizon's native mods.
Made on the hook points
The bundle hooks only Horizon's native hook points (crates/horizon-client/src/game/native_hooks.rs), which keep
their names and signatures across releases. compatibility.json names the version it needs ("hooks": 1), so the
launcher builds FPS Counter on any Horizon with that version or a later one, the player's own game by default, together with any other
mod. horizon_revision is only the commit it was last tested on.
| File | What it is |
|---|---|
mixins/fps_overlay/horizon-mixin.toml |
The bundle: one module and the HEAD hooks |
mixins/fps_overlay/runtime.rs |
The mod's logic and state, added to the game as game::official_fps_overlay; also this crate's library, for its tests |
mixins/fps_overlay/*.rs |
One small helper per hook |
tools/native.py |
Apply on Horizon (from GitHub, by commit), check, build, package the .hnmod, run the proof |
tools/proof.py, tools/game.py |
The proof: the built game driven with horizon-ctl --offscreen on fresh, temporary data |
Build and prove
cargo test # the logic
python3 tools/native.py check # apply on the tested Horizon and cargo check the game
python3 tools/native.py check --horizon latest # ... on the newest Nightly
python3 tools/native.py package # target/fps_overlay-<version>.hnmod for the registry
python3 tools/native.py proof --resources /path/to/.local/horizon-client/26.3
The proof needs resources prepared from your own Minecraft 26.3 (horizon-prepare); none are in this repository.
It seeds the WebAssembly mod's settings (bottom right, lows on) in a temporary game folder, then checks that Options > Mods shows them, and that the Corner button moves the box to the top left and writes the same file. CI runs cargo test, packages the .hnmod and checks the game on the tested commit, and every Monday on the newest Nightly.
License: MIT.