Union optimization?

So my game has fence Unions, hundreds of them. And I was wondering if it would be better to have hundreds of unions, or thousands of parts.
Compairson: (all parts are marked by a different color, unions on the left, parts on the right)

Which one of these would consume less FPS?

4 Likes

A more efficient way to optimize unions is to export them as obj meshes, then re-import them as a MeshPart. But if you want to optimise them the way you say, the left option seems better.

3 Likes

A problem with Unions is that they are VERY unoptimized. Duplicate vertices, faces that won’t ever be visible, unnecessary vertices, all sorts of stuff. I’d recommend recreating your union in a modelling program like Blender, and importing it into Roblox.

6 Likes

Extra question, would it be better to make the mesh have 3 pieces (like the one in the original post) or just 1? There technically would be more MeshParts, but they will have a smaller file size, so what would be more efficent?

You’d be better off having it as one piece. Less information for the server AND client to keep track of.

So the most beneficial would be to combine a whole strip of fences into 1 mesh?

less parts and geometry to keep track of is better, so the left option would be more performant
though you’re best off just using meshes to get rid of unnecesary faces instead of unions/parts

1 Like

Yes. It would be beneficial to do that.

2 Likes

plugin:BulkUnion

I agree, having a union without the ‘separate’ feature would improve efficiency, because ROBLOX has to keep track of each mesh inside of the union, I’d like to see a plugin:BulkUnion feature, that can be speedy you union a mega ton of parts in studio, and improve performance in-game. Like WorldRoot:BulkMoveTo, this function could be handy for unioning faster than plugin:Union. You may ask: why is a union so unoptimized?

Problems with plugin:Union
Duplicate vertices [Previously mentioned]
Mirrored Instances [For the ‘separate’ feature: this is multidimensional, for every step unioned]
Unstable import [When opening studio it occasionally disappears, this is due to glitches in the cloud]
Slow Union time [With a lot of vertices]

Note: I’m not a high enough tier on the forum, so I can’t make my own feature request post. :open_mouth:

1 Like

Export as a .obj, and delete faces that will never be seen.

2ea1ae094814b6f226235b3891b739bc74800dac

There should be two faces that will be rendered by the engine but never seen, I suggest removing them for performance.

If you remove the faces and set collision to box (as a meshpart) it’ll be a lot better than individual parts or a union operation.

1 Like