planet-wars-rts

๐Ÿช PlanetWars AI Competition โ€“ Submission Instructions

Welcome to the PlanetWars AI competition! This document describes how to package and submit your entry. Your agent should run as a WebSocket server and respond to JSON-formatted messages. Each submission must include a Dockerfile that builds and runs your agent.

We support entries in Kotlin/Java or Python.
However, you may use any language as long as your agent speaks WebSocket and uses JSON.

If youโ€™re entering a compeition linked to a conference, please see create a set of slides following the instructions here. Slides Instructions

For Kotlin/Java and Python, we provide example servers and agent wrappers so you can focus entirely on your agent logic.


๐ŸŽฎ Simulation-Based AI Support

The Kotlin framework includes a Forward Model to enable simulation-based AI methods such as Monte Carlo Tree Search (MCTS).
The Python version currently supports reactive agents, with forward model support a possibility for future releases.
The Python option may be more suitable for neural network-based agents, as it allows you to use libraries like PyTorch or TensorFlow.


๐Ÿ“ฆ Submission Format

Each submission must:

  1. Contain all necessary code and dependencies to build and run your agent.
  2. Include a working Dockerfile that listens on port 8080 and runs your agent server.
  3. Be able to receive JSON game states and return legal actions via WebSocket on port 8080.
  4. Be self-contained โ€” your Docker image must not require internet access at runtime.

โ˜• Kotlin/Java Submission

Your Kotlin or Java project must produce a single .jar file that runs the WebSocket server.

Example Dockerfile

# Use Java 20
FROM eclipse-temurin:20-jdk

# Set the working directory
WORKDIR /app

# Copy the compiled jar (adjust path to match your Gradle build)
COPY app/build/libs/client-server.jar app.jar

# Expose WebSocket port
EXPOSE 8080

# Run the agent
CMD ["java", "-jar", "app.jar"]

In your Gradle build file (build.gradle.kts), make sure to specify the correct entry point:

application {
    mainClass.set("competition_entry.RunEntryAsServerKt") // Adjust to match your actual package and file
}

Example Kotlin Server Main

package competition_entry

import games.planetwars.agents.random.CarefulRandomAgent
import json_rmi.GameAgentServer

fun main() {
    val server = GameAgentServer(port = 8080, agentClass = CarefulRandomAgent::class)
    server.start(wait = true)
}

โ˜• Python Submission

As for the Kotlin/Java submission, your Python project must produce a single Docker image that runs the WebSocket server.

A complete example, including loading a pre-trained PyTorch Neural Network model is availale in this public repository: https://github.com/Priwinn/planet-wars-rts/ Adapt this to your own agent logic and models.


๐Ÿ“ค Submitting Your Agent via GitHub Issue

To enter the competition, simply create a new GitHub Issue in the submissions repository.

Your issue must contain a YAML block describing your submission, like this, noting the opening and closing triple backticks::

```yaml
id: another-awesome-agent
repo_url: https://github.com/SimonLucas/planet-wars-rts/commit/9c1133cd88217abf99a892e89d95bae6fd0ed66b
commit: 9c1133cd88217abf99a892e89d95bae6fd0ed66b  # optional
```

Important Notes:

You will receive comments on your issue as your submission is processed, including:

image


Let us know if you have any questions. Good luck, and may the best agent win! ๐Ÿš€