It's common to have long-living Instances that are passed through the network, but that can be deleted, like maps, vehicles, or enemies. Because of event batching, the server firing a Zap event referencing an Instance and then deleting it can result in the event trigger being dropped because the Instance no longer exists.
While optional Instances exist in Zap, and are fine for things like particles on weapons, they're not suitable for cases like this:
A round in a game ends.
The server fires an event to all clients telling them this.
The server deletes the map.
Because deletion replicated but the Zap event trigger didn't yet, other client code doesn't know that the round has ended, and continues assuming the map exists, causing game-breaking errors.
The client can't simply end the round itself if it notices the map is unloaded, either. It doesn't know who won, what the score was, why the round ended, or any other information that any round-ending code would expect.
Pros:
Default options don't lead to incorrect or very awkward code. Developers can trust Zap to provide a reliable interface for games of any type or scale. What's intuitive works. Developers can write code with the same order guarantees they'd get from normal RemoteEvents.
manual_event_loop = true works exactly the same as it did.
Costs:
A few extra lines of generated output.
One extra export.
Developers could wastefully call the function, ignoring the new documentation comment that implies there's an automatic alternative.
It's common to have long-living
Instance
s that are passed through the network, but that can be deleted, like maps, vehicles, or enemies. Because of event batching, the server firing a Zap event referencing anInstance
and then deleting it can result in the event trigger being dropped because theInstance
no longer exists.While optional
Instance
s exist in Zap, and are fine for things like particles on weapons, they're not suitable for cases like this:The client can't simply end the round itself if it notices the map is unloaded, either. It doesn't know who won, what the score was, why the round ended, or any other information that any round-ending code would expect.
Pros:
RemoteEvent
s.manual_event_loop = true
works exactly the same as it did.Costs: