Synced lists aren’t officially a thing. Is there any way to keep lists easily synchronized between all players?
Would already seem that using an Event Sender and an Event Receiver, lists can be sent to all players in the room, with the data still be in order.
Is there a certain List< (x) > that it’s not returning results in order?
Pressing the set button on either player in the room, generates 78 random big int variables, puts it 3 times into a string, along with it’s iteration appended to the end of the string, added to the list, then sent to the event sender.
Trying to do anything more, does seem to hit a Network Heat limit, in which you’d want to share your usecase, see if theres a way to change it to optimize it.
Then either player presses the read button, with the button’s component board configured to run on all players, instead of just the local player that pressed, individually and slowly, one by one, go through the array provided from the Event Receiver every second, to output the next in the list every second, as the Log Screen is sync’d and would hit ‘Sending too many RPC’s’ error if using a For Each chip. (please recroom offer a slowdown on for each, or offer a way to configure chips to wait till they can run, not stop and error!)
And on the log screen, all players received the same array, in order.
The circuit graph below will sync a list to all other players in the room (event sender configured to “others”) when the list is updated.
From what I understood in @Nixxxxxx’s post, it’s just an event sender and receiver. Although I’m like 99% sure that the list will remain in-order when an update is received so I don’t think that’s something you’ll need to be concerned with.
It seems like this is by far the best and simplest solution to syncing lists.
The caveat with syncing variable lists, is you need to manage a few things with your circuit graph’s to prevent heat errors and overwrites.
Some extra tips when doing this:
- Only sync when you think you’re circuits will need it. As shown in the image, the variable will only sync if you send out an event to sync it with other players.
- Keep your sync event updates minimal. Less than 10 per second should be fine. (String lists are the largest kind of packet to sync, they can take up in some cases 2.62 megabytes - if you use all 4096 string elements!)
- Don’t connect another event sender to the receiving end of the String List variable, this will create a feedback loop and kill your NET heat. - Add a delay somewhere to mediate this.
- Expect overwrites, since there is always a delay between players devices you will run into you’re list being incorrectly overwritten sometimes. - This already happens with regular synced variables, but RecRoom hides these inconsistencies rapidly. (This is why clicker games with poorly synced variables struggle to correctly make the number increase when many players are clicking it at the same time.)
Other than that, it should “act” like a regular synced variable. Hope this helps, and sorry for the lengthy reply.
Thanks so much!