Friday, June 14, 2013

Hiding the interface pointers

The next update to move BWAPI4 closer to its desired state is to hide the interface pointers. This, however, will require all code bases to remove the asterisks used when declaring interface pointers. New code does not need to include asterisks when storing a Unit or Player interface object. This will make coding in BWAPI more user-friendly.

There are no additional major changes to the API after this. We will include some crucial bug fixes and plan to include additional features that make the API easier to use, such as operator overloads for sending text to players and player groups using C++ style ostream operator <<, as well as serve some of the issues that have been lingering for quite some time.

Friday, May 3, 2013

BWAPI 4.0.0 Beta Released

BWAPI 4.0.0 Beta has been released. Find it here.

Not all the documentation has been completed, and many relevant libraries have yet to be updated.

However, as mentioned in previous posts, BWAPI 4 has been upgraded to Microsoft Visual Studio 2010 and sports a proper Installer, which are two of the most important changes. The addition of events, extended clientInfo, and filters all add new dimensions to bot development in C++.

But BWAPI 4.0.0 Beta is not final. There are still some important, massive changes to be made, such as hiding the interface pointers.


Sunday, February 10, 2013

BWAPI4 moving forward


BWAPI 4 is coming along nicely. With a new GUI installer and altered configuration, BWAPI becomes much more user friendly.

A cute new feature in BWAPI is the use of ostream operator << for all type data and on Broodwar. For example, let's compare some old-style print syntax with the new style syntax.

auto self = Broodwar->self();
auto enemy = Broodwar->enemy();


// old (but still usable) syntax
Broodwar->printf("The matchup is %s (%s) vs %s (%s)", self->getName().c_str(), self->getRace().c_str(), enemy->getName().c_str(), enemy->getRace().c_str());

// new syntax
Broodwar << "The matchup is " << self->getName() << " (" << self->getRace() << ") vs " << enemy->getName() << " (" << enemy->getRace() << ")" << std::endl;


As you can see, it looks a lot less like C and more like C++. Here's an another example using BWAPI::Position:

// old (but still usable) syntax
Broodwar->printf("%s was created at (%d,%d)", myUnit->getType().c_str(), myUnit->getPosition().x, myUnit->getPosition().y);

// new syntax
Broodwar << myUnit->getType() << " was created at " << myUnit->getPosition() << std::endl;

// compatible with other streams
myLogFile << Broodwar->getFrameCount() << "," << myUnit->getType() << "," << myUnit->getPosition() << std::endl;


On a side note, the Events mentioned a long time ago have just been added to BWAPI 4. A generic build position locator function has also been added to Broodwar in an effort to mimic the AI in the actual game. The build position locator is not entirely complete, but it is functional. 

The next major steps are to add base locations and ground distance calculation. With those two things implemented, the BWScriptEmulator can finally have access to everything it needs for emulating the built-in AI. This also gives users access to all the basic necessities for writing an AI without any complicated code or external modules.

As soon as a few more issues are dealt with, BWAPI 4 will be looking at a release possibly during March.

Wednesday, July 25, 2012

Unit Events: Early concepts

Here are a few pieces of text which bring up possible interfaces for a Unit Event system.

http://pastebin.com/eRAKv6iP
http://pastebin.com/7SEgryyG
http://pastebin.com/BAmdiBUX

The Unit event system is basically a concept that allows you to register events to certain units using minimal AI module code.

Here is an example:
Let's say I want a specific barracks to train 5 marines once it has been completed.
Exhibit A: To do this currently I would need a global variable to keep track of the Unit pointer for this specific barracks in onUnitCreate, another global to keep track of the number of marines it has trained, and then use a piece of code in onFrame which will continuously check if the Barracks is idle, completed, and several other conditions.
Exhibit B: I would need to write a wrapper (or use an existing one) for Unit object pointers that handles these events.
Exhibit C: I use this new events feature and only need to write one line in onUnitCreate to perform the exact behaviour.

Unit events are currently in planning stages. The idea is to give access to an easily usable, flexible, and powerful system (like the UnitFilter, which has not been mentioned in this blog).

Sunday, July 22, 2012

Updating the BWAPI blog

I will now be committing posts to the BWAPI blog regarding anything related to BWAPI, including my own project breaks.

I won't include all the things that have happened since the last blog post, because that would be a lot of stuff.

I'm currently working on a project and won't continue working on BWAPI until Wednesday.

As for BWAPI 4.0 there is talk of an event-driven system for unit control, stay tuned and tell everyone you know about BWAPI!

Saturday, December 11, 2010

BWAPI Beta 3.4 has been released

BWAPI Beta 3.4 has been released. This release adds a new mode to the Local PC network module that uses pipes to enable communication between multiple instances of Starcraft: Broodwar, adds a number of functions to Game, Player, Unit, and UnitCommand, adds macro unit types, and also fixes a number of bugs. Here is the full list of changes.

Friday, November 19, 2010

BWAPI Beta 3.3 has been released

BWAPI Beta 3.3 has been released. This release adds a Local PC network module which enables games between multiple instances of Starcraft: Broodwar, native Windowed-mode, support for Heroes, Beacons, and Standard Powerups, new functions for upgraded unit type stats, and also fixes several bugs. Here is the full list of changes.