intomo wrote:How many room variables is too many?
There isn't a set limit. It depends on many parameters:
- how ofter they are updated
- content of the variables (simple numeric values vs long strings or nested objects)
- game client (mobile vs desktop)
The most important aspect is how many of these variables are updated and how often. If you find yourself updating 20+ variables every few hundred milliseconds you might need to rethink your strategy.
Even in that case you should probably check with a network monitor to see how much bandwidth a single client requires.
I'm trying to save the game state so that if a user joins late they are in sync with everyone else.
What I think I'd love to do is just save a state object instead of individual persistent room vars.
The separate variable approach would be fine unless these values are changed super fast multiple times a second.
Can I save the struct with VariableType_Object?
No, but you could wrap those values in a single SFSObject which would then act as a single Room Variable.
The problem with this approach, however, is that every time you need to change one of the values of the SFSObject you would re-transmit the whole object to everyone.
I would probably opt for the separate values unless, again, these values are all updating super-fast.
Hope it helps