currently, I Have a space themed game which involves the player to build buildings and ships.
over time as more things are built, I noticed that certain things like a gui counting down significantly slows down. my player is not losing frames however the game mechanics seem to just drop in speed. I asked a similar question on how to optimize my game and I was told to make general changes. so I have a few questions that I hope could be a solution to my problem.
1: all buildings and ships are anchored and cancollide false, but they are all humanoids. If I replaced all humanoids with intvalues, will this speed up script performance?
2: I know how limited streaming enabled is, but is there a way I could force parts to unstream if they are far from the player?
Humanoids are very expensive. Where possible (without being expensive) avoid using them.
StreamingEnabled had some QoL improvements recently that may help you.
A custom streaming system is beyond the scope for this topic— but the general idea is taking parts that are far away out of the workspace and into storage, only to return them back to the workspace when required.
move them out of the workspace on the client right? and if so I would like to use lighting as the storage option as I dont have to reset a parts position due to lighting also keeping track of position. is this a good idea?
ReplicatedStorage also keeps track of position. Its crazy how people keep trying to put client-sided things in Lightning even though replicatedstorage was made for this reason.
I have another question im sorry if I failed to mention it when I made this post but I make over 100 rays in a ring pattern every 0.2 seconds. are rays performance costly?
You can’t technically force parts to stream out but you can change the StreamingTargetRadius which more or less does that for you. Any parts outside this radius are streamed out.