A Boomtown rank-up and a tower's step up grow in place from the old height, by a grow-from fraction in the instance texel #145
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "task/3789-a-boomtown-rank-up-and-a-tower-s-step-up"
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: #3789
Step 3 of plan #3561. A Boomtown rank-up, and a monument tower's step up, now grow the drawn building from the height the old version stands at to the new version's height over the whole rise, never from the ground (D5, D6, D11). Until step 4, a reduced-motion re-model still swaps at once and a tower's step down still re-rises from its base, as on main.
What changes
max(0.02, mix(fract(animTexel.y), 1.0, curve)). The slot channel's fraction is the share of its height the instance grows from; with 0 it is main's rise. The defines and the program cache key stay, so no program is added.InstanceAnim.setwritesslot + from,setSlot(and sofadeBy) keeps the fraction, andrisewrites a rise start with itsfrom.riseScale(start, from, clock)is the program's CPU mirror. life.ts'srisenmoved here, and life's spinner poses a building's moving parts by it with the placement'sfrom.placeandrisecarryfrom. Moving parts still stand built.modelHeight(key)is a building version'slookHeightor a tower'stowerHeight(step).Placementholds itsfromand remembers the version that stood (stood: model, rise start andfrom). A version that begins its rise is remembered as it begins. A version that stands at once (every placement of a city first presented, a monument first shown, and a reduced-motionbegin) is remembered at full height. A re-model whose new version has not yet begun its rise or stood keeps the memory.modelHeight(old) × riseScale(old start, old from, clock) / modelHeight(new)where that is below 1, and otherwise from the base. The monument takes the same path, so a tower's step up grows. A new placement in a city already laid rises from its base with its cage, as on main. A tier step places the instance with the placement's start andfrom.beginran inpresentorworkand took the clock of the frame before, so a building's first drawn frame was already one frame into its rise (k = dt / 1.1). A rise begun there now starts at the next frame's clock, so the new version's first frame stands exactly at the old height, and a building rising from its base exactly at 0.02 of its height.placein a batch drawn in view, orshowAtwhen its batch comes into view), so a rank-up made out of view grows when the city is next seen, from the version that stood in view before it. Thestartedhook ofTierLayer, which only this path used, leaves.beginRisesstarts it in a batch the city draws in view that holds its model, Full or Mid before Far, so its cage goes up. A rank-up placed on a zoom-in fade's last frame therefore grows from the old height, with its cage, once the fade settles.Life.looksets each town live (in view, its monument tile in sight) at the start of the layer'sanimate, beforebeginRises, andLife.framereads it. So a rise that begins on the frame its city comes into view raises its scaffold cage.rankupscene. At stage time, before the host's first push, it sets the held city's roof building to&rank=(1–19, default 9) and takes the building nearest it out of the layout. At the death's time its cue installs a new layout object,{ ...layout, buildings }, with the roof building at its next rank and a rank-1 building on the emptied plot, then syncs the game's blocks. The Stage'scitytype widens to the wholelayout: CityLayout.Tests
riseScale(start, from, clock) × modelHeight(model)from the still instance's start texel and its slot texel's fraction:frombelow 0.98;towerHeighton its first frame, never below it, with a cage;from, drawing the same height on the same frames, and afadeBykeeps the fraction;towerHeighton its first frame with no cage.riseScale× their pivot on every frame; a building a rank-up grows keeps its lights off until its growth ends.rankupscene in every finish, with and without reduced motion, with no WebGL or shader error and no program added from before the rank-up to the scene's end.from0 fails the first-frame check (1.205 tiles off) and the tower's case;placeremoves the old instance from a batch not drawn in view fails the out-of-view case (and every other growth case, since a watched city's Far batch is such a batch);from0, start = clock − k_f × RISE_SECONDS) passes the first frame but fails the climb: it reaches the new height by 0.18 s;setSlotwriting the bare slot fails the fade-slot case alone;beginRisestaking the last batch the city draws, Far included, rather than Full or Mid first, fails the Far-to-Mid fade case alone.21673c8and of this head ran a rank-up presented 0.005, 0.02 and 0.15 s before a zoom-in fade's end (Mid→Full, Far→Mid and Far→Full, with the new variant built beforehand or bywork), then a zoom back out, and a rank-up at Full and at Mid as the city comes into view. On this head every case draws the old height (1.5076) on the new version's first frame with its cage, never draws below it, has begun its rise and remembers the new version 3 s later, and stands at its new height (1.6544) through the zoom back out. On21673c8, 18 of the 20 cases failed: each fade-end case drew 0.0943 with no cage and never began its rise; the 0.15 s cases into Far→Mid and Far→Full grew with no cage; and both view entries grew with no cage.Draw checks
The Map Yard bench (src/bench/map.ts, WebKit, iPhone 15 landscape) ran on m5 with 8 arms in one
map.ts 7 …call per session: base3d7dd93and head03c5436at rest and withgrown=full, and the head's?doom=battle,battle&spare,nukeandnuke&spare. 5 sessions, 840 pages, 22:35–23:38. Both arms were built fromgit archivetrees and served by vitepreview(). Another project's gate (ansxbuild at about 99% of one core) ran throughout.03c5436change only when a rise starts, not what draws at rest. The review of21673c8benched it on m5 against the base, 4 arms (base and head, at rest andgrown=full), 5 sessions × 7 runs, 420 pages: the same calls and triangles in every load, and paired head − base +0.000 / +0.003 / +0.003 ms at rest and +0.000 / +0.003 / −0.003 ms full. The two commits after21673c8change only which batch a queued rise begins in and when a town's liveness is set, on the CPU. One load per view of21673c8and of the final head11e5cacon s32, with motion as the bench loads it, drew the same calls and triangles: 68 / 65 / 41 calls with 336,400 / 415,516 / 518,984 triangles at rest (21673c8drew 336,480 at 1×, one smoke puff), and 68 / 66 / 42 calls with 463,939 / 526,887 / 668,691 full.present0.100 → 0.114 ms, the variant's build 0.484 → 0.448 ms, and 40 frames over the growth 0.363 → 0.446 ms (+0.002 ms a frame), base → head.Renders for the Reviewer
The Wreck Yard's
rankupscene at?mode=frames&frames=-0.1,0.02,0.1,0.2,0.3,0.45,0.6,0.7,1.2in Die-cast, Toybox and Micro-voxel, at the default zoom and at&zoom=3, with no page error and no program added. In every finish the watched building (rank 9 → 10) draws its new version squeezed to the old version's top on the 0.02 frame under its cage, and climbs to its own height by 0.7 s. The rank-1 building rises from its base on the emptied plot. Adding that rank-1 building lowers the city's median, so the monument's tower steps down and re-rises from its base, as on main until step 4. At&rank=1,9and19in Toybox, frames −0.1 and 1.2 show the same family's ground plan before and after. Classic swaps at once at 0.02, as on main.Play
The esbuild bundles of src/ai/sim.ts and src/bench/net.ts from the base
3d7dd93and the head11e5cacare byte-identical (sim a3c510e5…, net 4ffd0007…), so the 14 AI matches andnpm run benchwere not run.Gates
sak-gate fast(tracker gate run 365) on03c5436: passed,npm test986/986.sak-gate full(tracker gate run 372) on21673c8: passed,npm test996/996 andtest:phone181/181, the rankup phone test included.sak-gate full(tracker gate run 397) on11e5cac: passed,npm test999/999 andtest:phone181/181.changelog.md and the in-game help are step 6's, for the whole plan.