OpenRA/OpenRA · error · InvalidDataException
Map format {format} is not supported.
Error message
Map format {format} is not supported. What it means
While building a preview, UpdateFromMap reads MapFormat from yaml and rejects maps below Map.SupportedMapFormat (11). Previews of legacy maps are not supported by the current engine.
Source
Thrown at OpenRA.Game/Map/MapPreview.cs:384
Dictionary<string, MiniYaml> yaml;
using (var yamlStream = p.GetStream("map.yaml"))
{
if (yamlStream == null)
throw new FileNotFoundException("Required file map.yaml not present in this map");
yaml = new MiniYaml(null, MiniYaml.FromStream(yamlStream, $"{p.Name}:map.yaml", stringPool: cache.StringPool)).ToDictionary();
}
var newData = innerData.Clone();
newData.Class = classification;
newData.GridType = gridType ?? modData.GetOrCreate<MapGrid>().Type;
if (yaml.TryGetValue("MapFormat", out var temp))
{
var format = FieldLoader.GetValue<int>("MapFormat", temp.Value);
if (format < Map.SupportedMapFormat)
throw new InvalidDataException($"Map format {format} is not supported.");
}
if (yaml.TryGetValue("Title", out temp))
newData.Title = temp.Value;
if (yaml.TryGetValue("Categories", out temp))
newData.Categories = FieldLoader.GetValue<ImmutableArray<string>>("Categories", temp.Value);
if (yaml.TryGetValue("Tileset", out temp))
newData.TileSet = temp.Value;
if (yaml.TryGetValue("Author", out temp))
newData.Author = temp.Value;
if (yaml.TryGetValue("Bounds", out temp))
newData.Bounds = FieldLoader.GetValue<Rectangle>("Bounds", temp.Value);
if (yaml.TryGetValue("Visibility", out temp))View on GitHub (pinned to a520984d91)
Solutions
- Migrate the map forward by re-saving in a compatible older release, then current.
- Remove the legacy map from the scanned folder.
- Filter the preview list to maps whose format is current.
Defensive patterns
Strategy: try-catch
Validate before calling
if (yaml.TryGetValue("MapFormat", out var temp) &&
FieldLoader.GetValue<int>("MapFormat", temp.Value) < Map.SupportedMapFormat)
return; // skip legacy map in preview Try / catch
try { preview.UpdateFromMap(p, classification); }
catch (InvalidDataException e) when (e.Message.Contains("is not supported"))
{ /* skip legacy map */ } Prevention
- Migrate legacy maps forward before they reach the preview list.
- Filter previews to current-format maps.
- Re-author old maps in the current version.
When it happens
Trigger: MapPreview.UpdateFromMap: yaml has MapFormat and format < Map.SupportedMapFormat.
Common situations: A legacy map (format < 11) sitting in the maps folder; previewing a map authored before a format bump.
Related errors
- Map format {MapFormat} is not supported.\n File: {package.Na
- MapFormat is not defined
- Required file map.yaml not present in this map
- Invalid map uid: {uid}
- No valid shellmaps available
AI-assisted analysis of OpenRA/OpenRA@a520984d91 (2026-08-13).
Data as JSON: /api/errors/2ec959d79b5f4a11.
Report an issue: GitHub.