lgbot: docs (README, ADMIN, HOW-IT-WORKS, PLAYERS), back up lgbot files
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
c6a495ce2c
commit
d2fb4be349
5 files changed
+57
-6
No files matched your search
@@ -8,6 +8,7 @@ Players spawn with the LG only. Every hit heals you by the damage you deal (1:1
|
||||
- Public (listed in the in-game browser) or private (join by address, LAN/VPN): one setting.
|
||||
- Three variants: antilag, no antilag, flat 100 HP.
|
||||
- No warmup text on screen (small minqlx plugin), plus a welcome message.
|
||||
- **lgbot**, a training bot that plays LG like a duelist: ground strafing with uneven rhythm and fakes, holds LG range, never jumps. Aim and movement each go 1–5 and you can fine-tune the movement. Set it up with `./lgbot`.
|
||||
- Recovers on its own: Docker restarts it after a crash, a watchdog restarts it if it hangs, and it restarts daily while nobody is playing. It also takes nightly backups.
|
||||
- The RCON password never shows up in logs (Quake Live normally prints it there, see [How it works](docs/HOW-IT-WORKS.md)).
|
||||
|
||||
@@ -59,6 +60,7 @@ Shared values: `g_startingWeapons 33` (gauntlet + LG), infinite ammo, `g_knockba
|
||||
```sh
|
||||
./rcon status # who's on (./rcon alone = interactive console)
|
||||
./rcon addbot hunter 5 # a target to shoot at; ./rcon kick allbots
|
||||
./lgbot # LG training bot: asks aim/movement; ./lgbot --last | show | off
|
||||
./rcon say hello
|
||||
python3 tools/qlq.py 127.0.0.1 27960 --status
|
||||
docker compose restart # restart; docker compose stop / start
|
||||
@@ -74,10 +76,13 @@ setup.sh install / re-run / --update
|
||||
.env.example settings template (.env is yours, not in git)
|
||||
docker-compose.yml the container; Dockerfile = Debian + 32-bit libs + Python 3.11 + SteamCMD
|
||||
rcon server console
|
||||
home/baseq3/ server.cfg (shared), scripts/lgvamp.factories (game modes);
|
||||
lgbot LG training bot setup (runs tools/lgbot_setup.py in the container)
|
||||
home/baseq3/ server.cfg (shared), scripts/lgvamp.factories (game modes),
|
||||
scripts/lgbot.bot + botfiles/bots/lgbot_*.c (training bot aim);
|
||||
local.cfg, secrets.cfg, mappool_lg.txt are generated from .env on each start
|
||||
home/minqlx-plugins/ nowarmuptext.py (hides warmup text), welcome.py
|
||||
tools/ mkcfg.sh (.env -> cfg), qlrcon.py (RCON client), qlq.py (health check), tests
|
||||
home/minqlx-plugins/ nowarmuptext.py (hides warmup text), welcome.py, lgbot.py (training bot movement)
|
||||
tools/ mkcfg.sh (.env -> cfg), qlrcon.py (RCON client), qlq.py (health check),
|
||||
lgbot_setup.py (lgbot questions), tests (test_qlq, test_lgbot)
|
||||
scripts/ watchdog.sh, daily-restart.sh, backup.sh, install-cron.sh
|
||||
```
|
||||
|
||||
|
||||
@@ -22,6 +22,44 @@ Everything below is run from the repo folder on the server machine.
|
||||
|
||||
**Careful:** `cvarlist` prints the RCON password into the server log. `./rcon` hides it from you, but avoid running it anyway.
|
||||
|
||||
## LG training bot: `./lgbot`
|
||||
|
||||
A bot that only plays LG, built to practise against: it strafes on the ground like a duelist (uneven left/right holds, fake direction changes), keeps LG range, pushes in when it's ahead on health and backs off when it's low, and never jumps or crouches. It shoots back. Aim and movement are separate, so "poor aim, best movement" is fine.
|
||||
|
||||
```
|
||||
$ ./lgbot
|
||||
Aim level 1-5 [3]: 1
|
||||
Movement level 1-5 [3]: 5
|
||||
Customize movement details? (y/N): y
|
||||
Strafe hold min ms 50-2000 [120]:
|
||||
Strafe hold max ms 50-2000 [350]: 300
|
||||
...
|
||||
lgbot in: aim 1, movement 5 (custom: strafe_max 300)
|
||||
```
|
||||
|
||||
Enter keeps the value in brackets; anything invalid asks again; Ctrl+C changes nothing. The setup is saved in `home/lgbot.json`.
|
||||
|
||||
| Command | |
|
||||
|---|---|
|
||||
| `./lgbot` | the questions above, then (re)adds the bot |
|
||||
| `./lgbot --last` | put the saved setup back, e.g. after a restart (bots don't survive one) |
|
||||
| `./lgbot show` | saved setup and whether the bot is in |
|
||||
| `./lgbot off` | remove the bot (setup stays saved) |
|
||||
|
||||
Movement levels (the details override one part, `-1` = use the level's value):
|
||||
|
||||
| Level | Strafe hold (ms) | Fake chance | Range | Push in / back off | Speed |
|
||||
|---|---|---|---|---|---|
|
||||
| 1 | 600–1000 | 0% | 450 | no | 80% |
|
||||
| 2 | 400–800 | 10% | 450 | no | 90% |
|
||||
| 3 | 250–600 | 25% | 400 | yes | 100% |
|
||||
| 4 | 180–450 | 35% | 380 | yes | 100% |
|
||||
| 5 | 120–350 | 50% | 350 | yes | 100% |
|
||||
|
||||
Underneath it's plain console settings, if you'd rather: `./rcon addbot lgbot <aim>`, `./rcon set lgbot_move <1-5>`, and `lgbot_strafe_min`, `lgbot_strafe_max`, `lgbot_fake`, `lgbot_range`, `lgbot_range_play`, `lgbot_speed`. The plugin rereads them every second. `set lgbot_debug 1` writes one line a second about its movement to `home/minqlx.log`.
|
||||
|
||||
The bot fights the nearest human; with nobody nearby it roams like a normal bot. One lgbot at a time.
|
||||
|
||||
## Admins and bans: `home/baseq3/access.txt`
|
||||
|
||||
One line per player: their 64-bit Steam ID, a `|`, and `admin`, `mod` or `ban`:
|
||||
|
||||
@@ -19,7 +19,15 @@ Approaches that don't work:
|
||||
|
||||
In warmup the client draws "The match will begin when more players join" / "Press F3 to ready yourself". No cvar hides it. The client draws it only while configstring `CS_WARMUP` (index 5) holds a time (warmup sets `\time\-1`). The plugin hooks `set_configstring` and sends an empty value for index 5 instead. The server itself stays in warmup. The first map is set up before plugins load, so the plugin also clears the value once when it loads. Check: `docker logs ql-lg | grep nowarmuptext` shows `CS_WARMUP=''`.
|
||||
|
||||
minqlx is started with only our plugins (`qlx_plugins "nowarmuptext,welcome"`). Its default plugin list needs a Redis server, which this setup doesn't run. QL's built-in `access.txt` covers admins and bans without it.
|
||||
## The training bot (`lgbot`): aim from the character file, movement from a plugin
|
||||
|
||||
Quake 3 bots take their personality from a character file. `home/baseq3/botfiles/bots/lgbot_c.c` (registered by `scripts/lgbot.bot`) sets aim accuracy, aim skill, reaction time and view speed per skill level, sets jumping, crouching and rocket jumping to 0, and weights the LG above everything else. QL reads skill blocks 1, 4 and 5 and interpolates 2 and 3 between 1 and 4, which is why the file has only three. The server loads these loose files from `fs_homepath` alongside the ones in `pak00.pk3`, so no pk3 is needed (bots run on the server only, so clients don't need the files).
|
||||
|
||||
The stock bot AI moves like a bot: it runs at you, hops around and goes for items. So the movement is overridden. The `lgbot` minqlx plugin sets the bot's horizontal velocity on every server frame: sideways to its target in the current strafe direction, plus an in/out part that holds the wanted distance (capped at 70% of the speed so it still strafes while closing in). The strafe direction comes from a small pattern generator: hold one side for a random time between the min and max, then switch. Sometimes it fakes instead: a 60–120 ms tap the other way, then a new hold on the same side. An upward speed of 200–320 (a jump; QL jumps at ~275) is cancelled. Falling, slopes and jump pads are left alone. The AI still aims and shoots, so aim and movement don't interfere. Measured on a test server, the plugin costs no extra CPU you could measure.
|
||||
|
||||
minqlx gives bots Steam IDs from 90071996842377216 up. The plugin uses that to pick human targets only.
|
||||
|
||||
minqlx is started with only our plugins (`qlx_plugins "nowarmuptext,welcome,lgbot"`). Its default plugin list needs a Redis server, which this setup doesn't run. QL's built-in `access.txt` covers admins and bans without it.
|
||||
|
||||
## Vampiric, measured
|
||||
|
||||
|
||||
+1
-1
@@ -38,4 +38,4 @@ These are client-side; type them in the console, or put them in `baseq3/autoexec
|
||||
## Practice tips
|
||||
|
||||
- The [x76 strafe-aim guide](https://x76.gg/wiki/strafe-aim-guide/) covers the technique LG duels are about: keep the mouse steady, track by strafing with the keyboard and correct small amounts with the mouse.
|
||||
- Practice alone: ask an admin for a bot (`addbot hunter 5`). Bots jump around a lot, which makes them a fair tracking target, but they don't fight well in this mode.
|
||||
- Practice alone: ask an admin for **lgbot** (`./lgbot` on the server). It strafes like an LG duelist instead of jumping around, and its aim and movement are set separately, so you can train tracking against hard movement while it barely hits you, or the other way round.
|
||||
+1
-1
@@ -8,7 +8,7 @@ umask 077
|
||||
mkdir -p backups
|
||||
chmod 700 backups
|
||||
tar czf backups/ql-$(date +%F).tar.gz .env secrets home/baseq3/access.txt \
|
||||
home/baseq3/server.cfg home/baseq3/scripts home/minqlx-plugins 2>/dev/null || true
|
||||
home/baseq3/server.cfg home/baseq3/scripts home/minqlx-plugins home/baseq3/botfiles home/lgbot.json 2>/dev/null || true
|
||||
find backups -name "ql-*.tar.gz" -mtime +14 -delete
|
||||
for f in home/baseq3/*.log home/minqlx.log; do
|
||||
if [ -f "$f" ] && [ "$(stat -c %s "$f")" -gt 52428800 ]; then : > "$f"; fi
|
||||
|
||||
Reference in new issue
Block a user