diff --git a/.gitignore b/.gitignore index 6951f33..daeaf57 100644 --- a/.gitignore +++ b/.gitignore @@ -22,14 +22,8 @@ __pycache__/ devbox.json devbox.lock -# Compiled bot binaries and output directories -# Nim compiles to bot root (executable, no extension) and to out/ subdirectories +# Compiled bot binaries — all builds go to *_garage/out/ *_garage/out/ -GotoTest_garage/GotoTest -OscillatorBot_garage/OscillatorBot -PPO_Bot_garage/PPO_Bot -QBot_garage/QBot -SAC_LSTM_Bot_garage/SAC_LSTM_Bot # Java compiled classes *.class diff --git a/GotoTest_garage/GotoTest b/GotoTest_garage/GotoTest deleted file mode 100755 index 344351c..0000000 Binary files a/GotoTest_garage/GotoTest and /dev/null differ diff --git a/GotoTest_garage/config.nims b/GotoTest_garage/config.nims index 8ee48d2..04196e6 100644 --- a/GotoTest_garage/config.nims +++ b/GotoTest_garage/config.nims @@ -1,3 +1,4 @@ +switch("outdir", "out") # begin Nimble config (version 2) when withDir(thisDir(), system.fileExists("nimble.paths")): include "nimble.paths" diff --git a/OscillatorBot_garage/OscillatorBot b/OscillatorBot_garage/OscillatorBot deleted file mode 100755 index 6beaae2..0000000 Binary files a/OscillatorBot_garage/OscillatorBot and /dev/null differ diff --git a/OscillatorBot_garage/OscillatorBot.sh b/OscillatorBot_garage/OscillatorBot.sh index e8cd5f7..a94efab 100755 --- a/OscillatorBot_garage/OscillatorBot.sh +++ b/OscillatorBot_garage/OscillatorBot.sh @@ -1,3 +1,3 @@ #!/bin/sh cd "$(dirname "$0")" -exec ./OscillatorBot 2>> /tmp/oscillatorbot_stderr.log +exec ./out/OscillatorBot 2>> /tmp/oscillatorbot_stderr.log diff --git a/OscillatorBot_garage/config.nims b/OscillatorBot_garage/config.nims index be6555f..d450296 100644 --- a/OscillatorBot_garage/config.nims +++ b/OscillatorBot_garage/config.nims @@ -1 +1,2 @@ --path:"../common_libs" +switch("outdir", "out") diff --git a/PPO_Bot_garage/PPO_Bot b/PPO_Bot_garage/PPO_Bot deleted file mode 100755 index 21b6ff8..0000000 Binary files a/PPO_Bot_garage/PPO_Bot and /dev/null differ diff --git a/PPO_Bot_garage/PPO_Bot.sh b/PPO_Bot_garage/PPO_Bot.sh index d26da91..1dcbf5e 100755 --- a/PPO_Bot_garage/PPO_Bot.sh +++ b/PPO_Bot_garage/PPO_Bot.sh @@ -4,4 +4,4 @@ # which deadlock when called from within a multi-threaded Nim bot process. export OPENBLAS_NUM_THREADS=1 cd -- "$(dirname -- "$0")" -exec "./PPO_Bot" +exec "./out/PPO_Bot" diff --git a/PPO_Bot_garage/config.nims b/PPO_Bot_garage/config.nims index 99bb126..eaa9253 100644 --- a/PPO_Bot_garage/config.nims +++ b/PPO_Bot_garage/config.nims @@ -2,6 +2,7 @@ # ponytail: adjust path per machine, or use pkg-config switch("passL", "-L/nix/store/v07svn2y92bvzjl51aj7c9ca1cwg7rw7-openblas-0.3.32/lib -lopenblas") switch("threads", "on") +switch("outdir", "out") # begin Nimble config (version 2) when withDir(thisDir(), system.fileExists("nimble.paths")): include "nimble.paths" diff --git a/QBot_garage/QBot b/QBot_garage/QBot deleted file mode 100755 index b533462..0000000 Binary files a/QBot_garage/QBot and /dev/null differ diff --git a/QBot_garage/QBot.sh b/QBot_garage/QBot.sh index 4a0fe28..b12110d 100755 --- a/QBot_garage/QBot.sh +++ b/QBot_garage/QBot.sh @@ -1,3 +1,3 @@ #!/bin/sh cd "$(dirname "$0")" -exec ./QBot 2>> /tmp/qbot_stderr.log +exec ./out/QBot 2>> /tmp/qbot_stderr.log diff --git a/QBot_garage/config.nims b/QBot_garage/config.nims index be6555f..d450296 100644 --- a/QBot_garage/config.nims +++ b/QBot_garage/config.nims @@ -1 +1,2 @@ --path:"../common_libs" +switch("outdir", "out") diff --git a/SAC_LSTM_Bot_garage/SAC_LSTM_Bot b/SAC_LSTM_Bot_garage/SAC_LSTM_Bot deleted file mode 100755 index bb118a0..0000000 Binary files a/SAC_LSTM_Bot_garage/SAC_LSTM_Bot and /dev/null differ diff --git a/SAC_LSTM_Bot_garage/SAC_LSTM_Bot.sh b/SAC_LSTM_Bot_garage/SAC_LSTM_Bot.sh index e9b2b34..6987877 100755 --- a/SAC_LSTM_Bot_garage/SAC_LSTM_Bot.sh +++ b/SAC_LSTM_Bot_garage/SAC_LSTM_Bot.sh @@ -1,4 +1,4 @@ #!/bin/sh # Launch config for tools/training_runner/RunTraining.java (#49): the runner # executes .sh inside the bot dir (sample-bots convention). -exec "$(dirname "$0")/SAC_LSTM_Bot" +exec "$(dirname "$0")/out/SAC_LSTM_Bot" diff --git a/SAC_LSTM_Bot_garage/config.nims b/SAC_LSTM_Bot_garage/config.nims index eb6d48f..c993094 100644 --- a/SAC_LSTM_Bot_garage/config.nims +++ b/SAC_LSTM_Bot_garage/config.nims @@ -5,6 +5,7 @@ switch("passL", "-L/nix/store/v07svn2y92bvzjl51aj7c9ca1cwg7rw7-openblas-0.3.32/l # ponytail: nix store path; adjust per machine, or use pkg-config switch("passL", "-L/nix/store/wqvz31s598bvj3zb747943xhl38hjc6h-libzip-1.11.4/lib -lzip") switch("threads", "on") +switch("outdir", "out") # Submodules import each other as SAC_LSTM_Bot/; make that resolvable for # the binary build too (tests already add ../src via tests/config.nims). switch("path", thisDir() & "/src") diff --git a/SAC_LSTM_Bot_garage/make_twin.sh b/SAC_LSTM_Bot_garage/make_twin.sh index 1955b28..6aa7932 100755 --- a/SAC_LSTM_Bot_garage/make_twin.sh +++ b/SAC_LSTM_Bot_garage/make_twin.sh @@ -17,7 +17,7 @@ set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" TARGET="${1:-${SAMPLE_BOTS_DIR:-/home/davide/Projects/tank-royale/sample-bots/java/build/archive}}/SacTwin" -BIN="$SCRIPT_DIR/SAC_LSTM_Bot" # nimble build -d:release output +BIN="$SCRIPT_DIR/out/SAC_LSTM_Bot" # nimble build -d:release output (out/ subdir) SEED="$SCRIPT_DIR/weights/sac_best.zip" # frozen baseline [ -x "$BIN" ] || { echo ">>> $BIN missing — run 'nimble build -d:release' first"; exit 1; } diff --git a/tools/battle_runner/run.sh b/tools/battle_runner/run.sh index fbbb812..bce2eac 100755 --- a/tools/battle_runner/run.sh +++ b/tools/battle_runner/run.sh @@ -11,7 +11,7 @@ export PPO_BOT_DIR="$PPO_BOT_SRC" export SAMPLE_BOTS_DIR="${SAMPLE_BOTS_DIR:-/home/davide/Projects/tank-royale/sample-bots/java/build/archive}" # ── 1. Compile PPO_Bot if binary is missing ────────────────────────────────── -if [ ! -x "$PPO_BOT_SRC/PPO_Bot" ]; then +if [ ! -x "$PPO_BOT_SRC/out/PPO_Bot" ]; then echo ">>> Compiling PPO_Bot..." (cd "$PPO_BOT_SRC" && nimble build -d:release) fi