So there’s a kinda big problem in my game for which I haven’t found a solution for a long time. For some reason some specific parts/models (always random ones every session) just aren’t being rendered at certain camera angles, which can give legit x-ray for players and possibly trigger epilepsy (it’s really flickery).
I thought it was that all the maps are in ReplicatedStorage, but when I transfered them to ServerStorage the problem still hadn’t been solved.
I’d be glad for any help provided! (also it doesn’t really matter if map is 2M tris or 50k, it just happens randomly, you can play whole 3 sessions and not encounter even one render bug, or the first map is just Nine Circles from geometry dash lol)
This is very reminiscent of graphics levels in your Roblox settings.
At lower values, the engine will start aggressively de-rendering objects.
Are you certain you’re not confusing this behavior with anything related to how maps can be loaded by a developer?
This isn’t replication related if the parts appear and disappear based on camera direction. There has been a bug for a while with occlusion culling that has had this effect, but it’s up to Roblox to fix that, there isn’t really anything developers can do.
I always have max graphics, it doesn’t matter if they’re low or high in this situation.
Also thx GPT/Claude
Hm, that’s kinda sad to hear. But why do I not encounter anything like this in any other games? Could it possibly be because of StreamingEnabled wasn’t enabled?
Right, let’s not disrespect developers genuinely trying to help you by assuming they’re using AI based on… the way I formulate my messages?
Totally unwarranted response to my serious question, and I recommend you do some research before making such claims.
In a game I recently worked on, there is a feature that loads in user-made clan structures based on data saved to the DataStore.
While not exactly the same, the performant solution I went for remains the same as what’s commonly done in popular games on Roblox, and when adjusted to your use-case amounts to something like this:
Retrieve the children from the map instance you want to load into workspace.
Simply recreate the map in workspace by iterating over children and individually cloning the children.
Based on your setup, you may need to perform recursion if you have deeply nested models with too many parts, but you should generally be fine by just going with direct children.
Every n children, perform a task.wait() call. For example, if you make it yield every 500 instances, it will clone and parent 500 instances within the same frame to workspace. Total execution time is fast, but you’ll be met with a lag spike, so keep the wait step low (e.g. something like 10). Experiment with an amount yourself to determine what yields the least performance hits while still loading in your map relatively fast.
I couldn’t reproduce the problem either, but this is not too surprising; the developers who posted examples of the bug here on the forums were only seeing it happen on very specific maps, usually involving lots of very large parts. I definitely got the impression it wasn’t the easiest thing to reproduce, and that it might require a really specific set of settings, level geometry, etc.
I dont think natural disaster survival actually gradually loads the map and instead just pastes it in and it replicates to the clients with a bit of throttling, if you wanted to gradually load in visually youd have to loop through all the parts and turn their transparency off to get the effect that the map is loading in slowly
I can be really dumb, but this sentence felt odd for me. I’m sorry if I can’t understand the exact context of it, nevertheless I’m not a native English-speaker : )
I was thinking of that kind of solution, I’ll try to do smth maybe it’s going to work out just fine. Thanks for a suggestion!
Sometimes I’ll still have issues with some objects. For them, I’ll set up a spot under the map that’s 100% loaded and ready. A type of workaround to preloading, an old-school way of doing it.
After I’m fully loaded, this plate gets removed. The objects no longer have issues being pulled in from ReplicatedStorage. These tend to be more texture related, but not always.
Also looks like a good solution! Although it may be that I would just copy and paste the whole map under original one, because I can’t point out a distinct model/part that’s flickering
Recently stumbled upon an old video showing exactly the situation I was referring to, so here you go: hundreds upon thousands of instances loading relatively quickly, with each model having logic attached as well. (Just to clarify, these are no meshes; it’s all BaseParts…)
logically, just name ur parts that way lol, for example, name all the walls 1, then smaller building 2, and final thing 3, then ur load thing does it by iterating
if u want to keep the names like Wall and etc,
u can do something like this
Wall_A_B where A is main layer, and b is seperate, like where u see the wall is being built one by one.
and ur code gets map parts, splits and sorts arrays and then u simply iterate { {Wall_1_1, Wall_1_2, Wall_1_3}, {Building_2_1, etc} } 1 2
You’re on the right track; gradually loading in a map is common practice for many games. Loading a large map all at once can cause a severe performance spike and/or crash which can affect your crash-rate analytics.
You can load a map gradually by looping through the children or descendants of the map and clone + parent them individually. Be sure to add a delay before each clone. In cases where you don’t want a tremendous delay you can use:
game:GetService("RunService").Heartbeat:Wait()
If that is too slow of a wait, only perform the delay after a specific amount of iterations.
-- This code only performs the delay if the iteration you are on is even
if i % 2 == 0:
-- Delay goes here
-- This code only performs the delay every 10 iterations
if i % 10 == 0:
-- Delay goes here
I tried to do this and it seems to work just fine! Thank you a lot!
Also I inserted this line of code CodedJack suggested. I have some maps that have over a 1000 models, they’re loading quite slowly, but it’s definitely worth it. When I was performance checking my previous system and this one, the old one was clogging Recv with ~20 KB/s, and now it barely reaches 2 KB/s!