Tank Royale Battle Viewer

May 24, 2026 ยท View on GitHub

A web-based viewer for Robocode Tank Royale battles with GPU-accelerated rendering.

License

What This Is

A passive observer designed for broadcasting battles on a shared display (projector, TV, conference room screen) - giving your audience a polished "live sports broadcast" experience.

What This Is Not

This viewer does not control battles. There are no features for starting battles, selecting bots, or managing the server. Use the official Tank Royale GUI (or another controller) on a separate screen for that.

Features

  • ๐Ÿ“บ TV broadcast experience - Full-screen, designed for conference rooms and wall displays
  • ๐Ÿ”Œ WebSocket connection to Tank Royale server with auto-reconnect
  • ๐ŸŽฎ Real-time battle visualization that keeps up with any server TPS
  • ๐Ÿš€ GPU-accelerated graphics using PixiJS/WebGL (frees CPU for bots)
  • ๐Ÿค– Tank rendering based on the official Robocode GUI style with enhancements
  • ๐Ÿ‘ฅ Team support with colored indicators and grouped displays
  • ๐Ÿ† Battle results always captured and displayed
  • ๐Ÿ“ˆ Skill ratings - Local skill tracking (OpenSkill or TrueSkill, selectable) with tier badges (Scrap โ†’ Legend)
  • ๐Ÿ–ผ๏ธ Custom arena logo - Upload your own background image
  • ๐ŸŒ“ Light/dark theme - Toggle the surrounding UI between themes; the arena stays dark for broadcast clarity
  • โš™๏ธ Minimal UI - Settings hidden behind a subtle gear icon

Quick Start

Since this is a static web app running in your browser, you can use it directly at:

https://jandurovec.github.io/tank-royale-viewer/

No installation required - just open the link and connect to your local Tank Royale server.

Local Development

If you want to modify the viewer or run it locally:

Prerequisites

Setup

# Clone the repository (the official one or your fork)
git clone https://github.com/jandurovec/tank-royale-viewer.git
cd tank-royale-viewer

# Install dependencies
npm install

# Start development server
npm run dev

Open http://localhost:5173/ in your browser.

Connecting to Tank Royale

  1. Start Tank Royale GUI:
    java -jar robocode-tankroyale-gui-x.y.z.jar
    
  2. The server starts automatically on ws://localhost:7654
  3. Open the viewer - it connects automatically to the default URL
  4. Start a battle in the Tank Royale GUI
  5. Watch the battle in the viewer!

Usage

The viewer is designed for full-screen presentation with minimal UI.

Settings (Gear Icon)

Click the subtle gear icon in the top-right corner to access:

  • Server URL: WebSocket URL of the Tank Royale server (default: ws://localhost:7654)
  • Secret: Optional authentication secret if server has secrets enabled
  • Arena logo: Upload a custom background image with adjustable opacity and size
  • Skill ratings: Toggle display, choose rating algorithm (OpenSkill or TrueSkill), configure thresholds, export/import/reset ratings

Views

Pre-Battle: Shows list of connected bots with ratings and team groupings

During Battle:

  • Full-screen arena with bots, bullets, and visual effects
  • Mini bot list docked left (visible through transparent arena margins)
  • Round and turn counter

Post-Battle: Results screen with final rankings, statistics, and rating changes

  1. Open viewer in browser
  2. Press F11 for full-screen mode
  3. UI connects automatically (click the gear icon to verify server URL and secret)
  4. Start battle in Tank Royale GUI
  5. Enjoy the show!

Building for Production

npm run build

The built files are in dist/ and can be served by any static file server.

Documentation

  • Architecture - Design decisions and tech stack rationale
  • Protocol - Tank Royale WebSocket protocol reference
  • Development - Development setup and contribution guide

Tech Stack

  • TypeScript - Type-safe JavaScript
  • Vite - Fast build tool with HMR
  • PixiJS v8 - GPU-accelerated 2D rendering

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Run npm run typecheck and npm run lint
  5. Submit a pull request

See DEVELOPMENT.md for detailed instructions.

License

MIT License - see LICENSE for details.

Acknowledgments