Skip to content
OpenEnvisionGameMap
GameMap
GameMap
LearnGuides & notes
Measure a level generatorRuntime AI & NPCsWorld modelsAgents, skills & MCP2D & 3D development

Templates & project notes

中文/English

Measuring a level generator

  • 3 sections

A wall with two openings gives the player a choice. Whether it makes the route shorter depends on where those openings fall. This exercise compares two level generators whose entire output can be inspected. It follows the idea of expressive range introduced by Smith and Whitehead: choose properties of the levels that matter for the design, then examine how the distribution of those properties changes with the generator. Smith and Whitehead, 2010

Describe the space before sampling it

Use the seven-by-five grid from the policy comparison. Generator A opens one cell in the dividing wall. Generator B opens two different cells. The start, exit and movement rules stay fixed. There are five possible layouts for A and ten unordered pairs for B. Giving every layout equal weight defines the distribution for this study. A generator that favors central openings would need a different weighting even if it could produce exactly the same maps.

Two quantities answer different design questions. The number of openings counts opportunities to cross the wall. The shortest path length measures the minimum movement cost of reaching the exit. Two maps can match on both quantities while looking different to a player. If the design question concerns sightlines, neither measure observes what is visible at a junction.

Count layouts, then compare distances

Save the Python 3 script in a local directory. Run both commands there. The output contains a row for each policy on each layout. When tallying shortest paths, count each layout once, for example by using only the rows labeled planner.

python3 grid-study.py --gaps 1
python3 grid-study.py --gaps 2
Shortest pathOne opening (5 layouts)Two openings (10 layouts)
6 moves14
8 moves25
10 moves21

There is a simple check on the last cell. With two openings, the only ten-move layout has gaps at the top and bottom edges. Every other pair offers a closer crossing. The two generators occupy exactly the same three distance bins, yet ten-move routes account for 40% of A's layouts and 10% of B's. Reporting only the minimum and maximum would conceal that shift.

Separate geometric validity from player experience

Close all the openings with --gaps 0. The start and exit still occupy legal cells, but the solver cannot connect them. An audit that counted only layouts with finite distances would lose this failure. For a generator that can emit such maps, report its invalid fraction over all attempts, then calculate path lengths over the reachable subset. Keep rejected maps if generation or repair cost matters.

To extend the study, select two layouts with the same shortest distance but openings in different positions. Ask first-time players where they initially try to cross. Record their first approach before giving a hint. Route choice is evidence about those players under those viewing conditions. Shortest path length remains a property of the map. The graybox playtest guide explains how to record that distinction in the session notes.

Sources & document information

Level generators, runtime characters, world models, and tools that modify a game project.

View Markdown source

Evaluate a game development agent

Previous Page

Runtime AI & NPCs

Next Page

GameMap

A little direction for your next playable world.

Games

  • Game examples

Tools

  • Resources
  • Agent toolkit
  • Testing library

Research

  • Papers
  • Repository research

Learn

  • Guides & notes
GitHub
GameMap

On this page

Describe the space before sampling itCount layouts, then compare distancesSeparate geometric validity from player experience