I have 9 different “levels” for my game like this one. Right now, the method I am using to load and unload these levels is with PrimaryPartCFrame movement. Would the game be more optimized if I unload these into Replicated Storage and just move it into Workspace to load it?
It’s generally a good idea to keep your game as optimized as possible, so using ReplicatedStorage to store your levels and moving them into the Workspace when needed could improve the performance of your game.
However, there are a few things you should consider before making this change:
How often are the levels being loaded and unloaded? If the levels are being loaded and unloaded frequently, moving them into and out of ReplicatedStorage could create a lot of network traffic, which could decrease your game’s performance.
How large are the levels? If the levels are very large, moving them into and out of ReplicatedStorage could take a significant amount of time, which could affect the overall performance of your game.
What are other resources being loaded and unloaded at the same time? Suppose you are also simultaneously loading and unloading other resources (such as audio files or textures). In that case, this could also affect the performance of your game.
The levels are decently large. When a level is loaded, nothing else is loaded along with it. The levels will be loaded after a 30 second countdown then unload after a 45-55 second round. Here’s the same level with a dummy for scale
Your game has almost no geometry with one level loaded so this seems like premature optimization. It is good practice though to keep objects in ServerStorage until they’re needed. I would advice against using ReplicatedStorage because then all levels still exist on the client and that’s unsafe.
Moving the levels very far away and then moving them back is much more efficient than reparenting it. Since the levels look like they’re made out of just a few hundred parts, what you’re doing right now is fine.
If they were really big maps with lots of detail, then having a lot of them existing at once within the workspace could take a lot of memory. In this case it’d be a better idea to load them in individually from ServerStorage where they won’t be taking up memory on the client