When submitting a solution in C++, please select either C++14 (GCC 6-32) or C++17 (GCC 7-32) as your compiler. ×

qwerty787788's blog

By qwerty787788, history, 10 months ago, In English

A long time ago there was a competition called Deadline24, which I really enjoyed! Unfortunately, the last edition of it was in 2018. In that competition, you need to write a program, which connects to the server via TCP and plays some game. Usually, the game is turn-based, so you need to read the current state, make a move, wait for the next turn, and so on.

I like this format, so as a hobby project, I decided to write a server for a game in the same format. The game itself is very simple. You are playing as a circle, which flies around the field, and need to collect as many other circles as possible. The only hard part is that you can't change your speed instantly, you can only change acceleration.

The contest is already live! You can watch the current game in real-time: https://aicontest.dev/ and read more detailed rules of the game: https://github.com/bminaiev/aicontest.dev/blob/master/README.md

Consider writing a bot for it! In two weeks top-3 players from the "Highest Scores" (the biggest score achieved in any game) tab will get 100, 50 and 25 TON from me.

Also, I am very interested in the feedback about this game:

  • Do you like the format in general?
  • Do you like a specific game?
  • What could be improved?

UPD. The contest has finished. Congratulations to the winners:

  1. al13n — 175 points
  2. progiv-rust-main — 160 points
  3. eulersche_Zahl — 150 points

Please send me your details in DM.

Also, the server will continue working, so if you want to participate, you still can do it.

Tags bot, ai
  • Vote: I like it
  • +132
  • Vote: I do not like it

»
10 months ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

I read the docs but can't see how acceleration component is determined, can you explain? Do larger magnitude acceleration directions correspond to larger magnitude acceleration component?

Also, isn't the final result biased towards early participants, since it's probably easier to get a really high score while everyone else is just noob bots instead of strong competitors?

  • »
    »
    10 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    The easiest way to understand is probably just to read the code, which calculates the new position: https://github.com/bminaiev/aicontest.dev/blob/master/common/src/game_state.rs#L113

    I also added a test in the code with comments explaining the calculations: https://github.com/bminaiev/aicontest.dev/blob/master/common/src/game_state.rs#L359

    So you send a target coordinates (tx, ty), and the server accelerates your player in the direction of the target (tx, ty) from the current position (x, y).

    Hope it makes it more clear, but I can try to explain in more detail.

    About early participants: the size of the field is determined based on the number of players so in theory if we add some strong players and some noob bots, and the average smartness of the players is the same, it should be roughly similarly hard to get the high score. But yeah, there are a lot of factors, and potentially it could be harder.

»
10 months ago, # |
  Vote: I like it +3 Vote: I do not like it

Auto comment: topic has been updated by qwerty787788 (previous revision, new revision, compare).

»
10 months ago, # |
  Vote: I like it +10 Vote: I do not like it

First of all I would like to thank you for creating this game and organizing the contest. I found out about it thanks to clist.by with a little less than 3 days left to go.

Do you like the format in general?

Yes! When I saw it at first, I was a little worried about network performance, but it worked like a charm. I opted to compete in C#, as that's my go-to language. Took me maybe half an hour to adjust the python template, which is totally acceptable.

Do you like a specific game?

Again: yes! The rules were very simple to understand, yet the top 2 showed me that there is clearly room for improvement. And that's what defines a good game for me: easy to enter, hard to master. The constants (max. movement speed, circle radius, ...) felt well balanced. I gave it a short try with only the basic-rust bots as opponents in the arena, my scores remained pretty much the same with or without stronger opponents. I suppose the good and bad effects (enemy taking away the circles I want vs more new circles spawn when enemies are at other places on the map) cancel each other out.

A few sentences about my approach: it's basically a beam search, i.e. I try different actions, compute a score for each of them (based on circles I collected, distance to the next circles, my current speed) and keep the best few. I look 13 turns ahead with a beam width of 300. For the actions I only try a fixed amount of 16 actions (or even only 8 for every 2nd turn to further speed things up), which are pretty much 45° apart from each other (not exactly, as acceleration is capped at 20 and I picked numbers in a way that rounding works in my favor). For the opponents I simply assume that they all use the code from the starter template, that's accurate for most of them. I start with a static analysis of the board without myself to see at which turn each circle will get removed. I don't reward reaching a circle after the predicted removal. There's surely some room for improvement, mostly in the scoring function. I wanted to play it more casually and didn't set up a local test environment to try different scorings. Online matches were too slow for reliable feedback, so I just followed my intuition and watched the game if the browser for a while.