MT MouseTrainer
Open source

MouseTrainer Same seed. Same score. Every time.

Deterministic mouse dexterity trainer with fixed-timestep simulation, composable blueprint mutators, and replay verification. Built on .NET MAUI.

Install

dotnet add package MouseTrainer.Domain

Simulate

dotnet add package MouseTrainer.Simulation

Audio

dotnet add package MouseTrainer.Audio

Core Features

Determinism is constitutional. No DateTime.Now, no System.Random, no platform-dependent floats.

Deterministic to the Bit

xorshift32 RNG, FNV-1a 64-bit hashing, fixed 60 Hz timestep with accumulator catch-up. Same seed = same level = same score.

Composable Mutators

Six blueprint mutators reshape levels before play. Stack them, tune parameters, and the combination is frozen into the RunId hash.

Replay Verification

Binary .mtr format with quantized input, run-length encoding, and tick-by-tick re-simulation. Event hash + score + combo verified.

Protocol-Grade Identity

RunId is an FNV-1a 64-bit hash over mode + seed + difficulty + mutator specs. Once created, frozen forever.

Modular Monolith

Four assemblies with enforced one-way dependencies. Domain is the leaf with zero deps; MauiHost is the only composition root.

Event-Driven Audio

AudioDirector maps simulation events to sound cues with deterministic volume/pitch jitter. Rate-limited, asset-verified at startup.

Quick Start

Install packages

# Core primitives (RNG, hashing, run identity)
dotnet add package MouseTrainer.Domain

# Simulation engine (game loop, modes, mutators)
dotnet add package MouseTrainer.Simulation

# Audio cue system
dotnet add package MouseTrainer.Audio

Create a deterministic run

var run = RunDescriptor.Create(
    mode: new ModeId("ReflexGates"),
    seed: 42,
    difficulty: DifficultyTier.Standard);

var generator = new ReflexGateGenerator(config);
var blueprint = generator.Generate(run.Seed);

var loop = new DeterministicLoop(sim,
    new DeterministicConfig { FixedHz = 60 });

Blueprint Mutators

Mutator
Key Params
Effect
NarrowMargin
factor [0.1, 1.0]
Scales aperture heights down — tighter gaps
WideMargin
factor [1.0, 3.0]
Scales aperture heights up — more forgiving
DifficultyCurve
curve [-2.0, 2.0]
Power-curve re-interpolation of difficulty by gate index
RhythmLock
div {2, 3, 4, 6, 8}
Quantizes gate phases to N divisions — rhythmic patterns
GateJitter
str [0, 1]
Deterministic vertical offset via sin — spatial perturbation
SegmentBias
seg, amt, shape
Per-segment difficulty bias (crescendo, valley, wave)

NuGet Packages

Package
Description
MouseTrainer.Domain
Deterministic xorshift32 RNG, FNV-1a hashing, LEB128 varint, game events, run identity. Zero dependencies.
MouseTrainer.Simulation
Fixed 60 Hz game loop, composable mutators, level generation, replay recording/verification. Depends on Domain.
MouseTrainer.Audio
Event-driven audio cues with deterministic volume/pitch jitter, rate limiting, asset verification. Depends on Domain.

Replay System

Component
Role
ReplayRecorder
Captures per-tick quantized input samples during live play
InputTrace
Run-length encoded input stream for compact storage
ReplaySerializer
Binary .mtr format: magic header, LEB128 varints, FNV-1a checksum
ReplayVerifier
Re-simulates tick-by-tick; verifies event hash + score + combo
EventStreamHasher
Rolling FNV-1a hash over the simulation event stream

Architecture

Four-module modular monolith. No cycles, no platform leakage into libraries.

Domain (Leaf)

Shared primitives, RNG, hashing, run identity. Zero dependencies — the constitutional foundation.

Simulation

Deterministic loop, modes, mutators, levels, replay. Depends only on Domain.

Audio

Event-driven cue system, asset verification. Depends only on Domain. Never references Simulation.