Repository navigation
Cash limit, plan steps that keep purchases, island stats and building prices - #13
Merged
Merged
Conversation
A cash limit on Setup's Buildings tab (and --cash on the CLI) caps what turning the board in Edit into the layout may cost: net spend, buildings bought less refunds for buildings sold, moves free, copies on every island counted in the price. Net spend is a sum over building types of a function of each type's count, so it is tabulated once per island and folded into layoutHolds (renamed from planHolds), which every gate already calls. stabilize trims an over-budget layout to the cash, the walk refuses an over-budget move before simulating it, the standing board competes as a seed at no cost, and buildings the cash plus every refund cannot buy one of are dropped up front. One budget couples every landmass, so a budgeted run is one island and Solve all is hidden while a limit is set.
Selling everything and rebuilding was taken whenever it was fewer steps, which sells every building the layout keeps at a share of its price and buys it back at the next copy's - enough to put the steps over a cash limit the layout itself fits. It is now only planned when nothing on the island survives into the target, where it costs the same as the walk. A move onto a tile another mover still holds is a swap, as the game allows, so moves never block each other and the parking tile and the sell-and-rebuild fallback are gone, with the free-tile list behind them. A swap draws as two arrows side by side, and step mode drops the fill gauges as well as the state and anomaly icons.
…ame run A fresh code from the same run - same anomaly and balance, the same Time Lab levels, the timeline carried on rather than restarted, the islands making at least what they made - is only catching up on progress, so the target and the plan set against the last one stay. Anything else is a new situation and clears both, as before.
- The building ribbon and the Buildings tab show each building's next-copy price, base price and copies built across every island, priced with the last import's research. - Island stats (overflow menu, and a button under the island list): power, solves worth building ranked by power per cash, idle and overheating buildings, free grass, obstacles left and cleared, the next clear's time and the time to clear everything, the next island's price, every building's count and rebuild cost, and a card per island with its mix and power per building. Shore share only shows under Tidal. - The island list shows each island's power where it said "Modified". - A share code drawn on a shipped map can be imported onto that island, behind two presses, as well as into a new custom slot.
…tter The limit is now kept everywhere a layout can reach the board, not only in the search: - The per-island pickers are hidden under a limit: one landmass from each of two boards that fit it may not fit it together. - Tied layouts rank by spend from the board standing, as the engine ranked them, in IslandBest, buildSolveVariants and chooseSolveVariants. - A held layout is checked with fitsBudget, the engine's own tolerance, and the one on screen is found again after the filter instead of followed by an index into the unfiltered list. - Move steps under a limit never need more at once than the change costs net: a sale that pays for a build comes first. - stabilize strips offline producers before trimming to the cash, and greedyPolish re-tries moves it refused for budget once prices move, and checks the budget before simulating. - A budgeted launch is dropped if the island changes while its inputs are read, and reads the other islands' counts from the timeline's memo. The field: focusing and leaving no longer rewrites the limit to its 3-figure display, the keyboard takes ladder suffixes on iOS, and a figure under half an hour of income (all islands' power, 3 s a tick) is refused. Also: Import onto an island only carries over that island's solve; a re-import after a Time Jump clears the target and plan even once the new run passes the old figures; the spend rule has one implementation in the package (countsSpend), which changeSpend calls; terrain is no longer re-scanned when a building is placed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cash limit
--cashon the CLI) caps what turning the board in Edit into the layout may cost: buildings bought minus refunds for buildings sold; moves are free, and copies on every island count toward the price.layoutHolds.stabilizetrims to the cash after stripping offline producers, the walk and polish check the budget before simulating, the standing board competes as a free seed, and buildings the cash can never buy are dropped up front.fitsBudget, which uses the engine's tolerance.Plan steps
Island stats and prices
Testing
npm test(1162 passing),npm run check,npm run knip,format:check,build:solverall clean.fitsBudget, a carry-over limited to one island, and a re-import after a jump.