I have an interesting problem, for first time players my game takes about 2 minutes to load and as a result people get bored and play the next game mostly because I think they assume the game froze.
Its only an issue for new players, as I believe Roblox must have a process to cache players favorite games because returning players load in pretty fast 10-15 seconds.
The way I have it setup is to load in everything and then start the game, which is bullet proof, but it is resource heavy. (Streaming off)
I have also tried streaming on but often even if I tell the game to load in essential assets first then start the code it can randomly not do that and start without essential assets which causes the code to silently fail about 20% of the time and work 80% of the time. The main pro is that its fast and does the job but the main con is that it isn’t bullet proof like my first method.
I have tried some alternative approaches where I move decoration type assets to replicated storage and then clone these in after the player loads in but they seem to load in nearly instantly, so I don’t think I have that setup correctly or maybe it’s not a valid solution to my problem.
I feel like I am either doing something very small incorrectly or I am approaching this problem the wrong way
Anyway, I just wanted to see what the pros do in this type of situation.
My Plan B is to add a load bar which would help new players at least know it hasn’t stalled but ultimately, my preference is to find a way to get players in game within 20 seconds on their first login.
Many thanks for any suggestions or best practices that you can recommend!
I’m assuming you’re putting every single objects in the game and even BaseParts that are simple enough in the loading table, if you clearly iterated everything with no filter then chances are that it’ll go forever if it’s in for loops yielding every frame which is often the reason, some games I’ve played tend to do this, even with a gaming beast PC, it took me 5 mins despite it being a small game to load
incase loading bar suddenly froze, most game would often have the skip button since it’s 50/50 for the game to be fully loaded
one that i would recommend doing is to only LOAD things that had asset id property in the class that begins with “rbxassetid://” as it’s header (e.g MeshPart, Sounds, Images etc.) it’ll reduce the amount of objects needed to load
and if you want the fastest way possible, load only the “asset id” that isn’t the same as before
Make sure the game loads the things players actually need to play first, then bring in decorations and other big assets afterward. Things they can’t see at the moment or get to right away are always good candidates. Preload the essential stuff so the game can start quickly. Strategically placed task.wait(?)s and rs.Stepped:Wait() can direct a few controlled loading bursts. There are also many object properties you can optimize for performance. Default parts start out set to maximum drag.
Many thanks to 2112Jay and Mylo pankii_kust with your input I was able to refactor my code to get load time down to 40 seconds for new players and 7 seconds for existing players. It used to be nearly 2 minutes.
Biggest wins for me :
The water around the lobby was chunking resources pretty heavily. I deleted about 30% of the water area and replaced with glass blocks that look almost the same.
I moved lots of fluff assets to replicated storage , loaded in the essential assets first , loaded the player in and then loaded the fluff assets in after. The fluff assets take about 30 seconds. This gives some small mini lag spikes so ill try to tweak it to get to a sweet spot. Maybe ill bring in smaller batches of assets or ill try to stream them in. But im getting pretty close to a decent result, once again thanks for all the help!