How to reduce lag on a game?

Hello

Both in Roblox studio and Roblox when I test my game it always lags. I don’t know if it my pc or just the amount of items I put on my game.

If I remove some of the items in my game the map wouldn’t look good.

Is there some way I can avoid removing parts?

Thank you for your time.

25 Likes

Hello,

You could try solving this in a few ways by checking your PC status; going into settings and seeing how much data or storage you have on your computer along with uninstalling some applications on your device.

Another way could be to remove some parts within your studio; which is not ideal but you can check your performance stats.

Finally, you can check your game performance on games the same to see if it is just your game and change your graphics mode?

5 Likes

Hey, if you are 3D modelling make sure you have max 5k poly per asset because if you are importing 50k poly assets it can cause lag. Furthermore if you go to settings in roblox studio abd reduce your render settings that might help you (if its individual lag)

9 Likes

This is not a solution @soccervr. OP should remove. There are many factors that could cause lag. Do you have lag in other games? If not, it’s a sign your game is laggy. There are many plugins to tell you how many parts you have in your game. Try cutting this down, and also check your memory stats in the Console. Your scripts may be causing lag through memory leaks as well, make sure they are as efficient as possible. Removing unnecessary parts is hard but when building you need to consider this so that you keep parts down to a minimum whilst retaining some level of detail. This will prevent problems like this occuring in future so you don’t need to worry about optimising your building! Do you have lots of parts to make up a road? Consider textures! Are you using free models? Check to see whether there are any dodgy instances in there that may be slowing your game down such as rogue scripts. This is just one example of optimising your game. You also have to remember if it is laggy for you on a PC think of what it would be like on a phone or tablet!

If it is your hardware, check this out https://en.help.roblox.com/hc/en-us/articles/203314150-How-to-Reduce-Lag-and-Speed-Up-Play

39 Likes

Microprofiler and the Developer Console is your friend. You can track performance and memory usage with these tools and find out what may be causing lag, if it’s not hardware related.

15 Likes

Lag can be caused by lots of things in games and the problem you are having may not be a problem with your PC. Before I start, I have a quick question. Are we able to see a screenshot of your game or could we have a link to your game if that is possible. This will make helping you out a lot easier as people will be able to find specific ways your game can be optimised to reduce lag.

Lag isn’t just caused by how many parts are in a game but it can be caused by scripting, terrain and the way things are built. Here is a little list of things that could be causing lag in your game:

  • Your games code may not be optimised in the best way. For example, try and avoid using infinite loops as they could cause huge amounts of lag. When moving parts use tweenservice instead of a loop as tweenservice causes a great deal less lag than what a loop would. I am not going to say anymore ways to optimise you code as I could go on forever as there is so many ways to optimise code for performance. I would suggests you search through the dev forum for more ways.

  • Do you have lots of unions/meshes. A union could increase the amount of lag in your game instead of reducing it as unions increase the poly count. I would try and reduce the amount of unions you have, if you have any. As said in another post, make sure your meshes don’t have a huge poly count. In blender you can control the tris count(poly count) of your meshes easily.

  • Do you have lots of parts in your game? The more parts you have the more your game will lag. However their is a technique to reduce the part count without changing the way the model/game looks. Here is an very small scale example, I have put outlines on the parts so you can see each separate part better:


    In this image above you can see that 9 parts make this window up. This part count could be improved. Here is what the window looks like with a few less parts:

    If you notice, this window looks exactly the same as the one above but this one has 6 parts instead of 9. All I have done is only use one part for the glass instead of two, two part for the top and the bottom.

  • Do you have any free models in your game? Free models could increase lag in your game as they could be hiding weird scrips that create lag. Also lots of free models aren’t optimised that well meaning that they could cause lag.

You may want to read over this topic as it explains how to optimise/reduce lag in your game very well:

21 Likes

From what I have seen in games, and experienced myself as a developer, is that excessive use of the terrain editor creates lag. One thing I found is that with little use of the terrain editor, any game, no matter the part count can run with much less lag and delay. Alternatives to using the terrain editor can be things like using simple parts for terrain instead, and changing its material to grass and color to green. Sometimes, this “low-poly” terrain even fits better with games.

6 Likes

@Alvin_Blox are unions also the problem plus parts

3 Likes

If you have a lot of unions/meshes, set the render fidelity to “Automatic”, this will help with a lot of FPS issues, as it doesn’t load the precise mesh until you get closer. As others have said, also try to check for any infinite loops in your scripts. If you’re trying to move parts in your game, use TweenService instead of a for loop.

Here’s a script that could help you with lag, run this in the studio command bar:

for _,V in pairs(workspace:GetDescendants()) do
if V:IsA(“Model”) then
V.LevelOfDetail = Enum.ModelLevelOfDetail.Automatic
end
end

This changes the Level of Detail on models to automatic. Hope this helps.

13 Likes

This post is a year ago, How do you even find this :rofl:

6 Likes

Searching the specific keywords in google will result in finding this, just as me right now.
This post helped me a little

2 Likes

Try to use unions. It cuts down the usage of parts and combines them into one.

2 Likes

False, unions cause degrade performance. People are commonly confused about unions, they think it puts them into one part, reducing the amount of lag.

Even unioning the most basic shape gives it more poly that necessary. More parts unioned = more excessive poly = degraded performance.

12 Likes

What about the new cgi? that roblox released

1 Like