This commit is contained in:
33333-33333 2026-06-08 13:18:33 +09:00
commit 2c7e525c53
21 changed files with 1730 additions and 285 deletions

107
README.md
View file

@ -1,4 +1,57 @@
# Chick Sorter v16.1 Card Target Overlay Fix
# Chick Sorter v23.0 Phase 2 Routefix Hotfix
This build changes the SHREDDER Improvement payout rule.
## v18 changes
- `SHREDDER Improvement` now uses one payout roll per processed item.
- Probability after n cards: `((√n / 2) × n)%`.
- Maximum SHREDDER Improvement cards counted: 30.
- At 30 cards, the chance is about 82.16%, so the expected payout is about ¥0.8216 per processed item.
## SHREDDER Improvement expected value
```text
n = min(SHREDDER Improvement cards, 30)
p = ((√n / 2) × n)% = n√n / 200
Per item payout X ~ Bernoulli(p)
E[X] = p yen = n√n / 200 yen
```
For k shredded items, expected total bonus is `k × n√n / 200` yen.
---
# Previous build notes
# Chick Sorter v17.0 Shredder Card and Cleanup
This build adjusts selling constraints, timeout cleanup, settlement UI, and adds the SHREDDER improvement card.
## v17 changes
- The last EGG FARM, MIXER, SHREDDER, and TRUCK can no longer be sold.
- Non-last equipment still follows the existing rule: same Build phase removal refunds 100%, older equipment sells for 50%.
- When the day timer and shutdown grace expire, remaining chicks/poop are blown off the conveyors with no equipment damage.
- Settlement appears 1 second after that cleanup.
- The day settlement modal is reduced to two lines: one simple formula and final profit.
- Added `SHREDDER Improvement` card.
- Each card adds one independent trial per shredded item.
- Each trial has a 1/3 chance to pay ¥1.
- Expected value per processed item after n cards: n / 3 yen.
- EGG FARM price remains ¥250.
## SHREDDER Improvement expected value
```text
Per item payout X ~ Binomial(n, 1/3)
E[X] = n × 1/3 = n/3 yen
```
For k shredded items, expected total bonus is `k × n / 3` yen.
---
## Previous notes
This build refines the v15 card and tax system.
@ -38,3 +91,55 @@ ZUNDA TAX = ceil(taxable × rate)
```
With no `Legal Work`, `exemption = ¥500`, so ¥501 starts at 5% and ¥10,000 reaches 95%.
## v19 changes
- Added collapsed bottom-left debug panel: infinite cash, day override, free upgrade purchase.
- Added `src/core/balance.js` as the primary balance-tuning sheet for prices, income, penalties, timing, card rates, and caps.
- Increased UI text size.
- Auto Scanner base cooldown is now 2.25 seconds.
- High-Quality Bearing now adds +7.5% conveyor speed per card.
- Equipment click popover removed; hover now shows flavor text and equipment information.
- ERASE button renamed to SELL.
- Card drafts can contain up to 2 dud cards; each slot has a 30% dud chance. Dud cards can be clicked away without spending a pick.
## v20 Phase 1 structural changes
- Added a canonical FactoryGraph in `src/systems/routing.js`.
- Build/edit operations invalidate the graph.
- Route planning, connection validation, congestion component lookup, and debug metrics now read from the same graph model.
- Scanner and facility ports are exact grid cells; visual adjacency is not accepted as connectivity.
- `Next Day` now commits the current FactoryGraph before fees and day start.
- The committed snapshot records conveyor cells, edges, components, port counts, farm outputs, and validation issues.
- Added `src/systems/gameEvents.js`.
- Major lifecycle, cash, build/sell, move, cleanup, and jam events are stored in a bounded run log.
- Expanded the debug panel from cheats only into an observability panel.
- Shows FactoryGraph size, components, port status, farm outputs, dead ends, active/queued items, max congestion, and recent events.
- This is a structural pass, not a content/balance pass. It is meant to make later map generation, market contracts, route diagnostics, replay, and deeper factory simulation safer to add.
## v21 Phase 2 structural changes
Implemented the Phase 2 foundation without the market board or programmable scanner logic.
- Added seeded no-build terrain generation. Roughly 20% of grid cells become blocked each run while preserving the initial critical route.
- Added equipment degradation based on actual use.
- Truck and Manual Scanner are exempt and always operate normally.
- Conveyor tiles degrade from item pass counts and reduce local belt speed.
- Egg Farms degrade from egg production and gradually increase spawn interval.
- Mixer, Waste Shredder, and Auto Scanner degrade from processing counts and add delay.
- Equipment keeps full performance until 50% durability remains; at 0% durability it performs at half speed.
- Added dirty overlay rendering for degraded equipment.
- Added a one-day repairman hire button. The repairman costs ¥100 for the next production phase, walks freely across the map, and repairs 1% degradation every 3 seconds.
- Expanded debug/hover readouts with blocked-cell and degradation information.
Market contracts and deeper scanner-programming logic are intentionally left for later Phase 2 work.
## v22 Phase 2 starter-route protection
No-build generation now protects the complete initial factory footprint before blocked cells are placed. The protected footprint includes the default Egg Farm, scanner bodies, scanner input/output ports, machine receiver cells, and every starter conveyor segment. After blocked-cell generation, the starter backbone is scrubbed from the blocked set and reinstalled as a final guard.
Result: even with roughly 20% no-build cells, the initial line remains continuous from Egg Farm to S1, S1 to S2, and S2 to both Shredder and Truck exits.
## v23 hotfix
- Fixed the startup ReferenceError caused by binding the repairman button to a missing `hireRepairman` wrapper.
- Disabled optional external art probing by default, preventing 404 console noise for placeholder image filenames. Canvas fallback art remains active.