Billiards game - couple questions / issues

Greetings Dear Reader,

I think this is my first post…I wasn’t sure where to put it. I’m not in any urgent need of help - this is just a first BGE project and personal exercise - so figured this would be a good place to start.

So far, the game is only about half done. A friend of mine is cooking up at least 1 table model so the current one is just a placeholder so I can work on the logic in the mean time.

I am licensing this under GPLv3. The GIT repo will soon reside here. I’ll try to finish setting it up before anybody asks to see the .blend file :stuck_out_tongue:

The issues I’m having are as follows. Any advice is much appreciated!

  • Currently, I’m trying to do the physics simulation directly with the included Bullet engine, however I’ve had to employ “fake friction” because the balls otherwise never slow down (in fact, often times speed up). It doesn’t seem to matter what I set the mass or material friction to. My solution for now is to apply constant negative force manually, via code. I’m hoping there is something simple I am overlooking.

  • Even though I’ve set the physics substeps up to 5 (which leads to a bit of lag on some test machines) balls are occasionally still detecting collisions too late and will end up off the table or stuck in the wood. Hoping again there is something simple I can tweak to balance performance over bugs.

  • When you strike the ball w/ the cue stick, especially if it is near a rail, the cue ball will often pick it’s own vector to travel. My theory is that since I’m using the Sphere bounding box, the resolution is probably too low so it’s more like hitting a flat side. It seems that in general, the vector the ball chooses is not very precise but sometimes is very wrong by almost 90 degrees…My temporary solution will be to manually transfer the force pro grammatically (as in read the linear velocity of the stick, and apply it as force to the ball rather than directly using a collision).

I think that’s it for now. Happy blending (or w/e the kids are saying these days)!

Welcome to the forum !
Good luck with your first game, I hope you learn a lot. If I was making a billiard game I would use Python to code the collisions because Bullet can give unpredictable results. There is a lot of 2D billiards games made in Python, mostly for PyGame but the methods are the same.

I could be wrong, but I think the property you need to increase is the ‘damping’…

Thanks for the replies!!

This is more or less what I figured, and will probably make the game nicer to play in the long run if I just put in the leg work…Thanks for the PyGame suggestion too - I would have never thought to check there for examples!

I recall seeing this setting, so I’ll check it out and maybe twiddle a few more knobs before digging in to hand coding the collisions.

This did the trick for stopping the balls properly! Thanks!