A structure goes up over trees and fells them #130
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "task/3609-a-structure-goes-up-over-trees-and-fells"
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: #3609
Step 3 of #3558 (D1, D9, D11). A land structure may stand on Tree tiles, and placing it fells the trees under it.
What changes
Game.placeBuildingfells every Tree tile under the footprint throughfellbeforespawnchecks the footprint: each tile turns to Land, loses its wear and joinsfelled().siteRankgains a second mark, and city ground weighs more than trees, so sites rank: off the given cities' ground felling no tree (0), off it felling trees (1), on it felling no tree (2), on it felling trees (3).preferredSitenow takes the site view and the domain, checks a site is open before it reads its rank, and ranks against every city and tree of the view.placeNearAnchor/placePreferred, the churn case's staging and remote tries, and the AI'ssiteNearall rank this way.fellingOftakes the frame's living units and givesFate.Goesfor a tile under a structure's footprint. It reads the units only for a tile the frame clears, since the forest andPropField.fellask for a felling once per tile. Trees under a structure the player cannot see lie as logs (D9), since that structure is not among the drawn units.Tests
preferredSiteranks the four kinds of site in order.felled(), and their wear entries are gone.placeNearAnchortakes a tree-free site off the city's ground at the anchor's last step over nearer wooded ones, and fells trees only when no step off the city's ground is tree-free, still keeping off the city's ground.fellingOfgivesFate.Goesfor a tile under a Factory's footprint andFate.Liesfor the same tile under a medium with a bullet's landing; the forest's and Classic's trees on such a tile go as they topple, with no log in the forest's lying index and no Kenney log atFELL_SECONDS.Play checks (base
16cad70, head bundles; seeded, run on s32)Math.randomseeded per match): every trace and summary identical to base.Draw checks (Map Yard bench, WebKit iPhone 15 landscape, 5 sessions × 7 interleaved runs)
The head's yard bundle is byte-identical when rebuilt from the final head. Pooled medians, ms a frame, with the phone estimate (7.5×) in brackets:
?doom=battleon base and head drew the same calls, and triangles within the arm's own run-to-run jitter.?doom=battlestill fells its trees, and they lie as logs, since no structure stands on them.clearGroundevery tile cleared since the last snapshot, but the forest andPropField.fellcallfellingonly for a stand not yet felled or a Kenney tree not yet hidden, so once per tile, on the frame it clears. The new unit scan sits inside that call.Gates
fullat8ab27a1(job 37, on a runner other than m5, vitest start 07:51:17) failednpm test870/873 in 46.1 s. Its only failures were 5000 ms timeouts in hud-css.test.ts (text contrast), craft.test.ts (two gunships landing in turn) and collapses.test.ts (no part scaled below 1). Run alone on m5 a minute later, these files passed in 0.96 s, 1.54 s and 2.21 s.sak-gate fullrun 1 passed on8ab27a1on m5:npm test873/873 in 15.6 s, andtest:phone65/65 in 193 s.sak-gate fullrun 4 passed on8ab27a1:npm test873/873 in 31.95 s, andtest:phone65/65. Runs 1–3 just before it failed with the same three timeouts, and the base tree failed the same way when run at that time.