A launched nuke reveals where it lands to every player #142
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "task/3560-a-launched-nuke-reveals-where-it-lands-t"
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?
Tracker: #3560
From a nuke's launch until its blast's animation ends, every player sees the ground round its target as if a unit of theirs stood there. The server sends what stands there to everyone, every player's units may target it, and each client lifts its fog there. What it showed stays explored afterwards.
One shared rule in
src/shared/nuke.tsgives the disc and the window. The server's sight, combat and the client's fog all read it.REVEAL_RADIUSof the impact. That is the blast's widest drawn ring, at 1.35 × BLAST_RADIUS ≈ 13.36 tiles.BLAST_SECONDS(15 s) after the landing, 25 s in all.BLAST_SECONDSis the client's formerNUKE_AFTER, the time by which the blast's effect is gone, now one shared constant. The fallout's 90 s is not part of it.Steps
npm run bench.?fog&doom=nuke.Decisions (each overridable by Agra)
tick < due + BLAST_TICKS, on the server's tick and on the client's local tick alike. The effect is disposed of at the same seconds, so the reveal holds through the effect's last drawn frame.Acceptance walk
At
bc281f2against maind4a6158. Its tree is the tree step 3 was reviewed and benched at (9ffb2a4).due + BLAST_TICKS − 1. Both get UnitHidden for it atdue + BLAST_TICKS. A tank 14.56 tiles out is in neither replica at any tick. nuke.test.ts's reveal test has a third player's Artillery target the tank and fire on it through the window and hold fire after it, with a no-launch control.liveandexploredtextures for two clients: seen over the disc throughdue + BLAST_TICKS − 1, explored fog fromdue + BLAST_TICKS, and nothing lit past it. Mutants ofrevealingin whole-tree copies:<=for<andBLAST_TICKS − 1forBLAST_TICKSeach fail it. They also fail the host, combat, save, rule and replica tests. Dropping the reveals fromfogFriendsfails it too.BLAST_SECONDS/BLAST_TICKSin src/shared/nuke.ts are the only window. render/nuke.ts disposes of the effect and fades the cloud byBLAST_SECONDS, andNUKE_AFTERis gone. Disposing of the effect 1 s later fails nuke.test.ts's three disposal tests.ServerHostinto a Replica, a Fog fed byfogFriends, and a NukeLayer posed as main.ts poses it, at draw phases 0 and 0.99. The sides were the launcher, a viewer, a spectator of the viewer and a player joining atdue + 10, with frames on time and 3 ticks late.due + BLAST_TICKS − 1, and explored fog fromdue + BLAST_TICKS.replica.reveals()matchedgame.reveals()on every tick once the frames had arrived.− 1mutant it drew one tick without the reveal, and under the 1 s mutant 30 ticks.npm run bench(battle, economy, cities and churn at 128 and 256, seed 11, wan) is identical to main in hash, gameHash, commandHash, commands and every client's raw and deflated bytes.?fog&doom=nuke(88, 86 and 72 calls).sak-gate full#1 (tracker gate run 300) atbc281f2passed:npm test980/980 in 65.4 s,test:phone180/180.