M6: Bots that build

Bots now gather materials with the boathook and build with the same build
command and Building.check a player's client goes through:

- Gathering: an armed bot with nothing more pressing gathers from props
  nearby (12 m while looting, 24 m once there's nothing left to loot) up to
  60 of a material, or 120 in the last three tide phases. Not within 10 s of
  seeing an opponent or being hit, and not when hurt.
- Cover: a wall toward a shooter who catches it reloading, from ambush or
  worn down to 60, then waits behind it to reload or heal.
- Wall and heal: a badly hurt bot that would break off walls itself off and
  heals where it stands instead, if it can afford a wall.
- Ramps: a staircase of ramps, each from the top of the last, up to an
  opponent on a cliff or a steep rise (at most 5 a fight).
- Breakwaters: late in the match, a bot the tide would catch before it
  reached dry ground, or one at the last stand, rings its cell with four
  breakwaters and stays inside while they hold.

Measured with the new `make bot-builds` (tools/bot_builds.gd): every other
bot builds and the rest are a control group. Over 40 matches, seeds 501 to
540: builders built in 53% of the fights they began with materials for a
wall (12% of all fights; most fights are in the landing, before anyone has
gathered), lost 58% of the fights they built in against 67% of the rest,
and placed 12.1 on average against the control's 12.8. Overall fight losses
(65.8% / 65.7%) and wins (20 / 20) came out level; docs/BALANCE.md has the
numbers and the earlier batches that led to the careful gathering. Worst
p99 tick 3.4 ms of the 12 ms budget.

Closes #29

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-15 01:13:25 -05:00
co-authored by Claude Opus 5.5
parent 4177bfff76
commit eb239c5424
15 changed files with 1135 additions and 16 deletions
+8 -1
View File
@@ -1,7 +1,7 @@
# Tidewall build entry points. Everything runs headless with the repo-local engine.
GODOT := tools/godot.sh
.PHONY: qa-captures effects-captures app-icon deb deb-check bench dist dist-check build-captures poi-captures art figure figure-captures sea-captures models item-captures audio audio-check check import parse test test-selfcheck smoke capture-test terrain-capture binaries verify-engine balance bot-matches match match-captures client-check client-captures hud-captures style-captures menu-captures chart-captures discovery-check fuzz stability soak soak-selfcheck server-package-check
.PHONY: qa-captures effects-captures app-icon deb deb-check bench dist dist-check build-captures poi-captures art figure figure-captures sea-captures models item-captures audio audio-check check import parse test test-selfcheck smoke capture-test terrain-capture binaries verify-engine balance bot-matches bot-builds match match-captures client-check client-captures hud-captures style-captures menu-captures chart-captures discovery-check fuzz stability soak soak-selfcheck server-package-check
## A8: regenerates every sound in assets/audio/ from tools/audio/ (about 6 s).
audio: import
@@ -116,6 +116,13 @@ balance: import
bot-matches: import
@tools/bot_matches.sh
## M6: plays 40 bot-only matches in which every other bot gathers and builds (about 12
## minutes, under nice) and checks the builders build in over a third of the fights they
## can afford to, lose fewer of the fights they build in than of the rest, and place no
## worse than the others. BOT_BUILDS_SEEDS and BOT_BUILDS_FIRST change the seeds.
bot-builds: import
@tools/bot_builds.sh
## Plays one whole offline match, lobby to results, with a scripted player and 23 bots,
## then replays its command log and checks the replay ends in the same state.
## MATCH_SEED picks the seed.