Logo FSBarV1_Archived

Getting Started

Prerequisites

Standard BAR data directory: ~/.local/state/Beyond All Reason. Engines live under engine/recoil_<YYYY.MM.DD>/ and are auto-detected by FSBar.Client.EngineDiscovery.

Build

git clone https://github.com/EHotwagner/FSBarV1.git
cd FSBarV1
dotnet tool restore
dotnet build FSBarV1.slnx

Run the Hub GUI

XDG_RUNTIME_DIR=/tmp/runtime-developer DISPLAY=:0 \
  dotnet run --project src/FSBar.Hub.App

See Hub GUI for the tab walkthrough.

Run a headless script

dotnet build tests/FSBar.Viz.Tests/
dotnet fsi scripts/examples/Repl.fsx

Repl.fsx loads FSBar.Client + FSBar.Viz and exposes convenience helpers (start, step, units, move, viz, economy). Use it for interactive exploration.

Minimal library example

open FSBar.Client
open FSBar.Client.Commands

use client = BarClient.startHeadless ()

// Pull: block for 5 frames, inspecting each one.
client.WaitFrames 5 (fun frame ->
    printfn "Frame %d — %d events" frame.FrameNumber frame.Events.Length)

// Push: subscribe to the observable.
use _ = client.Frames.Subscribe(fun frame ->
    printfn "[obs] Frame %d" frame.FrameNumber)

// Always-current snapshot.
let state = client.GameState
printfn "%d tracked units, metal %.0f" state.TrackedUnits.Count state.Economy.Metal

Container

A fully provisioned dev container (SDK, fsautocomplete, FSI MCP, native libs) is available:

podman build --build-arg GH_TOKEN=<token> -t fsbar-dev -f container/Containerfile container/
podman run -it --rm \
  -v "<path-to-BAR>:/home/developer/.local/state/Beyond All Reason" \
  -p 5020:5020 fsbar-dev

See container/README.md for GPU passthrough and X11 forwarding.

Running tests

./tests/run-all.sh --category unit   # unit tests, no engine
./tests/run-all.sh                    # unit + live (requires BAR install)
./tests/check-prerequisites.sh        # diagnose BAR + proxy setup

Next

val printfn: format: Printf.TextWriterFormat<'T> -> 'T

Type something to start searching.