Skip to content

pongo1231/rcbot2

 
 

Repository files navigation

RCBot2

Information

This is a fork of nosoop's version of the RCBot2 plugin, originally written primarily by Cheeseh.

This version focuses only on TF2 enhancements and may or may not support the remaining games supported by other versions. If this is undesired check out APGRoboCop's version instead.

DISCLAIMER: The code in this branch is primarily LLM-generated by DeepSeek V4.

Features / Changes in this version

General

  • Hijack: takes control of AFK human players after configurable seconds, press any movement key to break free. Controlled by rcbot_hijack_afk_time, disabled by default.
  • Defense patrol spread: perimeter ring distribution, limited defenders per area with rotation cycles
  • Setup phase behaviors expanded, gate timing for pre-round readiness
  • Injured bots actively seek medics (FVisible trace, not FOV-limited), skip when health packs nearby
  • Burning bots seek out pyros or medics to get extinguished
  • Per-frame projectile dodging during combat, healing, and general movement -- bots strafe perpendicular and backward from incoming rockets, pipes, stickies, sentry rockets, arrows, and flares
  • Statistical projectile prediction with zigzag detection and overshoot/undershoot learning
  • Organic objective guarding: turn-taking patrols near flags and capture points, theft escalation scaling defense weight after flag steals, flank-route security detecting which exit the thief used, unguarded detection filling gaps when nobody is near the objective
  • Crash stack traces with backtrace and symbol resolution on SIGSEGV/SIGABRT
  • Null guard defenses across entity access and handle comparison code to prevent server crashes
  • Teammate personal space: bots spread out to ~80-unit radius, sidestep away instead of blending into each other during guarding, messing around, and setup
  • Mess-around overhaul: stationary types now wander aimlessly with ring-pattern movement; bots join nearby bots or human players already messing around via social detection; interact primarily with whoever inspired them; clean idle jumps replace glitchy crouch-hopping
  • Projectile dodge improvements: supports multiple simultaneous projectiles, trace-validated dodge destinations to avoid walls, gravity-compensated prediction for arcing pipe grenades, bots no longer dodge their own projectiles
  • Pyro reflection adaptation: bots firing explosives at a close-range Pyro stagger their shots with random delays that escalate as more projectiles get reflected; resets when the Pyro changes class
  • Build system: upgraded to AMBuild 2.2 and adopted hl2sdk-manifests for SDK configuration
  • Pathing and aiming fixes: corrected projectile gravity formula in aim prediction, unsticking strafe now persists, waypoint initialization fixed for runtime addition, ladder waypoint detection corrected, schedule use-after-free guard added, task timeout direction fixed

Classes

Soldier

  • Beggar's Bazooka: clip-aware load/release cycle watches actual loaded rockets and fires at 3, preventing overload self-damage regardless of reload speed attributes

Pyro

  • Thermal Thruster travel launch toward distant waypoints and combat launch toward enemies
  • Flamethrower forced against tanks, no back-off, stays point-blank for maximum damage
  • Ignites friendly sniper bow arrows with a brief flame puff at close range, out of combat
  • Active extinguish: moves toward burning allies, uses manmelter as preference

Engineer

  • Rescue Ranger remote repair and ranged sentry pickup with correct timing
  • Frontline-aware building placement near flags and capture points
  • Sentry engagement and awareness: team broadcast of sentry positions
  • Responds to player voice commands for dispenser, teleporter, and sentry placement
  • Gunslinger: mini sentries now correctly tracked; aggressive forward placement with heavier proximity weighting and lower metal threshold; always buildable regardless of team dominance
  • Wrangler: only activates when the sentry has ammo and a valid target in range; uses continuous hold for sustained shield instead of flickering tap; unequips when useless
  • Sentry intel: team-wide sentry position sharing with 30-second expiry; bots avoid known sentry positions even without line-of-sight; short-range weapons can now attack sentries

Medic

  • Smart positioning: far side of patient from enemies, wall cover, crouching
  • Projectile dodging while healing
  • Crusader's Crossbow: fires healing bolts at distant low-HP teammates with lead prediction
  • Syringe gun medics now use melee at close range via a minimum range gate, matching crossbow behavior

Spy

  • Backstab with flank approach positioning, scaled for giant enemies
  • Medic bait: injured disguised spies call medic to lure enemy medics, then backstab
  • Context-aware disguises: picks disguise class based on location context -- backline, near sentry nests, or frontlines; redisguises only when out of enemy sight
  • Blend-in: spies adopt class-appropriate idle posture; sidestep away from the specific player they are disguised as; break away from friendly packs to avoid giving away their disguise; use LOOK_AROUND instead of staring at enemies
  • Infiltrate and lurk: cloaks before pathing into enemy territory; lurks disguised in the backline to observe patterns and strike isolated or distracted high-value targets; cloak is reserved for infiltration, damage escape, and sap tasks -- lurk always stays blended in
  • Opportunistic striking: engineers near buildings prioritized for stabs before sapping; sentries sapped before other buildings; backstabs on high-value isolated targets

Gamemodes

MvM

  • Tank combat system: class-based priority, limited bots per tank, cover-seeking behind tanks, threat awareness with self-preservation, sentry buster avoidance with taunt detection and proper pathfinding
  • Medic revive: bots can be brought back during waves
  • Engineers prioritize building their full set near the frontline, fix damaged buildings before expanding
  • Spies play more aggressively
  • Hijacked player spies sap robots
  • Cash collection handled by scouts and available classes
  • Defense utility is deprioritized when combat is available, encouraging bots to seek more useful tasks
  • Jarate and Mad Milk are no longer thrown at tanks

Changes included from nosoop's fork

  • Build process uses AMBuild instead of make or Visual Studio. This removes the need for Valve's cross platform make conversion tool, and is what AlliedModders uses to build Metamod:Source and SourceMod.
  • The plugin has been split into SDK-specific builds to ensure proper compatibility, using the same loader shim SourceMod uses to load mod-specific builds.
    • This means all mod-specific changes are provided in the upstream SDK repository, instead of this repository having vendored code.
    • The shim is named RCBot2Meta to maintain compatibility with existing files; mod-specific plugins are named rcbot.2.${MOD}.
    • The sdk-split branch only contains modifications to get the project running on the new build tooling and SDK support without issues. It should be fairly painless to merge (though it does remove using namespace std; for sanity).
  • The usage of the install directory has been dropped. In particular, waypoints must be located under rcbot2/waypoints/${MOD} instead of nested under a folder matching the name of the steamdir.
  • Removed custom loadout and attribute support from the TF2 portion of the plugin. Other server plugins (namely tf2attributes and TF2Items, where the implementation was ported from) are better-suited and maintained to handle that stuff; this plugin should only deal with bots themselves.
  • The Metamod:Source plugin can now optionally expose natives to SourceMod, adding some functionality to access certain functionality of the RCBot2 plugin via SourceMod plugins.

Installation

  1. Install MetaMod:Source.
  2. Build the RCBot2 package, or download the most recent automated build.
    • For the latter, package.tar.gz is the Linux build; package.zip is the Windows build.
    • Automated builds are compiled with support for SourceMod native bindings.
    • The automated build uses Ubuntu latest LTS as the Linux build runner — RCBot2 will fail to load on older Linux distributions with an error resembling version `GLIBC_2.xx' not found.
    • If you get something like version `GLIBC_3.4.20' not found instead, your game likely has an outdated bundled copy. Please refer to these instructions to resolve the issue.
    • Regardless of how you get a build, it does not include things like the waypointing guide, hookinfo updater, and waypoints themselves. You can download those from the official release thread. Waypoints are also available at this page.
  3. Extract the package into your game directory, similar to the process of installing MM:S.
  4. Start the server or game client.
  5. To verify that the installation was successful, type rcbotd in your server console or RCON. You should see multiple lines starting with "[RCBot]".
    • If you are running this plugin in client mode, use rcbot instead.

If you are working with SourceMod interop, you will also need SourceMod PR#1053 for plugins to recognize that the natives are available. The pull request was merged in SourceMod build 1.11.0.6466, so at this point any stable version will do.

Building

Cloning from source

RCBot2's repo history had all sorts of build artifacts / binaries at various points in time, so pulling the repository down normally takes an unusually long while.

I'd highly recommend passing in --shallow-since 2019-07-19 to minimize the size of your working repository. This will create a repository with the earliest commit at 9a7f11ea40be12c9384e7530c2b77763394601db.

Compiling on Windows / Linux

  1. Clone the SDK manifests alongside the HL2SDK checkouts: git clone https://github.com/alliedmodders/hl2sdk-manifests hl2sdk-manifests
  2. Install the prerequisites for building SourceMod for your OS.
  3. Create a build/ subdirectory, then run configure.py.
    • The project requires C++11 support. It was previously confirmed to compile on GCC 5.4 (Ubuntu 16.04 LTS) and on MSVC 1900.
    • configure.py can be run with the following settings: python ../configure.py -s present --mms_path ${MMS_PATH} --hl2sdk-root ${HL2SDK_ROOT}
    • Specifying an --sm-path argument enables linking to SourceMod. This does not mean SourceMod needs to be installed for RCBot2 to run.
    • Note that the automatic versioning system requires an installation of git and a relatively modern version of Python 3.
  4. Run ambuild. MetaMod:Source plugin is built and the base install files will be available in build/package.

License

RCBot2 is released under the GNU Affero General Public License. Among other things, this means that any modifications you make to RCBot2 must have the sources available under the same license to players on your server.

Additionally, rcbot/logging.{h,cpp} is released separately under the BSD Zero Clause License.

About

RCbot created by Cheeseh

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • C++ 97.7%
  • C 1.3%
  • Other 1.0%