Streaming in/out causing massive lag spikes

On my game, i have a large map with detailed buildings and locations, and I utilize streaming enabled to reduce memory and optimize the experience, however doing this causes some massive lag spikes when streaming in or out parts of the map, causing for a very unpleasant experience, meaning i cannot utilize streaming.

Repro file and steps are contained in staff message

Expected behavior

I expect streaming in and out parts of the map to be smooth and not heavily impact my framerate.

A private message is associated with this bug report

9 Likes

Band wagoning ontop of OP

I have an, arguably, drastically more detailed map than what OP has - as we have a 1 to 1 recreation of a city in Kyoto

The streaming in/out lag spikes is jarring, and doesn’t align with any other AAA engine platform standards. I had assumed this was always just intended functionality, but seeing other bug reports, wanted to jump in

Here is a video of myself using our taxi system in our, marginally, outrageously detailed map. And, as you can see, the lag spikes are almost entire frame stops:


Our game typically uses VisTools to fix areas where engine fails on optimization, I’ve disabled it for the sake of the above video

For the sake of the video, I also lowered our streaming radius. I have it relatively large right now to mitigate the streaming freeze frames, but my ideal optimization route would be streaming having a lower target radius. Which just isn’t possible as is. My ideal radius for such a detail-heavy map would be about 145, but I have to have it at around 1024 so that the game doesn’t completely freeze frame

I really wanted to keep streaming radius as low as possible as, in principle, a low streaming radius would allow for a way more optimized experience with much less assets loaded. But as you can see by the literal freeze frames, it does more harm than good

My hope is that perhaps this gets better with Slim? But if this is not intended functionality with streaming, it is REALLY bad

This seems to be an inherent design flaw with instance streaming.

When stuff gets streamed in, you’re having to download all that data so you get Replicator ProcessPacket spikes because of all the new instances being added, on top of the fact that you’re likely having to build those instances as well.

So each time things stream in and out, you’re having to process a bunch of packets and create/destroy instances.

1 Like

@CorvusCoraxx This is still being a massive headache for us, any insight or ETA on a fix?

1 Like

We are investigating what can be done to improve this and reduce frame spikes when instances stream in. Unfortunately I don’t have an ETA on any potential improvements.

1 Like

Are improvements towards lower streaming radiuses one of the issues being looked into?

As displayed above, detailed experiences would benefit greatly from a lower streaming radius – but that is literally not possible in its current state

1 Like

Sorry, why is using a small value for the min or target radius not possible for you? It isn’t clear to me what is happening in your video. What value of min and target are you using?

Do you have streaming integrity mode enabled in your experience? If so what mode are you using?

In my video at 00:27 you will see the video completely freeze. This is NOT normal for us and ONLY happens when streaming is set to a small radius. To stop the intense freeze-frames, radius must be set extremely high or to a point where the radius is large enough that you don’t feel the streaming in/out

Our ModelStreamingBehavior is Improved, and StreamingIntegrityMode is PauseOutsideLoadedArea. StreamOutBehavior is Opportunistic

Our ideal radius would be like 124 or 250 ish. As explained, my game is INTENSELY detailed. For such a detailed map, best performance would come from a miniscule streaming radius

However, it is literally not possible to do a radius that small due to literal freeze frames (see video at 00:27). To completely counteract this and stop all freeze framing, the radius (same settings) is set to min 825 and target 1024

@Varyndor is your place publicly accessible? If so can you share a link? If it is private can you give me access? I’d like to see what is going on in your situation.

Are you open to DMs so I can get you access? It’s currently in private beta - so I have to get you dev access

Edit: DM’ed you

image
image
image

this engine is so good! the issue is present on literally any platform, even consoles.

1 Like

@CorvusCoraxx Any proper solution in-development on this or insight?

1 Like

I’ll tell you what, these 50ms frame time spikes are opportunistic for sure!


OpportunisticSpikes.rbxl (113.5 KB)

1 Like

We’ve recently (in the last couple weeks) rolled out an improvement to limit how long we spend in the ProcessPacket scopes. This should help significantly with this problem. Please try the scenarios you reported again. We believe this reduce the frame spikes, but it may not completely eliminate them.

2 Likes

Hey! The improvement does seem to have helped quite a bit, overall I am getting less lag spikes then I used to, however I still occasionally get large lag spikes (10+ ms)

This is on the same game as before too

Can you share that microprofile? (Or a microprofile showing the lag spikes)

can’t drag and drop the microprofile dump in here for some reason, so I had to zip it, but here:
microprofile-20260508-092135.zip (2.9 MB)

you should be able to easily find a 25+ ms lag spike in there

1 Like

Thanks again for reporting this and providing a repro place. We have some improvements in the pipeline that should help with this, and some longer term work under development.

1 Like

Streaming continues to have the same problem; I even found this link on the forum while searching for it, and since I still have something to report, I preferred to use this post as it discusses the same issue.

I would say that Opportunistic mode ends up being the best for optimization, not only for RAM but also for CPU/GPU. The problem is that the way Streaming works seems to send all instances, and the client only does this within the same frame. I believe that if the instances were inserted into a table and a loop with 33ms (30fps) was performed, it might be smoother, also prioritizing the rendering of instances closer to the surface rather than those further behind.

I also want to add about Streaming that even using identical assets already present in the game, the lag spike is very high. Since games usually use cloned assets, I don’t know if Streaming is creating a new instance as if it were unique, but it would be interesting to analyze whether cloning an existing object wouldn’t be more performant, since the object itself would already be in memory. (I’m not an expert in optimization, but I believe this makes sense)

Edit: I also want to add that Streaming seems more like a “Chunk” style where a piece of the map is sent via Streaming, and this seems terrible because the game seems to create all the instances and insert them into the workspace all at once, unlike when the piece is being removed from the Streaming, which seems to be one by one, much smoother. I would say that instead of storing the parts in some table and inserting them all at once, the engine should insert them one after the other, because even if the FPS drops a few percentage points, it doesn’t generate this lag spike/freeze in the frame.

This video demonstrates that the problem with Streaming is during insertion, as it throws all the parts into the workspace at once, unlike when removing them. If insertion were as smooth and dynamic in FPS as removal, we would no longer have lag spikes with Streaming.

1 Like