Skip to content

bwapinet/NBWTA

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NBWTA

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
----->

Usage

  1. Install the NBWTA nuget package.
  2. Using the data provided by BWAPI, analyze the map.
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.

About

Brood War Terrain Analyzer written in .NET

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • C# 99.9%
  • Batchfile 0.1%