Files
tidewall/Makefile
T
claudeandClaude Opus 5.5 eb239c5424 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>
2026-11-15 01:13:25 -05:00

207 lines
9.1 KiB
Makefile

# 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 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
@$(GODOT) --script res://tools/audio/generate.gd
## A8: checks the generated audio's hashes and loudness against the rules.
audio-check: import
@$(GODOT) --script res://tools/audio/check.gd
## A4: rebuilds every item model and icon in headless Blender (CPU only, about 20 s).
models:
@nice -n 15 blender --background --factory-startup --python tools/models/items.py
@$(GODOT) --import --quit >/dev/null 2>&1 || true
## A2 and A4: every generated model, the player figure and the items with their icons.
art: figure models
## A2: the player figure's parts (assets/models/figure/), about 3 s.
figure:
@nice -n 15 blender --background --factory-startup --python tools/models/figure.py >/dev/null
@$(GODOT) --import --quit >/dev/null 2>&1 || true
## A2: the figure in every movement state, every action, and close up
## (captures/figure_*.png, about 1.5 min). Needs Docker. Look at them.
figure-captures: import
@for stage in states actions close; do tools/capture.sh figure_$$stage captures/figure_$$stage.png; done
## A6: the sea at every tide phase from out at sea, a calm beach, the last land in the
## gale and the view under water (captures/sea_*.png, about 6 min), and three of them
## again in the Compatibility renderer (*_compat.png). Needs Docker. Look at them.
sea-captures: import
@for stage in tide_0 tide_1 tide_2 tide_3 tide_4 tide_5 tide_6 tide_7 shore_calm shore_gale underwater; do tools/capture.sh sea_$$stage captures/sea_$$stage.png; done
@for stage in tide_2 shore_gale underwater; do CAPTURE_RENDERER=compatibility tools/capture.sh sea_$$stage captures/sea_$${stage}_compat.png; done
## A4: items held in the hand, over the shoulder, lying on the ground and by tier
## (captures/items_*.png, about 3 min). Needs Docker. Look at them.
item-captures: import
@for stage in held shoulder ground tiers; do tools/capture.sh items_$$stage captures/items_$$stage.png; done
## A7: renders the visual effects: a hit over the shoulder, a keg blast and collapse, the
## quieter effects, and the stress scene at the largest budget (about 6 min).
## H6: every capture scenario, the HUD at 4K and contact sheets (captures/qa/, about
## 40 min). Needs Docker. Judge each against docs/VISUAL_QA.md.
qa-captures: import
@tools/qa_captures.sh
effects-captures: import
@for stage in fight blast work stress; do tools/capture.sh effects_$$stage captures/effects_$$stage.png; done
## H1: server tick times and client draw calls, triangles and memory against the budgets
## in docs/ARCHITECTURE.md (about 3 minutes; the client half needs Docker).
bench: import
@tools/bench.sh
## R1: exports the game with the official templates into
## build/dist/tidewall-<version>-linux-x86_64.tar.gz (about 20 s).
dist: import
@tools/dist.sh
## R1: builds the package, unpacks it outside the repo, and runs smoke, a whole bot match
## and its game playing on its server there (about 2 minutes).
dist-check: import
@tools/dist_check.sh
## R2: renders assets/icons/app/tidewall.svg to the PNG sizes desktops use.
app-icon:
@$(GODOT) --script res://tools/app_icon.gd
## R2: builds build/dist/tidewall_<version>-1_amd64.deb from the release package.
deb: import
@tools/deb.sh
## R2: builds the .deb and checks it in a throwaway Debian 13 container: install,
## desktop entry, the server and the game headless, lintian, purge (about 3 minutes).
deb-check: import
@tools/deb_check.sh
## Everything that must pass before a push.
check: verify-engine binaries parse test test-selfcheck smoke
verify-engine:
@$(GODOT) --verify
binaries:
@tools/check_binaries.sh
## Refreshes Godot's global class cache, so class_name lookups resolve.
import:
@$(GODOT) --import --quit >/dev/null 2>&1 || true
parse: import
@$(GODOT) --script res://tools/parse_all.gd
test: import
@tools/run_tests.sh
## Proves the test runner detects each kind of failure.
test-selfcheck: import
@tools/test_selfcheck.sh
## Boots the headless server for 1,000 ticks and checks exit codes, logs and timing.
smoke: import
@tools/smoke.sh
## Plays 20 bot-only matches and checks each has a winner, few bots drown and easy
## bots do worst. Takes about ten minutes, so it isn't part of `check`.
## BOT_MATCH_SEEDS and BOT_MATCH_FIRST change how many seeds and where they start.
## H3: the balance pass over 200 bot-only matches; report in build/balance/report.txt.
balance: import
@tools/balance.sh
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.
match: import
@tools/match.sh
## Renders each stage of the match `make match` last played. Needs Docker.
match-captures: import
@tools/match_captures.sh
## Joins a real client process to a real server process over loopback UDP and checks
## it gets from the lobby into the match. About a minute, in real time.
client-check: import
@tools/client_check.sh
## Feeds FUZZ_MESSAGES (default 1,000,000) malformed messages to every network parser.
FUZZ_MESSAGES ?= 1000000
FUZZ_SEED ?= 1
fuzz: import
@nice -n 15 $(GODOT) --script res://tools/fuzz_parsers.gd -- --messages=$(FUZZ_MESSAGES) --seed=$(FUZZ_SEED)
## Finds a real game server on the LAN (over loopback) and through a real list server.
discovery-check: import
@tools/discovery_check.sh
## Renders what a network client sees on the barge, gliding and landed. Needs Docker.
client-captures: import
@for stage in barge glide landed basin build build_refused hud hud_build; do tools/capture.sh client_$$stage captures/client_$$stage.png; done
## A9: the HUD at 1280x720 and at 3840x2160 (captures/hud_*.png). Needs Docker.
hud-captures: import
@CAPTURE_SIZE=1280x720 tools/capture.sh client_hud captures/hud_720.png
@CAPTURE_SIZE=1280x720 tools/capture.sh client_hud_build captures/hud_build_720.png
@CAPTURE_SIZE=3840x2160 tools/capture.sh client_hud captures/hud_2160.png
## A10: every menu screen (captures/menu_*.png, about 5 min). Needs Docker. Look at them.
menu-captures: import
@for scene in menu_main menu_practice menu_join menu_settings menu_settings_mouse menu_pause menu_results; do tools/capture.sh $$scene captures/$$scene.png; done
## A11: the chart and minimap with the first tide forecast, and after it has risen
## (captures/chart_*.png, about 2 min). Needs Docker. Look at them.
chart-captures: import
@for scene in chart_first chart_later; do tools/capture.sh $$scene captures/$$scene.png; done
## A5: every kind of point of interest, and the fort and wall state test card. Needs Docker.
poi-captures: import
@for scene in poi_hamlet poi_dock poi_lighthouse poi_quarry poi_salt_works poi_shrine; do tools/capture.sh $$scene captures/$$scene.png; done
build-captures: import
@for scene in build_fort build_fort_side build_states vessels; do tools/capture.sh $$scene captures/$$scene.png; done
## A1: the woodcut print pass on and off, side by side scenes (captures/style_*.png). Needs Docker.
style-captures: import
@for scene in style_hamlet style_hamlet_plain style_dock style_dock_plain; do tools/capture.sh $$scene captures/$$scene.png; done
## Renders the capture test scenes in the offscreen container. Needs Docker.
capture-test: import
@tools/capture_selfcheck.sh
## Renders the terrain crack check and its control in the offscreen container. Needs Docker.
terrain-capture: import
@tools/terrain_capture_check.sh
## The 24-client network soak: a real server and 24 headless clients behind a relay that
## adds latency, jitter and loss, for SOAK_MATCHES (default 2) whole matches in real
## time, about half an hour. Checks for desyncs, errors, leaks and the tick budget.
## H4: 50 bot matches back to back on one unthrottled server; report in build/stability/report.txt.
stability: import
@tools/stability.sh
soak: import
@tools/soak.sh
## About a minute: proves the soak catches a client whose world has drifted.
soak-selfcheck: import
@SOAK_SELFCHECK=1 tools/soak.sh
## Builds the server image with packaging/docker/compose.yaml, starts it, joins it with a
## headless client and stops it with SIGTERM. Needs Docker. About a minute and a half.
server-package-check: import
@tools/server_package_check.sh