Potential way of fixing build lag

Okay, so I’ve been thinking about this and based on the things I’ve heard around, I’d love to hear your opinions!!

So from what I’ve heard, apparently meshes take less memory compared to parts I believe… so I had thought about this and came up with this conclusion…

If we were to take a regular brick from Studio and bring it into Blender and then remove the inside of the part (so that there is nothing inside the brick… empty inside, full outside) and then use that instead of using regular parts from Studio… wouldn’t that potentially fix up the lag issues that come in with building?

Since when using a regular part, there is that inside of the brick which takes up memory - so wouldn’t getting rid of the inside and using that as the brick you’d normally build with fix up lag? :thinking:

12 Likes

I like the hypothesis… But we should have some sort of controlled testing to see what happens.

What you’re saying all makes sense. Just need some people to test.

3 Likes

Agreed, we totally should do that.

3 Likes

This is false. Meshes must download from the internet and come with additional memory overhead, while the client already knows how to render parts.

3D models consist of polygons, which you can think of as triangular pieces of paper. They’re already hollow. Also, the inside surface of polygons are not rendered (You may have seen threads here about people wondering why their models were rendering inside-out in Studio. This is partly why.)

11 Likes

Huh, really? I guess I’ve been hearing wrong then lol

2 Likes

Polygon count is what matters. NOT part count.

5 Likes

The misconception that OP is falling for is that they heard that MeshParts are instanced without hearing that Parts are also instanced - at a much better rate since, as @qqtt991 correctly said, Parts are already part of the Client.

The million dollar question that everyone asks is “well then are MeshParts better than Parts” and the answer is always “it depends” because there are an infinite amount of variables and situations where either could be more efficient, and that’s not even touching the style, theme, or genre of whatever it is.

The only way to know for sure is to test your game with different combinations.

6 Likes

I recommend watching the talk that Arseny did during RDC 2018.

4 Likes

Part count does matter if you have too many of them in your place.
Which eventually levels out to “too many polygons” too.
But from my experience if you have too many instances in one place/spot it will lag.

2 Likes

Part count very much matters.
1600 skyscrapers on the right pic, each one made up of a few unions. 1600 was well under a GB of RAM and not terribly laggy.
Left is 100 skyscrapers made up of parts, but I tried going to 200 and roblox crashed, while I could pan around the 1600 no problem.

3 Likes

If each of the buildings is just a few unions, that can lag the game more I believe, As shown here, Unions causing lag?

1 Like

1600 unioned skyscrapers and I was able to pan around at ~55FPS. 200 skyscrapers made up of parts and the file could not actually load and went up to 2-3GB. It’s clear in this specific case, unions are better.

2 Likes

As lawyers say far too often, “it depends”.

2 Likes

Yes, as I stated.

2 Likes

I’m not normally this pedantic, but hearing ‘lag’ so many times in this thread is making me sad :slightly_frowning_face:

3 Likes

Very true, haha.

1 Like

Okay, I went ahead and did a little science using unions and their optimized MeshPart equivalent.

https://i.gyazo.com/81093d08d8cbb46313e2792dd30507bc.mp4
The left is the MeshPart (314 Triangles), the right is the union (636 Triangles).

The lighting error is caused by ROBLOX’s unioning method and is visible in the in-game union.

From here, the baseplate was covered with the models in an 32 x 16 x 32 grid for a total of 16384 items. Cutscene editor was then used to create a replicateable path both through and around the grid for benchmarking. The total track is 42 seconds in length.

https://i.gyazo.com/a18519afb3301fb2fd59a8f6ec29b915.mp4

Tests were run with only a single instance of ROBLOX Studio open, ‘Performance Stats’ on and OBS recording. The models were anchored, set to cancollide true, and collision fidelity to default.

Meshes Unions
Memory Usage 669.5MB 704.2MB (-4.9%)
CPU 16.67 ms 16.76 ms (-0.5%)
GPU 3.35 ms 7.31 ms (-54.2%)
File Size 79.7KB 163.6KB (-51.3%)

Lower is better.


This data makes sense that by optimizing unions as meshes (and therefore reducing the triangle count), you can improve GPU performance.

I didn’t include an FPS count for the tests because I somehow still get a steady 60FPS doing this. Having a lower end computer test this might be for the future.

Also, I did not do a parts only test as this shape is impossible (well impractical) to make out of purely parts.

Interestingly however, I found that performance was even better in the ROBLOX client compared to Studio testing, RAM was a of third what was seen in Studio, and GPU/CPU times fared slightly better as well. It’s 1AM though, so I won’t redo tests there, yet.


My Specs: humblebrag, kidding
i7-3770
24GB RAM
GTX 980

For the future:
Changing CollisionFidelity to Hull, and disabling cancollide.

Here are downloads of the two test places if anyone wants to try it themselves:
meshPartPerformance.rbxl (79.7 KB)
unionPerformance.rbxl (163.6 KB)

19 Likes

I’d like to add to that this data is purely focusing on the discussion of unions versus MeshParts.

I highly advice against using MeshParts in place of normal parts as alluded to in OP due to the increased loading times you will experience; let alone the amount of tedious work to undertake such a project would be.

However, if you have a plethora of repeated unions across a build, it might be a consideration to clean them up in Blender. For example, one of my jobs was to take ROBLOX gun models and drop their triangle count by 80%. This worked wonders, especially since this reduced the number of moving parts by a factor of a hundred.

1 Like

Yes, but unions take more server memory from what I’m aware of…

A simple “Loading Assets” intro to your game would fix the issue and would let the MeshParts load in, yes they do take longer to load it… but would you rather want your game to be slower from Unions taking up more server memory than needed? :thinking:

2 Likes

Plus, unions have less accurate hitboxes on average

1 Like