Files
Cesarus85--mjolnir-vr/source/networking
BirchWoodGodandClaude Opus 5.5 4a275b608d Add bots to local Slayer games (bots.count, off by default)
Computer players for a game played on this computer alone: bots.count (0,
the default, to 15) of them join the lobby of a local split screen Slayer
game, as far as it has room, on the teams bots.teams asks for ("even", or
"against" the players), and follow the players' team changes there. A bot
is the one player of a machine of its own at the top of the machine indices
(113 up), which no real machine takes, so every machine of the game - only
this one - spawns, respawns and scores it as any player.
network_server_manager.c adds and removes them in the pregame;
players_update_before_game takes each bot's action of the tick from
port/linux/game/bots.c in place of its empty queue.

A bot looks for enemies (the AI's line of sight, its skill's reach and
field of view), reacts, turns at a limited speed with an aim error that
settles and leads by its weapon's projectile speed, fires in bursts or a
press a shot, throws grenades, strikes close up and strafes; otherwise it
goes where an enemy was last seen, to a better weapon lying near (the
action button once the game offers the swap), or about the map's starting
locations and item spawns. It walks the paths the campaign's AI finds:
path.c's searches over the walkable surfaces every stock multiplayer map
carries, on a copy of them less those with no room above (Longest's walls)
and those under scenery or machines its path's obstacle avoidance found no
way past (Sidewinder's blast door); stuck, it jumps, sidesteps and looks
again. The searches run in the tick, three a tick at most, so two runs of
the same input play the same. bots.skill sets reaction, sight, aim, turning
and bursts; debug.bot_trace logs each bot's state.

Nothing changes in system link or internet games: no bot joins a game that
accepts remote connections, and bots_update_actions returns unless a local
game runs, so nothing the machines send each other changes and the network
version stays the same. Other gametypes get no bots yet (their goals come
in a later change). The code is BirchWoodGod's, from the Halo CE for PS
Vita port's offline bots, contributed under CC0; this is their core.

Checked (Linux, debug and release builds, SDL's offscreen video driver,
debug.network_test "local:" with debug.test_input "bot:1" as the player):
- 150 s games on Blood Gulch (Slayer, 6 bots; Team Slayer, 7, legendary),
  Chill Out (Team Slayer, 5, heroic), Longest (Slayer, 8), Sidewinder (Team
  Slayer, 9), Hang 'em High (Team Slayer, 5, "against"), Damnation (Slayer,
  6, easy) and Prisoner (Slayer, 15): every bot walked 125-280 units, the
  bots killed 7-118 times and died, teams evened or all against the
  player, and every game ended cleanly with no assert. With
  debug.bot_trace, bots took up rocket launchers, shotguns and sniper
  rifles, and debug.txt had none of the distributed netcode's idle action
  lines.
- bots.count 0: a 60 s local game logs the same lines as origin/main with
  only the network test's local mode (numbers apart), and config.toml
  differs only by the new settings' lines (and the network test's
  comment). bots.count 6 in a system link
  game (host:) and in a local CTF game: no bot joins, nothing logged.
- ninja web and ninja android (Emscripten 6.0.10, NDK r27c) build, debug
  and release.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011ucYZ9cvWn3nrnk7kK3S5X
2026-10-15 00:27:32 -05:00
..
2026-10-04 01:56:45 +13:00
2026-10-07 13:20:54 +13:00
2026-10-11 12:46:28 +13:00
2025-11-27 02:27:27 +00:00