{
  "id": 8286067,
  "title": "The opening layout is part of the puzzle",
  "url": "https://urgent.news/2026/09/18/the-opening-layout-is-part-of-the-puzzle",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-09-18T18:38:24.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/indiecoredev/the-opening-layout-is-part-of-the-puzzle-37cj"
  },
  "original_language": "en",
  "account": "The opening layout of a word-block puzzle is crucial to the player's experience. Initially, it appears to be merely presentation, with blocks scattered around an empty grid. However, this layout serves a much deeper purpose. It determines the size of the grid drawn and can even reveal the answer. To achieve this, the layout must be carefully designed.\n\nThe camera frames the board and loose blocks together, so the zoom is calculated as the minimum of the available width divided by the span width, and the available height divided by the span height. This ensures the grid is drawn at a comfortable size, preventing squinting on smaller screens.\n\nThe objective is not just fitting the blocks onto the screen, but maximizing the grid size. This is a packing problem, where the goal is to determine how large the grid can be drawn, given the loose blocks. A tightly packed arrangement can consume up to 20% of the board's space.\n\nThe puzzle's rule that makes it challenging is that a cut board can be tiled exactly by its own blocks. The most efficient packing arrangement is to rebuild this tiling, but this is not allowed. The blocks come out already assembled, making the level a matter of sliding a finished slab onto the grid. The near-misses are just as easy to make, as two neighboring blocks may accidentally end up in their solved positions.\n\nTo prevent this, a rule is enforced that no two blocks that are neighbors in the solution may share an origin. Blocks that are not neighbors are left alone, as they do not touch in their solved positions. This rule is checked three times during the solving process.\n\nA loose block touching the board reads as if it is already placed, creating a clearance gap. However, this clearance is only on the axes that matter, not diagonally. A block sitting off a corner overlaps the board on neither axis and is not read as placed. Forbidding these four corner cells is costly and often makes it impossible to have an arrangement that wraps the board on all four sides.\n\nPositions are stored as (row, col) in cells, relative to the board origin. This allows the arrangement to be reusable on any screen, any cell size, and any zoom. Blocks can be off the lattice on an axis where they are clear of the board, buying back span. However, on an axis where they share the board's extent, they must stay whole.\n\nArrangements that put something above, below, left, and right of the board are preferred, as they often result in a tighter fit. This arrangement may also look like a bug in the camera, causing the board to appear as if it failed to load. Symmetry is also valuable, even when the arithmetic suggests otherwise.\n\nThe harness reports four things per board, and the pipeline will not ship a pack that fails any of them. These include the kept, block cells per side, and the balanced distribution of cells above, below, left, and right. Overlapping cell pairs are allowed, but only filled cells are considered. Solving the arrangement offline is the slowest step of the pack pipeline, so it is computed once and stored in the board file for use at level load.",
  "summary": "Originally published on indiecore.net . Part 5 of 10 on building a word-block puzzle engine. Part 4: difficulty rates, progression places. A level opens with an empty grid and a scatter of loose blocks around it. I assumed this was presentation — put the pieces somewhere sensible, get on with the game. It is not presentation. It decides how big the grid is drawn, and it can give away the answer.…",
  "key_points": [
    "Opening layout crucial to player experience",
    "Determines grid size and can reveal answer",
    "Packing problem aims to maximize grid size"
  ],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}