I was under the impression that Smash the Code challenge implied coding a perfect information agent. I was wrong: there is no way to reliably deduce the opponents move from only their board state, and therefore it is impossible to know their score and generated nuisance points with certainty.
(If you did not notice that yet, here’s an example: suppose that the opponent has the following board:
|. 2 . . . .|
|. 22 . . .|
|111 . . .|
…and that the next block to be played is a (1,2). The opponent can drop it vertically in the first column from the left with either the ‘1’ above the ‘2’ or the opposite, and the final board state will be the same even if the opponent does not earn the same number of points in both cases.)
This is counterintuitive to me because in 2 player puzzle games such as Puyo Puyo, a human player can see exactly where the opponent played. There is no information deprivation involved.
Since the input/output format may change between leagues and the Legend League was not introduced yet, I was wondering if CodinGame could consider giving as input the opponent’s move at the previous turn (for all turns except the first) in that league, allowing any AI to deduce the opponent’s score reliably. I believe that would make the challenge even more interesting.
This topic was brought up in the IRC chat. If I recall correctly, the consensual answer was two-fold :
If you assume your opponent is playing optimally for one ply, you can recalculate his score and nuisance points. In practice, this works fairly well.
Something about maintaining input/output compatibility between leagues.
The less consensual answer was that some people had already put work in identifying their opponent’s position, and this type of rule would invalidate their work unfairly.
If you simulate all the moves of your opponent you’ll be able on the next turn to know what he played most of the time. But as your example demonstrates, it’s not always the case. Then, you can suppose that he played the best possible move that lead to that grid which should almost always be the case among the best players. But maybe it could be strategic to postpone a new line? But then again, if your receive some skulls (resp. you don’t) you can cut again is the possibilities. I doubt that it’s a real problem.
When we decide the input/output of the game, we try to give as little data as possible in order to avoid to afraid the beginners. We thought that it was enough to recompute everything but indeed it’s not fully the case here.
Unfortunately, we can’t change the input given to the players now because that will break the current bots. We don’t want broken submissions when we open the legend league otherwise people who can’t develop on the contest next week-end would be penalized a lot.
Thanks a lot for all your answers, especially the “official” one from Maxime.
You’re making good points. I’ll use the highest score heuristic for now, and maybe improve my bot by storing the opponent’s score as an interval instead of a scalar if I have the time to do that. As you pointed out, hopefully it isn’t a big deal most of the time.
To be clear, not giving the score was an error because we thought it was not needed. While giving the 2 boards was an obvious requirement. What I wanted to explain is that we try to give the minimal amount of information and we don’t give what we think that can be computed.
None taken, I agree that we should have given it but I also think that it’s not a big deal ;).
I agree we should have had the score as input and/or his move, for one thing it is shown in the replay.
As for not scaring away new players with too many inputs:
Is it more tempting for new players to read inputs, included in the default code, or run simulations to get an educated guess of simple game info shown on the screen?
I understand you are trying to lower the barrier to entry in your multiplayer games but I don’t think it was that high to begin with (except PCR). The way I see it this contest will end up with maybe 2700 participants or something, a bit more than the previous one which could be explained by the increasing player count of Codingame (and not by the league system and associated efforts). I like the new league system in general though.