# Trying to model pinball physics for game AI

I'm working on an AI for a pinball-related video game. The ultimate goal for the system is that the AI will be able to fire a flipper at the appropriate time to aim a pinball at a particular point on the table. We are using an engine that will handle the underlying physics interactions when the ball is hit (Unreal). I'm trying to quasi-realistically model the physics for the AI's "thinking".

I have a reasonable understanding of Newtonian physics but I'm going to need some help making sure I'm correct about everything I may need to account for. For the purposes of simplification, I'm considering the table to be vertical on an XY axis with gravity just being a small fraction of actual gravity accelerating down on the Y axis (yes, this means I'm ignoring friction between the ball and table, for now).

By my understanding, I've got the work with the following when a ball is rolling along a flipper.

• The ball will have velocity along both X and Y axes as it rolls to the flipper.
• The flipper will have a range of motion (minimum and maximum angles) and a Torque value.
• When the flipper fires, it will apply force to the ball based on the flipper's Torque, the distance the ball is from the flipper's rotation point, and the length of the arc the contacted point on the flipper needs travel.
• The applied force will accelerate the ball back up the table following a new trajectory.

My question(s) are: Am I overlooking an important interactions in this system? Or am I misinterpreting anything? Does it seem like this is a reasonable modeling for video game? Et cetera?

Thanks!

-

When the ball is hit with the flipper, two velocity components should be considered: parallel to the flipper $v_{\parallel}$ and perpendicular to it $v_{\perp}$.

$v_{\parallel}$ will change if the ball is spinning - as Luboš said, this definitely should be included in your model. You can start with a crude approximation $\Delta v_{\parallel}\propto \omega$ for $\omega<\omega_0$ and $\Delta v_{\parallel}=const$ otherwise. $\omega_0$ would be the ball angular speed at which it starts to slip.

$v_{\perp}$ changes its sign (elastic collision) and gets additional kick from the flipper: $v_{\perp}=-{\gamma}v_{\perp}+v_{flip}$, where $\gamma$ is elasticity coefficient close to 1 and $v_{flip}=\omega_{flip}r$, $r$ is the distance from the flipper axis to the point where the ball hits it.

-