When do games begin lagging?

My entire game, has 6000 parts. I just used:
game:GetDescendants()
It said around 6000, and I want to know 2 questions:
Does a union of 5 parts count as 5 parts, or 1 part?
On an average computer, will 6000 parts lag an average windows 10 (One of the most popular computers out there, average.)

4 Likes

It might. To mostly stop the lag, you can buy a high-tech supercomputer that runs windows 10 with the highest screen-resolution possible.

2 Likes

Or, instead of making games for the few supercomputer users out there, you could use StreamingEnabled.

StreamingEnabled is a special utility that will load parts of your game when needed. Read more about it here.

7 Likes

I’ve tried it and it worked! It reduced some of the lag but, there may be some Cons.
Unions mess up the hitbox so if you walk on it would look like you are floating in mid-air. If you are unioning 6000 parts or more it would take a long time even if you are doing it one by one. Also, Unions can sometimes corrupt very easily, if it corrupts the asset will be hard to restore back.

1 Like

So, there is something that you can do, so collisions are precise. You can do this and the union will be precise with where you fall in, what is solid and what is not.

1 Like

The main issue, in my opinion is that it sounds like you’re relying on Unions for the bulk of your parts, which aren’t nearly as efficient objects as MeshParts. I would strongly recommend learning how to 3D model and upload meshes that you’d have a lot more control over in its memory usage (reducing poly counts and so forth) and other fine-tuning optimizations.

I was hesitant to have to learn how to make meshes since I was also pretty used to Unions, but it has reduced lag a hundredfold.

2 Likes

One glitch, I use blender, and when I import my file, from blender, it freezes for about 5 seconds, and the meshpart never gets the mesh I wanted it to…
A glitch or am I doing something wrong?
Should I put a mesh in a part and try it or?

1 Like

I’m not really sure what could’ve gone wrong, this isn’t a lot of detail to troubleshoot with. All I can say is that make sure you’re importing .OBJ or .FBX files and not .blend files themselves.

2 Likes

I have tried this and an easy way to do this is export the union and then import it which makes it a mesh part. It reduced lag in my case.

2 Likes

To fix this just set CollisionFidelity to PreciseConvexDecomposition.

3 Likes

To answer this specifically, a union would count as way more than however many parts were unioned together. Parts are instanced very well, meshparts are instanced quite decently, but unions are on a whole different scale.

When you create a union, Roblox is already storing data as to which parts were unionized, this is so you can revert the process (converting unions back to parts). Already by creating a union, you’re using up a very small amount of server memory. This can add up.

Also when creating a union, it’s no longer a simple basepart or meshpart that’s saved on the website. It has its own geometry. This makes unions typically harder on the server to calculate.

In my opinion, unions are terrible and using GetDescendants() on a bunch of unions is worse than using it on a bunch of parts or meshparts. Especially if you’re then getting all those descendants and configuring them.

1 Like

So, if I make a world, with nothing in it, and make a union of 5 parts, will GetDescendants say 1 or 5?

1 Like

My mistake, I originally thought you were asking about memory/performance, hence your topic title. But to answer this, it would say one.