Best ways to reduce lag in places with lots of parts?

I’ve been playing Hexaria for a week now, and it’s an amazing game with great mechanics (shout out to @anon89973268 , but, there’s something that has piqued my interest that I don’t understand…

HOW DOES IT HAVE ABSOLUTELY NO LATENCY OR LAG?

There’s over thousands and thousands of hexagonal prisms in the world, and yet, it doesn’t affect the gameplay one bit, how is this possible? Is there some sort of secret I am not in on?

I’ve been building a showcase called Giant’s Causeway (an actual place), and it also has tons and tons of hexagonal prisms (but all are stone and have extra detailing like cracks and imperfections), and yet, with about 2000 of them so far, i’ve already run into issues with the framerate. Any thoughts on how to reduce lag in places with lots of parts?
Screenshot_314
EDIT: The place is mainly unions, and i’ve tried Box and Hull, but neither seem to reduce much of the lag.

13 Likes

If you can help it, don’t use unions.

19 Likes

I mean, that’s a good suggestion and all, but to get the same effect of cracked stone, i’d have to make multiple parts per hex, which would in turn have just about the same amount of lag

1 Like

Low poly mesh is the best way to go. Don’t use roblox unions.

12 Likes

Switching from meshes to unions will probably fix your issue.

In general one thing you can do is spread out your parts more. This is especially applicable in showcases (although I’m not sure your showcase here has high density parts, most do).

Roblox is aggressively culls parts far away from you. So if you spread out your parts you can get a lot more performance. Especially when Roblox has to calculate shadow voxels and other things, part density starts to matter more.

2 Likes

Thanks for the ideas, i’ll definitely try and make low-poly mesh versions and check out how that will work.

1 Like

It’s also worth mentioning that featherweight parts apply to anchored parts with identical properties (unless this has updated since to all parts?).

Additionally, unique meshparts have to be downloaded first, but once they’re in, it can save a lot of room because they’re replicated. The issue is that for mobile devices, downloading can get too heavy so use judgement. Sometimes it’s cheaper to just make it out of parts if you’re planning on a mobile launch.

And Box collisions (not Hull) saves room too if you can apply it to anywhere (that wouldn’t ruin gameplay of course), since the physics engine doesn’t have to think more.

Textures and unions are messy and get really heavy really quickly.

5 Likes

Glad you like the game!

I think the reason it runs so smoothly is because we only use a few different MeshParts that are cloned a bunch of times. The release of instancing really really really helped out with the rendering load, and the physics load is pretty light because the only things that move in the world are the players. Everything else is anchored.

We also removed the bottom face from our hexagons to save a few polys on rendering, since nobody needs to see the world from below anyway.

If rendering is the problem for you, I would definitely agree with everyone else about making the switch to MeshParts, and also experiment with removing textures/materials.

7 Likes

Yeah, today I exported all of the variants of hexes/octs in the build, dropped them into blender, and simplified it. After cleaning it up a bit, I uploaded it to roblox and as I started copying them and moving them around, I immediately noticed the difference, as it is MUCH less laggy than what it was.

I would remove the material (slate in this case), but I feel like plastic just doesn’t look that good in contrast with the mildly realistic water & skies, although I think the switch has definitely improved it a ton.

I would absolutely love to use instancing considering the effects i’ve seen of it, but my lack of any skill in scripting says otherwise.

2 Likes

Make sure workspace.StreamingEnabled is enabled. It will make only parts in distance and view of the player will be loaded. Be aware that you may need to experiment after enabling to make sure that ROBLOX treats your place nicely.

You can also make your own script to only load in chunks or portions of the world near the player, this is what apocalypse rising, minecraft, and the source engine do.

Instancing is not a feature that you have to script, it’s a rendering technique that the Roblox engine uses.

Meshes > Roblox CSG

Oh, I thought it was something I had to script. I remember someone used some sort of scripting method to get ultra-fast graphics even though there was tens of thousands of parts.

Are you using parts, meshes or unions? :3

(edit) unions can cause client side lag, i recommend using meshes the next time you try a big project that is heavy on parts :smile:

1 Like