Netherguard: How a No-Guessing Deduction Game Is Built, Checked and Shipped to Three Stores

Netherguard is a deduction game. Heroes from the human world have slipped into the demon realm in disguise, and you are the new investigator who has to unmask them. Every case is a small board of suspects. Each one is either a resident of the realm or a hero in disguise, and each gives you a clue once you have proven which. You can play it on this site, and the same game is on Google Play, on the App Store, and inside Toss as an Apps in Toss mini-app (Toss is a Korean finance app that runs small web apps inside itself).

All four versions come from one web codebase. This note covers both halves of that: how the game works and how its 50 cases are generated and checked, and then how one browser game is packaged for three stores without the copies drifting apart.

Three Netherguard screens: the opening village scene, a deduction board of suspect cards, and the regional campaign map
The opening scene, a deduction board and the campaign map. The same screens ship in the browser, on Android and iOS, and in Apps in Toss.

Sources: the game’s repository (314 commits between February 9 and September 25, 2026), its rule and campaign design documents, the case-authoring tool, the campaign balance report of April 3, 2026, the deployment README of April 24, 2026, and the test suites. The screens below are captured from a local web build in English.

How a case plays

A board has six to fifteen cards in two or three columns and three to five rows. Every card shows a disguise: one of sixteen monster characters, each with one to three traits such as Beast, Demon, Aquatic or Mage. A disguise says nothing about the person under it. A Troll can be a resident or a hero, and clues always refer to the disguise.

One card starts solved, with its clue visible. You open another card and mark it as a resident (O) or an infiltrator (X). If the mark is right and provable, the card locks and its own clue appears. Clues are always true, and they come in a dozen families:

  • Direct: “Troll (B3) is an infiltrator”, or “the card immediately to my right is a resident”.
  • Counts: how many infiltrators are in a row, a column, a trait group, a named set of two to four cards, or among a card’s neighbours (the eight surrounding cards, diagonals included). Counts can be exact, “at least”, or a range.
  • Relations: two named cards share a status, or do not.
  • Comparisons: two rows, columns or trait groups hold the same number of infiltrators, without saying how many.

The case is solved when every card is locked. A timer runs, and you have three chances.

Three Netherguard phone screens of the Reedshadow Passage case: the opening board, an evidence warning after marking Hexshade too early, and the board with five cards confirmed
Standard Investigation 002, Reedshadow Passage. Left: the opening board, with Moss Paw given as a resident. Middle: Hexshade really is an infiltrator, but marking it this early costs a chance, because nothing proves it yet. Right: five cards in.

The characters and map tiles come from Pixel Frog’s Tiny Swords packs (the free pack and the separate Enemy Pack, used under Pixel Frog’s own license, which allows commercial use but not redistribution). The pixel font is Galmuri by Lee Minseo, under the SIL Open Font License 1.1.

The one rule: no guessing

The middle screenshot is the heart of the design. Hexshade is an infiltrator, and the game still refuses the mark and takes a chance, because the clues on the table do not prove it yet. Being right is not enough. You have to be right for a reason.

To enforce that, the game must know at every moment which cards are provable, and it finds out by brute force. With n cards there are 2ⁿ ways to label them, at most 32,768 on a fifteen-card board. After every confirmation the solver walks through all of them, drops every labelling that contradicts a locked card or a revealed clue, and looks at what is left. If every surviving labelling says a card is a resident, that card is forced, and only that mark is accepted. Each labelling is a bit mask, one bit per card, so testing a clue costs a few bit operations and the whole pass is unnoticeable on a phone.

A wrong mark gets one of two messages. If the clues point the other way, there is no logical basis for the choice. If they do not decide the card yet, the evidence is not strong enough. Both cost a chance. The second is the one players argue with, and the one that makes the game what it is.

Diagram of the Reedshadow Passage case in five steps, with the number of possible answers falling from 64 to 1 as each confirmed card reveals a clue
The same case from the solver’s side. Each confirmed card adds a clue, and the answers that still fit drop from 64 to 1. One clue is never needed at all.

Reedshadow Passage shows how quickly that collapses. Eight cards give 256 labellings. The opening clue fixes the Troll, which leaves 64. The Troll’s clue clears both fish, the fish clear rows 1 and 3, and two steps later one answer remains. The Reedshadow Passage guide walks through it from the player’s side, and the beginner deduction guide covers the habits that help on larger boards.

How a case is made

Writing fifty fair puzzles by hand, in two languages, was never realistic for one person. Every case is generated and then checked by a command-line tool in the repository, and the order of its work matters: answer first, clues second.

  1. Pick a hidden answer. For a board layout and a seed, the generator decides which cards are infiltrators. The seed makes it repeatable.
  2. Write true clues. Each card gets a clue from the families its profile allows (tutorial, standard, hard or nightmare), filled in so it is true for that answer.
  3. Check uniqueness. Exactly one of the 2ⁿ labellings may fit every clue. Zero is a contradiction; two or more means the case can only be finished by guessing.
  4. Check that it unfolds. From the opening card, confirm every forced card, reveal their clues, repeat. Getting stuck with unknown cards and nothing forced rejects the case.
  5. Score it and keep the best. The generator tries many seeds, 256 in the documented command, and keeps the highest-scoring candidate that meets its tier.

Step four hides a subtle problem. Players do not confirm all forced cards at once. If three are forced, they can take them in any order, and each order reveals clues in a different sequence. So the tool also explores every order a player could take. That sounds explosive, but the state of a case is just the set of revealed cards, one bit each, so the tool remembers every set it has already analysed. Fifteen cards can form only 32,768 sets. The same pass records the largest number of cards ever forced at once; on hard and nightmare boards it may not exceed six, because a clue that solves half the board in one go is not much of a puzzle.

Diagram of eight checks a generated Netherguard case must pass: generation, uniqueness, no-guess solving, difficulty score, quality, campaign ramp, language text and a browser playthrough
The gates a generated case has to pass. Failing any of them sends the generator to the next seed; cases are never patched by hand to squeeze through.

What makes a case hard

While planning the campaign, I listed what makes these puzzles harder to solve by hand: the size of the board; the share of infiltrators (two of six is easy to eliminate, eight of fifteen is close to a coin toss); the shape of the deduction chain, from a straight line to a bottleneck where three or four clues must be combined before anything is provable; and how many clues must be crossed to settle one card.

The difficulty score turns that into numbers. It starts at 50, adds up to 11 for board size, adds for more deduction steps, more clue families and a larger share of “advanced” clues (relations, column and trait counts, sets, comparisons), adds two points whenever a step forces a single card, and subtracts when one step forces many. A case with more than one answer loses 60 points, which sinks it. Tiers start at 72 for standard, 84 for hard and 96 for nightmare. A second gate catches cases that score well but are lazy: on a hard board at most a fifth of the clues may repeat the same logic, row counts may not exceed about half, and at least 38 percent of clues must lean on traits, naming at least three different ones. Nightmare tightens every limit.

Two languages, one logic

A case’s logic lives in one file; each language has its own text pack keyed by clue, written for that language rather than translated. Every speaker has a voice. The harpoon fish sights down a shaft, the oar fish follows the current, the Mage reads hex-marks. A clue may open with one short line of that voice, followed by one factual sentence that must keep its anchors: the card, row or column, the status and the count. When I use a language model to draft or repair wording, it must return a single JSON object that passes the same validators.

The last text check is visual. A browser test renders the longest clues on a full fifteen-card board at phone widths of 375, 390 and 430 pixels and fails if any line spills out of its card. Text that does not fit is rewritten, never cut short with an ellipsis, because a clue missing its last word can be a different clue.

A campaign of fifty cases

The first campaign plan, in early March, had forty cases in four chapters. On March 23 it grew to fifty cases in five regions: Border Sweep, Buried Traces, Deep Cover, Abyss Lockdown and Final Pursuit. The cases were regenerated several times, and the last full rebalance landed on April 2 and 3.

The opening is a ramp. Case 1 is a tutorial on six cards with a single clue family. Cases 2 to 4 are standard, on eight, nine and twelve cards. From case 5 everything is at least hard, and the last fourteen, from case 37, are nightmare. Twenty-nine cases use twelve cards and eighteen use fifteen, the first of them at case 17. A ramp check makes sure each case fits its slot in the plan: board size, tier, the clue families it must and must not use, and a difficulty range. When the forty-case version’s final case failed the tool’s validation on a text-anchor rule, the plan was to regenerate it, not edit it. That is the rule for every gate.

Chances, stars and unlocking

Every case starts with three chances. Each unprovable mark costs one, and losing the third ends the investigation. In the store versions a player can watch an ad to get one chance back; the browser version on this site has no ads, so there the way back is to retry. The word itself changed early: on February 12, three days into the project, every “life” in the game became a “chance”.

The first plan for stars was simple: stars equal remaining chances. The shipped rule adds time:

  • Three stars: solved within the case’s three-star time, with no mistakes.
  • Two stars: solved within the two-star time, with at most one mistake.
  • One star: solved.

One star opens the next case. An earlier plan with star gates between chapters was dropped, so three stars are a reason to replay, not a wall. The stars, chances and unlocks guide has the player-facing details.

Three Netherguard screens from the tutorial case: the opening board, a no-logical-basis warning after a wrong mark, and a two-star completion report
The tutorial case. Marking Razorjaw as a resident contradicts the clue already on the board, so the game reports no logical basis and a chance is gone. Finishing afterwards gives two stars, however fast.

Where the target times come from

Fifty target times are too many to set by feel, and nobody had played the cases yet. So they are computed from the validator’s own telemetry. A case’s estimate starts at 18 seconds plus 4 per card. Every deduction step adds 7.5 seconds, 1.8 per newly revealed clue, and 3.2 for every halving of the remaining possibilities (the base-2 logarithm of their count, so 64 possibilities cost six times as much as 2). A step that forces several cards subtracts a second per extra card, and slower clue families add a little.

Raw estimates are noisy. Case 19 came out at 7 minutes 22 seconds, far above its neighbours: a fifteen-card board whose first five steps each confirm a single card, so the possibilities only halve at a time, from 8,192 down. Shipping that would make the campaign lurch. So the series is smoothed with isotonic regression: whenever a case’s estimate is lower than the one before it, the two are merged into their average, and merging repeats until the line never goes down, with a minimum rise of 1.5 seconds per case. The two-star time is the three-star time plus 45 seconds, or 1.42 times it, whichever is larger. If smoothing moves a case too far from its own estimate, the ramp check flags it for regeneration.

Line chart of three-star and two-star target times for all 50 Netherguard cases, with the raw time estimate for each case shown as dots
Raw estimates and shipped targets for the whole campaign. Three-star times rise from 2:18 on the tutorial to 6:12 on the final case.

Testing a game that must never be unfair

A deduction game has one unforgivable bug: a case that cannot be finished without guessing. The repository holds 65 unit test files, 38 contract tests (checks on data and text rather than code) and 85 browser tests run with Playwright, Microsoft’s open-source browser automation library (Apache 2.0). One of the oldest dates from February 15: it opens every case in a real browser, asks the running game which cards are forced, and solves the board using only those. If an evidence warning or a failure screen ever appears, it fails. It is slow, and it is the test I trust most, because it checks the shipped game rather than the authoring tool’s opinion of it. The case validation guide goes into the checks in more detail.

Other suites test what a player would see. Modal and safe-area tests measure where panels land at phone sizes. Android tests replay delayed, zero and stale inset reports from the native side, because a late reply must never push the layout back to an older state. A campaign test makes a set number of mistakes and checks the star count; another reloads the page and checks that progress comes back.

Two habits keep the suites honest. A review gate maps the files a fix touches to the test clusters that cover them, and a file the map does not know triggers the full suite instead of a guess. And the repository carries written rules for fixing review comments, for me and for the coding agents I work with: name the invariant being protected, map every file and build output that depends on it, fix it at the layer that owns it, and add a test for the failure a player would actually see.

One codebase, three stores

The root of the repository is an ordinary browser game: an HTML page, plain JavaScript modules and data files, with no bundler. A build step copies them, with the art and license texts, into one portable web bundle plus a small runtime configuration file for the target. The Android and iOS apps wrap that bundle with Capacitor 7, a native shell around a web view. The Toss version uses the Apps in Toss web framework and ships as an .ait file, which must stay under 100 MB unpacked.

Diagram: Netherguard game source builds one shared web bundle, used by a Capacitor shell for Google Play and the App Store, a Toss shell for Apps in Toss, and this website
The game never talks to a store SDK directly. Each shell supplies platform features through one host bridge.

The deployment README states the rule plainly: if the source, the generated bundle and the packaged native assets disagree, the deployment is not finished. A script compares each packaged copy with the source byte for byte, and the review gate always runs it. Most “works on my machine” bugs in a multi-platform game come from exactly that drift.

The game reaches the platform through one global object, the host API. A web implementation is installed first, and every feature in it has a harmless default: ads, promotions and leaderboards answer “unsupported”; push, the back button, lifecycle events, safe areas and audio focus are empty listeners. Each shell merges its overrides on top, recursively, so the Toss shell can replace the function that shows a full-screen ad without touching the rest of the ads group. The version on this site keeps the defaults, which is why it has no ads or push prompts, and why it is the version the browser tests run against.

Six builds and a gate

There are exactly six official build commands: three stores times debug and release. Aliases such as “build and deploy” were deliberately left out, so nobody produces a store file by accident. Debug builds use a development channel and report errors to a separate environment; release builds produce what the stores accept, an Android App Bundle, an Xcode archive and a release .ait.

Before any release build, a readiness audit runs for that store: 46 checks, 44 of them blockers. They catch one-line mistakes a store reviewer would otherwise find days later: native version numbers that drifted from the shared version file, store descriptions over their length limits, missing legal links, a production ad slot that is empty or test-only, iOS tracking text missing in English or Korean, ads initialized before the iOS tracking prompt resolves, a missing Android 13 notification permission, or a Toss SDK older than the version that reports ad analytics. On April 24, 2026 the audit found no blockers and one warning: the support link was still a placeholder.

Diagram: a release command runs a readiness audit; any blocker stops the build, otherwise the store file is built
A release command runs the readiness audit first. Any blocker stops it before a store file exists.

Problems only real platforms showed

“The ad failed” was not one situation. Originally the revive ad returned only success or failure. On April 9 it began returning a reason, because each needs different advice: an ad closed early (“finish the ad to recover a chance”), no ad available right now, a build that does not offer the feature at all, or a loading error. Telling a player to try again when the build cannot show ads is worse than saying nothing. A related fix on July 1 moved the cooldown check for the ad between cases in front of the ad request; until then the game kept requesting ads it was never going to show.

Saved progress and a changed origin. Browser storage belongs to a web origin, the scheme and host a page is served from. If a mini-app starts running under a different origin, its storage looks empty and every player seems to have lost their progress. The Toss SDK offers a call that returns the previous origin’s storage, and the September 25 update of the Toss shell uses it before the game starts.

Diagram of the Apps in Toss start-up order: move the old origin's storage once, move progress keys into the SDK's storage, cache them, then import the game
The Toss shell moves old saves and switches progress to the SDK’s storage before the game module is even imported.

The shell copies the old storage across once, guarded by a flag, then moves campaign progress, the leaderboard score and tutorial reward records into the SDK’s own storage, which does not depend on the origin. Every call stops after five seconds, so nothing can strand a player on a loading screen. A unit test loads the real bridge file in a Node sandbox with fake storages and checks that the move runs once even if start-up runs twice, that saves survive it, and that an SDK store that cannot be read is left alone rather than overwritten with empty progress. Another assertion checks that the page sets up storage before importing the game; reversed, the game would read empty saves before the move finished.

Rewards that arrive after a restart. Finishing the tutorial in Toss grants a small promotional reward through the platform, and that request can be cut off by the app closing. Since May 3, a grant that fails for a retryable reason is stored as pending and retried at the next session start or when the app returns to the foreground. The confirmation appears only when the grant succeeds.

What this approach costs

  • Every platform feature needs a harmless web default and tests that run without the platform.
  • Store text lives in the repository and goes through the same audit as a version bump.
  • SDK updates still arrive per store. The Toss SDK alone was updated on July 1, August 18 and September 25, 2026.
  • Rejecting cases instead of patching them means some generation runs end with nothing usable, and then the plan has to change, not the case.

The payoff is that a rule, a clue family or a new case is written once and reaches every version of the game, already checked for the one thing a deduction game cannot get wrong.