TL;DR
This paper introduces Perceptual Distance Segmentation (PDS), a novel method for automatically breaking down 2D videogame levels into meaningful "chunks" based on what a player can see. By treating visibility as a probability distribution of surfaces, the authors create a scale-invariant metric that enables both high-level structural analysis and a "collage-style" procedural generator that remixes existing level designs.
What Problem Does This Paper Address?
Many procedural content generation (PCG) systems, like those in Spelunky or Dead Cells, rely on "chunks"—hand-authored segments of a level that are stitched together. Creating these chunks is labor-intensive. While researchers have tried to automate this via segmentation, existing methods often fall short:
- Tactical Bias: Methods like Brood War Tactical Analysis (BWTA) focus on finding choke points for AI, which doesn't always align with how a human perceives the high-level "rooms" of a design.
- The "Long Hallway" Problem: Traditional visibility techniques (isovists) often split long corridors into multiple segments simply because the visible area changes, even if the "feel" of the space remains the same.
- Scale Sensitivity: Many algorithms require different hyperparameters for different map sizes, making them difficult to generalize.
Methods
The authors draw from Space Syntax, a field of architectural analysis, to define a new metric: Perceptual Distance.
Instead of just measuring the area a player can see (an isovist), they model observation as a random process. If a player at point $p$ looks in a random direction, what is the probability they will see a specific wall segment $s$? By calculating this for every point in a level, they can compare two locations using Jensen-Shannon Divergence—essentially measuring how many "bits" of information you gain about your location by looking around.
The PDS Pipeline (illustrated in Figure 1) works in four steps:
- Surface Probabilities: Discretize the level and calculate the "angular area" of every visible surface from every point.
- Perceptual Flux: Calculate the rate of change of visibility. High flux means you are crossing a threshold (like a doorway); low flux (minima) indicates you are in the "center" of a room.
- Hierarchical Clustering: Group the local minima of the flux field based on their perceptual distance.
- Assignment: Map every other point in the level to its perceptually closest cluster.
Datasets
The authors evaluated PDS across two distinct domains:
- StarCraft: Brood War: They used 24 maps from the original BWTA dataset to compare their results against established tactical segmentation benchmarks.
- Super Metroid: They parsed all 255 rooms of the classic SNES title, focusing on complex rooms like "Bubble Mountain" and "Big Pink" to test the algorithm's ability to handle intricate 2D platformer geometry.
Key Insights and Ideas
- Surfaces > Points: By focusing on the visibility of surfaces (walls) rather than interior points, the algorithm avoids the "long hallway problem." A hallway looks like a hallway regardless of its length because the visible surfaces remain consistent.
- Information Theory as Distance: Using bits as a unit of distance makes the algorithm scale-invariant. The authors found that a threshold of ~0.59 bits worked effectively across different games and room sizes without manual tuning.
- Concavity is Okay: Unlike many architectural methods that force spaces into strictly convex shapes, PDS allows for slightly concave segments, which better matches human intuition of what constitutes a "room" in a game.
Key Results
- High Agreement: On StarCraft maps, PDS achieved an average cluster agreement score of 0.86 with BWTA. This suggests that PDS captures the same essential structural information as specialized tactical tools but through a more general perceptual framework.
- Metroidvania Decomposition: PDS successfully identified sub-sections of large Super Metroid rooms, such as side passages and geometric bottlenecks, while keeping main chambers intact.
- Collage Generation: The authors demonstrated a proof-of-concept generator that takes segments from a single room (e.g., "Big Pink") and remixes them. By matching borders and minimizing "badness" (tile mismatches), the system created a variety of novel, navigable layouts from a single source image.
Limitations and Future Work
- Computational Cost: The current implementation is slow. Segmenting a single StarCraft map took an average of 2.4 hours, largely due to the $O(n^2)$ complexity of computing surface probabilities for every tile.
- Gameplay Blindness: The algorithm only sees geometry. It doesn't know about a player's jump height, destructible blocks, or enemy placements, which are crucial for true functional segmentation.
- 3D Extension: While the math for perceptual distance naturally extends to 3D (using solid angles and triangle meshes), the authors have yet to implement or test this.
- Smooth Curves: The current flux-based approach struggles with "S-shaped" rooms that curve smoothly without sharp edges, often splitting them unnecessarily.
Summary updated