Ive been trying to get rid of lag in my game by doing all the things your suspose to do getting rid of unions making sure theres no viruses and having a low tri count on meshes but even with all that the game still lags and it isnt even done yet! I dont know what to do we cant restart cause this is a year of work and it would be really demotivating so would changing parts into meshes help any? Theres 65k parts in the game so far.
It also depends on how your own device is handling the game…maybe your device can’t handle the game your trying to make.
The thing is all my friends lag aswell my device is a Acer Nitro 5 with a AMD Ryzen 5 CPU and a Nivida 1650 GTX GPU
Things that lag my builds have been:
Using many parts with a lot of, or high definition textures
I was able to find the specific parts causing the lag by deleting groups, or individual parts from the workspace, and playtesting.
This seems to cause come extra collision or physics handling that is noticable.
Easy fix, anchor everything you can.
I can sometimes get away with using a small thin slice of terrain,
but for mobile optimization, I just zap it and use plastic.
I may as well be on a mobile device though.
This laptop is about 10 years old.
Are you using tons of textures? using mesh instead of parts is a better idea as parts tend to be very demanding.
Turn off cancollide on things that don’t need it. Collisions can cause a lot of lag.
Turn off “Castshadow” under lighting, shadows also cause lag.
It would probably also be a good idea to only render parts when a player is within a certain distance.
Also try not to have too many parts in one area, try to spread things out as best as you can.
I do use textures in the game
I anchor every part i can
I havent used terrain just yet
How would i do that?
A lot of textures using unique texture id’s can be an issue. That’s why you see a lot of games where mesh are just simply colored. The game has to go through and load each unique texture id an x amount of times. As for the render part, im not quite sure how to do it myself, but i have seen a few posts about it on here.
Lag doesn’t exist just because of parts in your game, a big part is also memory leaks in scripts. A way to fix this is to delete anything that the player might have created when they entered the game. There are also some corners you can cut when modeling stuff. If there is something a player is never going to see, then it does not need to be there.
I lag in studio aswell when not play testing no scripts are being ran then so it cant be a memory leak.
We cant just replace all the textures what should i do?
More about cutting corners when modeling.
Like I said, if a player will never see the part, it does not need to exist
If you have a bunch of smaller parts, try replacing them with a bigger part if you can
It’s Roblox. People will not go crazy if your game does not have triple A graphics. If you have to sacrifice how good your game looks for playability, I would do it.