OpenRA/OpenRA · error · MapGenerationException

could not find a playable region

Error message

could not find a playable region

What it means

Thrown when Terraformer.ChoosePlayableRegion() returns null. After computing which cells are playable terrain (CheckSpace on PlayableTerrain, accounting for impassable tiles) and optionally poisoning the exterior (for circle-in-mountains), ChoosePlayableRegion picks the largest connected region; if no region survives (all terrain impassable, fully poisoned, or terrain set empty), it returns null.

Source

Thrown at OpenRA.Mods.Common/Traits/World/ClassicMapGenerator.cs:678

			if (param.EnforceSymmetry != 0)
			{
				var asymmetries = terraformer.FindAsymmetries(param.DominantTerrain, true, param.EnforceSymmetry == 2);
				terraformer.PaintActors(symmetryTilingRandom, asymmetries, param.ForestObstacles);
			}

			CellLayer<bool> playable;
			{
				// For circle-in-mountains, the outside is unplayable and should never count as
				// the largest/preferred region.
				CellLayer<bool> poison = null;
				if (param.ExternalCircularBias > 0)
					poison = terraformer.CenteredCircle(
						false, true, CellLayerUtils.Radius(map.Tiles) - new WDist(1024));

				playable = terraformer.ChoosePlayableRegion(
					terraformer.CheckSpace(param.PlayableTerrain, true, false, true),
					poison)
						?? throw new MapGenerationException("could not find a playable region");

				var minimumPlayableSpace = (int)(param.Players * Math.PI * param.SpawnBuildSize * param.SpawnBuildSize);
				if (playable.Count(p => p) < minimumPlayableSpace)
					throw new MapGenerationException("playable space is too small");

				if (param.DenyWalledAreas)
				{
					// Coast tiles are particularly problematic. If they're for unplayable bodies
					// of water, they should be obliterated. If they're just surrounded by rocks,
					// trees, etc, they should be filled in with actors.
					if (waterIsPlayable)
					{
						var mask = CellLayerUtils.Clone(playable);
						terraformer.ZoneFromOutOfBounds(mask, true);
						terraformer.FillUnmaskedSideAndBorder(
							mask,
							landCoastWater,
							Terraformer.Side.Out,

View on GitHub (pinned to a520984d91)

Solutions

  1. Verify the PlayableTerrain config lists terrain indexes that actually exist and are passable in the tileset.
  2. Increase map size or reduce ExternalCircularBias so the poison circle doesn't consume all land.
  3. Ensure at least one connected landmass is produced by the land/water plan (raise Water fraction or lower it).
  4. Check CheckSpace isn't marking everything impassable due to missing LandTile validity.
Defensive patterns

Strategy: validation

Validate before calling

var playable = terraformer.CheckSpace(playableTerrainIndexes, true, false, true);
if (playable.All(p => !p))
    throw new InvalidOperationException("No playable terrain cells; check PlayableTerrain and tileset passability.");

Prevention

When it happens

Trigger: PlayableTerrain resolves to no valid cells; ExternalCircularBias>0 with a poison circle covering everything; the tileset marks the configured playable terrain indexes as fully impassable so CheckSpace yields an empty set.

Common situations: Misconfigured PlayableTerrain string (wrong terrain index names); a tileset where the playable terrain is also cliff-blocked; circle-in-mountains on too small a map where poison consumes all land.

Related errors


AI-assisted analysis of OpenRA/OpenRA@a520984d91 (2026-08-13). Data as JSON: /api/errors/79164cbf193e7086. Report an issue: GitHub.