Versus mode: attack vs defend (sim, bots, server, client)
One player defends, the other plays the Internet: earns credits over time and spends them on packets, upgrades and sabotage. Two rounds with swapped roles, timed (the faster fall wins). Built end to end, NOT yet QA'd or balanced. Sim (public/js/sim.js, TD.VS table): attacker economy (income, lifetime bonus, leak payback), spawn / stage / launch convoys, 7 tech tracks, abilities (EMP, decoy, surge, DDoS), defender tools (scan, patch, repair, quarantine), role-checked commands, round result, role-private state. Co-op/solo unchanged (24 scripted games replay identically). Bots (public/js/bot.js, tools/versus.js): defender (maze + turrets) and attacker (budgeted spender reading the tower mix); headless bot-vs-bot runner. Server (server/versus.js, protocol doc): versus rooms with lobby / countdown / playing / roundover / matchover, role stamping, cross-role refusal, role-private priv messages at 4 Hz, computer seat, freeze/forfeit rules, no pause/speed. Client (public/js/versus.js): setup dialog (role, length, vs computer or online), countdown, defender tools row, attacker unit shop with convoy + launch, tech and abilities, gateway choice, round/match screens, sounds, phone-first dock rows. Status and next steps (balance: the attacker currently wins ~100% of bot rounds; QA with two browsers; layout matrix rerun) are in docs/NEXT.md and docs/VERSUS.md. The full planned workflow incl. balance/QA prompts is in docs/workflows/versus-full.js. 253 unit tests pass; one smoke e2e run; no other e2e per the user's request. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Tb8pW2KAN4oFkh1aK1BfD8
This commit is contained in:
parent
b4ae6cb57d
commit
2098d59c1f
23 changed files with 6166 additions and 90 deletions
20
docs/NEXT.md
20
docs/NEXT.md
|
|
@ -33,7 +33,7 @@ and a check that the layout holds on **tablets and foldables**.
|
|||
| 2 | Co-op robustness (stalled-render tower loss, half-open sockets, idempotent upgrade/wave, restart message), audio + keyboard + a11y | **done 2026-10-10** (QA passed) |
|
||||
| 3 | New enemies (Daemon healer, Proxy shielded, Botnet swarm) and towers (Sandbox stun, Load Balancer buff), glyphs/shapes, gallery e2e; Orbital Uplink (4 levels, priced 1500 + 25% per owned, upgrades scale equally; ); 4 new maps | **done 2026-10-10** (QA passed) |
|
||||
| 4 | Difficulty picker (Easy/Normal/Hard) + ONE time-boxed balance pass (IDS no longer sufficient, credit snowball tamed, Mortar/Arc/Filter buffed, flyers slower); Uplink price step set to 30% per owned | **done 2026-10-11** (QA passed) |
|
||||
| 5 | Attack-vs-defend versus mode, bots for both sides | design in `docs/VERSUS.md`, workflow drafted |
|
||||
| 5 | Attack-vs-defend versus mode, bots for both sides | **built 2026-10-11, NOT QA'd, NOT balanced** (sim, bots, server, client; see below) |
|
||||
| 6 | Server leaderboard (needs `StateDirectory=netwall` + `DATA_DIR`; solo scores are client-reported) and an opt-in public room list | after 5 |
|
||||
| any | Fold/tablet real-device check; open items below | |
|
||||
|
||||
|
|
@ -48,6 +48,24 @@ and a check that the layout holds on **tablets and foldables**.
|
|||
* If room codes ever get longer than 4 characters, boot's regex and the `inCode` maxlength must change together.
|
||||
|
||||
|
||||
### Versus mode: where it stands and what is left
|
||||
|
||||
Built: sim rules + economy + tech + abilities + defender tools (`TD.VS` table), `public/js/bot.js` (defender and attacker bots), `tools/versus.js`
|
||||
(bot-vs-bot runner), server rooms/phases/roles/forfeit/private data/computer seat (`server/versus.js`), protocol (`docs/PROTOCOL.md` "Versus"),
|
||||
client (`public/js/versus.js`: setup dialog, countdown, role-aware HUD, shop, convoy/launch, tech, abilities, tools, round/match screens). 253 unit tests
|
||||
pass; the client was played by hand (local match vs the computer through both rounds, online rooms on the real server). **No e2e, no layout-matrix
|
||||
run, no independent QA, no balance pass** (the user asked to skip them for now).
|
||||
|
||||
Left to do, in order:
|
||||
1. **Balance** with `node tools/versus.js --maps all --limit 720 --seeds 6`: the attacker wins ~100% today. Cheapest lever: raise the buyCost of botnet
|
||||
and spam (3 credits each; botnet 8 / spam 6 flips it to ~0%); target 40-60% for equal bots on every map. The `buyCost` lives in `ENEMIES`, the rest in `TD.VS`.
|
||||
2. **QA** with two real browsers (prompt in `docs/workflows/versus-full.js`) plus the usual suites: `npm run e2e` (rerun the layout matrix: the menu foot now holds
|
||||
three buttons, the palette becomes the unit shop in versus, new dock rows in the side panel).
|
||||
3. Known limits from the client agent: a local computer match cannot be paused (opening the menu leaves the round running); no one-tap convoy presets (Rush, Swarm,
|
||||
Siege...); the defender sees no stealth/shield cue (by design); on very small phones the setup dialog's Online block needs a scroll; remote rematch, frozen/reconnect
|
||||
and reload-resume into a versus room were not exercised.
|
||||
4. Ideas not built: spectators, handicap sliders in the lobby, a leaderboard of attack times, an invite link that opens the versus lobby directly.
|
||||
|
||||
## Suggested order of work
|
||||
|
||||
1. **The wall bug above**, then the other confirmed high/medium client bugs:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue