Pool Shot Simulator

justnum

Billiards Improvement Research Projects Associate
Silver Member
To the moderator:

This website is about billiards however there is no billiards simulator.

A simple window that gives users access to a pool table environment. I am suggesting this idea because sometimes when people are posting or debating it would be more exciting to see dynamic simulations rather than static graphics.

Please create a billiards simulator. I am volunteering to help if you have trouble finding generic code for physics engine, creating a runtime environment and designing a interface.

I was thinking using a 2d game with orthogonal views to move perspectives. This way you don't need the heavy 3d engine. Most of the physics would be easy to calculate based on two dimensional motions.

Three main windows one for the cueball, a second window for overhead view of the table, and a third window for cue stick controls. The animations can be done based on calculated positions. The equations for masse and english would be huge for people that want to see how and why.

Alternatively the problem of people wanting to see which way balls spin is a required problem to solve.
What else would be nice to see?
 
Last edited:
That's a great idea. It would be nice to be able to easily (and graphically) vary aiming line, tip contact point, cue elevation, speed, and table conditions (sliding friction, ball friction, rail properties, and rolling resistance). It would also be important to be able to save and link to shots created so others can see and refer to them.

Good luck with your project,
Dave

To the moderator:

This website is about billiards however there is no billiards simulator.

A simple window that gives users access to a pool table environment. I am suggesting this idea because sometimes when people are posting or debating it would be more exciting to see dynamic simulations rather than static graphics.

Please create a billiards simulator. I am volunteering to help if you have trouble finding generic code for physics engine, creating a runtime environment and designing a interface.

I was thinking using a 2d game with orthogonal views to move perspectives. This way you don't need the heavy 3d engine. Most of the physics would be easy to calculate based on two dimensional motions.

Three main windows one for the cueball, a second window for overhead view of the table, and a third window for cue stick controls. The animations can be done based on calculated positions. The equations for masse and english would be huge for people that want to see how and why.

Alternatively the problem of people wanting to see which way balls spin is a required problem to solve.
What else would be nice to see?
 
To create a good billiard simulator from scratch probably takes a year or two of work.

It would be nice if we could get a version of Virtual Pool here.
 
To create a good billiard simulator from scratch probably takes a year or two of work.


*disclaimer* I'm not a programmer.

but, put "billiard simulation algorythm" in google... seems there are some open source simulators already out there... Doensn'y look like it would be that much work to piece some of the existing code together (for somebody who knows how to do that sorta stuff)

link
 
Does Virtual Pool have the effects of CIT programmed in? Will this new Program?
Thanks.
 
It sounds like I am going solo on this one.

To be precise I've worked out all the math portions, runtime algorithms and object programming.

What I don't want to program is a billiards game. Though it would be fun to have a ranked game.

I am thinking of programming a lab. Like is it possible to have the 90 degree cut shot. Or can we test how much english is needed for a dead stop shot, how much deflection can be applied until the path line changes, and other scenarios.

Here is the design, the basic shot demos are straight in, cut and bank. The beginners want to know why they are missing their shots. So I can program the said shots, and they can input how they would shoot, then modify until they see how to pocket the shot.

The program would be for beginning pool players that don't know why they are making mistakes or repeating mistakes.
 
Last edited:
It sounds like I am going solo on this one.

To be precise I've worked out all the math portions, runtime algorithms and object programming.

What I don't want to program is a billiards game. Though it would be fun to have a ranked game.

I am thinking of programming a lab. Like is it possible to have the 90 degree cut shot. Or can we test how much english is needed for a dead stop shot, how much deflection can be applied until the path line changes, and other scenarios.

Here is the design, the basic shot demos are straight in, cut and bank. The beginners want to know why they are missing their shots. So I can program the said shots, and they can input how they would shoot, then modify until they see how to pocket the shot.

The program would be for beginning pool players that don't know why they are making mistakes or repeating mistakes.
sounds great if you can get it to work
and having ranked games and standings sounds awsome :thumbup:
 
sounds great if you can get it to work
and having ranked games and standings sounds awsome :thumbup:

It will work, but it will not look pretty. Early stages are a green rectangle with some circles, a window with a white circle and a brown circle, cue ball and cue contact.

Its mostly a physics application and a programming exercise. I did not score high in the graphics department.
 
.... Here is the design, the basic shot demos are straight in, cut and bank. ...
How do you model the ball-cushion interaction? Do you include the curve of the object ball as it comes off the cushion?
 
How do you model the ball-cushion interaction? Do you include the curve of the object ball as it comes off the cushion?

I am going to decide the ball-cushion interaction from me shooting a ball a certain number of times and recording the variance from each.

I will shoot a straight in shot a 1000 times. A forty five degree angle 1000 times and 30, 60 degree angles as well.
I will repeat the shot for various speeds. I will also have to repeat for various english and deflection. I will shoot directly at a ball, directly at the cushion and the cue to the object ball to the cushion.

It is do the experiment or just pick a number that looks good in the simulation. The number I am referring to is the deviation from the ideal path. It will be perfect physics then make noise to eliminate the ideal results. How much noise and how to introduce it will be what the experiment helps me decide.

I will be performing the experiment on slow cloth.
 
Last edited:
You might want to spend a few days or weeks reading some of the billliards physics resources here:

These will help you with modeling many important effects.

Also, here's a list of typical values for many physical properties you will need in the simulator (although, it would be nice if some of these were adjustable):

For good info and help with squirt, swerve, and throw, see:

FYI, equations and derivations for many pool physics effects can be found here:

Feel free to contact me if you have any questions when working through some of the physics.

Good luck with your project,
Dave

I am going to decide the ball-cushion interaction from me shooting a ball a certain number of times and recording the variance from each.

I will shoot a straight in shot a 1000 times. A forty five degree angle 1000 times and 30, 60 degree angles as well.
I will repeat the shot for various speeds. I will also have to repeat for various english and deflection. I will shoot directly at a ball, directly at the cushion and the cue to the object ball to the cushion.

It is do the experiment or just pick a number that looks good in the simulation. The number I am referring to is the deviation from the ideal path. It will be perfect physics then make noise to eliminate the ideal results. How much noise and how to introduce it will be what the experiment helps me decide.

I will be performing the experiment on slow cloth.
 
Great ideas from everyone. The challenge with the task is mostly in the programming.
 
wouldnt the available open source code on billiards simulators save you a ton of time? There seems to be some available, at worst, most of the math have been done for you regarding ball/rail interaction dynamics and the some of the physics ?
 
View attachment 148146

The above picture shows how I can program the path of cut shots. What the user will see are the circles. How the program decides the path of the object ball is based on the how the normals (the lines touching the square) meet. Why I use squares in the picture is because programming boxes is easy and the prototype can be deployed after a few hours of programming.


The concept for programming cue ball and object ball contact is done.
The features I will program initially and that can be adjusted is the friction of the cloth.
I will create a simulation just focused on path of cue and path of object.

A software development house might say it takes a year because they have to recruit a person that can do it. That is a common response from management and other timeline oriented positions.

What I am programming the computer to do is to take a square with two lines and pretend it is a ball. If you have further interests refer to Montiel, "Curves and surfaces." I am using the idea that a normal is an accurate representation of a curve.

If you really want to get into you can use the idea of a normal for a time space object, which is referred to as a Riemannian manifold.
 
Last edited:
wouldnt the available open source code on billiards simulators save you a ton of time? There seems to be some available, at worst, most of the math have been done for you regarding ball/rail interaction dynamics and the some of the physics ?

I checked the pygames website for one I couldn't find it.

What I am thinking is I will deploy the program and someone will say well "I've shot a 90 degree cut shot and pocketed a ball, but the simulation doesn't do it." The perfect physics part is easy to program, the variance from the real-world conditions requires experimental data.

I am debriefing you now because this will happen for say the cloth speed, quality of balls or whatever experimental factors you think influence it.
 
Last edited:
wouldnt the available open source code on billiards simulators save you a ton of time? There seems to be some available, at worst, most of the math have been done for you regarding ball/rail interaction dynamics and the some of the physics ?

Dealing with someone else's code is a living hell.

It is almost always easier to start from scratch.
 
Great ideas from everyone. The challenge with the task is mostly in the programming.
To me, the real challenge is getting all of the physics right; otherwise, people might be disappointed by the results (which won't look real).

Good luck,
Dave
 
Back
Top