Skip to content

robocode-dev/tank-royale

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

4,770 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Robocode Tank Royale

Robocode logo

Build the best โ€“ destroy the rest!

๐Ÿค– About

Robocode is a programming game where the goal is to code a bot in the form of a virtual tank that competes against other bots in a virtual battle arena.

The player writes a program that controls the botโ€™s movement, scanning, firing, and reactions to events during a battle. All logic lives inside this program โ€“ you never control the bot directly.

The name Robocode is short for โ€œRobot codeโ€ and comes from the original version here.
Robocode Tank Royale is the next evolution, where bots can play over the Internet via WebSocket.

This project aims to help you learn programming, improve AI skills in a fastโ€‘running realโ€‘time game, and have fun while competing.

โš”๏ธ Example of a battle

GIF animation of tanks battling each other on a 2D battlefield

๐ŸŒŸ Explore More

Resource Why it matters Link
๐Ÿ“˜ The Book of Robocode The advanced companion to Tank Royale docs with deeper strategy content on movement, targeting, radar control, energy management, and competition-level tactics. Open the Book
๐Ÿ–ฅ๏ธ Tank Royale Viewer A dedicated web-based viewer for showing live battles, analyzing recordings, and putting matches on big screens during competitions. Open the Viewer

๐Ÿ“˜ The Book of Robocode

Want to go beyond the fundamentals? The Book of Robocode is the advanced companion to these docs and covers both Robocode and Robocode Tank Royale.

Start here:

๐Ÿ–ฅ๏ธ Tank Royale Viewer

Want to visualize battles in style? Check out the Tank Royale Viewer โ€” a web-based viewer for watching Robocode Tank Royale matches in real time.

Created by Jan Durovec, it is especially useful for:

  • displaying live battles on big monitors during competitions
  • analyzing recorded battles
  • showcasing tournament and championship matches

๐Ÿ“š Documentation

Main page: Robocode Tank Royale Docs

๐Ÿš€ Start here

If you want to... Start here
Install and run Tank Royale Installation guide
Learn the basics Getting Started
Build your first bot My First Bot
Learn advanced strategy The Book of Robocode
Watch battles in a dedicated viewer Tank Royale Viewer
Run battles headlessly from code Battle Runner API docs

๐Ÿ’ป Supported platforms

Robocode runs on Java 11 or newer and supports Windows, macOS, and Linux out of the box.
Bot APIs are available for:

  • Python
  • Java (JVM)
  • .NET

Bots can be written in any language that can access a WebSocket API and follows the protocol.

The following Bot APIs provide full client implementations:

Language API
Python Python Bot API
Java (JVM) Java/JVM Bot API
.NET .NET Bot API

Additional languages supported by the Java/JVM API:

  • Java
  • Groovy
  • Kotlin
  • Scala
  • Jython
  • Clojure

Supported .NET languages:

  • C#
  • F#
  • Visual Basic
  • IronPython

โš™๏ธ Battle Runner API

The Battle Runner API lets you run battles programmatically from any JVM application โ€” no GUI required. Use it for automated testing, benchmarking, or building tournament systems.

BattleRunner.create { embeddedServer() }.use { runner ->
    val results = runner.runBattle(
        setup = BattleSetup.classic { numberOfRounds = 10 },
        bots  = listOf(BotEntry.of("/path/to/MyBot"), BotEntry.of("/path/to/EnemyBot"))
    )
    println("Winner: ${results.results.first().name}")
}

Available on Maven Central as dev.robocode.tankroyale:robocode-tankroyale-runner. See the Battle Runner API docs or the module README for full documentation.

๐Ÿšง Work in progress

  • Bot API for TypeScript (Node.js and browser support for JavaScript and TypeScript runtimes)
  • Robocode API bridge for Tank Royale โ€“ see the robocode-api-bridge project.

Thanks to the contributors

Huge thanks to every contributor โ€” you make this project shine! ๐Ÿ™Œ

๐Ÿ‘จโ€๐Ÿ’ป Maintainer

@flemming-n-larsen

Buy Me A Coffee

๐Ÿ“„ License

Apache License 2.0

ยฉ๏ธ Copyright

Copyright ยฉ 2022 Flemming N. Larsen