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.
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.
Each submission must:
Dockerfile that listens on port 8080 and runs your agent server.Your Kotlin or Java project must produce a single .jar file that runs the WebSocket server.
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
}
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)
}
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.
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
```
repo_url should link to a specific commit (not just the repo root).commit field is optional if itโs already included in the URL.@SimonLucas as a collaborator with read access.You will receive comments on your issue as your submission is processed, including:
Let us know if you have any questions. Good luck, and may the best agent win! ๐