Skip to content
This repository was archived by the owner on Jun 8, 2026. It is now read-only.

intgrah/cambc-visualiser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cambc-visualiser

Replay viewer and bot-state visualisation helpers for the Cambridge Battlecode programming competition.

Two components:

  • viewer/ — a standalone Rust desktop app (eframe/egui) that renders .replay26 replay files tile-by-tile with scrubbing, indicators, per-entity inspection, empirical resource-flow overlays, and custom bot state overlays (##VIS## stdout protocol).
  • src/visualiser/ — a tiny Python library bots import to emit their state each turn (grids, palettes, scalar fields, tile sets, vector fields). The viewer parses the emissions and lets you toggle them as overlays per bot.

Viewer

Build:

cd viewer
cargo run --release -- path/to/replay.replay26

The viewer hot-reloads the replay file on change. Right sidebar holds the overlay toggles, including the experimental per-junction conveyor sprites.

Bot-side API

from visualiser import (
    BoolGrid, I16Grid, Scalar, Tiles, Palette, PaletteStop,
    Colour, VectorField, emit, TRANSPARENT,
)

emit(
    dist=I16Grid(state.dist, palette=P_DIST),
    fog=BoolGrid([e is None for e in state.env], palette=P_FOG),
    scale=Scalar(142.5),
    goals=Tiles([(3, 5), (7, 2)]),
)

The viewer picks these up from the replay's captured stdout and exposes them as overlays for the emitting bot.

Regenerating conveyor junction assets

Install dev deps and run the script:

uv sync
uv run conveyor-assets

This writes 128 PNGs into viewer/assets/ (one per team × armour × output-direction × input-mask).

Licensing

Split licensing — see LICENSE for full terms.

  • Code (everything except viewer/assets/cambc/) — MIT.
  • Upstream assets in viewer/assets/cambc/ — © Cambridge Battlecode (https://battlecode.cam), licensed under CC BY-NC-SA 4.0. Attribution required; non-commercial only; derivatives must share-alike. See viewer/assets/cambc/LICENSE.
  • Generated assets in viewer/assets/conveyors/ — rendered by uv run conveyor-assets; covered by the MIT code licence.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages