fix/per-tick-run-and-rebuild-effects #72
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/per-tick-run-and-rebuild-effects"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
A viewer whose scene rebuilt on a given tick was sent no zone effects for that tick at all. The reasoning behind the skip was right for replay and wrong for the present: an effect is a moment, so there is nothing to re-send in one that has already happened, but the effects of the tick being encoded have not reached the client yet. Dropping them loses a projectile or a hit graphic for exactly the player who crossed a zone boundary while it was in flight — which reads as a netcode fault rather than as a missing branch. The distinction needed no new state. World.ZoneEffects already keys {tick, region}, and zone_updates/3 only ever reads the bucket for the tick it was asked to encode, so the replay the skip was guarding against cannot arise: sending them is simply correct. What the rebuild branch does have to get right is the base. Everything behind a rebuild packet is addressed against the scene the client is about to build, so the zone reads now take the scene zone rather than helping themselves to player.scene_zone, which on a rebuilding tick is still the old one. Both region set and set_zone prefix come from the new scene; the assertions check the old base is absent, since the two encode to identical bytes but for that prefix. Costs nothing today — only ::proj and the bench harness emit effects — and closes ahead of combat, which makes it per-attack-per-tick. Closes #59.