Brood War Terrain Analyzer written in .NET.
Given a map with walkability info, detects choked areas (in red) and regions (areas enclosed by walls and chokes).
| Map | Analyzed | |
|---|---|---|
![]() |
-----> | ![]() |
var mapWidthWalkTiles = Game.MapWidth * 4;
var mapHeightWalkTiles = Game.MapHeight * 4;
bool IsTileWalkable((int x, int y) tile) => Game.IsWalkable(tile.x, tile.y);
var mapAnalyzer = new MapAnalyzer();
AnalyzedMap analyzedMap = mapAnalyzer.Analyze(mapWidthWalkTiles, mapHeightWalkTiles, IsTileWalkable);The resulting AnalyzedMap holds the information about found choke points (ChokeRegion) and map regions (MapRegion), alongside the functionality to load and persist this to a file.
public class AnalyzedMap
{
public IReadOnlyCollection<ChokeRegion> ChokeRegions { get; }
public IReadOnlyCollection<MapRegion> MapRegions { get; }
public void SaveToFile(string filePath);
public static Result<AnalyzedMap> TryLoadFromFile(string filePath);
}The API of NBWTA was designed this way so that it's independent from BWAPI version changes.

