fix: add water_treatment to simulation coverage loop#442
Open
flaviocarmo wants to merge 1 commit into
Open
Conversation
Water Treatment plants (water_treatment) do not provide any water coverage to buildings. The watered property on all buildings is always false, regardless of how many Water Treatment plants are placed or their upgrade level. This means building efficiency is permanently capped at 50% (powered only), halving population and job output. Steps to Reproduce 1. Start a new game or load a city 2. Place multiple Water Treatment plants (I tested with 24, all upgraded to level 5) 3. Open the Water System overlay 4. Observe: the entire map is shown as uncovered (red/dark tint on all tiles) 5. Inspect any building's state: building.watered === false Expected Behavior Water Treatment plants should provide radius-based water coverage to nearby buildings (similar to how Power Plants provide power coverage). Buildings within range should have watered: true, which would increase their efficiency from 0.5 to 1.0, doubling population and job output per the formula: efficiency = 0.5 * (powered ? 1 : 0) + 0.5 * (watered ? 1 : 0) actual_pop = maxPop * level * efficiency * 0.8 Actual Behavior - The Water System overlay shows zero coverage across the entire map (see screenshot) - All buildings have watered: false even when directly adjacent to a Water Treatment plant - The game engine actively recalculates watered back to false on every state update/tick — setting it to true via state manipulation is immediately overwritten - By contrast, Power Plants work correctly: their overlay shows radius circles and buildings within range have powered: true How This Was Discovered While automating city management via React state access (__reactFiber), I noticed: 1. Placed 24 Water Treatment plants (level 5) spread evenly across a 100x100 grid 2. Queried all buildings: watered === false on every single one (0 out of 4,285 buildings watered) 3. Force-set watered: true on all buildings via dispatch() — the game recalculated it back to false on the next tick 4. Confirmed Power Plants work correctly: powered updates dynamically based on proximity 5. The Water System overlay visually confirms zero coverage (entire map dark/red) Impact This effectively halves all building output: - house_small at level 5: gives 12 pop instead of 24 - shop_medium at level 5: gives 56 jobs instead of 112 - A 50K city could be 100K if water worked Environment - Browser: Chromium (latest) - Game URL: https://iso-city.com - Grid tested: 100x100 with 24 water_treatment plants at level 5
Contributor
|
@flaviocarmo is attempting to deploy a commit to the andrew-4640's projects Team on Vercel. A member of the Team first needs to authorize it. |
xkonjin
reviewed
Mar 8, 2026
xkonjin
left a comment
There was a problem hiding this comment.
Quick review pass:
- Main risk area here is UI state transitions, empty/error states, and interaction regressions.
- I didn’t see targeted regression coverage in the diff; please add or point CI at a focused test for the changed path in simulation.ts.
- Before merge, I’d smoke-test the behavior touched by simulation.ts with malformed input / retry / rollback cases, since that’s where this class of change usually breaks.
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.
Water Treatment plants (water_treatment) do not provide any water coverage to buildings. The watered property on all buildings is always
false, regardless of how many Water Treatment plants are placed or their upgrade level. This means building efficiency is permanently
capped at 50% (powered only), halving population and job output.
Steps to Reproduce
Expected Behavior
Water Treatment plants should provide radius-based water coverage to nearby buildings (similar to how Power Plants provide power
coverage). Buildings within range should have watered: true, which would increase their efficiency from 0.5 to 1.0, doubling population
and job output per the formula:
efficiency = 0.5 * (powered ? 1 : 0) + 0.5 * (watered ? 1 : 0)
actual_pop = maxPop * level * efficiency * 0.8
Actual Behavior
How This Was Discovered
While automating city management via React state access (__reactFiber), I noticed:
Impact
This effectively halves all building output:
Environment
Note
Low Risk
Small, localized change to service coverage logic; main risk is gameplay/balance impact from newly-enabled water coverage radius and upgrades for
water_treatment.Overview
Fixes a simulation bug where
water_treatmentbuildings were ignored when computing water utility coverage.water_treatmentis now treated as a water-providing service building (added toSERVICE_CONFIG/SERVICE_BUILDING_TYPES) and included in the coverage loop so nearby tiles correctly getservices.waterset totrue.Written by Cursor Bugbot for commit c7850c7. This will update automatically on new commits. Configure here.