Computer Pool Tournament

sbg11

New member
For any of you who like both pool and computer programming, here is an ideal competition for you!

You can write a software agent which will compete in a simulated game of pool, deciding automatically what shot to attempt in any situation. Your program will then compete against other software written by other programmers to see which is the best. The 2011 International Computational Billiards Championships will take place next summer, leaving you plenty of time to prepare your software. There is no entry fee or travel required. Check out the tournament website for more details about how you can get involved.
 
As a pool enthusiast and computer programmer...

I would say that I would not bother with this contest. There has to be some sort of realism, or "human factor" involved. I checked out the site and played some of the games from last year's "winning" entry, and the first thing I have to say is that NO HUMAN would ever attempt half of those shots. The computer will ALWAYS find a shot (3-rail bank, 4 rail kick, 3 ball combo, etc.) and run out every time. If I were to develop an algorithm for running a rack of 8-ball, I would apply the actual knowledge of the game to it, position, patterns, safety play (when there's no "reasonable" shot), etc. Of course, my algorithm would lose to one such as this, so what's the point? Your algorithm would certainly defeat mine, but mine would be more realistic, which I think is a greater challenge.

Also, the english on some of the draw shots was not very realistic.
 
You make a good point, Winston.

Just a few details that might clear up some things about the competition. The "human factor" is inserted into the game by perturbing each shot slightly before execution. The reason that the computer was able to execute such "unrealistic" shots in the demo videos is because the perturbations, or noise, added to the shots was too small to emulate human play. The next competition will include noise levels that are much higher, which will reduce the possibility that the unrealistic shots will be successful. As the noise gets higher, the computer can have less of an idea of what will happen on any shot, and it gets harder to plan accurately.

To summarize: your points are very correct about the previous competition, but changes are being made to the next tournament with the goal of addressing these problems.
 
You also need to avoid the tic-tac-toe scenario. What if 2 teams (or individuals) both come up with perfect algorithms (ones that will always find some sort of shot). If I'm not mistaken, you can also calculate where each and every ball will go, how it will deflect, etc. Knowing that, you can tell how hard to hit every shot, what english to apply to put the cue ball in an exact location, etc. In short, play perfect pool. You will always pocket a ball on the break and run out. If each team alternated breaks, it would be a stalemate, just like tic-tac-toe.

Hopefully this "noise" you speak of will alleviate that, because otherwise, I can't see this competition being anything other than a stalemate.
 
just checked some of the recorded games.. they should switch to rack your own format for next year..
 
I can't wait to see Winston's program. The task sure sounds easy when he describes it!
Thanks to sbg11 for telling us about this. I wonder what graphics library is good these days?
 
I can't wait to see Winston's program. The task sure sounds easy when he describes it!
Thanks to sbg11 for telling us about this. I wonder what graphics library is good these days?

I never said it was easy. But I did say I wasn't going to bother entering. Just pointed out some flaws that the OP agreed with. But if you go to the site and check it out, you'll see that the perfect program has already been done. The computer finds a shot no matter what.

As for graphics libraries, check out...
http://www.thefreecountry.com/sourcecode/graphics.shtml
 
From the website:

"The championships will feature 3 different competitions.

* Low Noise- agents will compete with a low amount of noise added to their shots. The specific noise model used will be the same as the last competition.
* High Noise- agents will compete with a high amount of noise added to their shots. The specific noise model will have standard deviations 5 times those of the low noise case.
* Variable Noise - agents will compete at random noise levels, between 0 times the low noise level and 5 times the low noise level. Each agent will be given the noise level of the current game at runtime, but agent designs will have to account for the variability. Every two games during the match will have a different randomly chosen noise level, and each player will break once using each noise level."

The base noise standard deviations are:
Parameter φ θ V a b
Standard Deviation 0.125 deg 0.1 deg 0.075 m/s 0.5 mm 0.5 mm

And they claim the 'high noise' version will have 5x these values. So they introduce noise into all parameters of the shot, including shot speed.

-s
 
The main problem I see with 'making it real' is that the client AI has access to the same physics engine as the server uses. So you can literally try every shot (and every possible shot) in detail before it is submitted.

I would think a 'more real' version would require the client to choose the next shot without absolute feedback as to what's going to happen. Or at least make the client do its own calculations in this regard. If every real player knew what each shot choice would do, exactly, a lot more of us would run out all the time. That's part of what makes a good player, and they've removed that aspect, making it a 'trial and error' problem, instead of the real pool problem of 'trial and (fail or succeed)'.

I may or may not work on something for this, but knowing the parameters, probably not...
-s
 
If every real player knew what each shot choice would do, exactly, a lot more of us would run out all the time. That's part of what makes a good player, and they've removed that aspect, making it a 'trial and error' problem, instead of the real pool problem of 'trial and (fail or succeed)'.

At lot of real players know what to do, but most cannot execute it.

I haven't looked at their API directly, but I would think that any ball-pocketing algorithm would involve plotting points along a line with the endpoints being the center of the object ball and the center of the pocket and then plotting the object ball down that line (using the point on the line as the center point of the object ball.) Before these points are plotted, a "noise" function can alter the pocket endpoint to a degree (altering the trajectory of the line) so that the shot misses.

Of course, any algorithm would also have to check plus and minus 1 ball radius along each line point to see if any other ball exists in that region (i.e. does the object ball "pass" into that pocket).
 
At lot of real players know what to do, but most cannot execute it.

I haven't looked at their API directly, but I would think that any ball-pocketing algorithm would involve plotting points along a line with the endpoints being the center of the object ball and the center of the pocket and then plotting the object ball down that line (using the point on the line as the center point of the object ball.) Before these points are plotted, a "noise" function can alter the pocket endpoint to a degree (altering the trajectory of the line) so that the shot misses.

Of course, any algorithm would also have to check plus and minus 1 ball radius along each line point to see if any other ball exists in that region (i.e. does the object ball "pass" into that pocket).

You might have missed my post re: noise.

They add noise to the shot angle, speed, cue placement before the shot's result is calculated. Not just the path.

-s
 
You might have missed my post re: noise.

They add noise to the shot angle, speed, cue placement before the shot's result is calculated. Not just the path.

-s

Agreed. I was just taking into consideration the path of the object ball to the pocket. The same principles are also applied to the cueball traveling to the object ball, which would then alter the contact point on the object ball, also potentially resulting in a miss.

Noise applied to the shot speed would only affect the cue ball position on your next shot. But, that could be enough to cause you to be snookered when you normally wouldn't have.
 
Collision detection is a big thing in video gaming (and therefore pretty much figured out).

I would think more difficult for them would be deflection (ball-ball, cue-ball, and spin-induced!), masse effects, spin effects from rails, and other pool-specific physics situations.

I expect their model takes very little of those factors into account, which helps explain the perfection of the AI's results.

Maybe I should work on my own pool simulator lol.

-s
 
Collision detection is a big thing in video gaming (and therefore pretty much figured out).

I would think more difficult for them would be deflection (ball-ball, cue-ball, and spin-induced!), masse effects, spin effects from rails, and other pool-specific physics situations.

I expect their model takes very little of those factors into account, which helps explain the perfection of the AI's results.

Maybe I should work on my own pool simulator lol.

-s

Exactly. The collision detection part is pretty easy. From what I've seen, spin-induced effects, "throw", and the like don't seem to be included. Not that it can't be done, though. The physics are VERY realistic in the Virtual Pool series.

As for simulators, I thought of writing one specifically for 14.1 to see how accurate of a model I could get for pattern play and how many balls the computer would actually run. VP's computer players are not very good at this as they'll also play shots that no human would ever attempt (some seriously sick masse shots) to keep their run going. And they don't specifically play for a certain break ball. They just shoot any 14 balls and try to break the rack with what's left. I would want some extra AI in there to make the computer only shoot balls within the "realm of shoot-ability". No "fantasy" shots. And I would want it to recognize distinct patterns, including leaving and getting on the best possible break ball.
 
I believe that a AI, programmed to perfections, would be so good that it would countinue play 14.1 and have a run that will last untill you shut the program down - infinte in other words. I also believe that creating this program would probably find some breakshots with good effect that none player yet are using on a regular basis. This would be a great study for all 14.1 fans. Even though I dont have the technological skills in c++ to create this (with all the real physical effects, and the so-called "choose real shots"); I sure hope you winston, or someone else have the knowledge and motivation. This could be a great leap for the 14.1 game.

Sorry if my english is bad, I'm tired. And it is not my native language.
 
I believe that a AI, programmed to perfections, would be so good that it would countinue play 14.1 and have a run that will last untill you shut the program down - infinte in other words. I also believe that creating this program would probably find some breakshots with good effect that none player yet are using on a regular basis. This would be a great study for all 14.1 fans. Even though I dont have the technological skills in c++ to create this (with all the real physical effects, and the so-called "choose real shots"); I sure hope you winston, or someone else have the knowledge and motivation. This could be a great leap for the 14.1 game.

Sorry if my english is bad, I'm tired. And it is not my native language.

I've thought about it, and one day may attempt it. A LOT of time involved in writing something like this from scratch. First I'd have to develop an engine. I'm not too concerned about graphic detail and 3D effects, just something simple like the engine for this contest. I'd only be looking for a model and a concept for study purposes only. Not looking to make a game or anything. The hardest part would be attaining realistic physics (english, deflection, throw, etc.).

My ideal simulator for this would start by racking the 14 balls and choosing where to put the break ball and cue ball. The computer can then begin it's run.

Maybe one day...
 
Definitely needs human factor

Before reading this thread I assumed that for each category of shot there would be a certain percentage of the shooter making it. That would favor more realistic solutions rather than solutions that involve ridiculous shots like 3-rail banks, or many difficult shots in a row.

You could take a professional and try to estimate their percentages for each shot, and then each team will shoot with the same percentage of making shots and see who comes out ahead.

Another thing is that if 3-rail banks are possible in the current implementation, that implies that they are using simple methods to determine where a ball will go (like only angle) and neglect the more compliated aspects like throw, speed, spin off a rail and so on. It would be difficult to mimic reality, but the current implementation still seems too simple.
 
Separating the planning and simulation

I feel that the discussion is conflating two separate issues. One is how realistically a computer can simulate the physics of pool balls on a pool table, and the other is how computer could determine which shot to attempt, given the model of the physics that it possesses.

In my mind, the two issues can be investigated simultaneously and independently. While I agree that the current physics model used by the computers may have its flaws, it is nevertheless fairly realistic and has been used by several robotics projects to predict locations of balls on tables with some success.

The interesting thing from the planning side is to take a model of physics, which corresponds somewhat to realistic pool, and determine what shot to attempt, treating the physics model as a black box. Ideally, a very good shot planner could then substitute in a better physics model and make decisions that are more comparable and meaningful to real-world pool playing humans.

The computational pool tournament is designed as an arena to test and compare various methods for planning shots, given the current physics model. The hope is that even if the physics model requires slight tweaking to more accurately simulate the real world, the planning methods which do best will still be successful on the new physics model, and could be used eventually by robots to play pool on physical tables against humans, if desired.
 
added noise

To address mincho's comment. There is an implicit probability of making each shot in the current implementation. For each shot, there is a certain range of shot parameters that will successfully make the shot. Since noise is added to these parameters, there will be some probability that any chosen shot is successful. This probability is close to 1 for short, easy shots, and increases rapidly as the number of collisions and the distances involved grow.
 
Back
Top