Did Change Events for players joining after model has been changed.
So lets say I have a Realtime component with a model. I change some values on that model and the RPC goes off to notify players that a model value has change. Now lets say a new player joins the room after the rpcs have been through current players. Do they just get a single callback to bring them up to date with the current model value or do they receive multiple callbacks for every time the model changed? or None at all.
2 Replies
Hi @RonJames. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
When a new player joins a Normcore room, they receive the current state of the datastore, which includes the latest values of all models. They do not receive a replay of all previous change events or RPCs that occurred before they joined. Instead, the model is populated with the most recent values, and only a single callback (such as
- Late joiners receive the current model state, not a replay of all changes. - They get a single callback to set up their local state, not multiple callbacks for each historical change. - Model change events will only fire for changes that occur after they have joined. If you need to initialize something for late joiners based on the current model state, do so in
OnRealtimeModelReplaced
) is triggered to bring their local state up to date with the current model values.
If you are using model change events (e.g., property change events or custom events in your model), these will only fire for changes that happen after the new player has joined and their model is set up. They will not receive callbacks for every historical change—just the current state and then future changes.
This is explicitly why Normcore recommends against using RPCs for state synchronization: late joiners will not receive those RPCs, and any state changes that happened as a result of them must be manually synchronized via the model. The recommended pattern is to always store the current state in the model, so late joiners are automatically brought up to date when they join, without needing to replay a history of events or RPCs. One-shot effects (like particle bursts) that do not need to be seen by late joiners can use the RPC-like event pattern, but persistent state should always be stored in the model for this reason Recipe: RPC Events, Room > Room > RPCs.
In summary:- Late joiners receive the current model state, not a replay of all changes. - They get a single callback to set up their local state, not multiple callbacks for each historical change. - Model change events will only fire for changes that occur after they have joined. If you need to initialize something for late joiners based on the current model state, do so in
OnRealtimeModelReplaced
or similar initialization logic RealtimeComponent.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@378869779668140042> Kapa.ai is still learning and improving, please let me know how I did by reacting below.