• News

• Industries

• Learning & Support

• Community

• Marketplace

# Unstable physics. Per-poly collision physics problem.

Okay… first of all, please forgive the long wall of text but this is pretty important (to me)!!

So this is a weird one… I’m not exactly sure where to start but basically in the most simple terms I would put it like this: per-poly collision + physics = nope

What I’m trying to do is create a large moving vehicle (in this case a ship, but it could be a submarine, a plane, a spaceship, etc.) that has accurate per-poly collision and is able to be driven around while players can freely walk on it… it’s basically a moving building
Since convex collision would require a really large amount of collision primitives to pull off (that kills performance… plus is a pain to setup), it seems per-poly collision is the only option.

The idea is to use a simplified collision shape (a box) as the root, that will handle all the large scale forces and collisions (ship-to-ship and ship-to-world)…
Then attach a mesh with complex collision to it and set the collision channels so that it will handle only the pawn and small physics object collisions (those are one-way collisions… meaning the pawns can’t actually push the mesh with complex collision, but they can collide with it).

At first it looked like I had succeeded, buuut as you will see, it doesn’t seem like physics are very happy with this idea
As long as the ship is relatively stationary, it works fine but the moment you add some velocity to the equation… all hell seems to break loose!

At this point it would probably be better to show you a video instead of trying to describe it :rolleyes:

As you can see, everything gets really unstable and stuttery when the ship is moving.
I first noticed this from the client’s perspective (since it’s more obvious) but server side (or single player) definitely has this problem as well.
Also I should mention that if I try the same with a simple collision ship, the problem goes away *almost *completely.

By the way, if you want to play around with this a little bit and see it for yourself, the project is on github, check my post here.
(if you think it will be helpful, I can make a super simple bare-minimum project to demonstrate the problem)

Now I know that complex collision was probably not designed with this in mind… it seems it is more meant to work with static objects (although even that wasn’t working that great until recently :p) but this is so close!
It’s almost there! there is just a little bit of something missing… somewhere… my guess is that this is core-side (unfortunately) so I’m hoping someone here with deeper knowledge of the engine can help me solve this.

Don’t know if this counts as a bug since I’m using complex collision for something beyond of what it was meant to do but I would be extremely grateful if I could get some help from the Epic staff with this

sorry i cant help but can confirm the problem with a playable example in html5

if you stand the character (or drop a physics enabled shape) on a physics enabled shape it jitters around quite violently.
i imagine the sheer mass of your ship dampens the effect somewhat but it seems the same thing is happening.

after lots of digging and reading it looks like there is a miscalculation in physx to do with mass and physics reactions. i cant back this up with anything concrete unfortunately but there is lots of evidence (just try a search) that points to this.

Just checking in to see if there is any new information on this, physics objects on a moving ship are producing some very odd results.

Any info on how to fix this or info on a workaround would be much appreciated! Thanks.

Edit: Here is an updated link to this project in case it helps: GitHub - UE4-OceanProject/OceanProject: Environment Plugin Project (Ocean Simulation, Sky Simulation, Buoyancy, Time, Fish plugins for Unreal Engine 4)

I have a big pirate ship moving with character walking around inside it.
Had collision issues too like sliding and sinking.
I solved the problem by breaking the ship up into smaller mesh pieces and then attaching them to one main one with attach to actor
in level BP.
It works great now.

Hey TK_Master! I’m using your Ocean Project while developing my game. Could you tell please how did you eventually solve the problem. In-project ships behave fine but I’m getting the same issue with my own ship. Thanks!