What do you want to achieve? Hello, I need help with a script I made. You can see on the video below the concrete example on my game (20 seconds video).
Explanation: I tried to recreate StreamingEnabled in my way because it allows me to break almost no script and better optimize the rendering of the map manually. However I would like to know if I can do it better.
My process: When the camera is at a certain distance from a “ExamplePart”, then a file (of usually 800 parts inside) is parented to the replicated storage, when the camera approaches the “ExamplePart” then the file in replicated storage returns to the map. I would like to know if there are better ways, if putting the objects in replicated storage is a bad practice.
Or should I go about it in some other way to reduce latency? I specify that the scripts are optimized, it’s the huge number of parts that causes problems. Thanks
Depending on what kind of map it is there are certain optimizations you can make. For indoor (or even tightly modeled outdoor) maps, you can break your map into a graph based on potential visability, this is a long-standing feature of the Source engine and many others: Source Engine Visleafs Explained - YouTube
For open world style maps the problem is harder as a player can get into places where a lot of items should be visible, most open world games have visible “pop in” as a result, especially when players are high up or moving at speedrun speeds. Games like Skyrim try to break detailed areas into their own hidden “indoor” section to limit this issue. This is why cities in Bethesda games are almost always walled and have a loading screen to get in.
Hello, thank you for your answer. Indeed it is a similar mechanism (largely simplified and easy to do), but I wonder if placing sometimes up to 20 000 parts and more in replicated storage could not be done in another way? Like for example store all the map in server storage and use the map files that are stored to put them back on the map (which induces that I remove the map and replace it by the new one in server storage instead of putting a build of the map in replicated storage and putting it back in the map). I don’t know if u understand what i mean my english is not very good . Thank you
I don’t think there’s a good reason to move things between ServerStorage and ReplicatedStorage, mostly I think it will place any delays due to loading in weird and hard to predict points in time. ReplicatedStorage seems to be the accepted stagin area for things that the client needs but either don’t go in the workspace or aren’t ready to be there yet.
Yes, but I can’t reduce latency if I don’t store the buildings somewhere ? Indeed when they are on the screen the game has to constantly render them and when players with lower end devices look in a certain direction or are in the middle of the map, the latency is huge. I tried Streaming Enabled and it gives the same result as my script in terms of latency except that it destroys all my scripts and I can’t have control over what is not stream. I precise that with the script the latency is reduced of 80% for lower end device and they can play it.
But I’ve seen very, very large games with lots of terrain that don’t lag much on lower devices and I don’t understand how they do it (while mine seems to be less large but the latency is incredibly high)
Have you made sure the latency is from rendering. Also since you mentioned your english, usually latency eclusively means network related delay, slow rendering would be referred to as “low framerate” or “stutter”. Either way you can check these with the built in profiler, which will give you a graphical breakdown of how time is being spent. Try it from a few different locations in your game.
I’m 100% sure it’s related to the number of parts on the screen. I don’t have any infinite loops in the game they are all triggered when needed, no infinite tweenservice. The lags are horrible when the player has the whole map to render in the game (i.e. when the player is at a certain position and looks at certain places, where the parts are concentrated). They are approximatly 30 000 parts in the game. I would also like to point out that the game is perfectly fluid on not old devices. Here the link of the game if u want to make you an idea (24) Find The Simpsons [199] - Roblox