I have been developing a small game using Unity as the client. I downloaded your source code and it was working until I put about 400 world objects down. These objects do not move or update at all.
Now, when the player moves, there are huge lag spikes. I narrowed it down to line 180 in Room.cs (Patch function):
var newState = MsgPack.Deserialize<IndexedDictionary<string, object>> (new MemoryStream(this._previousState));
I believe this is because any time there is an update, it attempts to deserialize the entire state, when it only needs to actually deserialize the difference and apply it.
Does anyone have any ideas on how to fix this?
The only solution I can think of would be to have a different room for the static world objects so that they would not need to get serialized for every patch... this seems like a bit of a hack though.
I do realize it is expensive to load the world from the server, but I would like the world to be randomly generated and then sent to the player as they load sections. Is this possible with Colyseus?