Darts for Geeks: Statistician Cracks the Game’s Secrets
wired.com
wired.com
I think there is one catch, though. I think he's assuming that my accuracy is the same around the target that I am aiming for, regardless of where it is.
I find that this is not the case. As a "below average" player, I am still much better at hitting the triple 20, for example, then I am at the triple 19 - even though the triple 19 is theoretically "easier". What throws me is that the triple 19 is not centred across the board so lining up to it is more difficult.
I found it easiest to simulate millions of random dart throws parameterized by throw angle and velocity. I record the slot on the board (1-20, Bull) hit given the launch angles and force of the throw. I let this "simulation" run until I had 50 samples per board slot.
The simulation is run once ahead of time. The simulation results are bundled with the app.
When it becomes the AI's turn, it picks a slot to aim at based on the game variation and state of the game. Currently, it chooses rather poorly in Cricket.
Then it picks a random sample from the sample pool recorded from the aforementioned simulation. Based on the user-chosen competence level, it adds a small, random amount of error to the angle and velocity associated with the selected sample. Finally, the dart is launched using the calculated angles and force.
While the app is Objective C, the offline simulation was written in Python. The whole thing was a blast to write.
Here's an old video of gameplay:
Skip ahead to around 1:10 to see the AI take its turn.
From the heat maps, I would say that even the "above average" skill level should still be shooting for the triple 20, but if the study said that it makes the findings moot.