Hi,
I am looking for someone with a strong understanding of the UE4 physics engine (I believe it is PhysX) that may be able to help me solve a problem that has been plaguing my project since its inception 4 years ago.
The Problem:
The game I have been working on is a rolling ball platformer. You essentially play as a ball which is controlled through applying force and torque based on inputs. Little naive old me thought this would be a good, simple place to start learning game development back in the day, and my love of Marble Blast Ultra back on the 360 made it seem like the perfect project to start messing with.
I very quickly ran into an issue with collision when rolling over modular mesh pieces, which was going to be my intended method of creating levels for the game.
After some brief research on the issue, I found a few posts of people having similar issues, and that they were finding that setting the “Min Contact Offset” and Max Contact Offset” to their smallest possible values fixed the issue. After trying this myself, it did infact appear on the surface to fix the collision issue. My ball would no longer randomly bump up into the air when rolling over the seam of two modular pieces.
Unfortunately this is not the end of the story though…
I soon found out that the issue still existed when I implemented a jump mechanic in the game. Upon re-impact with a connection seam, the ball would calculate the collision based on one of the internal faces instead of the actual surface faces. The same would also happen with two connecting planes, as depicted in this image.
The image shows two planes seemingly connected perfectly together. When the ball comes in from a jump, you would expect the trajectory to follow the green arrow, but if the seam of the two planes is hit, the ball will actually follow the red arrow trajectory, or sometimes simply just stop in its path. Its as if the physics calculation thinks the ball has hit a corner (like the one depicted in red).
So this discovery destroyed every thought of using modular pieces to create the levels for my game. I had to find a new solution… I eventually realised that creating entire levels out of a single mesh in blender was a valid solution. It still had some minor collision issues when it came to the top edges on ramps, but it was something I could live with for my project.
I continued to create levels in this way for the next few years as I worked on the project in my spare time. During this time, the game has progressed a decently long way to the point where I was recently able to release my game into Early Access on steam which I am very happy with.
After some feedback on the game, a big feature that people are asking for is a level editor. As well as being requested by my community, I have always wanted to include one anyway, but had to shelf the idea upon the discovery that I would not be able to use modular pieces for designing levels. I feel that this is the next step for my game though, so I feel it is time to revisit this problem, and this is where I need the help of someone with experience in this field.
I recently made the discovery that when starting to mess around again was that unreal geometry seemingly reacts differently than a static mesh, which has made me wonder if this problem may have a solution within my reach after all.
The video below shows me jumping on the seam of two static mesh objects and then two geometry objects. It is very clear to see that there is some sort of difference when it comes to the physics calculations being done, and that is what I am hoping to solve with this post!
Video of collision issue in action
I really appreciate any help or information anyone can provide <3
Thanks!