Billiard AI, how?

Started by
28 comments, last by ogracian 20 years, 7 months ago
Another factor to consider: Buying your opponent drinks
You can only do this when your opponent''s drink is more than half-empty (or less than half-full if you prefer).

The more your opponent drinks, the more they attempt difficult shots, like combos or bank shots when a simpler shot is available. At severe levels, the opponent may sometimes forget and try to shoot one of your balls in. If the opponent is heavily impaired and makes a mistake then you make a successful difficult shot, there is a chance they will attack you with the cue stick.

Although buying drinks may give you an advantage, it also uses money you could have used for betting on games.

Some opponents will refuse a drink unless you join them.
-solo (my site)
Advertisement
The concept that Dave has mentioned is one that is very common to astronomers: apparent size . In lay terms, the angular width of an object is linearly proportional to its distance from the observer. Mathematically, if W is the actual width of the object and D the distance to the object (in the same units as W), then a = W/D is the apparent width of the object in radians. This is an approximation for W < < D. If |W|~|D| then a = 2tan-1(W/2D).

For your billiard table, unless the ball is close to the pocket, then the first form will be perfectly acceptable. If not, then it will still give a reasonable approximation and at least the approximation will have a consistent bias.

As for the difficulty of the angled shot, this comes down to the apparent width of the acceptable contact area on the ball and is linearly proportional to the desired angular difference between the trajectory of the cue ball and the target ball. The minimum difficulty is for straight on (zero angle), up to infinite difficulty at (pi+a)/2, where a was calculated above. At this angle, the contact area is a point and thus the cue ball imparts no force on the ball (as it's passing perpendicular to the contact point). The acceptable contact area is defined as the arc on the surface of the ball within which a strike by the cue ball will send the target ball on a trajectory that falls within the apparent width (angular width) of the target.

Given this formulism of the problem, you can see why longer shots with some angle are harder than shorter shots of the same angle, because the difficulty factor is a function of the apparent width of the target, which is a function of the distance to the target!

Cheers,

Timkin

[edited by - Timkin on August 14, 2003 10:41:55 PM]
Dude... that''s what I said.

Dave Mark - President and Lead Designer
Intrinsic Algorithm - "Reducing the world to mathematical equations!"

Dave Mark - President and Lead Designer of Intrinsic Algorithm LLC
Professional consultant on game AI, mathematical modeling, simulation modeling
Co-founder and 10 year advisor of the GDC AI Summit
Author of the book, Behavioral Mathematics for Game AI
Blogs I write:
IA News - What's happening at IA | IA on AI - AI news and notes | Post-Play'em - Observations on AI of games I play

"Reducing the world to mathematical equations!"

quote:Original post by InnocuousFox
Dude... that's what I said.

Dave Mark - President and Lead Designer
Intrinsic Algorithm - "Reducing the world to mathematical equations!"


Well, actually, it's not. You'll note that my post is rife with maths! Well, maybe not rife, but it does point out the essential elements of the mathematics of the problem. You did describe such a system, but you failed to express it mathematically. So much for reducing the world to equations!

Besides, you should be happy that someone supported your opinion enough to express it mathematically for you!

Cheers,

Timkin

[edited by - Timkin on August 15, 2003 2:51:51 AM]
Yeah, but are the formulas you described really the necessary ones for performing the calculations IN GAME?

Dave Mark - President and Lead Designer
Intrinsic Algorithm - "Reducing the world to mathematical equations!"

Dave Mark - President and Lead Designer of Intrinsic Algorithm LLC
Professional consultant on game AI, mathematical modeling, simulation modeling
Co-founder and 10 year advisor of the GDC AI Summit
Author of the book, Behavioral Mathematics for Game AI
Blogs I write:
IA News - What's happening at IA | IA on AI - AI news and notes | Post-Play'em - Observations on AI of games I play

"Reducing the world to mathematical equations!"

quote:Well, actually, it''s not. You''ll note that my post is rife with maths! Well, maybe not rife, but it does point out the essential elements of the mathematics of the problem. You did describe such a system, but you failed to express it mathematically. So much for reducing the world to equations!

Besides, you should be happy that someone supported your opinion enough to express it mathematically for you!

True, but we''re not here to spoon-feed this information to people. Just point them in the right direction.
IMHO, we''re here to educate each other... to share our knowledge. Some days we may not feel like posting details, others we might. For me, my above post was as much about giving some equations that could be used as well as showing the links to other problems (in this case astronomy) so that anyone who reads this thread can get a feel for the broader implications of the problem... and maybe, just maybe, find that this is applicable to a problem they face in the future... or leads them to the solution on their own.

...and Dave, as to whether these are the exact equations one would use in the game... well, we could probably generate infinitely many such equations that would do the job... these though are fairly trivial computations that give the answers needed, thus they are a good candidate for the job!

Cheers,

Timkin
I appreciate the spoon-feeding. I also think it''s fine when you read 2 responses that agree with each other.

Now if this were the matrix it would be different. Because...

...there is no spoon.
-solo (my site)
You may want to check out / download "Virtual Pool" And version will do. The method you may want to check out for a idea which can be "seen" is the line drawn from the cue to the ball to be hit, and moving the cue adjust the angle in which the ball to be "hit" will "reflect" off of. Just thought you might like to see something in action. To compute which ball to go for:
Shoot a ray at the balls "low/high" the computer is using from the cue ball.
Check if any balls are not blocked ( ray collison against "test" ball success/failure )
For each ball, using the above evidence, calculate the possibility of sinking the ball in a pocket. ( Have to see it in Virtual Pool to know what I''m talking about )
And as for whether the computer sinks it or not... I''ll leave that up to you ( if you care to make it simple or robust )
Hope this helps, with first hand experience with Virtual Pool.
quote:Original post by InnocuousFox
As much as I like Baylor...


Really? i always heard he was kind of a jerk...

-baylor, who never expresses things in math because he failed math. At the liberal arts level. 5 freakin'' semesters in a row...

This topic is closed to new replies.

Advertisement