Hot Arena Combat — C# engine
A C# implementation of the Sanguis et Harena / Hot Arena Combat rules, plus simulators that hunt for broken mechanics. It implements the current design rules (v0.3.19 plus the rulings of 2026-10-18: glory on success, second wind, center +1), with the printed v0.3.19 rulebook available as RuleOptions.V0319.
| Project | What it is |
|---|---|
HotArena.Rules |
The rules engine. Pure C#, net10.0, no I/O, trimmable and AOT-compatible, with a deterministic RNG. Verified to publish and run in a Blazor WebAssembly app. Includes AI opponents (Ai/) and a HumanController for UIs (Interactive/). |
HotArena.Sim |
CLI for bulk simulation: probe, duel, log. |
HotArena.Web |
Blazor WebAssembly app styled after the printed cards, mat and arena. Watch AI-vs-AI bouts card by card (pause, step, speed), or Play against the AI as a playtester. |
HotArena.Rules.Tests |
xUnit tests (60): geometry, cards, combat, economy, flow, determinism, and the interactive controller. |
Other docs:
- RULES.md: which rules are implemented, the sources they come from, and every interpretation and option.
- FINDINGS.md: broken mechanics found by simulation, with numbers and proposed fixes.
Build, test, simulate
dotnet test engine/HotArena.slnx
dotnet run -c Release --project engine/HotArena.Sim -- probe --scale 10 --seed 2026
dotnet run -c Release --project engine/HotArena.Sim -- duel --a statue:cassius:murmillo --b duelist:cassius:murmillo --games 2000
dotnet run -c Release --project engine/HotArena.Sim -- log --a duelist:rufus:murmillo --b brawler:vela:thraex --seed 7
probewritesengine/sim-output/probe-report.md, which is gitignored. A full run at scale 10 takes about 100 seconds; pass--only tuningto run just the tuning section.- Fighter specs are
ai:champion:loadout:- ai:
brawler,duelist,showman,turtle,edgecamper,statue,random - champion:
rufus,vela,cassius,drusa - loadout:
murmillo,thraex,retiarius,veles,dimachaerus,unarmored,naked
- ai:
- Rule flags for
duelandlog: by default these use the current rules (glory on success, second wind, center +1, rally once per round, edge −1).--v0319: the printed v0.3.19 rulebook. With it,--second-windand--center-gloryadd those rules back.--no-second-wind,--no-center-glory,--edge-glory 0,--rally any: turn those rules off.--advanced,--rally crawl,--cap-water: other switches.
engine/HotArena.slnx builds from the command line. The projects are also in HAC/HAC.slnx for Visual Studio, but that solution's Wikidown project type only builds inside VS.
The web app (watch and play)
Live: https://hotarenacombat.com/demo/. The site workflow (.github/workflows/publish-wiki.yml) publishes the wiki at /, this app at /demo/, and these engine docs at /engine/ on every push to main that touches them. Deep links such as /demo/play go through the site's 404.html (HotArena.Web/deploy/404.html), which hands the route back to the app.
To run it locally:
dotnet run --project engine/HotArena.Web --launch-profile http
Then open http://localhost:5284.
- Watch: pick champions, loadouts and AI styles for 2–4 seats, then watch the bout play out.
- The arena shows tokens, facing (advanced), attack lines, and floating hit/block/glory effects.
- Each mat mirrors the printed one: water/blood/glory tracks, a loadout fan with dent marks, the 3 → 2 → 1 burn-down track, discard pile and hand.
- Pause, Step, and speed controls are in the top bar.
- Play: you take the first seat.
- Each round: plan your 6-card hand (or use Suggest) and pay upkeep.
- Each second: click a card in your hand, then act. Click a highlighted hex to move, or click an outlined opponent to see your attack options. Defense choices pop up when you're attacked.
- Opponents' hands and planned cards stay hidden.
- Everything fits on one screen: mats on either side of the arena. Hover any card to see it full size in the inspector.
- Both modes can switch between the current rules and the printed v0.3.19 rulebook, and toggle advanced rules, second wind, center glory, and the proposed edge penalty.
Card art comes from the printed card PNGs in assets/, shrunk to WebP by HotArena.Web/tools/make-card-images.py (about 0.9 MB in total). Re-run it after the cards are recomposed:
python engine/HotArena.Web/tools/make-card-images.py
.claude/launch.json has a hotarena-web configuration for the Claude desktop preview.
Using the engine (e.g. from Blazor WebAssembly)
using HotArena.Rules;
using HotArena.Rules.Ai;
using HotArena.Rules.Interactive;
var human = new HumanController();
human.DecisionRequested += _ => InvokeAsync(StateHasChanged); // re-render when input is needed
var engine = new GameEngine(RuleOptions.Basic, // current rules; or AdvancedRules, V0319, or `with { ... }` variants
[
new FighterSetup("You", Champions.Drusa, Loadout.Standard["murmillo"], human),
new FighterSetup("Rufus", Champions.Rufus, Loadout.Standard["thraex"], new HeuristicAi(Personality.Duelist, seed: 1)),
], seed: 42);
engine.EventRaised += e => log.Add(EventText.Describe(e, engine.State)); // play-by-play
_ = engine.RunAsync();
- Getting input.
human.Pendingdescribes what the engine is waiting on: build hand, shed gear, choose card, choose action, or choose defense. For actions and defenses it includes the legal options. Render them and callhuman.SubmitCard(...),SubmitAction(...), and so on. - Legality. The engine validates every answer and only ever offers legal actions. A UI never needs its own rules logic: highlight
MoveAction.Tohexes andAttackActiontargets straight from the list. - State.
engine.Stateis the whole table: board, fighters, tracks, hands, gear and dents. Treat it as read-only. - Events. Every change is a typed
GameEventrecord (CardPlayed,AttackDeclared,AttackHit,WentProne,CardBurned, …), useful for animations. - Determinism. The same seed and the same decisions replay the same bout on any runtime.
- Previews.
Reachexposes the pure geometry (sources, ranges, arcs, cover) for UI hints like "can I hit from here?".
Layout
HotArena.Rules/
Hex.cs, Board.cs axial hex math, arena sizes, start corners
Cards.cs, Gear.cs, the printed v0.3.0 card, gear and champion data
Champions.cs
RuleOptions.cs defaults = current rules; V0319 preset; variants and proposed fixes
GameState.cs fighters, tracks, gear state
Actions.cs TurnAction / DefenseChoice records
GameEngine.cs the round/second loop, legality, combat, burn
Reach.cs geometry helpers
Events.cs, EventText.cs event records and one-line descriptions
Ai/ RandomAi, HeuristicAi + Personality presets
Interactive/ HumanController for UIs
HotArena.Web/
Session/ GameSession (engine + controllers + log), Pacer (watch speed), ActionText, Art
Components/ ArenaBoard (SVG arena), PlayerMat, Track, CardView, ArenaView (table + human prompts), SetupPanel
Pages/ Home, Watch, Play
tools/make-card-images.py web copies of the printed card art