QuakeWorld demobot
Setup for automated QuakeWorld client streaming demos, accepting commands via Twitch chat.
How does it work? (TLDR version)
ezQuake reads from a pipe located at /tmp/ezquake_[username]
on posix systems, where username
is the username of the
user who started the ezQuake process.
So basically all you have to do is to write commands to /tmp/ezquake_[username]
.
Stack
- Written in Go (Golang)
- ZeroMQ - Communication/messages (single proxy and multiple subscribers/publishers)
Overview
- Message Proxy: Central point for communication.
- Quake Manager: Interaction with ezQuake
- Log monitor (thread): Read in-game events (demo started, demo stopped, etc)
- Process monitor (thread): ezQuake events (started, stopped)
- Twitch Manager: Interaction with Twitch channel (e.g. set title).
- Twitch Bot: Interaction with Twitch chat.
Development
Directory structure
Uses the Standard Go Project Layout.
cmd/ # Main applications
internal/ # Private application and library code
scripts/ # Various build, install operations
Build
Build specific app
Example: build proxy
cd cmd/proxy
go build
Build all apps
./scripts/build.sh
Run
Single app
Example: start the proxy.
./cmd/proxy/proxy
App controller scripts
Runs app forever (restarts on error/sigint with short timeout in between).
bash scripts/controllers/proxy.sh
bash scripts/controllers/quake_manager.sh
bash scripts/controllers/twitch_manager.sh
bash scripts/controllers/twitch_chatbot.sh
bash scripts/controllers/ezquake.sh
Test
go test ./... --cover
Production
Build all apps and run all app controller scripts.
./scripts/build.sh && ./scripts/start.sh