CTF Frogbots - #452
Draft
dsvensson wants to merge 11 commits into
Draft
CTF Frogbots#452dsvensson wants to merge 11 commits into
dsvensson wants to merge 11 commits into
Conversation
dsvensson
force-pushed
the
ctfbots
branch
8 times, most recently
from
June 25, 2026 18:57
b21f6ad to
a668f35
Compare
The route calculation used the bare literals 100000 and 1000000 interchangeably to mark a link or route that can't be taken. Introduce TRAVEL_UNREACHABLE and use it for every such sentinel so the intent is explicit and the value is defined in one place (next to PATH_SCORE_NULL). No behaviour change beyond unifying the two 100000 sites onto the same 1000000 value the reachability checks (< 1000000) already test against. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Server-side teamplay messaging for CTF, usable by human players (not bot-specific): - Report the flag and the rune(s) a player is carrying in status/took/ need/area/point messages (CTFItemText), with team-coloured FLAG and abbreviated rune names. - New messages: tossflag, tossrune, basesafe, basenotsafe, goingflag. - TeamplayEventItemTaken now records picked-up runes. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Co-Authored-By: SpookyScaryDev <thomaslcave@gmail.com>
Generic frogbot functionality (usable in DM, not CTF-specific) for making bots shoot buttons and shootable doors: - LOOK_BUTTON path flag marks a path from a regular marker to a button; bots don't travel it, it only tells them where to look to shoot. - MARKER_LOOK_BUTTON is set automatically on a marker that has such a path, and makes closed-door paths from it passable. - FIRE_BUTTON path state is raised when a bot should shoot the linked button/door, suppressing normal enemy fire and picking a hitscan weapon to press it. Added to the .bot format as path flag 'l'. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Co-Authored-By: SpookyScaryDev <thomaslcave@gmail.com>
Admin-only debugging command that sends every bot to the marker the caller is looking at (reuses the existing fixed_goal mechanism). Generic bot tooling, unrelated to CTF. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Co-Authored-By: SpookyScaryDev <thomaslcave@gmail.com>
Instead of adding up to 8 bots toward maxclients, fill the player count (humans + bots) up to the next multiple of 8, capped at maxclients: 3 players -> 8, a repeat -> 16, and a server already at a full team size jumps straight to the next one. Run repeatedly to keep filling. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Co-Authored-By: SpookyScaryDev <thomaslcave@gmail.com>
Mirror sv_loadentfiles_dir (used for .ent files): when sv_loadbotfiles_dir is set, look for a map's .bot file under that subdirectory before falling back to the default location, and write generated .bot files there too. This lets alternative entity sets keep their waypoints in a dedicated directory instead of colliding with the stock per-map files, and is useful for any such set, not just CTF. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Markers added at runtime by the server (MARKER_DYNAMICALLY_ADDED) are not part of the saved .bot file, so a /botcmd addpath that links to one would produce a path that can't be persisted. Reject it with a message instead. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Frogbots can now play Capture the Flag. - Three roles, assigned round-robin as bots are added: attackers go for the enemy flag, midfielders contest mid/quad, defenders hold near base (FB_CTF_ROLE_*); each role weights the relevant goals differently. - Goals for flags and runes: capture/return the flag and grab runes in priority order res > str > hst > rgn (goal_flag, goal_flag_enemy, goal_rune), plus manually-placed defend points (goal_defend_marker, MARKER_FLAG1_DEFEND / MARKER_FLAG2_DEFEND). - Bots prioritise an enemy carrying their flag; a flag carrier won't chase enemies and surrenders its flag/rune to a nearby human teammate (SurrenderCTFItemsLogic). - Bots leave a goal to a teammate already going for it, except powerups and flags (GoalLeaveForTeammate). - CTF-only bot names, longer goal lookahead, and per-map bot files loaded from the sv_loadbotfiles_dir subdirectory. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Per-team "discharge at start" markers (MARKER_DISCHARGE_AT_START_RED / MARKER_DISCHARGE_AT_START_BLUE, 'd'/'D' in .bot files): on its first life a bot of the matching team runs to the marker, grabs the LG and discharges it. Driven entirely by the marker flag (e.g. red on e2m2). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Co-Authored-By: SpookyScaryDev <thomaslcave@gmail.com>
Lets frogbots use the grappling hook for routing and movement: hook
travel-time in the marker routing graph (hook_time / *_hook fields), a
HOOK path flag ('h' in .bot files), the hook_routes parameter threaded
through the route lookups, and the bot hook movement/aim/weapon logic
(BotCanHook, BotPerformHook, SetHookAngles). Gated by k_ctf_hook.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: SpookyScaryDev <thomaslcave@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Draft. A rebased, conflict-resolved, and restructured take on #365 (CTF Frogbots by @SpookyScaryDev), adding CTF support to the KTX frogbots.
The original branch was ~18 months behind master. This rebases it onto current
master, fixes the build (strict-prototypes, c89/QVM), works through the review comments, and splits the single large "Added CTF bots" commit into focused commits that each build on their own.Commits
.botfile whose marker numbering is out of sync with the map).LOOK_BUTTON/FIRE_BUTTONbehaviour (usable in DM, not just CTF)..botloading fromsv_loadbotfiles_dir. (@SpookyScaryDev)Still to do before un-drafting
.botfiles for the new marker numbering (the team spawns are now markers) and playtest.tossflag/tossrune/basesafe/basenotsafe/goingflagmessages have a counterpartTP_Msg_*side in ezQuake.Co-authored with @SpookyScaryDev (original author of #365).
🤖 Generated with Claude Code