commit 1018b76098c392d846b775ac0c9e6a751cba1378
parent e7278f0b155179a0f277aee63db05fa947c16a29
Author: MikoĊaj Lenczewski <mblenczewski@gmail.com>
Date: Thu, 2 Jan 2025 15:10:03 +0000
Improve documentation for test-server.sh
Diffstat:
2 files changed, 23 insertions(+), 2 deletions(-)
diff --git a/README.txt b/README.txt
@@ -69,8 +69,26 @@ with usernames of the form `hex-agent-$id`, where `$id` is an integer, in a
round-robin fashion. To generate these users, please run the `install.sh`
script as root (or via `sudo`).
-Alternatively, to run a single game between two agents, the server can be
-directly invoked using the following shell command:
+During initial agent development, it may be desirable to simply start the
+server with two known agents. For this, the `test-server.sh` script can be
+used as follows:
+
+```sh
+$ sudo ./test-server agents/hexes/run-random.sh <your-agent-cmd>
+```
+
+NOTE: instead of using the existing `agents/hexes/run-random.sh` agent, you can
+of course substitute any other agent run command you would like. For early
+development, `agents/hexes/run-random.sh` is recommended to ensure your agent
+successfully connects to the server and can respond to random moves, but for
+developing stronger play or benchmarking your agent, you might want to
+use `agents/hexes/run.sh` to play against a MCTS agent instead.
+
+NOTE: the `test-server.sh` script must be ran as root (or by a user with the
+Linux CAP_SETUID capability) to allow it to use setuid() for process resource
+limiting.
+
+To directly invoke the server, use the following command:
```sh
$ sudo ./server/bin/hex-server -a <agent-1> -ua <uid> -b <agent-2> -ub <uid> \
diff --git a/agents/hexes/run-random.sh b/agents/hexes/run-random.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+exec $(dirname $0)/bin/hexes -v -a random $@