Download

How to setup realistic collisions and physics for a Carrom (similar to pool/billiards) game?

I am new to UE4, I have seen some tutorials and I am trying to make a Carrom game in UE4. For those who don’t know about Carrom, it is similar to pool game. It is a square surface with 4 holes(pockets) at each corner. Instead of spherical balls like in pool game, it has cylindrical pieces called carrom coins. The objective is to hit these coins using another, slightly larger cylindrical object called a Striker, and put them in the pockets. Here’s an image of a Carrom board.

Signature_Carrom_Board_big.jpg

I have modeled Carrom board, but I am stuck at setting up collisions and physics. I tried using per poly collision, but the I found that the result was not quite satisfactory. There were issues like coin getting stuck in the border of the board, coins jumping out of the board, etc. I would like some suggestions on how to setup collisions and physics for such a game, or if it is even possible to get such realistic results using builtin PhysX in UE4.

P.S. this is my first ever post in this forum. If you think I missed some details, please feel free to ask.

So the first thing I can tell you is that you want to avoid using per-poly collision when possible, because it’s extremely expensive in comparison to the built-in primitives that comes with PhysX which are highly optimized mathematical models.

The downside is, there is no Cylinder collision component so you may have to model a collision and import it. In fact there are a very limited selection (Capsule, Box, Sphere). You may be able to tweak the capsule settings to make it a cylinder though and if that works, you’ll want to use that. I imagine that friction of the surface plays a large role in the game, you can change the friction of a surface by creating and setting a physical material on the wood and changing the properties, which will in turn change the friction imposed on the cylinder. For a game like this, it may also be worth increasing the strength of the world gravity to make pieces ‘stick’ to the board a bit better.

You could also look into completely faking it, and programming the ‘physics’ yourself instead of relying on PhysX.

Just code it by yourself. There are so little amount of objects that you can just do bruteforce collision checks and even model everything using just 2d physics. Circle vs circle checks are ridiculous easy.

Increasing the gravity! That’s a great tip, thanks. I didn’t think of that!

As for cylindrical shapes, I was able to get pretty accurate collision for it using Auto Convex Collision. What I can’t figure out is how to create collision for the board itself, as it has holes in it. I would appreciate any suggestions/tips on this. Also, I am pretty new at this, programming the required 3d physics myself would be too much for me.

But you don’t need any 3d physics. Just use 2d physics. It will be simpler this way. Trying to make physX to achieve this is lot bigger task than coding collision routine for static box and couple circle shapes. Whole physic system for this kind of game is just few dozen lines of code.

I’m doing this as a learning exercise and also I insist on doing it on PhysX (if possible) because I’d like to achieve realistic effects like coins falling through the pockets into the nets and such. I already know the 2d physics behind it, and I don’t know if I can achieve the falling effect with just 2d physics. I’d appreciate your inputs if you think it can be done with 2d physics, too.

Thanks.

Falling effect can be just visual.