27 KiB
Kernel Panic
A Unity card battler about Linux distributions and programming languages. Native cards resolve immediately; Python uses a FIFO queue, Haskell a LIFO stack, and Go persistent goroutines.
Open and run
Use Unity 6000.4.8f1, with Windows build support. Open this directory through Unity Hub, let the complete package set import, and start Assets/Scenes/MainMenuScene.unity. New profiles learn the game in a three-wave tutorial, including Cron Job's countdown and a Daemon miniboss. New normal runs have a ten-wave campaign ending with a seeded Kernel Overseer, Process Supervisor, or OOM Reaper encounter. After clearing wave 10, bank your rewards or continue the same build into endless survival at wave 11.
Keep Unity .meta files alongside their assets in version control. Library, Temp, Logs, builds and local recovery scenes are excluded. Do not delete or regenerate metadata to resolve missing references.
Gacha economy and feature branch
Commits are the free pull currency shared by beginner, stable and feature banners. Normal runs award one Commit at wave 5, two at the wave-10 campaign boss, and one at every later five-wave endless milestone. Sustained daily objectives award one Commit and the wave-5 daily awards two. Root Credits remain the premium currency and convert to Entropy at the existing 1:1 rate; one pull paid entirely with Entropy costs 100.
The feature branch is a permanent NixOS rate-up with independent 4-star and 5-star pity. Its 4-star distro pool features Fedora and Ubuntu. A 5-star first splits evenly between package and distro; a distro hit has a 1/3 chance to use the non-featured standard pool, and losing that roll guarantees that the next 5-star distro on this banner is NixOS. Equipment hits do not consume or arm the featured-distro guarantee.
Completed pull transactions are saved newest-first, capped at 100 receipts, and available through a separate pull-history pop-up from the gacha toolbar or the main prompt with git log --pulls. Pull history is not a banner and opening it preserves the currently selected banner. Each receipt retains its banner, payment, exact resolved rewards, rarity, and duplicate conversion.
In ls ~/collection/languages, unlocked playable languages offer Learn more / practice fight. C, C++, Rust, Python, JavaScript, TypeScript, Haskell, Java, and Go each have a replayable guided fight with a fixed loan deck, followed by free practice. Exit with Escape or the training button; completion returns to the selected language, with a retry option. Practice does not replace campaign checkpoints, advance daily quests, award currencies, or change mandatory tutorial progress. Languages whose cards are still planned show an availability note instead.
The mandatory tutorial retains the basic queue/stack turn-order demonstration. Python's detailed preparation, automation, modifier and payload lesson now lives in its optional fight, where players perform the combo and watch the captured payload replay.
Campaign evolutions and combat feedback
Clear all ten campaign waves with C selected as either run language to permanently unlock C++, or with JavaScript selected to unlock TypeScript. Selecting both unlocks both. The unlock is saved at the completion boundary, including when continuing into endless survival, and remains available in collection, run setup and practice. Generated cards and distro exclusives do not qualify by themselves; optional training and legacy five-wave campaigns never qualify. Failed saves show a retry action and never announce a saved unlock.
Each evolution has three distinct starter cards (four cards including the duplicate) and eight repository cards, mirroring its base language's costs, rarities and roles. C++ matches C's base attack damage and improves its utility, retains its elevated critical chance, transfers all remaining overkill and never causes segfault recoil. Its pointer chains after C++, and its sizeof counts both C and C++ cards in hand. TypeScript cannot crit and uses JavaScript's average base damage, rounding halves up: console.log deals 6, fetch 9, typeof always deals 11 (14 at 75% success averages to 10.5), Math.random 11, Promise.all 7 three times, Array.map 4 per enemy, Promise.resolve 3, JSON.parse 6 plus a draw, and eval 15. Averages exclude JavaScript critical hits. Its defensive and copy cards also improve. External buffs, distro mechanics and enemy defenses still apply.
The combat workspace includes Turn resolution: Go, Python automation, FIFO, Haskell LIFO, enemies and cleanup, with the active action highlighted and a bounded journal of actual damage, Shield and host losses. Completed results remain available during planning. The separate execution preview still shows public estimates rather than guaranteed outcomes. These observers never consume randomness or delay gameplay.
Run reports and recent history now include full-run totals, per-card plays/damage/Shield contributions and the final deck with its upgrades. Contributions group copies by card type and include Go ticks, Python payload replays and overkill spill without counting them as additional plays. Utility effects are not ranked. Statistics survive repository save/resume; older checkpoints explicitly report statistics only since resuming. Original-build loading retains its existing behavior.
New campaigns use encounter revision 4, adding boss and elite variants while retaining alternate compositions and threat advice for waves 5–9. Old checkpoints retain their saved encounter revision. The boss remains wave 10. Combat repository/report screens, menu history, and collection language panels live in separate controller partial files; reusable turn-resolution and performance views own their own presentation.
Planning, encounters and combat saves
The repository's installed deck foldout shows permanent Cycles costs (0, 1, 2, 3, 4+), RAM requirements, language counts, and overlapping damage/defense/utility roles. Each card upgrade has Before / after details with its costs, magnitude bonus, draw rider, and actual rules. Combat discounts are excluded from the durable deck summary.
New campaigns select one of three final bosses from the run seed. Process Supervisor cycles through summoning two workers, Shield, and an interrupt; summons stop at eight living processes. OOM Reaper removes two RAM while alive and cycles through a Shield charge, a 14-damage burst, and a weak recovery attack. Both strengthen their next attacks below half Uptime. Elite detours can add a hidden-intent Daemon, a countdown Watchdog, or a Process Broker that alternates summoning and attacking. Future route previews disclose the encounter and advice. Older encounter revisions retain their original bosses and escorts.
Save & exit is also available during a stable combat planning phase, including after playing queued cards. Resolve target selections, Python choices and animations first. The checkpoint preserves the hand and pile order, temporary card state, FIFO/LIFO targets and multipliers, enemy intents, statuses, delayed effects, Go PIDs/ticks, Python automation, governor/Compilation state, progression and random cursor. Restore rebuilds these objects without replaying gameplay events. A failed write keeps the run playable; a successful resume consumes the checkpoint once. Tutorial and optional practice cannot replace campaign saves. Mid-combat checkpoints require compatible content; this does not promise replay compatibility across later balance changes.
Card previews explain each hit's input, flat bonuses, multipliers and defenses without rolling randomness. The top-bar results button opens a scrollable report; Damage calculation / recent hits shows the observed stages, critical outcome, Shield/Uptime losses and excess damage. Inputs already include the card's base roll/condition and magnitude; the rules and preview notes describe those upstream values. The journal bounds detailed storage to 32 recent hits per action.
Balance batches accept -balanceCombatPolicy greedy|language (default language). The language policy values affordable Python setup/payload combinations, drawing with usable Cycles/RAM, Haskell stack setup, Go deployment/extensions and Java warmup. It remains a heuristic, not an optimal player.
Validation for these improvements: 1,022 EditMode tests passed, followed by all 24 combat-layout tests after the final responsive UI changes. A Windows player build and wide/narrow player smoke checks exercise planning save/resume, resumed Go/FIFO execution, damage details, deck/upgrade views and route previews. Six fixed-seed benchmark cases reproduced identical wave, round, Uptime and event-trace results against their baseline. Test logs and screenshots are under Logs/next-* and Logs/NextSmoke*.
For human balance review, play the same seeds with both an immediate-damage build and a setup-heavy Python/Go or Haskell build. Record where route advice changes a decision, which upgrades are hard to evaluate, and whether each boss's loss feels explainable from its announced actions. Automated smoke checks exercise mechanics and layout; they do not establish human difficulty or enjoyment.
NixOS and Go
NixOS is a standard-pool five-star distro with 60 Uptime, 6 RAM and 3 Cycles. Ownership unlocks Go; Haskell and Go are recommendations, so any two unlocked playable languages remain valid. Select four of its five exclusive cards for the usual twelve-card starting deck. Existing pity, package/distro odds, duplicate Merges and upgrade prices are unchanged.
The host's CPU GOVERNOR controls accept clicks or keyboard focus and Enter. The current-governor shortcut beneath the host name scrolls to the controls and focuses an available policy, including in short windows. Each wave starts in schedutil. Switch once per player turn for one Cycle; selecting the active governor or an invalid action spends nothing. Governors apply only to card damage and explicit card Shield, at resolution time. Package Shield, status damage, healing, recoil, draw and duration are unaffected.
| Version | Release | Cumulative benefit |
|---|---|---|
| V1 | 24.05 | performance: +20% damage/-25% Shield; powersave: -20%/+30%; schedutil: +5%/+5% |
| V2 | 24.11 | schedutil: +10%/+10% |
| V3 | 25.05 | First successful switch each wave is free |
| V4 | 25.11 | performance damage +30%; powersave Shield +40%; penalties retained |
| V5 | 26.05 | Switching to performance deals 5, powersave grants 6 Shield, schedutil draws 1 |
V5 bonuses bypass card scaling and card-play/draw riders. Performance uses the selected living enemy, otherwise the first living enemy in process order; without one, the switch is disabled. The Haskell nixos-rebuild switch card grants Shield and draws; it does not switch governors.
Go deploys at most three goroutines, each with a stable PID and at most five remaining ticks. A deployed card leaves hand RAM and stays outside draw/discard piles until termination. At Interpret, eligible goroutines tick once in deployment order, then Python FIFO and Haskell LIFO resolve. Deployment-round work does not tick. Extensions change only remaining ticks. Select a scheduler PID before playing a management card, or play the card and then select an eligible PID; Escape cancels selection without spending resources. rollback still heals when nothing can be extended.
Each goroutine snapshots its card magnitude once, while governor, Compilation and source damage buffs are read independently at each tick through the existing damage pipeline. Ticks never replay card-play events or equipment hooks. A dead, removed or reviving target is replaced by the first living enemy; no living target means the tick is consumed without damage. Final ticks, cancellation, wave changes, defeat and run termination release the slot and dispose of the source card exactly once. No background threads or animation-driven gameplay timers are used.
Card assets follow one layout: distro exclusives in Assets/Data/Cards/<Distro>/, language starters in Assets/Data/Cards/Languages/<Language>/, and repository cards in Assets/Data/Cards/Shop/. Language deck definitions and their database stay directly under Languages/. NixOS and Go use these same folders, alongside GoDeck.asset, NixOS.asset and NixRebuildSwitch.asset, registered in the existing databases. Runtime integration is in CombatManager.NixGo.cs, NixGovernorState.cs, GoroutineScheduler.cs and GoEffect.cs; CombatSceneController.NixGo.cs supplies the compact governor controls and PID rows. Saves retain the existing schema and language enum values; the Goroutine track is appended without renumbering existing tracks.
NixGoTests, NixGoProgressionTests and CombatLayoutTests cover gameplay, content registration, equipment, progression and UI. A development player can run the isolated UI/combat check with --kernel-panic-smoke --kernel-panic-nixos-go-smoke --kernel-panic-save-path <absolute-unused-path>. The equivalent --kernel-panic-language-training-smoke checks all nine lessons. Neither harness uses the real profile.
Repository language coverage
Every playable language has at least eight run-only repository cards: C, Rust, Python, JavaScript, Java and Go each have eight; Haskell retains ten. All shop assets live directly in Assets/Data/Cards/Shop/, named <Language><CardName>.asset (for example, CKernelExploit, PythonListAppend, JavaScriptMathRandom, and GoTimeTicker). Asset names identify the language in the project browser; in-game titles retain their function/command names. Prices, rarity weights, language filtering and starter decks use the existing rules.
The expansion adds 29 cards:
| Language | New cards | Role |
|---|---|---|
| C | memcpy(), memset(), realloc() | Drawing, area damage and corruption repair, with normal C recoil/spill |
| Rust | Vec::push(), Result::Ok, Option::take(), Mutex::lock(), Iterator::collect(), match, Arc::clone(), std::mem::drop() | Reliable hits, overkill Shield, defense, draw, copying and a same-language combo |
| Python | itertools.islice(), collections.deque(), sum(), contextlib.suppress(), map() | Immediate preparation and delayed damage/Shield payloads |
| JavaScript | Array.map(), Promise.resolve(), try...catch, JSON.parse(), eval() | Variable damage, area attacks, cycling and defensive recovery |
| Java | ArrayList.add(), StringBuilder.append(), Objects.requireNonNull(), try...finally, Stream.map(), Class.forName(), System.gc(), JIT.compile() | Two-RAM cards that build JIT warmup, with spill, draw, defense and a turn discount |
Python payload detection reads catalog operations rather than a fixed list of card IDs. New payloads participate in loops, zip and async capture; map() draws once on queue resolution, never on repeats or automation replays. contextlib.suppress() supplies a pure Shield payload and does not consume zip. Fixed draws remain fixed under magnitude upgrades.
Software loadouts
Equipment uses System, Tools, and Services, with one featured combat bonus per category. These slots represent selected bonuses, not all software installed on a distro. System covers foundational libraries, storage, memory, security, and desktop components; Tools covers interactive utilities, package managers, build tools, and recovery; Services covers background processes and recurring work.
Existing collection loadouts move packages to their current categories. An item already in its category takes precedence over an incoming item; collisions leave the incoming package owned and upgraded but unequipped, with a migration notice. Saved runs and original-build retries preserve their original package allocations and effects. Loading an archived build into new setup uses current categories and reports any conflicts. Package effects, upgrade caps, costs, and rarity are unchanged. Internal serialized slot enum identities remain stable; UI and Inspector labels use the new taxonomy.
Package upgrades
Packages have individual upgrade caps stored in their assets, from no upgrades to level 8. Each purchasable level changes an effective combat value. AUR and the currently unimplemented less/firewalld effects have no paid upgrades. Gentoo's three package progressions retain their five levels.
Counts and timing scale separately: udev progresses from draw 1 every 4 turns, to draw 1 every 3 turns, to draw 2 every 3 turns (cap 2). Wave draws and generated cards gain at most one additional card; Cycle bonuses gain at most one additional Cycle. Vim and Snap Store extend their one-Cycle discount to one more card. Generic ccache/nginx reduce their free-card interval to a minimum of two cards. Systemd gains ten percentage points per level; Timeshift raises its actual recovery threshold by five percentage points per level, up to 75% on Mint.
Repeated shield/damage effects generally have three to five levels; selected one-time shields and health packages have six or eight. Levels 6–8 cost 230/330/450 Cache and 460/660/900 Bandwidth; levels 1–5 keep their existing prices. Collection previews, equipment, gacha details, save/load, run checkpoints and previous-build retries use the package's own cap. Loading a collection refunds the full original Cache and Bandwidth cost of levels removed by a lower cap, in the same save transaction as the cap adjustment; reloading cannot pay twice.
Test and build
Run the EditMode tests from Unity's Window > General > Test Runner window.
Build the game through File > Build Profiles, using the scenes configured in the project. The editor entry point KernelPanic.Editor.PlayerBuild.BuildWindows is also available for batch-mode Windows development builds; its default output is Builds/Windows/KernelPanic.exe.
For seeded balance measurements, use the editor entry point KernelPanic.Editor.BalanceComparison.RunBatch. These are bot measurements, not human win rates.
Campaign improvement validation: Logs/improvements-tests-final.xml records 998 passing EditMode tests. The additional unlock save-failure/retry check passes with the five settlement tests in Logs/improvements-unlock-save-tests.xml; the final responsive resolution panel passes all 23 combat layout tests in Logs/improvements-layout-tests.xml. Logs/improvements-build-final.log records a successful Windows development build with zero errors at Builds/Improvements/KernelPanic.exe. All nine language lessons pass isolated player checks at 1280x720 and 390x844, including actual-resolution captures, retry, exit and unchanged practice progression. Final captures and results are under Logs/ImprovementsFinalWide-ad85afbdcdb147e69230db196c9c9bb1/ and Logs/ImprovementsFinalNarrow-47ef11a7be2e4a44960a0ccb3fc3ccdc/.
Current run decisions
C balance tuning: C damage now has a 35% critical chance (down from 50%); critical damage remains 1.5x. Each C overkill jump transfers 50% of the remaining excess, rounded down, after the previous target's defenses. For example, 11 excess damage spills 5; if that target consumes 2, the next jump carries 1. Java still transfers all remaining excess, and Rust's overkill-to-Shield is unchanged. Base card damage and segfault rules are unchanged.
- Waves 2–9 offer connected route stops before their seed-selected encounters; wave 10 converges on the boss. Elite detours add a disclosed elite escort and award eight Bits plus a draw rider on the first eligible card after clearing the wave (16 Bits total if no card is eligible); repairs restore up to six Uptime. Patch workshops improve a card, sacrifice altars exchange one card for a stronger upgrade, recyclers remove a card for Bits, and caches grant Bits. Previewing routes consumes no combat or shop randomness.
- After waves 2, 4, 6, and 8, choose a magnitude upgrade, a first draw rider on a chosen card, or eight Bits. Rewards last for the current run. The choice and its claim state survive repository saves.
- During normal combat, prefetch spends two Cycles to draw one card, once per turn. It requires two free RAM so any possible card fits. It does not bypass the draw order, corruption or card locks.
- Combat sounds have a 0–100 volume slider in Settings; zero is muted. Audio observes events and has no effect on gameplay timing or randomness.
- Daemons hide a fresh action each round: Surge (8–10 damage), Harden (6–8 Shield), or Bypass (3–4 damage through Shield). Damage, including Shield-only hits, reveals the committed action for that round without rerolling it.
Focusing a hand card reveals its name and Cycles cost, including when its rules are taller than the hand viewport. Cards fit the available hand width on narrow screens; the rules remain freely scrollable.
Checkpoint versions 1–5 still load; older campaigns retain their original encounter timing and wave-five completion choice. New saves use envelope schema 11 and checkpoint version 6, including route topology, event results, travel history, run statistics, accrued Commits, independent feature-banner state and bounded pull receipts. Seeded retries require the same game content and action sequence.
Daily quests
The main menu's compact [ cron.daily ] widget sits below neofetch. The entire widget is clickable and reports the reset countdown, completed/claimed counts, five task progress readouts, and the exact number of unclaimed rewards in amber. Its terminal action highlights on hover/focus and switches from > inspect tasks to > claim available rewards when appropriate. Click it or focus it and press Enter to inspect descriptions and claim individual rewards in a terminal overlay. Escape or the close control restores previous focus. The existing prompt also accepts cat /etc/cron.daily/quests, including Tab completion; no extra navigation tab is added. Claims and daily resets update both views immediately. The widget and overlay have no animations.
The wider detail modal keeps its terminal command, reset countdown, and completion summary above the scrolling task list. Fixed-width ASCII bars and aligned numerical progress accompany subdued [ in progress ], amber > CLAIM REWARD, or muted-green [ CLAIMED ] controls. A successful atomic save produces a two-line [ OK ] confirmation with the actual deposited currencies; failed saves never announce success. Focus moves to Close after claiming so repeated Enter does not advance into another reward.
Focus restoration distinguishes input methods: mouse-opened details return to the menu without a persistent widget focus highlight; keyboard-opened details restore the prior keyboard target, and the command alias returns to the prompt. Escape can release the widget's keyboard focus. Selecting a primary command with arrows or pointer hover also releases the widget, keeping Enter consistent with the selected command. Ordinary hover highlighting remains while the pointer is over the widget. This follow-up passes 78 relevant tests (Logs/daily-quest-focus-tests.xml), a zero-error Windows build (Logs/daily-quest-focus-build.log), and isolated mouse/keyboard player checks at 1280x720 and 390x844 (Logs/DailyQuestFocusSmoke-16bd1b818f1046de9bbc6780170b64f2/).
The main menu shows five distinct quests randomly selected from eight options: clear 3 waves, play 25 cards, deal 200 Uptime damage, block 40 damage with Shield, play 15 Native cards, deal 60 damage to enemy Shields, survive 8 enemy rounds, or clear wave 5. Each 24-hour reset picks a new set and never repeats the exact previous set. The saved selection survives reopening the game and does not consume combat or shop randomness. Active three-quest periods expand to five immediately while preserving their progress and claim status.
Progress accumulates across normal runs and is saved as you play. Tutorial combat and self-damage do not count. Shield damage and Uptime damage advance their respective objectives; surviving rounds requires reaching Garbage Collection alive after the enemy phase. Only the five active quests can progress or pay rewards.
Each completed quest has an individual claim button. Rewards scale with the objective's difficulty and expected effort:
| Objectives | Bandwidth | Entropy | Commits |
|---|---|---|---|
| Play 25 cards; play 15 Native cards | 75 | 25 | 0 |
| Deal 200 Uptime damage; block 40 damage with Shield | 100 | 50 | 0 |
| Clear 3 waves; deal 60 damage to enemy Shields; survive 8 enemy rounds | 150 | 75 | 1 |
| Clear wave 5 | 250 | 125 | 2 |
Quest details and payouts use the same reward table. Existing progress and claimed flags are preserved; already-claimed quests do not pay again when rewards change. Both currencies and the claim flag are saved together, so repeated clicks or saving retries cannot pay twice. Claim rewards before the countdown expires: progress and unclaimed rewards reset every 24 hours, anchored to the first quest initialization using the computer's UTC clock. Closing the game does not pause or restart the countdown.
Claiming all five daily task rewards automatically pays a one-time all-clear bonus of 250 Bandwidth, 125 Entropy, and 2 Commits. The fifth quest reward and all-clear bonus settle atomically: if any balance would overflow or the save fails, neither payout is announced as successful.
Validation: Logs/daily-quests-tests.xml records 672 passing EditMode tests, including reset boundaries, save/reload, failed-save recovery, reward claims, gameplay events, and menu layouts at standard/large text sizes.
Difficulty reward validation: Logs/daily-quest-difficulty-tests.xml records 76 passing EditMode tests, including exact payouts for all eight objectives, duplicate-claim prevention after reload, preservation of previously claimed flat rewards, currency overflow checks, displayed reward amounts, and responsive quest layouts.
Final UI polish validation: Logs/daily-quest-polish-tests.xml records 77 passing tests covering all three states, claim counts, keyboard/mouse activation, alias dispatch, focus restoration, save-failure feedback, duplicate claims, countdown/reset updates, and standard/large text layouts. All three quests plus confirmation fit at the requested desktop sizes, including a 1024x576 logical viewport representing 1280x720 at 125% display scaling. Short viewports retain scrolling with a fixed header. Logs/daily-quest-polish-build.log records a successful Windows development build with zero errors. Five isolated player checks passed at 1920x1080, 1366x768, 1280x720, 960x400, and 390x844; captures and results are under Logs/DailyQuestPolishFinal-a25f067715164a92a6b0632f62d06264/.
Random selection validation: Logs/daily-quest-variety-tests.xml records 55 passing focused tests, including 120 daily selections, reload stability, fixed-quest migration, new combat objectives, inactive-quest rejection, and layouts covering all eight quest options.
The [ cron.daily ] redesign passes 66 focused tests in Logs/cron-daily-final-tests.xml, covering the compact/expanded layouts, mouse and Enter activation, Tab/Shift-Tab, Escape and focus restoration, command completion/dispatch, claims, and live countdown/reset updates. Logs/cron-daily-final-build.log records a successful development build. Isolated quest UI player checks passed at 1280x720 and 390x844, with visually inspected captures under Logs/CronDailyFinal-c61dd55e9648437f81a5d9586900c144/. Run this focused player check with --kernel-panic-smoke --kernel-panic-quest-ui-smoke --kernel-panic-save-path <absolute-unused-path>; it creates a quest fixture only in that isolated save. Earlier full-run smoke passed wide but stopped at the tutorial's finish-zombie target on narrow, before reaching quests; the focused quest check avoids that unrelated automation path.