- Game behavior lives in
NetRts.Engineand must stay deterministic. No clocks, noSystem.Random, no iteration over unordered collections, explicit tie-breaks. If you add state, include it inStateHash()so the replay test keeps you honest. - Balance numbers live in
GameRulesand reach bots throughGET /api/v1/rules. Updatedocs/bot-guide.mdwhen you change them. - The wire contract lives in
NetRts.Protocol. Changing a field name breaks every bot in every language; add fields rather than renaming, and bump the API version for breaking changes. - The server stays thin. Anything that touches a
GameSimulationgoes throughMatchHostso it happens under the match lock.
Write the test first where you can.
- Rules and mechanics →
tests/NetRts.Engine.Tests. UseTestGames.New()and the internal hooks inGameSimulation.Testing.csto stage exact scenarios. - API behavior →
tests/NetRts.Server.Tests(real HTTP pipeline, isolated SQLite file, manual ticks viaMatchHost.Advance). - If you change the house bots or balance, run
FullMatchTestsand make sure matches still end decisively.
dotnet build
dotnet test- Branch from
main. dotnet buildmust be warning-free (warnings are errors) anddotnet testgreen.- Describe user-visible changes (API, rules, balance) in the PR.