This guide is build for WSL2 / Linux. For Windows it is also possible, but I can never remember Powershell syntax.
Get Python3.8+.
Create a venv (for Debian, install python3-virtualenv
package first):
python3 -m venv venv
Checkout the repos we will be needing:
git clone https://github.com/OpenTTD/py-protocol
git clone https://github.com/OpenTTD/game-coordinator
Next, we install all the dependencies:
venv/bin/pip install -r game-coordinator/requirements.txt
cd py-protocol
../venv/bin/pip install -e .
cd ..
We need several components running:
- redis
- Game Coordinator
(you do NOT need the STUN/TURN server as long as the server/client runs on the same network segment as the Game Coordinator is running, which is highly advised for development! This means the server will be marked Public
).
docker run --name redis --rm -p 6379:6379 redis
cd game-coordinator
../venv/bin/python -m game_coordinator --db redis --app coordinator --shared-secret test --web-port 12345
Start OpenTTD with:
OTTD_COORDINATOR_CS="localhost" ./openttd