Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions docs/ENV_VARIATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -270,12 +270,13 @@ victims, preserving damage dealt as the placement tiebreak under kills.
### Baseline policy doctrine (process environment)

These are reference-policy controls rather than `GameConfig` fields: they do
not change the Coworld manifest or simulation `GameVersion`. The league
baseline remains legacy unless a runner explicitly opts into another arm.
not change the Coworld manifest or simulation `GameVersion`. Hunter is now the
baseline default; `legacy` is the explicit opt-out for the previous behavior.
The existing selector semantics and all other doctrine arms remain unchanged.

| Environment variable | Values / default | Effect |
|---|---|---|
| `CTF_BOT_FFA_DOCTRINE` | `hybrid`, `legacy`, `passive`, `rush`, `shade`, `hunter`, `pact` / `legacy` | Selects the baseline FFA doctrine. |
| `CTF_BOT_FFA_DOCTRINE` | `hybrid`, `legacy`, `passive`, `rush`, `shade`, `hunter`, `pact` / `hunter` | Selects the baseline FFA doctrine; set `legacy` explicitly to opt out of hunter. |
| `CTF_BOT_FFA_DOCTRINE_SLOTS` | comma-separated `slot=doctrine` pairs / unset | Opt-in per-seat doctrine overrides; an unset value is a no-op. |
| `CTF_BOT_FFA_HUNTER_RING_MARGIN` | float `>=0` / `0.0` | Extra safety margin used by the hunter ring gate. |
| `CTF_BOT_FFA_HUNTER_ARM` | bool / `true` | Allows hunter trips to arm a weapon. |
Expand All @@ -295,11 +296,11 @@ baseline remains legacy unless a runner explicitly opts into another arm.
| `CTF_BOT_FFA_PACT_PARTNER_MATCH_RADIUS` | float `>=1` / `60.0` | Matching radius for remembered partner and common-target positions. |

The hunter-only and pact-only controls are ignored by the other doctrines. Pact
is opt-in, and an unset doctrine still means legacy. The parser in
[`players/baseline/baseline.nim`](../players/baseline/baseline.nim#L4264)
keeps an unset `CTF_BOT_FFA_DOCTRINE` at `legacy`; the defaults and bounds for
the doctrine controls are declared at
[`baseline.nim:267`](../players/baseline/baseline.nim#L267).
is opt-in. `ffaDoctrineFor` in
[`players/baseline/baseline.nim`](../players/baseline/baseline.nim#L491)
resolves an unset `CTF_BOT_FFA_DOCTRINE` to `hunter`; set it to `legacy` for the
explicit opt-out. The defaults and bounds for the doctrine controls are declared
at [`baseline.nim:267`](../players/baseline/baseline.nim#L267).

**Pact needs encounter density, and degrades silently without it.** A pact seat
can only form a pact from what it can see: it needs a second and a third living
Expand Down
8 changes: 8 additions & 0 deletions players/baseline/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,14 @@ COWORLD_PLAYER_WS_URL="ws://localhost:8080/player?slot=0&token=0xBADA55_0" \

Container build uses `players/baseline/Dockerfile` (produces `/bin/baseline`).

## FFA doctrine

The baseline policy's compiled FFA default is now `hunter`. Set
`CTF_BOT_FFA_DOCTRINE=legacy` to explicitly opt out; `hybrid`, `passive`,
`rush`, `shade`, and `hunter` remain selectable by name. These process
environment controls change baseline policy behavior only — they do not change
the Coworld manifest, `GameConfig`, or `GameVersion`.

## Artifact telemetry (always on)

`baseline/artlog.nim` records structured decision telemetry every episode
Expand Down
4 changes: 2 additions & 2 deletions players/baseline/baseline.nim
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ proc ffaDoctrineName(doctrine: FfaDoctrineKind): string =
of FfaPact: "pact"

proc ffaDoctrineFor(requestedDoctrine: string): FfaDoctrineKind =
if requestedDoctrine.len == 0: FfaLegacy
if requestedDoctrine.len == 0: FfaHunter
elif requestedDoctrine == "hybrid": FfaHybrid
elif requestedDoctrine == "legacy": FfaLegacy
elif requestedDoctrine == "passive": FfaPassive
Expand Down Expand Up @@ -526,7 +526,7 @@ var
FfaTraceTickScale = 1
FfaTraceMaxTick = 0
FfaLateClose = false
FfaDoctrine = FfaLegacy
FfaDoctrine = FfaHunter
FfaPerimeterBand = FfaPerimeterBandDefault
FfaLootBand = FfaLootBandDefault
FfaHoldBand = FfaHoldBandDefault
Expand Down
15 changes: 10 additions & 5 deletions tests/test_baseline_doctrine.nim
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,19 @@ suite "baseline FFA doctrine":
baseline = readFile(RepoRoot / "players" / "baseline" / "baseline.nim")
demo = readFile(RepoRoot / "tools" / "run_ffa_demo.sh")

test "unset doctrine defaults to legacy":
check baseline.count("FfaDoctrine = FfaLegacy") == 1
check baseline.count("if requestedDoctrine.len == 0: FfaLegacy") == 1
test "unset doctrine defaults to hunter":
check baseline.count("FfaDoctrine = FfaHunter") == 1
check baseline.count("if requestedDoctrine.len == 0: FfaHunter") == 1
check baseline.count("if requestedDoctrine.len == 0: FfaLegacy") == 0
check baseline.count("if requestedDoctrine.len == 0: FfaPact") == 0
check baseline.count("if requestedDoctrine.len == 0: FfaPassive") == 0
check baseline.count("if requestedDoctrine.len == 0: FfaHybrid") == 0
check demo.count(
"CTF_BOT_FFA_DOCTRINE=\"${CTF_BOT_FFA_DOCTRINE:-legacy}\"") == 1
"CTF_BOT_FFA_DOCTRINE=\"${CTF_BOT_FFA_DOCTRINE:-hunter}\"") == 1

test "legacy doctrine remains an explicit opt-out":
check baseline.count("requestedDoctrine == \"legacy\"") == 1
check baseline.count("elif requestedDoctrine == \"legacy\": FfaLegacy") == 1

test "hunter doctrine is selectable":
check baseline.count("FfaHunter") >= 4
Expand Down Expand Up @@ -67,7 +72,7 @@ suite "baseline FFA doctrine":

test "pact is never the default":
check baseline.contains("FfaDoctrineKind = enum\n FfaHybrid")
check baseline.count("FfaDoctrine = FfaLegacy") == 1
check baseline.count("FfaDoctrine = FfaPact") == 0
check baseline.count("if requestedDoctrine.len == 0: FfaPact") == 0

test "per-seat doctrine override is opt-in":
Expand Down
2 changes: 1 addition & 1 deletion tools/run_ffa_demo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ BOT_ENV=(
CTF_BOT_TRACE=1
CTF_BOT_TRACE_TICK_SCALE=16
CTF_BOT_TRACE_MAX_TICKS=8640
CTF_BOT_FFA_DOCTRINE="${CTF_BOT_FFA_DOCTRINE:-legacy}"
CTF_BOT_FFA_DOCTRINE="${CTF_BOT_FFA_DOCTRINE:-hunter}"
)
case "$ARM" in
E1|E2)
Expand Down
Loading