Do Unions reduce lag?

Hello there, my name is Dataspec, also known as Sy.
I have a decent amount of building experience and recently got into modelling

Example of a map I built

I will just post a link to one of my projects, a Tower Defence Simulator map submission.
Jungle Madness - Roblox

I have been using unions for quite some time now and I have been wondering whether they actually do or do not reduce lag.

For example, when you union 3 parts it turns them into 1 part which should then be faster to load.

I’m pretty sure it works this way and unions reduce lag but just want someone to confirm for me.

Lastly, feedback on the map I have added to this post would be much appreciated! Thank you for your time.

10 Likes

The dependency of “triangles” is important when speaking about the unions, including its hitbox as well. The more detailed the union is, the more triangles(or polygons).

6 Likes

From personal experience unions actually don’t reduce lag, even though they do might seem to reduce amount of parts. There are 2 reasons for that:

  1. Roblox engine is terribly bad at performing Boolean calculations, and almost always produces unions with a more complicated geometry (larger amount of polygons) than its analogue made out of parts.

  2. Every single union is considered a unique asset. Because of that it takes a greater amount of time and memory to both start up and run the game. If compared to a model made out of many parts, game would only need to load a single part which has been used over and over again.

It is better to keep models simply grouped, as it would not generate unnecessary data and keep your game faster to run. I would suggest to use unions only in instances where union is not intended to be duplicated or if shape is too complicated to make otherwise.

13 Likes

From what I have experienced with unions, it really helps with keeping the triangle count low. But I don’t think they really reduce lag. But they do take 2x longer to load than regular parts

6 Likes

@vanletts @Ethanthegrand14

Thanks for informing me, I will continue to use unions as they are easy to use and organise, but it’s good to know that it wouldn’t make a big difference whether I use unions or not. The load time shouldn’t be a big problem, especially not when adding a loading screen.

(Just put you all in a single reply if that’s fine)

6 Likes

It depends what you’re using them for. For holes, especially cylindrical ones, they usually do reduce polygon count. For unioning regular parts, no, they don’t reduce polygon count but increase it most times.

If you aren’t sure whether you should use unions or not, don’t use them. There are a lot of downsides not only in terms of polygon count but loading times and unions abruptly disappearing.

If you’re really into modeling though, I recommend learning Blender. It’s really simple to learn for beginners, it’s free, and you can do everything you can do in paid modeling softwares.

8 Likes

A well thought out and optimized group of meshes will perform much better than tons of parts and unions. If you search the forum you’ll find some clarification on the performance of unions. Most advice will tell you to do a test comparison and watch the memory and average FPS numbers.

Performance is affected by total face/triangle count (among other things). If you want your games to run on lower end hardware you should test your game on the lowest graphics settings since you have a good video card. Testing on level 1 graphics shows you when things overload and stuff starts to disappear.

18 Likes

Thanks for clarifying this for me, you’re all a great help! since I’m currently getting into Blender I will be using more meshes aswell so that should help. As for unions, I’ll only create them when necessary.

3 Likes

@sfinteractive, Great post, I wanted to clarify that triangle count is not the way to know if a map is too much for low-end devices. It’s memory use.

The reason being that triangle count is also counting instanced objects, which load substantially faster than unique objects, and therefore skew the actual amount. However memory use is the actual number you should be using to gauge how well your game runs.


@Dataspec just to add a bit more info that I’m not sure has been said yet, but regular Part geometry is already known by the Client, so they’re incredibly efficient. Union geometry has to be downloaded first, resulting in higher load times with others have said as well as memory use impacts. Unions are also full of redundancies, and really are just messy MeshParts.

Just because a Union means there’s less Parts, it doesn’t mean it’s better for performance. Instance types don’t use memory the same way.

12 Likes

Thanks! I was mostly thinking about certain Android devices that lack OpenGL/Vulkan support. Without a compatible GPU, instancing won’t work. If you were targeting an audience with low-end phones/tablets, triangles will still bog you down. I’m guessing in a few years we won’t have to worry about it at all.

3 Likes