Hello fellow devs,
I have a HUGE problem in my game (partnering with @ObbyCraftsman), everything is working fine, but for low end devices the game is LAGGY!
If you have a low end device you can try it out right here:
The game has 500 average players on non-weekend days and gets up to 1k players on weekends. We get a miserable dislike rate because of the lag so it needs to be fixed ASAP. Out Game is “huge”, uses a ton of scripts and I do not know where to start.
What we have already done:
reduced the datastore amount from 10 to only 3 datastore (one global and 2 sorted datastores)
prevented most “while task.wait(0)” loops which can cause lag
yields and checked for viruses
You can clearly see, also on a high end device, that rendering stages far away is already a problem for the loading screen and even me, on an iMac from 2017, opening workspace causes “lag”?
You can see how huge the game is (idk if it helps, ive put most of workspace parts in this folder)
It would be a HUGE help if anybody could help us as soon as possible, would also reward you if you want!
Sincerely,
Mystery and Jake
if there are obstacles that have their movement physics-based, you could also try anchoring them until the player gets nearby if they are cloned to each player’s client
I think I have heard of that, maybe used it some time ago, but maybe I have used it wrong, everything errored when I tested (like the objects in workspace have been removed and local scripts in start ui are giving nil errors)
you can set models to have a specific behavior when they attempt to be streamed out,but im not really experienced in using this feature, so its best to experiment with it first before implementing it into your real game
Just how many Parts are we talking here in the entire place? I see what looks like a lot of items in your ‘bushes’ folder. That might be a problem with rendering.
Do you have lots of Constraints in your place (Hinges, Prismatic, etc)? Lots of physics constrants need to be calculated so that might be an issue.
Yea, to hold on spinners, falling platforms, welded parts (halos). But it might not all be the HUGE workspace, but also the scripts. Maybe something is causing lag, maybe there is like a way to find out which script could possibly cause lag?
Edit : If you see a script using a lot of rate then just try to optimize it. Also I’d recommend seting CanTouch to false for most parts where u don’t need CanTouch set to true also try to minime the amount of parts when a player has a lot of ping (if you want / can)
you should try to make a script that anchors some of these parts once they are a certain distance away from the player, because it appears that a lot of these obstacles have physics calculated on the client which probably would put a heavy load on many low-end devices
another small thing you can do is that if there are animated conveyors in your obby, you can try to have an option to turn the animation off
local addConveyor = function(c)
if c.Name == "CONVEYOR" then
c.Parent.Velocity = c.Value*c.Parent.CFrame.lookVector
end
end
workspace.DescendantAdded:Connect(addConveyor)
for i,v in pairs(workspace:GetDescendants()) do
addConveyor(v)
end
i didnt add this but this seems SO MUCH OVERCOMPLICATED? especially calling every descendant