M5: Bot looting, combat and tide awareness

BotBrain plays a match with the commands a player sends: it picks a landing
marker near the barge's route, loots points of interest (following their own
walking routes into huts, lofts and piers), fights opponents it can see,
bandages itself, and gets to ground the coming tide will leave dry. BotWorld
is the map every bot shares: loot markers, routes, and each tide phase's safe
ground, which is the dry land joined to the island's highest walkable ground.

Three difficulties (Tuning.BOT_DIFFICULTIES) set reaction time, sight range
and aim error. The server mixes them unless --bot-difficulty says otherwise.

NavGrid labels connected regions when it is built, so a goal that is cut off
is turned down without a search of the whole island (about 70 ms each).

make bot-matches plays 20 bot-only matches and checks winners, drownings and
difficulty. Seeds 101 to 120: 20 of 20 with a winner, 7 of 460 deaths were
drownings (1.5%), easy bots placed worst (13.7 against 11.8 and 12.0) and
hard bots took the most eliminations (186 against 137 and 132).

Closes #28

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-12 02:42:10 -05:00
co-authored by Claude Opus 5.5
parent 793caf2b12
commit 4db605c33d
23 changed files with 1691 additions and 19 deletions
+13 -1
View File
@@ -1,7 +1,8 @@
## Command-line configuration for a headless server.
##
## tools/godot.sh -- --server [--seed=N] [--port=N] [--players=N] [--bots=N]
## [--ticks=N] [--unthrottled] [--log-every=N]
## [--bot-difficulty=mixed|easy|normal|hard] [--ticks=N]
## [--unthrottled] [--log-every=N]
##
## Unknown or malformed arguments are errors, so a typo can't silently run the wrong
## match. See `parse()`.
@@ -23,6 +24,8 @@ var port: int = DEFAULT_PORT
## Player slots for human clients. Until v0.5 they join as idle players.
var players: int = 0
var bots: int = 0
## Every bot's difficulty, as an index into Tuning.BOT_DIFFICULTIES, or -1 to mix them.
var bot_difficulty: int = -1
## Ticks to run before exiting. 0 runs until the process is stopped.
var ticks: int = 0
## Runs ticks back to back instead of at the real tick rate. For tests and smoke runs.
@@ -59,6 +62,7 @@ func to_dictionary() -> Dictionary:
"port": port,
"players": players,
"bots": bots,
"bot_difficulty": "mixed" if bot_difficulty < 0 else String(Tuning.BOT_DIFFICULTIES[bot_difficulty]["name"]),
"ticks": ticks,
"unthrottled": unthrottled,
}
@@ -94,6 +98,14 @@ func _parse_one(arg: String) -> void:
"--log-every":
if _check_int(key, value):
log_every = value.to_int()
"--bot-difficulty":
var found: bool = value == "mixed"
for index: int in Tuning.BOT_DIFFICULTIES.size():
if Tuning.BOT_DIFFICULTIES[index]["name"] == value:
bot_difficulty = index
found = true
if not found:
errors.append("--bot-difficulty must be mixed, easy, normal or hard, got '%s'" % value)
"--fault":
fault = value
_: