Physics Slowing down dramatically

When using boats with smooth terrain water, the physics start to struggle quite quickly and the boats start switching between velocities from very slow to a tiny bit faster to very slow etc

I mostly use ships for this map here: https://www.roblox.com/games/1085549607/Battle-of-Baltimore

In this map I have about 16,000 parts before ships are spawned in.

The effect becomes noticeable at about three ships idle or moving.

I was able to reproduce this with the default pirate island map, but with 9 ships and a tall skyscraper added in.

ShipRepo.rbxl (1.3 MB)

cc @zeuxcg

1 Like

Okay so looking at this right now, this boat is build in a way that utilizes some of the least efficient parts of our engine.

Our collision detection has 2 primary processes:

BroadPhase - Which does filtering of all objects in the world to figure out which might be close enough for an interaction.

NarrowPhase - Which takes all the potential interactions and figures out if they actually are interacting.

Each of these boats is about 1200 or so parts. Our BroadPhase updates once for each of these 1200 (x 9 since there are 9 boats) or so parts (despite them being clumped together). [This is something we will be optimizing next year BTW]. Of those 1200 parts, say we find around 60 potentially near water. So now, for every boat we have 60 (x 9 for every boat) fine collision detection check against water.

Basically these boats are built in such a way that they are one of the least optimal things you can build for Physics in the ROBLOX engine.

If you are making a game with boats, please consider making that boats have lower part counts for the time being.

Next year we will be starting some heavy optimizations to make structures like this A LOT more optimized.

Hope this explanation makes sense.

8 Likes

In addition to @Khanovich’s post, another way to optimize this without losing build quality is to disable the collisions of the hull’s individual parts. Then, you could create a large invisible box that would provide buoyancy. This box would, of course, need to use collision groups so that players do not collide with it. Unfortunately this would allow players to swim under the ship.

Another method would be to create a much simpler union of the bottom of the hull and set its CollisionFidelity to a convex hull (Hull in the properties menu). With this, you can provide a shell that would serve for collision and still be fast. If you don’t know what a convex hull is, imagine solid shrink-wrap. It goes around the shape of the object but never has any pores or holes.

Click to see what I did

I will union these three parts.

In this union I will CollisionFidelity to Hull. I’ve also turned on the property of studio to view collision models.

Of course you can make the shape slightly more complex, but you can see the union requires maybe 5 parts and can get close to what’s needed for collision.

1 Like

Its totally smooth for me :confused:

Try how it is after removing all the parts and leaving one ship

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.