This has been a great problem that happens to a lot of people, and I was wondering if anyone has any tips so that I wouldn't make my models/meshes/unions causing a lot of lag. I am just concerned about the models/meshes/unions, not script.
Lag Reduction with building. How to do so, and any tips?
1 answer
Since this is a very vast topic, expect a long answer.
Lag was, is, and always will be the enemy of a Developer.
The first thing you always want to keep in mind is that everything that is in the studio are the source of lag. This includes even 1 Part which you inserted in the Workspace. That 1 Part is causing lag. Of course since it is 1 Part, it is going to be very very very very small. As you implement more Parts to the Workspace or just game in general, it is going to generate more and more lag, gradually.
Now before going on explain about different types of lags, we first have to identify what kind of lag is it?
There are generally a lot of types of lags, but I am going to narrow it down.
Latency Lag
- Consider this as the main type of lag. Latency lag occurs when the
Local Playeris very far from theRoblox Server. Say I am living inSeattleand the server I am playing in is fromLondon, I am going to be experiencing tremendous amount of lag due to the distance factor. This is generally the most common type of lag. You cannot really decrease this type of lag because this strictly depends onserverandplayer's location.
- Consider this as the main type of lag. Latency lag occurs when the
Part Lag
So this is the type of lag which deals strictly with
Parts. When there is generally high amount ofPartsin yourgame, it will generally delay the run time process. However, this again has couple factors inside it again.- How much parts are there?
- How concentrated are the parts?
- Are they
Anchoredor not?
######Since this is the main issue, I will be going on details here. There are more lags which will contribute it overall as well. I will not go into to much details on that.
"How much parts are there?"
This, again, strictly depends on a person's computer. If a person is playing at a high-performance computer, they will have no problem playing a game with around 30,000 Parts to around 50,000 Parts. Of course this is all just approximate, Meaning, I could have a high-tier computer and still face lag because it could possible be a Latency Lag.
"How concentrated are the parts?"
This, is the, might I say, the main factor you want to consider. How concentrated are the parts?. Say I have a two place.
A: One place has 10,000 parts and is spread apart, anchored.
B: Another place has a 5000 parts but it is heavily concentrated.
In a situations like this, the B is more likely to lag more when we look at it. Else, A is more likely to lag. Slightly more.
##*"Are they Anchored or not?"*
When a Part is not Anchored, roblox physics has to play in role to make it "realistic". Now, this is not a significant issue when you have only limited amount of parts. But if you have 5,000 parts, then you will suffer. Terribly.
Which is why: Always Anchor your parts. If it is a special case, I suggest you Un-Anchor it from the script and revert it back after the "animation" is finished.
#Solutions.
So. What can we do about it?
Unions? Are they really the best solution?
- If you had asked a question to different people, you will notice different answers. Why? Because it generally depends on what you want to do. The thing about
Unionis that, it isn't loaded by theserver. This responsibility is given forclient, i.e., theLocal Player. Now, this is not a specific answer because sometimes, you might want theclientto have their experience the best instead ofserver. In cases like this, you would want to avoid usingUnion. However, if theserverperformance is higher priority for you, then you would want to stick with not usingUnion. Now again, this is for a large amount. Having a mere10-100 Unionswill not effect drastically.
- If you had asked a question to different people, you will notice different answers. Why? Because it generally depends on what you want to do. The thing about
Streaming Enabled? The only solution?
Streaming Enabled or Network Streaming, is a roblox feature that allows the parts to only be generated when it is required to do so. The best example of usage of this feature is Apocalypse Rising. Streaming Enabled takes into account of the
Local Player'sview. If I was facing to theNorth, the game would load thePartslocated in theNorth. Elsewhere, it wouldn't load to theClient.Now, do keep in mind that Streaming Enabled do have some of its cons. It isn't very stable at all. It can sometimes backfire and cause massive lag instead.
The Best Solution, in my opinion, is to try to cut down the number of instances used. If you find yourself using the same parts more often, make it a
unioninstead, sinceUnionhas to calculateShapeandCollision Datafor theUnionyou created. It downloads one for each differentUnionsso it is best to reuse the previousUnions. Try not to make your places high-detailed on just one area. That will be too much for a player to handle looking at. Spread it apart more.
Of course, you aren't entitled to be limited to the options shown above. You could research more and come up with a new solutions. In conclusion, I will leave you with some resources you would want to take a deeper look at for more insight.
Resources
3 comments
thx
No problem
So if I’m building a stadium that is all anchored, and packed, should I use meshes and unions?
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
Look into network streaming: http://wiki.roblox.com/index.php?title=Network_streaming
Don't forget to accept the answer If it helped you.