When we receive an update for an object we don't know about, we create it. This handles the case where we may have joined the session while other objects are already in-flight.
Now with the snapshot interpolation, there are issues where a missile destroy message is processed, but a buffered update message for the missile is processed after. This results in the just-destroyed missile being re-created.
Proposed fix:
When a destroy message is received, mark the missile or player for destruction and still handle the destruction in-game. In other words, play relevant destroy animations and/or sounds and then hide the node(s).
During updates, check if the object is marked for destruction. If it is, do not process the update.
If the update message's sequence number is more than the buffer number of frames old, it means the buffer has been cleared out and we can finally destroy the object.
When we receive an update for an object we don't know about, we create it. This handles the case where we may have joined the session while other objects are already in-flight.
Now with the snapshot interpolation, there are issues where a missile destroy message is processed, but a buffered update message for the missile is processed after. This results in the just-destroyed missile being re-created.
Proposed fix: