Streaming mode, really the best choice?

Hello ^^
Im LetsGoLolly and im trying to make a game not lagging hard for all devices.
its a clicking game
Ive been runnning into some issues with Streaming mode.

  1. What do you want to achieve? I want to find out a good way to make a game im working on not to start lagging

  2. What is the issue? When using Streaming mode, parts that are included in a loop are returning an error, because they have not been found

  3. What solutions have you tried so far? Disabling Streaming Mode for now

Note: I have been thinking about hiding parts / Islands (that are not included in an active Loop),
that the second island over and under you setted to replicatedstorage, so they dont get rendered

Should i concider to enable Streaming Mode, or should i do the island render thing (= see note)?

and if i should use Streaming Mode, is there a way to fix this issue?

I wouldn’t recommend using streaming enabled unless you’re skilled at scripting, while it does offer superiour perofrmance, it requires you to check for objects you want to access so they even exist and wont return nil/error. You mentioned its a clicking and island game, I don’t want to underestimate you in any way but I honestly doubt the lags are caused by the size of the map. However, I have three solutions for you:

First: You can change the streaming behaviour of model objects to be persistent, aka to never stream out and always be loaded in. In this way, if you set all the needed objects to persistent, you will be able to run on streaming enabled without running into any issues.

Second: Disable streaming. You said you have many loops in the game, I would recommend to absolutely avoid loops unless necessary. Having events and functions connected is much better and reliable. I would also revise all the current code and check for its performance, and optimize whatever you can.

Third: Enable streaming. In this way, you will get many errors, and you will need to focus on scripting a lot. I recommend using Collection Service to check for the objects if they are currently streamed in or not, and then just skip any action you’re doing in the loop in case they are not currently streamed in.

1 Like

check the documentation for more info if it helps
my take: maybe when your loop tries to find a part, the part is streamed out and is parented to nil.

yeah about the second one, i use loops for touch detection, as example the index’s. There are more than 1 part that register if the index has been entered by the player, so thats why i loop them trough. Should i stay it like that or is there a better way (and yes i use functions)

What do you mean by looping through to check if they have been entered by a player? From what I can understand, you use a touched event to register that? Then just connect all of the parts into the same function under one script, that will process the event and do whatever it needs to do

yeah thats what i did, the parts use all the same function. Thanks that you helped me ^^

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.