A bot for rabitem/HolsDerGeier
To use, simply clone the above repo and drop the whole content of this repo (excluding README) into the
/src/de/rabitem/main/player/instances folder
© Dominik Reh
The DoomBot uses a heuristic algorithm to predict enemy moves. This is done by keeping track of the cards played by the enemy in previous rounds, so we can try to predict which card the enemy will return for a specific value.
The DoomBot starts off with a generic middle-field priority strategy. This means that it doesn't spend its high cards for the highest points, since many opponents will probably try the same, but instead keeps those high cards to beat the opponents in the middle field and for negative cards, leading to an averagely higher number of points.
Additionally, this bot memorizes its opponents' behaviour in the previous rounds and uses this to predict the likelihood that a card will be chosen again. This is especially effective against deterministic bots without randomness.
The DoomBot looks at the statistics memory each time it should play a new card. If the stored weight for specific points gets high enough in respect to the total, it is determined as likely, and the thus predicted enemy choice gets compared to our own. If it matches a middle field strategy, the DoomBot adjusts its priority to counter it more effectively. Due to a missing match-spanning algorithm that could predict wether to over- or underbid the enemy and which cards to use for it, this underutilizes the available data but performs better than always trying to one-up the enemy.
If no return crosses the chosen threshold of 30% (as would be likely for bots with high randomness), the fallback to the aforementioned middle-field-priority is used.
The threshold function is modeled by
(weight of current return for value p) / (weight of all returns for value p) * 100
which translates to the percentage distribution of weight over all observed returns, this way we can measure how confident we are that the bot is or isn't randomly choosing this result.
In practice, this means that the DoomBot will get increasingly confident the more rounds are played, and will be more eficcient for deterministic or limited-scope randomness bots.