BWAPI.NET
0.1.4
See the version list below for details.
dotnet add package BWAPI.NET --version 0.1.4
NuGet\Install-Package BWAPI.NET -Version 0.1.4
<PackageReference Include="BWAPI.NET" Version="0.1.4" />
paket add BWAPI.NET --version 0.1.4
#r "nuget: BWAPI.NET, 0.1.4"
// Install BWAPI.NET as a Cake Addin #addin nuget:?package=BWAPI.NET&version=0.1.4 // Install BWAPI.NET as a Cake Tool #tool nuget:?package=BWAPI.NET&version=0.1.4
BWAPI.NET
A pure .NET BWAPI 4.4.0 client implementation. It follows the idea of using memory mapped files to communicate with Starcraft launched by BWAPI.
This project is a port to .NET of JBWAPI which is a pure Java BWAPI 4.4.0 client implementation.
Capabilities
- Write AIs for Starcraft: Broodwar by controlling individual units.
- Read all relevant aspects of the game state.
- Get comprehensive information on the unit types, upgrades, technologies, weapons, and more.
- Study and research real-time AI algorithms in a robust commercial RTS environment.
Quick Start
- Installation
- Create a bot project
- Run
dotnet new console -o MyBot
- Run
cd MyBot
to change directy intoMyBot
folder - Run
dotnet add MyBot.csproj package BWAPI.NET
to add the reference to the nuget package generated from this repository - Copy and paste example bot below into
Program.cs
or develop your own bot - Run
dotnet run
(At this point you should see "Game table mapping not found." printed each second)
- Run
- Run StarCraft through Chaoslauncher
- Run Chaoslauncher.exe as administrator
- Chaoslauncher is found in Chaoslauncher directory of BWAPI install directory
- Check the BWAPI Injector x.x.x [RELEASE]
- Click Start
- Make sure the version is set to Starcraft 1.16.1, not ICCup 1.16.1
- Run Chaoslauncher.exe as administrator
- Run a game against Blizzard's AI
- Go to Single Player → Expansion
- Select any user and click OK
- Click Play Custom, select a map, and start a game
- Run a game against yourself
- Run Chaoslauncher - MultiInstance.exe as administrator
- Start
- Go to Multiplayer → Expansion → Local PC
- Select any user and click OK
- Click Create Game, select a map, and click OK
- Start – Uncheck BWAPI Injector x.x.x [RELEASE] to let a human play, leave alone to make AI play itself
- Go to Multiplayer → Expansion → Local PC
- Select any user and click OK
- Join the existing game created by the other client
Bot Example
using BWAPI.NET;
namespace ExampleBot
{
public class ExampleBot : DefaultBWListener
{
private BWClient _bwClient;
private Game _game;
public void Run()
{
_bwClient = new BWClient(this);
_bwClient.StartGame();
}
public override void OnStart()
{
_game = _bwClient.Game;
}
public override void OnFrame()
{
_game.DrawTextScreen(100, 100, "Hello Bot!");
}
public override void OnUnitComplete(Unit unit)
{
if (unit.GetUnitType().IsWorker())
{
Unit closestMineral = null;
int closestDistance = int.MaxValue;
foreach (Unit mineral in _game.GetMinerals())
{
int distance = unit.GetDistance(mineral);
if (distance < closestDistance)
{
closestMineral = mineral;
closestDistance = distance;
}
}
unit.Gather(closestMineral);
}
}
public static void Main()
{
var bot = new ExampleBot();
bot.Run();
}
}
}
Legal
Starcraft and Starcraft: Broodwar are trademarks of Blizzard Entertainment. BWAPI.NET through BWAPI is a third party "hack" that violates the End User License Agreement (EULA). It is strongly recommended to purchase a legitimate copy of Starcraft: Broodwar from Blizzard Entertainment before using BWAPI.NET and/or BWAPI.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.1 is compatible. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.1
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on BWAPI.NET:
Package | Downloads |
---|---|
BWEM.NET
A port of BWEM to .NET. |
GitHub repositories
This package is not used by any popular GitHub repositories.