Rebalance most languages and revamp main game loop
This commit is contained in:
+134
@@ -1,5 +1,43 @@
|
||||
# Unity package metadata recovery
|
||||
|
||||
## Ten-wave route redesign (2026-10-25)
|
||||
|
||||
New campaigns use encounter/map revision 2: wave 1 starts the run, waves 2-9 each offer a route stop before combat, and wave 10 is the Kernel Overseer. Build rewards arrive after waves 2, 4, 6 and 8. Clearing the boss opens the existing finish/bank-or-endless choice; survival begins at wave 11 without resetting the deck, Uptime or run identity. Revision 0/1 checkpoints retain their original encounter timing and revision 1 topology, including their wave-five completion choice.
|
||||
|
||||
The deterministic generator uses three-node tiers with occasional four-node expansions, merging back into three lanes on even waves. Every non-final node has two or three exits; every node has an entrance and can reach the boss. Each tier includes recovery and utility, with at most one elite. Elites become more frequent later, while waves 5-9 introduce heavier authored encounters. Generation never consumes combat or repository randomness. Existing Patch, Scrap, Altar, Cache, Repair and Elite effects are unchanged.
|
||||
|
||||
The map now displays the entire normal route in its own vertical viewport, initially positioned at the player. A fixed desktop sidebar previews focused/hovered nodes without changing selection; selecting updates the destination. Cleared, current, available, selected, future and boss states have distinct styling, with separated crossing trails. Tab, arrow/WASD focus navigation, submit and Escape/back are supported. The equal-sized bottom actions and separate reward/event screens remain. Narrow screens stack the sidebar below the map. No heading/legend was reintroduced inside the map.
|
||||
|
||||
Changed runtime files: `RunRouteMap.cs`, `RunJourney.cs`, `RunManager.cs`, `EncounterDirector.cs`, `RunMapView.cs`, `RunRouteView.cs`, `CombatSceneController.cs`, `KernelTheme.uss`, and the development-only `PlayerSmokeRunner.cs`. Coverage was extended in `RouteMapTests`, `CampaignTests`, `RunCheckpointTests`, `CombatLayoutTests`, and `RewardSettlementTests`.
|
||||
|
||||
Validation in the isolated `KernelPanicSelection-ce53bfc5e8924913a99349bd9ed232f9` project:
|
||||
|
||||
- `Logs/long-route-full-tests.xml`: **762 passed, 0 failed, 0 skipped**. Includes 256-seed reachability/distribution checks, checkpoint round-trips at every old/new campaign boundary, all stop effects, boss/victory/endless and keyboard/hover preview checks.
|
||||
- `Logs/long-route-final-layout.xml`: **27 passed**, after removing redundant map padding/outer scrolling and tightening row spacing. Desktop checks cover 1280x720 and 1920x1080; existing layout tests also exercise narrow/short viewports and large text.
|
||||
- `Logs/long-route-delivery-build.log`: Windows development build succeeded with zero errors; executable is `Builds/LongRouteDelivery/KernelPanic.exe` in the isolated project.
|
||||
- `Logs/LongRoute-Final-{1280,1920,390}-*/`: final player UI fixtures passed the complete route, sacrifice, exact save/resume, boss convergence and wave-eleven survival. Runtime-panel screenshots were inspected. These fixtures remove enemies to exercise transitions, not balance.
|
||||
- `Logs/LongRoute-Campaign-c4419358d2f74e8c89746cad3b5291d0/`: a real seeded ten-wave combat playthrough passed, including purchases, the actual boss, victory, exactly-once saved rewards/history, and return to menu. This is an automated regression run, not a broad difficulty study.
|
||||
|
||||
The user's open editor, existing saves and unrelated working-tree changes were preserved. The sections below describe earlier iterations.
|
||||
|
||||
## Route map verification (2026-10-25)
|
||||
|
||||
Campaign departure now shows a seed-stable map with two previous decisions, two future steps, connected forks/crossings/merges, and a complete travel journal. Each node is a stop before that wave's battle; the five-wave campaign and optional endless mode are unchanged. Back and Continue share equal-width footer slots.
|
||||
|
||||
Stops include Repair, Elite, Cache (+6 Bits on departure), Patch (+2 effect), Sacrifice (remove one card, give another +4 effect), Recycler (remove one card for +4 Bits), and direct continuations. Interactive stops show the affected card faces, require confirmation or an explicit pass, and lock after resolution. Changes affect the run deck only. Removed cards no longer receive unsold shop upgrade offers. Checkpoint version 4 persists route topology revision, selected node, resolved event, and travelled outcomes. Older campaign saves begin a map at their saved wave without fabricated history.
|
||||
|
||||
`RouteMapTests` checks topology, reachability, RNG isolation, event effects, passing, path locking, deep-copied history, and sacrifice save/resume. `CombatLayoutTests` checks footer equality, map layout, and sacrifice controls across desktop/narrow/short screens and standard/large text. The development-player flag `--kernel-panic-route-ui-smoke` (with `--kernel-panic-smoke` and an absolute unused `--kernel-panic-save-path`) captures the actual runtime panels and verifies UI confirmation, save/menu/resume, history and direct continuation. Its fixture removes enemies to reach repository boundaries; it is not a combat-balance playthrough. All validation uses isolated saves.
|
||||
|
||||
Validation used an isolated copy of the working tree: **755/755 full EditMode tests passed**, followed by **21/21 route/layout checks** after the final responsive-label and equal-height footer polish. The final Windows development build succeeded with zero build errors. The rebuilt player's route UI smoke passed at 1280x720, 390x844 and 960x400, including sacrifice, exact save/resume and travelled history; desktop and narrow captures were visually inspected. The user's open Unity project and progression were not reset.
|
||||
|
||||
The route map was subsequently rebuilt after visual review: compact circular vector-icon markers now ascend from a labelled current position. One shared canvas connects marker edges directly, with solid travelled trails, gold selected routes, dotted future routes, and dark under-strokes separating crossings. The redundant row cards and section heading were removed; event details stay in a separate panel. Layout tests assert fixed compact marker sizes, a shared coordinate space, and upward progression. Player smoke now also asserts that the initial current-position label fits alongside the upcoming map at standard desktop/mobile heights. The rebuilt player passed the route workflow at 1280x720, 390x844, and 960x400; the desktop and mobile captures were inspected.
|
||||
|
||||
Departure now uses three mutually exclusive screens: pending build reward, route map, and interactive stop. Reward selection previews the chosen card before/after an effect or draw upgrade; only Claim changes the deck, and the Bits alternative opens the map immediately. The map contains no reward controls, event pickers, or `THEN / WAVE` briefing. Entering an interactive node opens a full-width event with donor/current/after card previews. Back returns to the map without applying changes; Apply or Pass locks the stop, then Continue starts battle. Resolved events also offer Save and Exit, preserving their result. Reward and event actions stay in the fixed footer while previews scroll. No checkpoint-format or balance change was required.
|
||||
|
||||
The separated-flow revision passed **72 targeted EditMode tests** covering layout, reward previews/claims, map progression, campaign behavior and checkpoints. The Windows player workflow passed at 1280x720, 390x844 and 960x400, including separate-screen assertions, cancellation, fixed controls, sacrifice and exact save/resume. Desktop and mobile reward/event captures were inspected; narrow footer captions were shortened to avoid splitting words.
|
||||
|
||||
## Recovery procedure
|
||||
|
||||
`Repair-UnityPackageMetadata.ps1` repairs the package-cache GUID corruption that caused the URP/Shader Graph `CS0246` / `CS0234` error cascade in this workspace.
|
||||
|
||||
The cached `.asmdef.meta` files had regenerated GUIDs. For example, `Unity.Collections` was registered as `20584ab9ce8473748b0938382416bb61`, while its dependents referenced the official `e0cd26848372d4e5c891c569017e11f1`. Shader Graph had the same problem. The missing types were present in source; Unity omitted the assemblies from compiler references because their GUIDs did not resolve.
|
||||
@@ -88,6 +126,102 @@ Get-Content (Join-Path $smokeDirectory 'player-smoke-result.txt')
|
||||
|
||||
The player exits after completion. The smoke directory contains `player-smoke-result.txt`, `player.log`, its isolated progression files, and runtime panel images `first-battle.png`, `repository.png`, and `run-report.png` for stages reached. It temporarily renders each real UI panel to a texture because hidden Windows backbuffer screenshots can be black; empty panel images fail verification. Matching `*-panel.txt` files record bounds, visibility, opacity, and graphics API. This verifies runtime UI rendering but not desktop-window compositing. The runner enables background execution only for the smoke process. Check the result text, process exit code, log, and images together. The smoke runner and command-line save override are available only in the editor or development builds; normal player launches do not activate the smoke scenario.
|
||||
|
||||
## Python pipelines and automation (2026-10-25)
|
||||
|
||||
This rework supersedes the Python rules in the historical balance sections below. Python now has immediate preparation, FIFO payloads/modifiers, and two wave-local automation slots. Installing a third script requires choosing an existing script to replace; inspection and package generation also use keyboard-accessible choice dialogs. The combat scheduler and end-turn preview show scripts and remaining activations.
|
||||
|
||||
| Card | Cycles | New base effect |
|
||||
|---|---:|---|
|
||||
| print() | 0 | Payload: 4 damage to a chosen enemy. |
|
||||
| for loop | 1 | Modifier: 2 Shield; repeat the next payload once. |
|
||||
| import antigravity | 1 | Preparation: immediately draw exactly 2. |
|
||||
| list.append() | 1 | Payload: 6 damage, +2 per subsequent hand play of that instance this wave. |
|
||||
| zip() | 1 | Modifier: 2 damage; the next single-target damage payload hits all enemies. |
|
||||
| async def | 2 | Draw exactly 1 on play. Queue a script capturing the next payload; replay its damage/Shield before the queue on the next two rounds. |
|
||||
| ask ubuntu | 0 | Preparation: inspect the top 3 cards (5 at Ubuntu V3+), take one that fits RAM, preserve the others' order. |
|
||||
| sudo apt install | 1 | Preparation: choose from three distinct nonexclusive Python cards; the temporary copy costs 0 this turn and exhausts after play. |
|
||||
| unattended-upgrades | 1 | Automation: 3 Shield now and before the queue on the next two rounds. |
|
||||
| cinnamon | 0 | Payload: 3 Shield, or 5 if an earlier Python payload dealt damage this phase. |
|
||||
| update manager | 1 | Payload: 3 damage to all enemies, or 5 if automation ran earlier this phase. |
|
||||
| timeshift snapshot | 1 | Automation: record Uptime; after enemies on the next two rounds, restore toward the snapshot by at most 6 per round. Cannot prevent defeat. |
|
||||
|
||||
Unused modifiers survive only the following round. A payload consumes at most one repeat and one applicable area modifier; preparation, installation, and other modifiers never consume/repeat them. Scripts snapshot the upgraded operation before repeat/area transformations, including its captured flat amount, then use current damage defenses/multipliers at execution. Replays never repeat draw riders, growth, or installation, and retarget a defeated original target. Magnitude upgrades affect damage/Shield, not draw counts, choices, repetition counts, durations, or the restoration cap. Scripts, modifiers, pending choices, and temporary cost discounts clear at wave boundaries; repository checkpoints need no new combat-state schema. The unplayable Ubuntu Pro Trial token is unchanged.
|
||||
|
||||
Validation: `Logs/python-rework-tests.xml` records **738/738 passing** tests. After the final readout layout adjustment, `Logs/python-rework-layout.xml` records **13/13 passing** combat-layout checks, including choice submission, two active scripts, and accessible dispatch controls at desktop, narrow, and short viewport sizes. Tests cover modifier consumption/expiry, immutable automation snapshots, target fallback, once-per-round activation, fixed draw counts, inspection/RAM/order preservation, choice-before-rider resolution, generated-card exhaustion, restoration caps, and wave cleanup.
|
||||
|
||||
The delivered Windows development build is `Builds/PythonRework/KernelPanic.exe` (keep its adjacent files). `Logs/python-rework-build.log` records success with **zero build errors**. The final executable passed the full isolated-save smoke at 1366x768, including training, combat, choice handling, purchase, checkpoint resume, archive/retry flows, and natural defeat: `Logs/PythonRework-FinalSmoke-60361a1e9f0642fb9cd0038b4debb988/`. Runtime panel captures were inspected; this is automated player/UI verification, not a manual playthrough. The working editor and real progression were left intact.
|
||||
|
||||
`Logs/PythonRework-Balance/` contains **108 measured runs and 36 matching replay checks**, using seeds 17/101/2027, level-0 packages, both shop policies, repair routes, and a five-wave cap. Every measured run reached the cap. The bot selects the first enabled Python choice, including replacements; it does not optimize pipeline construction. This is a deterministic integration check, not proof of final human-play balance. The batch editor logged a Unity Search database startup exception outside gameplay; the benchmark completed successfully with no reported gameplay diagnostics.
|
||||
|
||||
## Language balance pass (2026-10-25, historical Python values)
|
||||
|
||||
This pass improves starter throughput and the early scaling curves. Values below are base values before crits, distro bonuses, packages, upgrades, target defenses and wasted overkill; they are not measured win rates.
|
||||
|
||||
| Area | Before | After |
|
||||
|---|---|---|
|
||||
| Python `print()` / `for loop` | 3 single-target / 2 per enemy | 4 single-target / 3 per enemy; costs, FIFO timing and draw unchanged |
|
||||
| JavaScript `typeof` | 75% for 8; otherwise 0 | 75% for 14; otherwise 0. Expected base damage rises from 6 to 10.5 at the same 1-Cycle cost |
|
||||
| Haskell stack positions 1 / 2 / 3 / 4+ | x1.0 / x1.5 / x2.0 / x2.5 | x1.5 / x1.75 / x2.0 / x2.5; only damage and explicit Shield scale |
|
||||
| Java `main` / `println` / `new Object()` cold cost | 3 / 2 / 1 | 2 / 1 / 0; damage stays 7 / 5 / 3 and each still occupies 2 RAM |
|
||||
| Java JIT | -1 per play, unlimited banked plays | -1 per two accepted Java plays, at most six banked plays (-3); lose two banked plays per wave |
|
||||
|
||||
Python's four-card starter (two prints, one loop, one draw card) now supplies `8 + 3N` base damage instead of `6 + 2N` against N enemies, for the same two total Cycles. It retains the cost of deferred execution and does not gain a new draw engine. `typeof` keeps its failure risk, but its 10.5 expected base damage now exceeds same-cost `fetch`'s 9 (range 5-13), giving a reason to accept the zero-damage outcome. Free `console.log` still averages 6. Mint receives the successful 14-damage hit, versus `fetch`'s maximum 13.
|
||||
|
||||
Haskell's prospective preview and immutable enqueue snapshot share one curve, including an exact x1.75 label. Draw and healing are not multiplied. The x2.5 per-card ceiling and third stack position are unchanged; a full stack does gain the improved first two entries, so this is not a claim of unchanged total stack damage. Compilation, LIFO order and snapshot ownership are unchanged.
|
||||
|
||||
Java costs use the same discount calculation in execution and UI. The discount sequence after 0..6 plays is 0 / 0 / 1 / 1 / 2 / 2 / 3. Repeated plays beyond six cannot bank immunity to cooling. Repository checkpoints retain the existing play-count field, clamp legacy oversized values to six on restore, and preserve odd warmup counts. Separate temporary Java/package/Fedora discounts still apply, and final cost remains at least zero. This is an intentional retuning of resumed runs, not preservation of the old discount formula.
|
||||
|
||||
### Individual outlier review: `unwrap()` and `printf()`
|
||||
|
||||
- This first pass identified `unwrap()` as an outlier: 9 damage and magnitude-scaled draw at the same 1-Cycle cost as `fn main()`'s 6 damage. The targeted follow-up below reduces its damage and fixes its replacement draw at one.
|
||||
- This first pass also identified free `printf()`'s 7 damage plus repair as an outlier. Its repair can remove its own segfault corruption. The follow-up below reduces damage while retaining its repair role and C's crit, spill and recoil rules.
|
||||
|
||||
### Validation and bounded before/after comparison
|
||||
|
||||
- The final full EditMode run (`Logs/language-balance-delivery-tests.xml`) passed **712/712 tests**, including balance, catalog, preview, stack execution, cost-modifier and checkpoint tests. An earlier run had an intermittent tooltip-focus failure, which passed both its isolated retry and the final full run. No production UI changes were made for it.
|
||||
- `Logs/LanguageBalance-Before/` and `Logs/LanguageBalance-Delivery/` each contain 54 measured runs and 18 exact replay checks: 18 loadouts, seeds 17/101/2027, five-wave or 100-round cap, repair routes, prefetch enabled, no shopping, level-5 packages when equipped. The baseline used the pre-pass runtime/asset versions in a disposable Unity project; the working tree and player saves were not reverted. All 108 runs reached five waves and all 36 replays matched. The six Arch C/Rust control traces were unchanged. `Logs/LanguageBalance-After/` is an intermediate comparison with the discarded 10-damage `typeof`, not the final tuning.
|
||||
- Both reports separately record the harness's recognized Unity Search-index startup exception. No combat errors or replay mismatches occurred. These three-seed samples establish reproducibility and exercise real combat; they do not establish human win rates or isolate each numerical change.
|
||||
|
||||
| Package-free loadout | Mean rounds before | Mean rounds after |
|
||||
|---|---:|---:|
|
||||
| Ubuntu V1 Python/JavaScript | 14.67 | 12.33 |
|
||||
| Mint V1 Python/JavaScript | 13.00 | 11.33 |
|
||||
| Gentoo V1 Haskell/C | 13.00 | 11.67 |
|
||||
| Gentoo V5 Haskell/C | 13.67 | 13.33 |
|
||||
| Fedora V1 Rust/Java | 9.00 | 9.67 |
|
||||
|
||||
Java's cheaper cold entry and slower capped warmup did not make the sampled Fedora runs faster overall. Damage remains unchanged, as intended; a larger sample with shopping and challenge routes is needed before judging overall Java damage. Some package loadouts also moved in opposite directions, so this pass does not claim universal pacing gains.
|
||||
|
||||
## Targeted card rebalance (2026-10-25)
|
||||
|
||||
This follow-up addresses the remaining card outliers after the language pass above. All three costs are unchanged.
|
||||
|
||||
| Card | Before | Current | Purpose |
|
||||
|---|---|---|---|
|
||||
| Rust `unwrap()` (1 Cycle) | 9 damage; draw 1 scaled by effect/magnitude bonuses | 5 damage; fixed draw 1 | Trades one damage versus `fn main()` for immediate card replacement; retains Rust overkill-to-Shield |
|
||||
| C `printf()` (0 Cycles) | 7 damage; repair 1 | 4 damage; repair 1 | Keeps free repair/setup utility with less burst; repair still scales and can repair its own corruption |
|
||||
| Python `list.append()` (1 Cycle) | 4 starting damage, +1 per requeue | 7 starting damage, +1 per requeue | Pays more than free `print()` on its first use; retains gradual scaling |
|
||||
|
||||
`unwrap()`'s fixed draw ignores both card magnitude and source effect bonuses. A +2 magnitude upgrade now gives 7 damage and one draw, rather than the old 11 damage and three draws. Separately purchased draw riders still work normally. Fixed draw uses the existing ordered RAM-aware deck operation, so it cannot skip a Java card that will not fit. Rules text and the combat preview disclose the fixed draw. Serialized custom draw effects retain their existing scaling.
|
||||
|
||||
The first tutorial zombie now has 5 Uptime so the required `unwrap()` hit still kills without a crit and teaches revival. Normal encounters are unchanged. Existing card IDs, costs, deck composition and save fields are retained; resumed runs use the updated card definitions.
|
||||
|
||||
Java, JavaScript and Haskell retain the previous pass's tuning. Java's RAM/card-flow concern does not yet justify another cost reduction. Haskell and JavaScript did not show a clear language-wide outlier in the source review. Python's change targets a weak repository option instead of increasing all queued damage.
|
||||
|
||||
Validation: `Logs/card-rebalance-final-tests.xml` records **723/723 passing EditMode tests**, including fixed draw with magnitude/source bonuses, Java RAM blocking and draw order, preview/execution agreement, requeue growth, and the tutorial's non-critical first kill. The first run found an old expected damage value in the queue-before-stack test and a UI PageDown scrolling failure; the expectation was updated for 7 base damage, and the complete rerun passed without a UI implementation change.
|
||||
|
||||
`Logs/CardRebalance-Before/` and `Logs/CardRebalance-After/` each contain **360 measured runs and 36 successful deterministic replay checks** using the actual combat manager: 36 scenarios, the same 10 seeds, repair routes, 10-wave/100-round limits, prefetch enabled, no-shop and upgrade-first shopping, level-0 packages where equipped. The baseline captured the current working files before this follow-up, including the earlier language tuning. All 720 measured runs cleared the five-wave campaign; none of the updated runs hit the play cap. All 60 Python/JavaScript no-shop control traces matched exactly. Each report separately records the recognized Unity Search-index startup exception; no combat errors or replay mismatches occurred.
|
||||
|
||||
| Package-free V1 loadout, upgrade-first shopping | Mean rounds before / after | Reached wave 10 before / after |
|
||||
|---|---|---|
|
||||
| Arch C/Rust | 17.9 / 18.9 | 10/10 / 10/10 |
|
||||
| Fedora Rust/Java | 26.0 / 28.0 | 10/10 / 10/10 |
|
||||
| Gentoo Haskell/C | 28.8 / 29.8 | 8/10 / 8/10 |
|
||||
| Mint Python/JavaScript | 30.0 / 29.8 | 9/10 / 9/10 |
|
||||
| Ubuntu Python/JavaScript | 26.9 / 26.7 | 8/10 / 8/10 |
|
||||
|
||||
The principal observed downside is package-free Fedora without shopping: wave-10 survivors fell from 5/10 to 0/10, and mean waves cleared fell from 9.0 to 7.8 (all still cleared the campaign). Its lower mean round count is therefore not a speed improvement. This reinforces its dependence on upgrades/card flow after the Rust nerf. These are small heuristic samples, not human win rates or proof of parity. Different actions also change subsequent random draws. The comparison does not isolate each card change, exercise all package levels/challenge routes, or establish the optimal use of `list.append()`.
|
||||
|
||||
## Seeded balance comparisons
|
||||
|
||||
`KernelPanic.Editor.BalanceComparison.RunBatch` starts an empty Play Mode scene in a separate batch editor and drives the actual combat manager through public gameplay operations. It performs **1,680 measured runs** by default: 56 scenarios across 30 fixed seeds, beginning with the original `17`, `101`, and `2027`. It also repeats the first seed for each scenario (**56 additional runs**) and requires identical recorded metrics and event hashes before reporting success. The matrix covers all five authored distributions with and without DNF, plus Gentoo V5 controls for Haskell/C, C/Rust, Python/JavaScript, zram, and zram with DNF. Package-bearing builds run at both levels **0 and 5**; every build runs with **no shopping and upgrade-first shopping**. Package-free controls are not duplicated across irrelevant package levels. Gentoo V1 Haskell/C controls come from the distribution baseline.
|
||||
|
||||
Reference in New Issue
Block a user