Source, Quake, Garry’s Mod, And Civilization Game Mod Bridges
This document covers the non-Minecraft FPS game bridge packages in
game_mods/ and their _AugmentedIntelligence runtime commands.
Use these only on private/local servers you own or administer. Do not use them
to bypass anti-cheat systems or automate public multiplayer play.
What Was Added
[text]
GameModBridge.hpp / GameModBridge.cpp Native _AI UDP receiver
game_mods/source_mod/ai_bridge.sp SourceMod server plugin
game_mods/source_mod/cfg/ai_bridge.cfg SourceMod cvar template
game_mods/source_mod/tools/source_action_bridge.py Optional UDP-to-RCON action sidecar
game_mods/quake_mod/ai_bridge_defs.qc QuakeC field/function declarations
game_mods/quake_mod/ai_bridge.qc QuakeC telemetry/action hooks
game_mods/quake_mod/tools/quake_log_bridge.py Quake log/action sidecar
game_mods/garrys_mod/addons/augmentedintelligence_bridge/ Garry’s Mod GLua addon
game_mods/garrys_mod/tools/gmod_file_bridge.py Garry’s Mod file/UDP sidecar
game_mods/civilization_mod/AugmentedAICivilization.modinfo Civilization VI mod package
game_mods/civilization_mod/tools/civ_log_bridge.py Civilization Lua.log/UDP sidecar
The native receiver accepts authenticated UDP JSON, keeps per-adapter packet
counts, stores a recent packet tail, and maps simple health/damage/death fields
into GamingRL::FPSPerception. Civilization packets are routed into
GamingStrategyRL::CivilizationState and receive a high-level strategy
decision response.
_AI Commands
[text]
gaming mod bridge status
gaming mod bridge configure source_mod 0.0.0.0 8767 YOUR_TOKEN true
gaming mod bridge configure quake_mod 0.0.0.0 8768 YOUR_TOKEN true
gaming mod bridge configure garrys_mod 0.0.0.0 8771 YOUR_TOKEN true
gaming mod bridge configure civilization_mod 0.0.0.0 8772 YOUR_TOKEN true
gaming mod bridge start source_mod
gaming mod bridge start quake_mod
gaming mod bridge start garrys_mod
gaming mod bridge start civilization_mod
gaming mod bridge start all
gaming mod bridge stop source_mod
gaming mod bridge tail source_mod 10
gaming mod bridge tail quake_mod 10
gaming mod bridge tail garrys_mod 10
gaming mod bridge tail civilization_mod 10
Configuration is persisted in:
[text]
game_mod_bridge.local.txt
Recommended FPS RL startup:
[text]
gaming rl init
gaming rl dry-run on
gaming rl input hold 120
gaming rl input mouse 32
gaming rl bridge spec
gaming mod bridge configure source_mod 0.0.0.0 8767 YOUR_TOKEN true
gaming mod bridge status
Use dry-run on until tail, packet counts, and gaming rl explain look sane.
SourceMod Bridge
The Source bridge is an in-server SourceMod plugin.
Requirements:
[text]
Source Dedicated Server
Metamod:Source
SourceMod
SourceMod Socket extension
Build and install:
[powershell]
copy game_mods\source_mod\ai_bridge.sp C:\srcds\addons\sourcemod\scripting\
cd C:\srcds\addons\sourcemod\scripting
spcomp ai_bridge.sp
copy ai_bridge.smx C:\srcds\addons\sourcemod\plugins\
copy E:\_AugmentedIntelligence\_src\_AugmentedIntelligence_v11.0 – Typed Commands\game_mods\source_mod\cfg\ai_bridge.cfg C:\srcds\cfg\sourcemod\
Configure cfg/sourcemod/ai_bridge.cfg:
[text]
ai_bridge_enable “1”
ai_bridge_host “10.0.0.151”
ai_bridge_port “8767”
ai_bridge_token “YOUR_TOKEN”
ai_bridge_interval “0.25”
ai_bridge_observe_bots “1”
ai_bridge_actuation “0”
ai_bridge_dry_run “1”
ai_bridge_safety “1”
ai_bridge_chat_enable “1”
ai_bridge_goal “survive_and_learn”
ai_bridge_curriculum “input_smoke”
Server commands:
[text]
sm_ai help
sm_ai status
sm_ai connect
sm_ai disconnect
sm_ai reload
sm_ai observe
sm_ai chat <message>
sm_ai dryrun on|off
sm_ai safety on|off
sm_ai monitor on|off
sm_ai replay on|off
sm_ai goal <text>
sm_ai curriculum <phase>
sm_ai metrics
sm_ai debug
sm_ai action <userid|@me> <action> [text]
ai_bridge_status
ai_bridge_action <userid> observe
ai_bridge_action <userid> hint “Move to cover.”
ai_bridge_action <userid> say “Training observation received.”
ai_bridge_action <userid> nudge_forward
ai_bridge_action <userid> look_left
ai_bridge_action <userid> look_right
ai_bridge_reply <userid|@all> chat|hint|center <message>
ai_bridge_action requires admin permission, ai_bridge_actuation 1, and
ai_bridge_dry_run 0 for movement/rotation actions. Actuation is intentionally
limited to server-safe lab actions. A Source server
cannot hold a real player client’s movement keys; use a local client controller
for full key/mouse control.
Optional Source action sidecar:
[powershell]
python .\game_mods\source_mod\tools\source_action_bridge.py –listen-port 8769 –rcon-host 127.0.0.1 –rcon-port 27015 –rcon-password YOUR_RCON_PASSWORD –token YOUR_TOKEN –print
The sidecar accepts action/reply JSON and dispatches plugin commands over RCON:
[json]
{“type”:”action”,”userid”:2,”action”:”hint”,”message”:”Move to cover.”,”token”:”YOUR_TOKEN”}
{“type”:”reply”,”target”:”@all”,”channel”:”chat”,”message”:”Training round started.”,”token”:”YOUR_TOKEN”}
Quake Bridge
Classic QuakeC has no portable socket API, so the Quake bridge emits structured
server log lines and a sidecar forwards them to _AI.
Wire the QuakeC hooks:
[c]
// worldspawn
ai_bridge_init();
// PutClientInServer
ai_bridge_player_spawn();
// ClientDisconnect
ai_bridge_player_disconnect();
// player death / obituary path
ai_bridge_player_death();
// PlayerPostThink
ai_bridge_player_postthink();
// Optional chat/command hooks if your mod exposes them
ai_bridge_player_chat(message);
ai_bridge_player_command(“status”);
ai_bridge_print_status();
Load the cvars:
[text]
exec quake_ai_bridge.cfg
Run the sidecar:
[powershell]
python .\game_mods\quake_mod\tools\quake_log_bridge.py –log C:\quake\id1\qconsole.log –host 10.0.0.151 –port 8768 –token YOUR_TOKEN –print –action-listen-port 8770 –action-file C:\quake\id1\ai_bridge_actions.cfg –print-actions
Optional private-server cvar actuation:
[text]
set ai_bridge_actuation 1
set ai_bridge_dry_run 0
set ai_bridge_action_slot 0
set ai_bridge_action_id 1
set ai_bridge_action_time 1
Increment ai_bridge_action_time for each action. Action IDs are:
[text]
1 turn_left
2 turn_right
3 nudge_forward
4 jump
5 weapon_1
6 weapon_2
7 weapon_3
8 freeze
9 nudge_back
10 observe
11 hint
Garry’s Mod Bridge
The Garry’s Mod bridge is a server-side GLua addon plus a file/UDP sidecar. The
addon uses normal garrysmod/data files, so it does not need a binary socket
module inside GMod.
Install:
[powershell]
copy game_mods\garrys_mod\addons\augmentedintelligence_bridge C:\gmodserver\garrysmod\addons\augmentedintelligence_bridge -Recurse
Start _AI:
[text]
gaming rl init
gaming rl adapter set garrys_mod
gaming rl dry-run on
gaming mod bridge configure garrys_mod 0.0.0.0 8771 YOUR_TOKEN true
Run the sidecar on the GMod server host:
[powershell]
python .\game_mods\garrys_mod\tools\gmod_file_bridge.py –data-dir C:\gmodserver\garrysmod\data\augmentedintelligence_bridge –host 10.0.0.151 –port 8771 –token YOUR_TOKEN –print
Server commands:
[text]
ai_bridge_status
ai_bridge_observe
ai_bridge_action <userid|steamid64|name|@all|@bots> observe
ai_bridge_action <target> hint “Move to cover.”
ai_bridge_action <target> nudge_forward
ai_bridge_action <target> look_left
ai_bridge_action <target> look_right
ai_bridge_action <target> freeze
Movement and effect actions require:
[text]
ai_bridge_actuation 1
ai_bridge_dry_run 0
Packet fields include health, armor, ammo, team, origin, velocity, eye angles,
active weapon, and eye-trace target.
Civilization Bridge
The Civilization bridge is a turn-strategy integration for Civilization VI. It
is advisory by default: the mod emits state and displays/logs recommendations
instead of silently making irreversible game choices.
Install:
[powershell]
copy game_mods\civilization_mod “$env:USERPROFILE\Documents\My Games\Sid Meier’s Civilization VI\Mods\AugmentedAICivilization” -Recurse
Start _AI:
[text]
gaming rl strategy on
gaming mod bridge configure civilization_mod 0.0.0.0 8772 YOUR_TOKEN true
Run the sidecar:
[powershell]
python .\game_mods\civilization_mod\tools\civ_log_bridge.py –host 10.0.0.151 –port 8772 –token YOUR_TOKEN –print
The Civ Lua mod prints AI_CIV_BRIDGE_JSON {…} records to Lua.log. The
sidecar forwards them to _AI, receives strategy_decision replies, and
appends them to Logs/augmented_ai_civ_actions.jsonl by default. The Lua mod
polls both augmented_ai_civ_actions.jsonl and
Logs/augmented_ai_civ_actions.jsonl when file I/O is available.
Civilization strategy actions:
[text]
0 balanced_development
1 prioritize_science
2 prioritize_culture
3 prioritize_gold
4 build_infrastructure
5 raise_military
6 improve_tiles
7 scout
8 settle_city
9 diplomacy
Packet Contract
Source observation:
[json]
{“type”:”observation”,”engine”:”source”,”adapter”:”source_mod”,”map”:”de_dust2″,”userid”:2,”player”:”Player”,”team”:2,”alive”:1,”health”:100,”origin”:[0.0,0.0,0.0],”angles”:[0.0,90.0,0.0],”reason”:”tick”,”token”:”YOUR_TOKEN”}
Quake observation:
[json]
{“type”:”observation”,”engine”:”quake”,”adapter”:”quake_mod”,”time”:12.25,”player”:”Player”,”health”:100,”frags”:0,”origin”:”0 0 0″,”angles”:”0 90 0″,”reason”:”tick”,”token”:”YOUR_TOKEN”}
Garry’s Mod observation:
[json]
{“type”:”observation”,”engine”:”garrys_mod”,”adapter”:”garrys_mod”,”map”:”gm_construct”,”userid”:2,”player”:”Player”,”steamid”:”7656119…”,”alive”:true,”health”:100,”armor”:25,”origin”:[0,0,0],”angles”:[0,90,0],”weapon”:”weapon_crowbar”,”ammo”:0,”reason”:”tick”,”token”:”YOUR_TOKEN”}
Civilization observation:
[json]
{“type”:”observation”,”engine”:”civilization”,”adapter”:”civilization_mod”,”turn”:42,”cities”:3,”settlers”:1,”military_units”:5,”enemy_military_units”:2,”science_per_turn”:32,”culture_per_turn”:18,”gold_per_turn”:11,”expansion_score”:0.8,”war_pressure”:0.2,”victory_focus”:”science”,”token”:”YOUR_TOKEN”}
Civilization decision response:
[json]
{“type”:”strategy_decision”,”engine”:”civilization”,”adapter”:”civilization_mod”,”action_id”:8,”label”:”settle_city”,”confidence”:0.72,”value”:0.14,”source”:”civilization_actor_critic”,”turn”:42,”token”:”YOUR_TOKEN”}
Native _AI mapping:
[text]
health -> FPS health feature
player_hurt -> recent damage feature
player_death -> death/terminal feature
round_end -> terminal cause
origin/angles -> retained in packet tail for adapters and later richer mapping
civilization turn state -> GamingStrategyRL civilization policy
For richer aiming/objective features, pair these server bridges with the normal
client-side FPS perception path: screen capture, HUD OCR, audio threat, minimap
threat, and target detection.
Firewall
On the _AI machine, allow inbound UDP for the bridge ports you actually use:
[powershell]
New-NetFirewallRule -DisplayName “_AI SourceMod Bridge UDP 8767” -Direction Inbound -Protocol UDP -LocalPort 8767 -Action Allow
New-NetFirewallRule -DisplayName “_AI Quake Bridge UDP 8768” -Direction Inbound -Protocol UDP -LocalPort 8768 -Action Allow
New-NetFirewallRule -DisplayName “_AI Garrys Mod Bridge UDP 8771” -Direction Inbound -Protocol UDP -LocalPort 8771 -Action Allow
New-NetFirewallRule -DisplayName “_AI Civilization Bridge UDP 8772” -Direction Inbound -Protocol UDP -LocalPort 8772 -Action Allow
On the game server, allow outbound UDP to the _AI machine on those ports. Keep
tokens private and do not expose these ports to the public Internet.
Training Flow
- Start _AI with gaming rl dry-run on.
- Start gaming mod bridge … for the target adapter.
- Join a private game/server with bots or a controlled test map.
- Verify gaming mod bridge tail <adapter> 10.
- Verify gaming rl status and gaming rl explain.
- Run curriculum phases in a private arena.
- Only enable limited mod/server actuation after telemetry is reliable.
- Prefer replay and behavior cloning before live bot mode.
Filed under: Uncategorized - @ July 18, 2026 6:34 am