Hello i am here to ask on solutions for lag as my game i use terrain and i have a state group i started and i know have greats amount of lag the cars are not the issue as its there on ssus(server startups) and no cars are in the game but lag is alot and i tried unioning my road pieces but it made weird stuff happen what is a solution to this maby using decals road lines or what if you wnana see lag for yourself pls pm me so i can further you in
i know this might be ismilar but idk if they are aiming at what my map has in it
heres the link Indiana River County - Roblox i have a friend that can run 100 fps and just got his laptop and has a GETFORCE GTX 1060 ti or something and he lagss
You probably wanted to take some free-to-use models in the toolbox, and one of them was accidentaly holding a ‘virus’ inside that. Roblox model viruses, are just scripts, that clones laggy stuff (ex: fire element, or fog(particles)) around the place, the cloned fire is transparent so people don’t see it but it’s still here. Once cloned tenth of thousands of times it makes the whole game lag.
Type ‘Script’ in the explorer and it will list all scripts in the game then just sort through and delete potential virus scripts which may cause the game to lag by cloning or creating instances in a loop.
Here are a few notes about how to improve the lag on your game through abstraction. Whether you use these, up to you.
Unions
Unions actually have the capability to cause more lag than multiple parts. When using these, you should be very careful and should try to achieve a balance. Things to consider about unions should be:
Whether you’ll be touching the specific details in the unions, if not then set it to box collision
Whether the player will be going near it at all, if not going near it at all, make the union cancollide false in an attempt to reduce memory usage.
Unoptimised scripts
Chances are that lag can be caused by scripts that are either looping for a long amount of time, or are set up in a way that uses the most memory possible. I suggest you consult someone to see if you can make your scripts any more efficient, and so they operate in a way the least memory is used as possible.
Optimising Terrain
When using Roblox’s built in terrain system, you should keep in mind that it is not lag free in huge quantities. That being said, try to focus on what the player will be able to see, and remove any bits that aren’t needed (i.e - loads of caves and stuff under the map a player would never go into.
Details on buildings
Sometimes buildings don’t require as much detail as you’d think. If there are massive, large part structures that occupy a small amount of space, you should definitely consider looking over how to improve that, perhaps by using less parts or using your parts more efficiently. You should also make sure to look out for duplicates that take up a specific space as they can add onto lag also.
Your cars
If I may ask, what type of cars do you use? Do you use mesh, part or unions? I suggest the following for each:
For mesh cars, try to assure the body itself is as low poly as possible without taking too much detail. I experienced an issue in the past with some team members where the game would take a while to load up due to high poly cars
I personally wouldn’t use union cars but if you are going to use it, try to make sure the collision settings for each union is either box or even better, uncancollide the parts and use a hitbox. (then again this is probably not as effective as a mesh or part car).
If you have any questions or if anyone has any points to add, I’m up to listen!
I checked out the place and looking at the dev stats I can see why you’re lagging - 878mb is lot of usage. I can’t speak to any scripting best practices or memory saving methods, but let me break it down some building ones:
This isn’t bad but could be better. Check if you have unnecessary unanchored parts and anchor them.
GraphicsSolidModels: 41mb
You said you used Unions? If you can avoid them, don’t use them. Except under certain circumstances, they aren’t very efficient. Again, not bad but could be better.
GraphicsParts: 142mb
You must have a lot of Parts. Take out redundant ones. This is a really high memory use. The largest map of the 2018 Egg Hunt, Hardboiled City, had around 90k Parts and didn’t even reach this number. Remember to take advantage of Featherweight Parts - Parts that have the same properties are instanced much like MeshParts, but more efficient.
GraphicsTexture: 133mb
Again, a lot of decals and textures. Make sure you aren’t uploading textures at 1024x1024 unless you absolutely need to, and to remove any decals/textures that are redundant.
TerrainVoxels: 135mb and Terrain Physics 169mb
Remove some of the unnecessary or redundant terrain, and make it so that there isn’t as much “noise” (swiss cheese-like holes inside the terrain) going on with how the voxels are calculated.
ok so i am ganna look at using them i plan om making my map 5 islands because roblox squared maps limit building but i plan on doing a lot more terrain i use mano cars cause there dev quit and gave them up (they were free to take at one point and also i use textured buildings there free i used them on other maps but may i ask if maby you can come in and help me reduce the lag?
also you have a more in depth look in it
Unions cause lag issues, Roblox renders everything on the CPU AFAIK. Unions used to have a property for checking how many triangles… if you could use this script in game.Workspace, and post the results, that would be nice
local unions = 0
local parts = 0
local baseparts = 0
local meshes = 0
local unknown = 0
for i,v in pairs(game.Workspace:GetDescendants()) do
if v:IsA("Union") then
unions = unions + 1
elseif v:IsA("Part") then
parts = parts + 1
elseif v:IsA("Mesh") or v:IsA("MeshPart") then
meshes = meshes + 1
elseif v:IsA("BasePart") then
baseparts = baseparts + 1
else
unknown = unknown + 1
end
print("Parts: "..parts)
print("Unions: "..unions)
print("Meshes: "..meshes)
print("BaseParts: "..baseparts)
print("Unknown objects: "..unknown)
EDIT: Read some more of the thread, this could help find out more root issues… if you see many unions, such as ones that are just parts unioned, just group them instead. If they are NegativeOperations, then try workaround, such as for rooms, build walls separately.
It’s not about whether you have unions or not, it’s about having a lot of complex geometry in your place that can reduce performance and having a lot of unique assets (CSG, meshes, textures) in your place can lead to low performance / high memory usage / long loading times.
Union parts don’t inherently cause “lag issues”, and Roblox does not “render everything on the CPU”.
I had heard a lot of people complaining about FPS drops when streaming and such, and others saying the cause is the CPU, and I should’ve stated more clearly that more complex unions, especially unanchored can cause longer load times and separating them can reduce lag, and drop memory usage a lot.