Bot scaffold and build setup #11

Closed
opened 2026-08-16 11:51:33 +02:00 by SirStone · 1 comment
Owner

Question

Create the nimble project structure, folder layout, build configuration, and static OpenBLAS linking for the RL bot.

  • Self-contained folder under SirRoboGarage repo root
  • Nimble project with Arraymancer dependency
  • Static-link OpenBLAS for portable single-binary deployment
  • Folder structure for weights persistence (latest/, checkpoint_1/2/3/)
  • Entry point wired to the Tank Royale bot API

Blocked by #9 and #10

## Question Create the nimble project structure, folder layout, build configuration, and static OpenBLAS linking for the RL bot. - Self-contained folder under SirRoboGarage repo root - Nimble project with Arraymancer dependency - Static-link OpenBLAS for portable single-binary deployment - Folder structure for weights persistence (latest/, checkpoint_1/2/3/) - Entry point wired to the Tank Royale bot API Blocked by #9 and #10
SirStone added the wayfinder:task label 2026-08-16 11:51:33 +02:00
Author
Owner

Resolution

Scaffold created at PPO_Bot/ with 6 files:

  • PPO_Bot.nim — minimal bot: subclasses Bot, run loops on go(), starts with start(bot, botJsonPath). No RL logic yet.
  • PPO_Bot.nimble — requires nim >= 2.0.0, tankroyale_botapi >= 1.0.0, arraymancer >= 0.7.0
  • PPO_Bot.json — bot descriptor (gameTypes: classic, melee, 1v1; platform: Nim)
  • PPO_Bot.sh — launcher script
  • config.nims — switch("passL", "-lopenblas") + switch("threads", "on")
  • shell.nix — NixOS dev shell providing OpenBLAS (only build dep not globally available)

Build: nix-shell --run "nimble build" produces a 760K binary.

Weight directories (weights/latest/, weights/checkpoint_1/2/3/) are created at runtime by the bot when first needed — no empty dirs in the repo.

Static OpenBLAS linking is handled via config.nims + shell.nix. For deployment to non-NixOS machines, the binary links OpenBLAS dynamically by default; true static linking (--dynlibOverride + .a) is a future build concern.

## Resolution Scaffold created at `PPO_Bot/` with 6 files: - `PPO_Bot.nim` — minimal bot: subclasses Bot, `run` loops on `go()`, starts with `start(bot, botJsonPath)`. No RL logic yet. - `PPO_Bot.nimble` — requires nim >= 2.0.0, tankroyale_botapi >= 1.0.0, arraymancer >= 0.7.0 - `PPO_Bot.json` — bot descriptor (gameTypes: classic, melee, 1v1; platform: Nim) - `PPO_Bot.sh` — launcher script - `config.nims` — `switch("passL", "-lopenblas")` + `switch("threads", "on")` - `shell.nix` — NixOS dev shell providing OpenBLAS (only build dep not globally available) Build: `nix-shell --run "nimble build"` produces a 760K binary. Weight directories (`weights/latest/`, `weights/checkpoint_1/2/3/`) are created at runtime by the bot when first needed — no empty dirs in the repo. Static OpenBLAS linking is handled via config.nims + shell.nix. For deployment to non-NixOS machines, the binary links OpenBLAS dynamically by default; true static linking (--dynlibOverride + .a) is a future build concern.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SirStone/SirRoboGarage#11