Senior Game Math Engineer
Use this skill to produce simulation-backed math decisions and implementation guidance for slot-style games.
Workflow
- Capture target spec before tuning.
- Collect
game_id, mode list, target RTP by mode, volatility band, hit-rate band, max win cap, bonus frequency goals, and bet-unit assumptions.
- If constraints are missing, state assumptions explicitly and mark them as pending confirmation.
- Build math model before runtime code.
- Break EV into components: base line wins, feature triggers, bonus rounds, multipliers, and retriggers.
- Keep currency-agnostic math in integer bet units and convert to display values only at UI/reporting layers.
- Check that each outcome path has bounded payout and deterministic trigger conditions.
- Define mode architecture and RTP split.
- Allocate RTP contribution per mode and feature (base vs bonus).
- For selectable mode packs, verify weighted blend RTP remains within target range.
- Guard max win and tail-risk behavior with explicit caps or probability thresholds.
- Run simulation and convergence checks.
- Use at least
1,000,000 spins for directional checks and 20,000,000+ for sign-off.
- Report standard error and confidence interval; reject sign-off if drift exceeds tolerance.
- Keep seeds reproducible and preserve run configuration for replay.
- Validate generated artifacts.
- Verify book weights are positive, normalized, and mapped to valid state/outcome payloads.
- Recompute empirical RTP/hit-rate/volatility from generated books, not only from formula sheets.
- Confirm replay/event outputs do not mutate payout totals post-generation.
- Prepare sign-off handoff.
- Deliver assumptions, math decomposition, simulation method, results table, and open risks.
- Include implementation deltas by file path and exact verification commands.
Project Commands
Use existing project verifiers first:
python3 Engine/scripts/verify_rtp.py <game_id> --spins 1000000
bash games/Darumas/verify_math.sh
bash games/Darumas/test_rtp_check.sh
When game-specific scripts differ, keep command shape the same and report the substituted paths.
Output Contract
When designing or auditing math, return:
Math Spec: assumptions, mode definitions, EV decomposition, target metrics.
Results: theoretical vs simulated RTP/hit-rate/volatility with deltas and pass/fail.
Patch Plan: exact files/functions to edit and why.
Verification: runnable commands and expected pass criteria.
Risks: unresolved constraints that block sign-off.
References
references/workflow.md: detailed step-by-step execution order.
references/metrics-and-thresholds.md: formulas, tolerances, and acceptance gates.
references/signoff-template.md: final report template for handoff.
Execution Rules
- Distinguish theoretical RTP from simulated RTP in every report.
- Treat sub-million-spin conclusions as preliminary only.
- Flag contradictions between max-win marketing claims and math reality as blockers.
- Prefer deterministic, replayable evidence over narrative claims.
1---2name: senior-game-math-engineer3description: Design, audit, and tune casino game math for Stake-style game pipelines. Use when defining mode math, paytables, reel strips, feature frequencies, RTP/volatility/hit-rate targets, book weights, max-win controls, simulation plans, or release sign-off evidence.4---56# Senior Game Math Engineer78Use this skill to produce simulation-backed math decisions and implementation guidance for slot-style games.910## Workflow11121. Capture target spec before tuning.13- Collect `game_id`, mode list, target RTP by mode, volatility band, hit-rate band, max win cap, bonus frequency goals, and bet-unit assumptions.14- If constraints are missing, state assumptions explicitly and mark them as pending confirmation.15162. Build math model before runtime code.17- Break EV into components: base line wins, feature triggers, bonus rounds, multipliers, and retriggers.18- Keep currency-agnostic math in integer bet units and convert to display values only at UI/reporting layers.19- Check that each outcome path has bounded payout and deterministic trigger conditions.20213. Define mode architecture and RTP split.22- Allocate RTP contribution per mode and feature (base vs bonus).23- For selectable mode packs, verify weighted blend RTP remains within target range.24- Guard max win and tail-risk behavior with explicit caps or probability thresholds.25264. Run simulation and convergence checks.27- Use at least `1,000,000` spins for directional checks and `20,000,000+` for sign-off.28- Report standard error and confidence interval; reject sign-off if drift exceeds tolerance.29- Keep seeds reproducible and preserve run configuration for replay.30315. Validate generated artifacts.32- Verify book weights are positive, normalized, and mapped to valid state/outcome payloads.33- Recompute empirical RTP/hit-rate/volatility from generated books, not only from formula sheets.34- Confirm replay/event outputs do not mutate payout totals post-generation.35366. Prepare sign-off handoff.37- Deliver assumptions, math decomposition, simulation method, results table, and open risks.38- Include implementation deltas by file path and exact verification commands.3940## Project Commands4142Use existing project verifiers first:4344```bash45python3 Engine/scripts/verify_rtp.py <game_id> --spins 100000046bash games/Darumas/verify_math.sh47bash games/Darumas/test_rtp_check.sh48```4950When game-specific scripts differ, keep command shape the same and report the substituted paths.5152## Output Contract5354When designing or auditing math, return:55561. `Math Spec`: assumptions, mode definitions, EV decomposition, target metrics.572. `Results`: theoretical vs simulated RTP/hit-rate/volatility with deltas and pass/fail.583. `Patch Plan`: exact files/functions to edit and why.594. `Verification`: runnable commands and expected pass criteria.605. `Risks`: unresolved constraints that block sign-off.6162## References6364- `references/workflow.md`: detailed step-by-step execution order.65- `references/metrics-and-thresholds.md`: formulas, tolerances, and acceptance gates.66- `references/signoff-template.md`: final report template for handoff.6768## Execution Rules6970- Distinguish theoretical RTP from simulated RTP in every report.71- Treat sub-million-spin conclusions as preliminary only.72- Flag contradictions between max-win marketing claims and math reality as blockers.73- Prefer deterministic, replayable evidence over narrative claims.