If your setup already has some of the required tools installed, please adjust accordingly.
- Install a new version of IntelliJ
- Clone the master branch with
git clone https://github.com/Nightmarius/tablut-bot.git
- Open the project with IntelliJ and let gradle build the project
- If prompted, install java (17.0.5)
- Lombok (usually already installed)
- Spring (usually already installed)
- Edit the name of your bot and add your access token in the properties file
bot/src/main/resources/application.properties
- Read the rules and familiarize yourself with the game https://challenge.zuehlke.com/#/rules
- Adjust your bots logic by editing the BetterBot class Alternatively, you may implement the bot interface in your own class
- Start your bot by running the BetterBot run configuration
- Only stop the bot when the tournament is over
- On application startup the bot application joins the lobby by sending a
JoinRequest
tohttps://challenge.zuehlke.com/api/lobby/join
. This is used as a first confirmation that your bot is ready to play. The admin will then create a tournament which will determine the games your bot will be assigned to. When these games are created the server will publish updates on the game topic. - On application startup the application subscribes to the websocket
/topic/game/
. This is where you will receive game updates as aGameDto
object. - Next, the game updates are filtered
- Only running games are considered
- Only games where your bot needs to make a move are considered
- Only requests which have not been processed yet are considered
- Your bot calculates its next
GameAction
. The providedGameDto
already contains a list of possible actions in theGameState
object, next to other useful information like the currentBoard
and list of past moves. This will ensure that you can only pick legal moves. - Once you have decided on a move to play, your application sends its
Move
tohttps://challenge.zuehlke.com/api/game/{gameId}/play
We highly recommend to use this template as a starting point for your bot project.
If you decide to use another language or framework, you can use the following information to build your own bot.
Here are some of the requirements your bot needs to fulfill:
- A bot needs to be able to play multiple games at once
- The bot needs to send the token in the header for every play request
- Make sure you follow the flow of events as described above
- The bot should send a hearbeat every second so that we can track failing bots during the event
- Your bot will have to follow the API contracts defined in https://challenge.zuehlke.com/swagger-ui/index.html
- You can ignore the admin controller section. This is only used during the event to organize the tournament
Each bot gets a thinking time of two minutes per game. If you use more, you will loose the game. If the game lasts for more than 200 moves it will be declared a draw.
Yes, we encourage you to be creative. Just follow the rules of the game and don't abuse the endpoints.
Yes, please bring a laptop where you can run the code. You don't need to send us your code beforehand.
This will be announced at the event. Expect to play any and every opponent possible.