Skip to content

Latest commit

 

History

History
1273 lines (1018 loc) · 78 KB

CHANGELOG.md

File metadata and controls

1273 lines (1018 loc) · 78 KB

Changes {#changesTop}

[TOC]

Current (Tue Apr 15 20:59:42 EDT 2014) {#current}

Changes:

  • BWAPI has migrated from Google Code to GitHub.

Bug Fixes:

  • Fixed a bug where some replays would be skipped when auto_menu iterated through them.
  • Fixed a major bug that could cause crashes or produce undefined results on larger maps when using hasPath or getRegion.
  • Fixed a crash when the save_replay configuration option contained extended ASCII characters.

BWAPI 4.0.1 Beta (r4453) {#changes_401b}

Changes:

  • All interface pointers are now hidden. Instead of Unit* you will now just use Unit. This will require a "Replace in Files" operation to convert existing sources.
  • The installer now prompts the user to locate the Starcraft installation directory if it is not found.
  • Game::setTextSize now takes a BWAPI::Text::Size::Enum parameter instead of an integer.
  • All instances of IsUnpowered were renamed to IsPowered.
  • The AI module in the configuration now accepts absolute paths (Ex: C:/stuff).

Bug Fixes:

  • Fixed a regression that prevented auto-menu from functioning.
  • Fixed an issue that caused Type::getType to be case sensitive.
  • Fixed a regression where addons and the engineering bay returned incorrect tile sizes.
  • Fixed a regression that prevented the construction of structures on the right and bottom edges of the map.
  • Fixed a regression that prevented the example projects from building out-of-the-box.
  • Fixed a bug where auto_menu caused a second multi-instance client to redownload a map that already existed.
  • Fixed a bug where auto_menu attempted to start a game before map downloads could be processed.
  • Fixed a regression that prevented the client/server setup from communicating.

BWAPI 4.0.0 Beta (r4350) {#changes_400b}

General Changes:

  • All BWAPI projects have been upgraded to use Microsoft Visual C++ 2010 Express.
  • BWAPI now uses the available C++11 features, such as move semantics, std::function, lambdas, and nullptr.
  • The location of BWAPI.dll has been moved to the bwapi-data folder.
  • Several performance improvements have been made for BWAPI.
  • The save_replay configuration option has been altered for more flexibility on date/time stamps.
  • The documentation has been extensively reworked and is now included as offline HTML files. Not all documentation has been updated but will continue to be worked on.
  • A proper installer is now distributed for BWAPI.

Necessary Regressions:

  • BWAPI no longer supports loading older revisions of itself.
  • The holiday lights have been removed.
  • BWTA is no longer compatible with BWAPI.

AI/Tournament Module:

  • Type data is no longer initialized by the module, and can now be retrieved properly at any time.
  • The gameInit function is now exported to initialize the Broodwar pointer.
  • The original newAIModule function now takes 0 arguments.
  • Removed the Tournament enum restartGame.

Sets and Vectors:

  • Using a custom new class template known as a Vectorset, BWAPI and AI modules can perform significantly better (faster and less memory). This replaces the use of STL containers, but is used the same way (with Vectorset::iterator, stl algorithms, etc).
  • It can be treated like a vector or a set, and the user has the option of treating it as a vector for some cases and a set for others.
  • Additional convenience members have been added, such as .rand(), which returns the value of a random element of the set.

Positions:

  • Position, TilePosition, and the new WalkPosition now all share the same class template: Point. This maintains consistency between member functions to be used by any Position type, and provides conversions between each type, including custom ones.
  • Positions now have several operators that make arithmetic easier. For example, Position(8,8)/2 will give Position(4,4) and Position(30,20) - Position(15,5) will give Position(15,15).
  • There is also Position::set, derived from the Vectorset that will handle sets of Positions.
  • The x and y members are now public, and the x() and y() member functions have been removed.
  • Added the constants Positions::Origin, TilePositions::Origin, etc. which represent (0,0).

Interface:

  • Each interface class will have its own derived set with several enhancements, and brings in some functionality similar to that of BWSAL. The new sets are as follows: Unitset, Playerset, Regionset, Bulletset, Forceset
  • Interface overhead has been reduced by making some member functions with alternative parameters non-virtual. Keep in mind some function parameters have been re-arranged so that default parameters can be used.
  • getClientInfo/setClientInfo are now available to all Interface classes, and also take an optional parameter that acts as a key.
  • User-defined events have been added, and can be utilized through registerEvent.

Types:

  • Types have also received their own set, the Type::set (Example: UnitType::set).
  • The behavior of type creation has been changed, and now all types with an id between 0 and Unknown will be considered valid, even if data for the type has not been defined in BWAPI. This drastically simplifies the type's constructors.
  • Most type data is now made constant and no longer requires an initialization to be made. This gives users more flexibility for when they want to access type information.
  • Added a Type::isValid function.
  • All types' enumerations are now available (for switch case usage) and are accessed by Types::Enum (Example: UnitTypes::Enum::Terran_Marine).
  • TechType::energyUsed has been renamed to energyCost.
  • All types now overload std::ostream operator<< (including Color).
  • UnitTypes::getUnit, Races::getRace, etc. have now been replaced with static Type::getType. (Example: Races::getRace doesn't exist, use Race::getType)
  • Added UnitType::width, UnitType::height, and UnitType::isCritter.

Game:

  • Draw functions now take Position parameters as an alternative to individual x and y.
  • The parameters for canBuildHere, canMake, canResearch, and canUpgrade have been rearranged.
  • getUnits_ functions now return a Unitset copy instead of a reference, and also now takes a function predicate.
  • Added getClosestUnit, getBestUnit, getClosestUnitInRectangle, vPrintf, vSendText, vSendTextEx, vDrawText, isGUIEnabled, getBuildLocation, getDamageFrom, and getDamageTo.
  • Removed getScreenBuffer, setReplayVision(use setVision for replays too), changeRace, and startGame.
  • Instead of using Game::printf, you may use BWAPI::Broodwar like you would std::cout, using operator <<.
  • Using Special_Start_Location in canBuildHere will ignore units that are occupying the space while still checking for resource distance.
  • Some functions now take an Enum type instead of an int.

Unit Filters:

  • UnitFilter is a new powerful function composition object and function predicate for use with getUnits_ functions throughout the interface. It can generally be combined with any other functional object (including lambdas) using operators && and ||, as well as ! for the inverse. (Example: !(IsFlyer || IsLifted) )
  • CompareFilter is a sister function composition object that compares the values returned from the call to the object, and can be combined using operators ==, <, <=, >, >=, and !=. (Example: GetType == UnitTypes::Terran_SCV && HP_Percent < 100)
  • Filters can be found in the BWAPI::Filter namespace.

Player:

  • groundWeaponMaxRange and airWeaponMaxRange have been removed. Use weaponMaxRange instead.
  • getTextColor now returns a char instead of an int so that it is printed correctly when used with ostream::operator <<.
  • Added damage(WeaponType)
  • Unit count functions now take a default parameter of AllUnits.
  • Rename groundWeaponDamageCooldown to weaponDamageCooldown.

Unit:

  • The parameters for build have been rearranged.
  • getUnits_ functions now return a Unitset copy instead of a reference, and also now takes a function predicate.
  • Added getClosestUnit, getUnitsInRadius, getSpaceRemaining, and isTargetable.
  • Removed getUpgradeLevel.
  • Several functions for testing command validity were added.
  • Unit commands are now more strict.
  • getResources now returns the last-known resource amount when the unit becomes inaccessible.

Region:

  • Added a getUnits function.
  • Renamed isWalkable to isAccessible

Bug Fixes:

  • Fixed a bug where Unit::getRemainingBuildTime failed to work correctly for some units (such as siege tanks).
  • Fixed a bug where Spider Mines were not correctly identified for Jim Raynor (Vulture).
  • Fixed a bug where key enum values were incorrectly mapped for Game::getKeyState.
  • Fixed a bug that allowed multiple instances of the BWAPI DLL to be injected into Broodwar, which could cause compatibility issues.

BWAPI 3.7.4 (r4160) {#changes_374}

Changes/Additions:

  • The Random race feature has been corrected and re-enabled. Players who chose Random will have their race displayed as Unknown until they are scouted.
  • MPQDraft and Chaoslauncher with its plugins are now included in the release.
  • The exception filter now writes to Starcraft/Errors/.
  • An Install script is now included. Simply run Install.exe to automatically copy the folders to their desired locations.

Bug Fixes:

  • Fixed a regression that involved save_replay not working correctly.
  • Fixed a bug where getUnitsIn_ functions were unable to properly retrieve unit data on the edge of the map.
  • Fixed several minor buffer overflows.
  • Fixed a bug that caused some replays to save with 0 frame time (causing a division by 0 exception on loading).
  • Fixed a bug that prevented auto-menu "join game by name" from functioning.

BWAPI 3.7.3 (r4111) {#changes_373}

Bug Fixes:

  • Fixed a bug where UnitTypes::maxUnitHeight was returning the max unit width instead.
  • Fixed a regression where getUnitsIn functions did not function for non-client AI.
  • Fixed the client's Game::getForces which included the null force.
  • Fixed a client bug where Force::getName could return an invalid string.
  • Fixed an auto_menu bug which prevented Zerg from being selected as a race.
  • Fixed a bug where BWAPI's version checking was too strict.
  • Fixed a bug that allowed bots to tell if an opponent had constructed a structure in the fog of war using Game::canBuildHere and Game::isBuildable.
  • Fixed a bug where drawText with a string over 255 characters could cause an overflow.
  • Fixed a bug involving some uninitialized game data causing an inconsistency during the first game.
  • Fixed an issue where shared memory would require high level permissions such as administrator. The permission requirement should now be reduced.

BWAPI 3.7.2 (r4025) {#changes_372}

Changes:

  • The exception filter now informs of NULL Broodwar pointers when the game crashes, making it more informative.
  • The exception filter now destroys the direct draw window (if the game crashes in full screen) to make debugging easier.
  • BWAPI will drop players from the game when the countdown timer reaches 0.
  • The random race implementation was disabled because it was not working correctly.

Additions:

  • Added an onPlayerDropped event which is currently only called for the tournament module.

Bug Fixes:

  • Fixed a bug that caused a crash in a map where extended players were being used.
  • Fixed an issue where BWAPI would allocate a huge amount of unused shared memory.

BWAPI 3.7.1 (r4000) {#changes_371}

Changes:

  • Complete map information is now available when the game ends, so that bots may view post-game information.
  • The single unload unit command now optimizes a select only when the command optimizer level is at least level 2 (prevents mistakes generated by replay analyzers).
  • If the game is minimized in single player with windowed mode enabled, it will now automatically increase the speed of the gameplay.
  • Windowed mode now uses less CPU.
  • BWAPI will now hide the race of players that chose Random until one of their units have been spotted.

Bug Fixes:

  • Fixed a bug that caused saving replays to fail, when attempting to save them manually.
  • Fixed a regression that caused the Command Optimizer to go into an infinite loop.
  • Fixed an issue where Player::getForce would return NULL when a player was not in a force (specifically in melee).
  • Fixed a bug where non-existent client bullets were not handled properly.

BWAPI 3.7 (3969) {#changes_370}

Changes:

  • Unload, Unload_All, and Unload_All_Position now return false when the location specified is unwalkable.
  • Renamed Player::cumulativeMinerals to Player::gatheredMinerals.
  • Renamed Player::cumulativeGas to Player::gatheredGas.
  • Users are now restricted from deleting interface classes.
  • The performance of BWAPI has been vastly improved in several places.
  • Multiple instances now display the instance number in the window title.
  • BWAPI Client-Server setup is now compatible with multiple instances.
  • BWAPI now contains a top level exception filter, which will log more detailed information about a crash.

Additions:

  • Added Unit::getReplayID.
  • Added the onUnitComplete callback (UnitComplete event).
  • Added Player::refundedMinerals - returns the cumulative amount of minerals refunded from canceled units, canceled upgrades, and canceled research.
  • Added Player::refundedGas - returns the cumulative amount of gas refunded from canceled units, canceled upgrades, and canceled research.
  • Added Player::repairedMinerals - returns the cumulative amount of minerals spent on repairs.
  • Added Player::repairedGas - returns the cumulative amount of gas spent on repairs.
  • Added Player::spentMinerals - returns the cumulative amount of minerals spent, not including repairs.
  • Added Player::spentGas - returns the cumulative amount of gas spent, not including repairs.
  • Added Player::isUnitAvailable. (for Use Map Settings)
  • Added Player::isResearchAvailable. (for Use Map Settings)
  • Added Player::getMaxUpgradeLevel. (for Use Map Settings)
  • Added Game::getCountdownTimer. (for a few game modes)
  • Gave all types a <type>::c_str() member to reduce the redundancy of retrieving names (such as type.getName().c_str(), which can now be type.c_str()).
  • Added the Region class with several member functions.
  • Added Game::getRegion, Game::getAllRegions, and Game::getRegionAt.
  • Added encapsulation to Event.
  • Added Game::getLastEventTime for tournaments.
  • Added BulletTypes::Ensnare.
  • Added Unit::getRegion.
  • Added the configuration option show_warnings under config to disable BWAPI launch warnings.
  • Added UnitTypes::maxUnitWidth and UnitTypes::maxUnitHeight.
  • Added Unit::getLeft, Unit::getTop, Unit::getRight, and Unit::getBottom.
  • Added UnitType::canBuildAddon.
  • Added Game::setReplayVision and Game::setRevealAll.
  • There is now /record and /stoprecord Commands that perform native video recording. It is not fully supported and does not record sound.
  • BWAPI now has the ability to join a LAN game by name, specified by the game parameter in the configuration file, under auto_menu.
  • Added a new configuration option called shared_memory under config, which can disable BWAPI's Server functionality.

Bug Fixes:

  • Fixed several memory leaks in BWAPI.
  • Fixed a bug where some Zerg upgrades would return false when a Hatchery or Spire was morphing.
  • Fixed a bug where cheat codes were treated as case sensitive.
  • Fixed a regression where Game::hasCreep returned false incorrectly for some locations.
  • Fixed a regression where Nuclear Strike did not execute correctly.
  • Fixed an issue where the frame counter and isPaused would be incorrect or could stop working completely.
  • Fixed a regression where auto_menu could not set the bot's race in multiplayer.
  • Fixed a bug where auto_menu could not correctly set the bot's race if it was not specifically in slot 0 or slot 1.
  • Fixed a bug where getUnitsIn functions could not find large units in a small location.
  • Fixed an issue where Position and TilePosition's isValid member always returned false if the Broodwar pointer was not initialized.
  • Fixed an issue where the Zerg's Spore Colony and Sunken Colony unit types did not contain the correct requirements.
  • BWAPI should no longer crash when the Starcraft version is incorrect. Instead it will display a message box and attempt to remain functional.
  • Partially restored WINE compatibility through a workaround that disables BWAPI's Server functionality using the new config option shared_memory.

BWAPI 3.6.1 (r3769) {#changes_361}

Changes:

  • The command optimizer now groups some Use_Tech commands correctly.
  • Command optimizer level 4 will now group Archon Warp and Dark Archon Meld.

Additions:

  • Added Orders::NukePaint.
  • Added TechType::getOrder.
  • Position and TilePosition can now be treated as a boolean value and will automatically call isValid(). This is an effort to make cleaner-looking code.

Bug Fixes:

  • Fixed an issue where every module using the BWAPILIB library would take some loading time when initializing color information. Instead it will only initialize the information on the first call to the Color(r, g, b) constructor.
  • Fixed various minor potential buffer overflows/underflows.
  • Correctly initialize some Player values.
  • Fixed a bug where non-existent players' Start Locations were excluded from the Start Location group in a Use Map Settings (revealing only opponent Start Locations).
  • Fixed a regression where Archon Warp and Dark Archon Meld always returned an error.

BWAPI 3.6 (r3745) {#changes_360}

Changes:

  • Starcraft now always uses the saved speed setting in Single Player instead of using Normal speed. This means that Single Player games will always start on fastest if that was your last setting in multi-player.
  • Some tileset-reserved palette entries were removed.
  • The constructor for Color(r,g,b) has been optimized for speed.
  • Players that are observing, as well as Start Locations for possible Observer players are excluded from the list of enemies and start locations.
  • The Unload Unit command now uses less actions by performing the command with no matching select unit.
  • Several TechType::targetsUnit and TechType::targetsPosition flags have been altered to be consistent with the tech's capabilities.
  • Logging and the logging_str config option in BWAPI have been removed. Attach the debugger instead.

Additions:

  • Added `Game::hasPath.
  • Added Position::hasPath`.
  • Added configuration option pause_dbg which pauses the auto-menu until you attach a debugger (only in DEBUG mode).
  • Added TilePosition::hasPath.
  • Added Game::setAlliance.
  • Added Game::setVision.
  • Added more options and variants to Game::hasPower.
  • Added a new function Game::hasPowerPrecise which takes a pixel coordinate instead of a tile position.
  • Added some Use Map Settings UnitTypes that were missing, such as Map Revealer, Start Location, Doors, and Traps.
  • Added a new config entry called mapiteration which allows you to specify if wildcard maps will be chosen randomly or in a sequence.
  • Added Unit::getOrderTarget.
  • Added Game::observers which returns the list of observing players in a Use Map Settings.
  • Added Player::isObserver.
  • Added the auto_menu config options wait_for_min_players, wait_for_max_players, and wait_for_time which change the way BWAPI behaves when hosting a network game.
  • BWAPI now supports a tournament module to control the flow of tournaments.
  • Added Game::elapsedTime.
  • Added Game::setCommandOptimizationLevel which allows BWAPI to automatically optimize commands to lower APM.

Bug Fixes:

  • Fixed a bug in Unit::isInWeaponRange where the minimum range of 0 would be included in the computation.
  • Fixed an issue where BWAPI and its loaders did not attempt to first find the Starcraft install path in HKEY_CURRENT_USER and instead only looked in HKEY_LOCAL_MACHINE.
  • Fixed a bug where the bot's APM counter did not reset between matches.
  • Fixed an issue where BWAPI's Windowed Mode (set in config) would initially start the application in Fullscreen before switching back.
  • Increased compatibility with other hacks, depending on their behaviour.
  • Fixed an issue where Game::hasPower could return incorrect results.
  • Fixed some cases where bad calls could cause a buffer overflow.
  • Fixed an issue where users without administrative privileges were unable to use BWAPI. Limited users will now be able to use BWAPI and an AI DLL, but will not be able to use the Client/Server setup.
  • Fixed an issue where Healing(for HealMove) and Maelstrom could not be used in Unit::useTechPosition.
  • Fixed a bug/regression where Game::mapFileName would return with the full path after using auto-menu.
  • Fixed a bug/regression where Battle.net Recent Maps would save a map with its path attached after using auto-menu.
  • Fixed an issue where auto_menu did not start multi-player games on its own.
  • Fixed a bug where a unit position returned an incorrect value when it was intended to be Unknown.
  • Fixed a bug where a unit's clientInfo was not reset to NULL in a new game.

BWAPI 3.5.4 (r3597) {#changes_354}

Bug Fixes:

  • Fixed a crash on game end involving extended ascii characters in the map name.
  • Fixed an auto-menu issue/regression where the map's registered path was assumed to be in the maps/BroodWar folder
  • Fixed an issue where restartGame switched to a different map in auto-menu mode.
  • Fixed a crash involving a rare occurance that causes a unit's hit box to be partially outside of the playable map area.
  • Fixed an issue where text sent by the player near the end of the match (specifically when BWAPI was defeated) would be carried over to the next game.

BWAPI 3.5.3 (r3589) {#changes_353}

Bug Fixes:

  • Fixed an issue/regression where auto-menu would spawn or hide units in replays depending on the selected auto-menu game type.

BWAPI 3.5.2 (r3586) {#changes_352}

Bug Fixes:

  • Fixed an issue/regression where auto-menu failed to work for replays.

BWAPI 3.5.1 (r3584) {#changes_351}

Bug Fixes:

  • Fixed an issue where screenshots were disabled while in Windowed mode.
  • Fixed a bug/regression that caused replays to crash.

BWAPI 3.5 (r3577) {#changes_350}

Changes:

  • The return values for Game::getGroundHeight have been altered. This allows the inclusion of doodads in terrain height computation (For example: Units behind a tree).
  • The DEBUG version now checks for memory leaks.
  • Game::isBuildable now includes a boolean to specify whether to check if a visible building is blocking the way. It is false by default.
  • Game::canBuildHere has slightly increased performance.
  • Game::drawLine has greatly increased performance.
  • The config values ai_dll and ai_dll_dbg have been replaced with ai and ai_dbg, the revision and multi-instance entries (ai_dll_rev, ai_dll_#, etc.) have been removed. More information in the updated bwapi.ini config file.
  • Some distance functions now use integers instead of doubles.
  • The config option save_replay under auto_menu now accepts environment variables as well as our user defined variables. It also creates the directory if it does not exist, and creates the file directly instead of copying LastReplay.rep (LastReplay.rep will not be created).
  • Most BWAPILIB objects now have an operator int() const as a replacement for all other comparison operators. This allows more flexibility, specifically for the developers of BWAPI, so that a call to .getID() does not need to be made.
  • Resizing the window in Windowed Mode will now stretch the game screen.
  • Holding ALT in Windowed Mode will now prevent the cursor from leaving the window (same as W-Mode functionality).
  • The auto-menu map selection no longer loops back and forth with the previous menu in order to select the correct map.
  • The map entry under auto_menu in the config now accepts wildcards, and chooses a random map from the pool when starting the game.
  • BWAPI's custom network module has been marked deprecated and replaced by BWDI's module. (SNP file)
  • Unit::attackMove and Unit::attackUnit have been renamed to Unit::attack to conform with the other functions. Current users can perform a Find&Replace in all files(a function provided by Visual Studio and Notepad++), or use a #define.
  • Ordering an Infested Terran to Attack a location (Attack Move) will now cause it to explode at that location. (Also known as "Sap Location")
  • Renamed UpgradeType::mineralPriceBase to UpgradeType::mineralPriceBase, UpgradeType::gasPriceBase to UpgradeType::gasPrice, and UpgradeType::upgradeTimeBase to UpgradeType::upgradeTime, as well as added the parameter that specifies the level. These functions now include the cost factors in calculations. To obtain the base value, use 1 as the parameter.
  • There is a new menu hack that causes menus to load immediately instead of the old one which quickly played the swish-in and swish-out animations.
  • BWAPI's windowed mode can now be resized smaller than the game's resolution. The window will snap to the original dimensions when they are close enough.
  • Holding the CTRL key while resizing the windowed mode window will now maintain a 4:3 aspect ratio.

Additions:

  • Added Game::getAPM which retrieves the bot's running actions per minute and ignores user actions.
  • Added the errors Errors::File_Not_Found and Errors::Invalid_Parameter.
  • Added Game::setMap which changes the map for when you next restart the game.
  • Added Unit::isUnderAttack which identifies units that have been recently attacked.
  • Added Unit::getLastAttackingPlayer which identifies the player that last attacked this unit.
  • Added Game::getUnitsInRectangle.
  • Added Game::getUnitsInRadius.
  • Added Unit::getUnitsInRadius.
  • Added Unit::getUnitsInWeaponRange.
  • Added the configuration option holiday which allows disabling the once-secret holiday modifications that were activated at the appropriate time.
  • Added Game::setFrameSkip which alters Starcraft's built-in frame skipping value.
  • Added some more UnitTypes that are specific to Use Map Settings games, as well as the WeaponTypes to go with them.
  • Added a new configuration option screenshots under Starcraft which allows you to specify the format Starcraft saves screenshots in. Defaults to GIF.
  • Added UnitType::isMineralField which just returns true if the unit is Mineral Field Type 1, 2, and 3. BWAPI currently converts all Mineral Fields to Type 1 for its own purpose, so you don't need to worry too much about it.
  • Added Unit::isUnderDarkSwarm.
  • Added Unit::isUnderDisruptionWeb.
  • Added UpgradeType::whatsRequired, which returns the building required to accompany the upgrade at a certain level.
  • Added Player::weaponMaxRange which takes a WeaponType instead of a UnitType.
  • Added several configuration options for BWAPI's windowed mode.
  • Added the ability to queue commands like you can in Starcraft. Many command constructors have this addition built-in. Re-read the documentation on them for more information.
  • Added UnitCommand::isQueued.

Bug Fixes:

  • Corrected the return values for Game::getLatencyFrames, Game::getLatencyTime, Game::getRemainingLatencyFrames, and Game::getRemainingLatencyTime.
  • Fixed a crash involving the use of the extended ASCII character set in the drawText functions.
  • Fixed a memory leak that was unique to Starcraft: Broodwar.
  • Corrected WeaponTypes::normalWeaponTypes and WeaponTypes::specialWeaponTypes which were returning the wrong sets.
  • Fixed a bug where Game::canBuildHere would fail in some cases where buildings can overlap. See issue 302 for more information.
  • Fixed a bug that would cause the game to freeze for several seconds when invalid positions were passed to Game::drawLineMap.
  • Fixed a bug that prevented the usage of known /commands on a Battle.net server.
  • Fixed an issue where Overmind With Shell, Overmind, Cerebrate, Cerebrate Daggoth, and Overmind Cocoon would return false for isDetector(). They now correctly return true.
  • Fixed a bug in Windowed Mode where the System Cursor was displayed instead of the game cursor.
  • Game::restartGame no longer freezes/crashes the game when called during multi-player. Instead it silently returns an error.
  • Fixed an infinite loop involving auto-menu attempting to find the correct map.
  • The new network mode now displays lobby slots correctly.
  • Fixed a bug where Player::getKillScore returned the unit score instead of the kill score.
  • Fixed an issue where ordering a Protoss Photon Cannon, Terran Missile Turret, Zerg Sunken Colony, or Zerg Spore Colony to attack would perform no action.
  • Fixed a bug where Game::canUpgrade returned false positives when a required building was not present.
  • Fixed an issue where some bullet types such as the Subterranean Spines were inaccessible with CompleteMapInformation disabled.
  • Fixed an issue where area abilities such as EMP Shockwave could not be used on a unit target (Use_Tech_Unit).
  • Fixed a bug where two or more instances could conflict and crash when saving LastReplay.

BWAPI Beta 3.4 (r3347) {#changes_340b}

Changes:

  • Position::getApproxDistance now returns an integer and more accurately resembles the internal Starcraft function.
  • Player::allUnitCount now returns the number of accessible units of the given type for the given player. If complete map information is disabled, this will be equivalent to Player::visibleUnitCount.
  • Player::getUpgradeLevel now also returns information for enemy players when the Complete Map Information flag is disabled if at least one completed unit owned by that player that uses that upgrade type is accessible.
  • There has been a regression involving the optimization of issuing commands to multiple units at the same time (Stop, Hold, Cloak/Decloak, Burrow/Unburrow, Siege/Unsiege). This will not impact the behaviour of the game or the AI. It will however increase the APM of the AI.
  • Renamed Unit::getLastOrderFrame to Unit::getLastCommandFrame to make it consistent with Unit::getLastCommand, Unit::issueCommand, and Unit::canIssueCommand.

Additions:

  • Added Unit::isInWeaponRange which returns true if the specified target unit is in the immediate weapon range of the callee.
  • Added Player::visibleUnitCount which returns the number of visible units of the given type owned by the player.
  • Added Game::neutral - returns a pointer to the neutral player.
  • Added Game::allies - returns a reference to the set of ally players that have not left or been defeated.
  • Added Game::enemies - returns a reference to the set of enemy players that have not left or been defeated.
  • BWAPI will attempt to compare its revision/build with the AI revision/build and load the correct BWAPI module for the AI. Note: For the moment this only applies when attaching BWAPI to Starcraft and not when the module is loaded.
  • Added the following Player functions to retrieve player score: Player::getUnitScore, Player::getKillScore, Player::getBuildingScore, Player::getRazingScore, Player::getCustomScore.
  • Added the following UnitTypes which can be used as a macro: UnitTypes::AllUnits, UnitTypes::Men, UnitTypes::Buildings, UnitTypes::Factories.
  • Added UnitTypes::allMacroTypes for the introduced macros.
  • Added Unit::placeCOP which allows you to relocate Flag Beacons in Use Map Settings or Capture the Flag game types.
  • Added Unit::isAttackFrame - returns true if the unit is performing an attack animation or starting an attack.
  • Added the LPIP network mode known as "Local PC (Pipes)". This mode is compatible with Windows XP and previous revisions of BWAPI. However it has the same issue as the other custom network mode. Instructions are the same, copy the SNP file to the Starcraft directory.
  • Added Unit::getAcidSporeCount.
  • Added Unit::isInvincible.
  • Added Unit::getLastCommand - returns the last successful command that BWAPI issued to the unit.
  • Added UnitCommand::getUnit - returns the unit the command is for.
  • Added UnitCommand::getTarget - returns the target unit of the command, or null if there is no target unit.
  • Added UnitCommand::getTargetPosition - returns the target position of the command, or Positions::None if there is no target position.
  • Added UnitCommand::getTargetTilePosition - returns the target tile position of the command, or Positions::None if there is no target tile position.
  • Added UnitCommand::getUnitType - returns the unit type of the command, or UnitTypes::None if the command is not of type Build, Build_Addon, Train, or Morph.
  • Added UnitCommand::getTechType - returns the tech type of the command, or TechTypes::None if the command is not of type Research, Use_Tech, Use_Tech_Position, or Use_Tech_Unit.
  • Added UnitCommand::getUpgradeType - returns the upgrade type of the command, or UpgradeTypes::None if the command is not of type Upgrade.
  • Added UnitCommand::getSlot - returns the slot of the command, or -1 if the command is not of type Cancel_Train_Slot.
  • Applied a hack that now looks for files relative to the Starcraft directory first before checking the MPQ. Modifications to Starcraft can now be done without the need for MPQ management.

Bug Fixes:

  • Fixed a bug where Game::canBuildHere would do collision checks with flying and lifted units.
  • Fixed a bug where Game::enemy would return NULL if the enemy player left the game.
  • Fixed a bug where Unit::getUpgradeLevel would always return 0 in client programs when complete map information was disabled.
  • Fixed a bug where Game::printf and Game::sendText could cause a crash when called from the BWAPI Client using a formatting character % as part of the desired message.
  • Fixed a regression that prevented the use of Nuclear Missiles.
  • Corrected a mistake where Colors::Purple would appear Orange.
  • Fixed a crash involving a buffer overflow with text formatting for Game::printf, Game::sendText, and Game::drawText.
  • Fixed a bug where Unit::getLastOrderFrame would not reset to 0 at the start of a new match.
  • Fixed a bug where Starcraft would hang when attempting to connect a BWAPI Client to the BWAPI Server during a match.
  • Fixed a bug where some units were mistakenly considered selected.
  • Fixed a bug that prevented the placement of Infested Command Centers and Zerg Flag Beacons off the creep.
  • Fixed an issue where loaded units could be given orders.
  • Fixed an issue where Overlords would accept orders to load units when the Ventral Sacs upgrade was not researched.
  • Fixed an issue where completed transports would accept orders to load incomplete units and vice-versa.
  • Fixed an issue where heroes could not use abilities until the technology was researched.
  • Fixed an issue where Infested Kerrigan could not use all of her abilities.
  • Fixed an issue where our custom network modes would bring users back to the main menu instead of the game select menu.
  • Fixed a BWAPI Client crash that involved passing a NULL parameter to Player::isAlly and Player::isEnemy.

BWAPI Beta 3.3 (r3163) {#changes_330b}

Changes:

  • Game::canBuildHere now has an additional boolean value that allows the user to specify if the function should consider checking if they have first explored the area.
  • Tile position variables in Game functions have been clarified.
  • Game::getMouseX and Game::getMouseY have been removed due to deprecation. Use Game::getMousePosition instead.
  • Game::getScreenX and Game::getScreenY have been removed due to deprecation. Use Game::getScreenPosition instead.
  • Renamed Unit::setRallyPosition and Unit::setRallyUnit to Unit::setRallyPoint so that it conforms with the other commands.
  • [Config] Auto-menu options in the configuration file have been moved to the [auto_menu] group.
  • [Config] Renamed the auto_menu option LAN_UDP to LAN.
  • Removed UnitType::getSublabel, as it didn't appear to be significant.

New Functions:

  • Added UnitType::cloakingTech - returns the tech used to cloak the unit, or TechTypes::None if the unit cannot cloak or is permanently cloaked
  • Added Unit::getPowerUp - returns the power up the unit is holding, or NULL if the unit is not holding a power up
  • Added Unit::isInterruptible - returns true if the unit can be interrupted without issuing a stop or one of the cancel commands.
  • Added Unit::isStuck - Returns true if the unit is "stuck" on other units.
  • Made Game::setLastError available.
  • Added several UnitType functions: UnitType::isHero, UnitType::isPowerup, UnitType::isBeacon, UnitType::isFlagBeacon, UnitType::isSpecialBuilding, and UnitType::isSpell.
  • Added Game::getInstanceNumber to identify which instance an AI module belongs to.
  • Added several Player functions for obtaining upgraded unit type stats, including Player::topSpeed, Player::groundWeaponMaxRange, Player::airWeaponMaxRange, Player::sightRange, Player::groundWeaponDamageCooldown, and Player::armor.
  • Added TechType::targetsUnit - returns true if the tech type requires a unit to target.
  • Added TechType::targetsPosition - returns true if the tech type requires a position to target.
  • Added Game::getNukeDots - returns the set of accessible nuke dots on the map.
  • Added Unit::canIssueCommand - use to see if you can issue a command to the given unit, without actually executing it.
  • Added Game::issueCommand - issues a command to a set of units.

New Config Features:

  • [Config] Added the ability to load different revisions of BWAPI for different modules using the config options ai_dll_rev and ai_dll_#_rev.
  • [Config] Added auto-menu race options RandomTP, RandomTZ, and RandomPZ which allows you to randomly choose one of two races.
  • [Config] Added the auto-menu option lan_mode which allows you to choose between the different multiplayer network modes.
  • [Config] For auto-menu, added the ability to choose a race for specific enemy players using enemy_race_#.

Other New Features:

  • [W-Mode] The position of the window in the config now changes when a new multiple-instance compatible client is launched.
  • BWAPI can now play networked games between multiple instances using the BWAPI network module (BWAPI_SNPModule.snp) which currently supports winsock UDP on localhost. Bad news: Windows XP users may experience failure. Good news: It can be used with older BWAPI revisions.
  • Added Heroes, Beacons, and Standard Powerups to UnitTypes. This gives you more flexibility for Capture The Flag and Use Map Settings (including Campaigns).
  • Added hero weapons to WeaponTypes.
  • BWAPI now supports a native Windowed mode. Pressing ALT+Enter or typing /wmode will toggle between fullscreen and windowed mode. (Note that this windowed mode is not compatible with Battle.net)
  • Added Errors::Invalid_Tile_Position - returned when you try to build something at an invalid tile position.

Bug Fixes:

  • Fixed a bug where Unit::hasPath would not work correctly in BWAPI Client programs.
  • Fixed a bug where Unit::getResourceGroup would not work correctly in BWAPI Client programs.
  • Fix several issues for commands that were being sent repetitively and for actions that couldn't actually be performed.
  • Several functions in the BWAPI Client have been updated to match behaviours and fix issues that were once in the BWAPI server.
  • Fixed some unlikely crashes, possibly related to the compatibility with other hacks.
  • Fixed a bug where unit command error codes wouldn't be generated correctly in BWAPI Client.
  • Fixed a bug where networked games involving auto_menu would desynchronize.
  • Fixed a bug where calling Game::restartGame would not work correctly during AIModule::onEnd.
  • Fixed a bug where restarting the game wouldn't work correctly for BWAPI client programs.

BWAPI Beta 3.2 (r2917) {#changes_320b}

Changes:

  • A Debug build now loads the AI specified by ai_dll_dbg (ai_dll_#_dbg for multiple instances) in bwapi.ini.
  • When the user selects a unit, the command is not processed unless it is given an order. (Decrease action count)
  • Position and TilePosition conversions are now explicit.
  • Issuing Stop, Hold Position, Siege, Unsiege, Cloak, Decloak, Burrow, or Unburrow for multiple units in the same frame will perform the commands in groups instead of individually. (Decrease APM).
  • canUpgrade and canResearch with a Unit* specified will now fail if the unit is busy.

New Features:

  • Added auto_restart option to bwapi.ini.
  • Added Game::getReplayFrameCount - Retrieves the maximum number of frames in a replay.
  • Added a save_replay option to bwapi.ini which copies LastReplay?.rep to the destination specified.
  • Added a sound option to bwapi.ini which allows you to disable all Starcraft sound functionality to increase performance.
  • Added Game::setGUI which allows you to disable all rendering within the game for a huge performance increase.

Bug Fixes:

  • Fix a bug where canMake would fail to work correctly when units of a different race are owned.
  • Fix an issue where ChaosLauncherInjector and MPQDraftInjector were using a non-standard registry call.
  • Fix an issue where an MPQDraft executable failed to find the bwapi-folder when launched from a different directory.
  • Fix an issue that prevented Player::getUpgradeLevel() from working correctly.
  • Fix an issue that performed auto-menu key presses outside of Starcraft.
  • Fix an issue where the neutral player was not being processed correctly.

BWAPI Beta 3.1.1 (r2864) {#changes_311b}

Changes:

  • bwapi-errors are now written to the logs folder with a time and date stamp.
  • Using train or morph(unit) on a hatchery, lair, or hive will automatically issue the order to a larva.
  • Ordering a Nydus Canal to build a Nydus Canal will allow you to place the Nydus exit.
  • Changed the palette index for some Colors and updated the colors for sendText in Single Player.
  • The Config button in ChaosLauncherInjector and MPQDraftInjector will now load the BWAPI config file from the Starcraft path obtained by the registry.

New features:

  • Added Unit::getResourceGroup - Returns a group index for a resource to identify which base it belongs to.
  • Implemented the Nydus Canal. You can now tell a Nydus Canal to build an exit.
  • Added Unit::hasPath(Unit *target), a macro function that calls hasPath for the target unit.
  • Added the following Color constants: Colors::Brown and Colors::Teal.
  • Added Player::getColor and Player::getTextColor to retrieve a player's color for drawing and control character for text messages.

Bug fixes:

  • Fixed a desynch caused by a large number of commands being processed.
  • Fixed restartGame which was broken in a previous release.
  • Fixed a crash when passing a NULL target to Unit::getDistance().
  • Fixed an issue where Map::getMapHash() failed on campaign maps.
  • Fixed a bug that prevented sending text when no module is loaded.
  • Fixed a bug involving duplicate cheat codes.
  • Fixed a bug where onMorph would sometimes be called when a building finished morphing, rather than when it began morphing.
  • Fixed a canBuildHere issue involving the message "Couldn't reach building site".
  • Fix an issue where hasPath failed at cliff edges.

BWAPI Beta 3.1 (r2796) {#changes 310b}

The following features have been altered:

  • Player::isAlly, Player::isEnemy, and Game::enemy no longer include players that don't start with any supply (used or available).
  • Using a hacked executable, ChaosLauncher can now run multiple instances of Starcraft. Each instance of BWAPI can load a different AI module specified in the configuration(bwapi.ini) file. There are plans for inter-process communication as a network module.

The following functions have been added:

  • Game::getLatencyFrames - returns the maximum number of frames for a command to be processed.
  • Game::getLatencyTime - returns the maximum time for a command to be processed (milliseconds).
  • Game::getRemainingLatencyFrames - returns the remaining number of frames for a command to be processed, according to the current frame.
  • Game::getRemainingLatencyTime - returns the remaining time for a command to be processed (milliseconds), according to the current tick count.
  • Game::getRevision - returns the current BWAPI revision number
  • Game::isDebug - returns whether the current build is debug mode or not
  • Game::sendTextEx - allows the AI to send a text message to allies only
  • Unit::hasPath - checks if the unit and target specified are on the same island
  • Game::isLatComEnabled - returns true if latency compensation is enabled
  • Game::setLatCom - use to enable or disable latency compensation; Default: Enabled
  • Unit::getLastOrderFrame - Returns the frame of the last successful order issued.
  • Unit::setClientInfo - Sets the unit's custom client info. The client is responsible for deallocation. In other words, this allows the user to associate data with the unit.
  • Unit::getClientInfo - Returns the unit's custom client info. The client is responsible for deallocation.

Bug fixes:

  • Fixed a bug where multiple onEnd events would be produced.
  • Fixed a bug where onFrame was called after onEnd.
  • Fixed a bug where neutral buildings were not included in getStaticNeutralUnits when called from the client process.
  • Fixed a bug that caused Starcraft to randomly pause for 100ms every couple of seconds.
  • Fixed a bug that caused Starcraft to crash while retrieving force names.
  • Fixed an off-by-one issue when retrieving force names.
  • Fixed a compatibility issue with auto-menu and a non-english locale.
  • Fixed a user bug when attempting to recall(hotkey) a group of units.
  • Fixed a bug involving the inability to retrieve enemy upgrades via Unit::getUpgradeLevel(UpgradeType).
  • Fixed an issue with canBuildHere failing when units are at a valid position on the same tile.
  • Fixed an issue with hasPower failing for 4x3 buildings at the top-most position of the power range.
  • Fixed a bug where canMake will fail for Mutalisks when a Greater Spire is owned.
  • Fixed an issue with an unhandled canBuildHere requirements that produces the message "You must explore there first.".
  • Fixed an auto-menu bug that would pause at the end of a Replay in Single Player.
  • Fixed an issue that would reselect the user's unit every time BWAPI performed an action. Reduces APM by 1/3.

BWAPI Beta 3.0.3 (r2639) {#changes_303b}

Fixed a bug with BWAPI's frame 0 accessibility where BWTA would not identify base locations when run on the client.

BWAPI Beta 3.0.2 (r2635) {#changes_302b}

Fixed order of UnitDiscover/UnitEvade events.

BWAPI Beta 3.0.1 (r2630) {#changes_301b}

Fixed order of events/callbacks.

BWAPI Beta 3.0 (r2627) {#changes_300b}

The internal implementation of the Unit class has been refactored to optimize performance for the client-server architecture.

Unit IDs now increment from 0, rather than just casting the unit address as an int.

Menu automation has increased speed and several more dialogs are automated.

The following callbacks have been added:

  • AIModule::onUnitDiscover - called when a unit becomes accessible
  • AIModule::onUnitEvade - called right before a unit becomes inaccessible

The following Events have been added:

  • Event::UnitDiscover - corresponds with AIModule::onUnitDiscover
  • Event::UnitEvade - corresponds with AIModule::onUnitEvade

The following functions have been added:

  • Game::getGroundHeight(TilePosition position) - works same way as Game::getGroundHeight(int x, int y)

  • Game::getFPS - returns the frames per second the game is running at.

  • Game::getAverageFPS - returns the exponential moving average frames per second.

  • Game::setTextSize - sets the text size for drawText commands.

  • Game::mapPathName - returns the path and file name of the map.

  • Game::getForce - returns the Force object with the given force ID, or NULL if no force has the given ID.

  • Game::getPlayer - returns the Player object with the given player ID, or NULL if no player has the given ID.

  • Game::getUnit - returns the Unit object with the given unit ID, or NULL if no unit has the given ID.

  • Unit::getCarrier - returns the carrier that this unit belongs to, or NULL if this unit is not an Interceptor or if its carrier has recently been destroyed.

  • Unit::getInterceptors - Returns the set of interceptors owned by this carrier. The interceptors inside the carrier can be obtained via getLoadedUnits, while the interceptors outside of the carrier is the difference of these two sets.

  • Unit::getNydusExit - Returns the Nydus Canal unit that is connected to this Nydus Canal, or NULL if the unit doesn't have a connecting Nydus Canal.

  • Unit::hasNuke - returns true for nuclear missile silos that have a nuke ready.

  • Unit::isDetected - returns true if the unit is visible and detected/targetable. If this is false and Unit::isVisible is true, then the unit is only partially visible, and won't be targetable until a science vessel, overlord, or some other detection unit comes in range and detects the unit.

  • Unit::isHoldingPosition - returns true if the unit is holding position.

  • Unit::gather - orders the unit to gather the specified mineral patch or refinery/extractor/assimilator

  • Unit::move - orders the unit to move to the specified position

  • TechType::researchTime - returns the number of frames needed to research the given tech type.

  • Position::isValid - returns true if the position is on the map.

  • Position::makeValid - modifies the position so that it becomes valid (on the map), moving it at little as possible

  • TilePosition::makeValid - modifies the tile position so that it becomes valid (on the map), moving it at little as possible

The following functions have been renamed:

  • Game::mapFilename has been renamed to Game::mapFileName.
  • Game::getMapHash has been renamed to Game::mapHash and it now returns the sda1 hash of the map file as a std::string.

The following error codes have been added:

  • Error::Currently_Researching - generated when you try to tell a unit to research a TechType that is already being researched (at that unit or another unit).
  • Error::Currently_Upgrading - generated when you try to tell a unit to upgrade an UpgradeType that is already being upgraded (at that unit or another unit).

The following UpgradeTypes have been renamed:

  • Protoss_Armor -> Protoss_Ground_Armor
  • Protoss_Plating -> Protoss_Air_Armor
  • Charon_Booster -> Charon_Boosters

Renamed UnitCommandType::Attack_Position to UnitCommandType::Attack_Move.

The following Orders have been renamed/merged:

  • SiegeMode -> Sieging
  • TankMode -> Unsieging
  • Burrow -> Burrowing
  • Unburrow -> Unburrowing
  • StrafeUnit1 -> InterceptorAttack
  • StrafeUnit2 -> ScarabAttack
  • Return -> InterceptorReturn
  • Rightclickaction -> RightClickAction
  • ReaverStop -> Stop
  • CarrierStop -> Stop
  • Attack1 -> AttackUnit
  • Attack2 -> AttackUnit
  • CarrierAttack1 -> AttackUnit
  • CarrierAttack2 -> AttackUnit
  • CarrierFight -> AttackUnit
  • ReaverAttack1 -> AttackUnit
  • ReaverAttack2 -> AttackUnit
  • ReaverFight -> AttackUnit
  • StayinRange -> AttackUnit
  • SapUnit -> AttackUnit
  • WatchTarget -> AttackUnit
  • TowerAttack -> AttackUnit
  • TurretAttack -> AttackUnit
  • AttackFixedRange -> AttackUnit
  • CarrierHoldPosition -> HoldPosition
  • QueenHoldPosition -> HoldPosition
  • SuicideHoldPosition -> HoldPosition
  • MedicHoldPosition -> HoldPosition
  • ReaverHoldPosition -> HoldPosition
  • BuildTerran -> PlaceBuilding
  • BuildProtoss1 -> PlaceBuilding
  • DroneStartBuild -> PlaceBuilding
  • DroneLand -> PlaceBuilding
  • SapLocation -> AttackMove
  • Repair1 -> Repair
  • Repair2 -> Repair
  • FireYamatoGun1 -> FireYamatoGun
  • FireYamatoGun2 -> FireYamatoGun
  • InfestMine1 -> InfestedCommandCenter
  • InfestMine2 -> CastInfestation
  • InfestMine3 -> CastInfestation
  • InfestMine4 -> InfestingCommandCenter
  • TerranBuildSelf -> IncompleteBuilding
  • ProtossBuildSelf -> IncompleteBuilding
  • DroneBuild -> IncompleteBuilding
  • ZergBuildSelf -> IncompleteBuilding
  • WarpingArchon -> ArchonWarp
  • WarpingDarkArchon -> DarkArchonMeld
  • MagnaPulse -> CastLockdown
  • DarkSwarm -> CastDarkSwarm
  • SummonBroodlings -> CastSpawnBroodlings
  • EmpShockwave -> CastEMPShockwave
  • NukePaint -> CastNuclearStrike
  • NukeGround -> CastNuclearStrike
  • PlaceScanner -> CastScannerSweep
  • DefensiveMatrix -> CastDefensiveMatrix
  • PsiStorm -> CastPsionicStorm
  • Irradiate -> CastIrradiate
  • Plague -> CastPlague
  • Consume -> CastConsume
  • Ensnare -> CastEnsnare
  • StasisField -> CastStasisField
  • Hallucination1 -> CastHallucination
  • Restoration -> CastRestoration
  • ResetCollision1 -> ResetCollision
  • ResetCollision2 -> ResetCollision
  • InitPsiProvider -> Nothing
  • InitArbiter -> PlayerGuard
  • Teleport -> CastRecall

The following functions have changed in functionality:

  • Game::getGroundHeight now accepts build tile coordinates rather than walk tile coordinates.
  • Unit::getLoadedUnits now returns a set rather than a list.
  • AIModule::onSendText now has a void return type, rather than bool. Instead of returning true you can use Game::printf or Game::sendText to send the message.

Bug fixes:

  • Fixed a bug where Game::getGroundHeight would always return 0 for tiles until Zerg Creep.
  • Fixed a bug where Unit::isConstructing would not return true for Terran buildings that are constructing add-ons
  • Fixed a bug where Unit::isIdle would sometimes return true when the unit is Constructing
  • Fixed a bug where Unit::getBuildType would not work for Terran buildings that are constructing add-ons
  • Fixed a bug where Unit::isConstructing would not return true for incomplete Terran add-ons that are being constructed.
  • Fixed a bug where Unit::getBuildUnit would return NULL for incomplete Terran add-ons that are being constructed.
  • Fixed a bug where Unit::isTraining would not return true for Reavers or Carriers.
  • Fixed a bug where Unit::getRemainingTrainTime would incorrectly return 0 on some frames due to latency.
  • Fixed a bug where Unit::getType would not immediately switch to Egg/Lurker Egg/Cocoon after issuing a morph command to a unit
  • Fixed a bug where Unit::isBeingConstructed would return false for morphing Zerg units
  • Fixed a bug where Unit::isConstructing would return false morphing Zerg units
  • Fixed a bug where Unit::isIdle would return true morphing Zerg units
  • Fixed a bug where Unit::getBuildType would sometimes return UnitTypes::None for morphing Zerg units
  • Fixed a bug where Unit::getRemainingBuildTime would sometimes return incorrect values for morphing Zerg units
  • Fixed a bug where Unit::getRemainingResearchTime would sometimes return 0 due to latency.
  • Fixed a bug where Unit::getRemainingUpgradeTime would sometimes return 0 due to latency.
  • Fixed a bug where Game::canResearch would return true while another unit was researching the same TechType.
  • Fixed a bug where Game::canUpgrade would return true while another unit was upgrading the same UpgradeType.
  • Fixed a bug with UpgradeType::Apial_Sensors.whatResearches() so that it now correctly returns UnitTypes::Protoss_Fleet_Beacon.
  • Fixed a bug with Unit::getTransport so that it works for Protoss Interceptors
  • Fixed a bug with Unit::isLoaded so that it returns true if and only if Unit::getTransport!=NULL.
  • Fixed a bug with Unit::getLoadedUnits so that it also returns the Interceptors currently loaded inside a Protoss Carrier.
  • Fixed a bug where Unit::getPosition and Unit::getTilePosition would return incorrect positions for loaded units.
  • Fixed a bug where Unit::useTech would not cast Maelstroms.
  • Fixed a bug where Unit::useTech would not work for Nuclear Missiles.
  • Fixed a bug where Siege Tanks, Goliaths, Reavers, and Carriers would not attack when given an attackUnit command.
  • Fixed a bug where Starcraft would crash when an AI issued a stop command to a Reaver or Carrier.
  • Fixed a bug where Game::unitsOnTile would incorrectly include Terran Add-ons for tiles that did not contain a Terran Add-on.
  • Fixed a bug where Unit::isBeingHealed wouldn't work. Now returns true for Terran units that are being healed or repaired.

BWAPI Beta 2.8 (r2422) {#changes_280b}

Added menu automation - you can now automatically start replays and games with no manual user interaction.

New classes:

  • Added class GameType.
  • Added class Bullet.

The following functions have been added:

  • Added AIModule::onReceiveText - called when messages are received from other players.
  • Added Game::isBattleNet - returns true during games being played on BattleNet.
  • Added Game::getBullets - returns the set of accessible bullets.
  • Added Game::getGameType - returns the game type of the current match.
  • Added Player::maxEnergy - returns the max energy for the unit type, taking into account the player's upgrades.

The following functions have changed in functionality:

  • Unit::getHitPoints now rounds up to nearest integer rather than down.
  • Unit::getShields now rounds up to nearest integer rather than down.
  • Unit::getEnergy now rounds up to nearest integer rather than down.
  • Game::enableFlag can now also be called in AIModule::onFrame() during frame 0.

All neutral units are accessible in AIModule::onFrame() during frame 0.

The AttackType class has been renamed to BulletType.

The following functions are now case-insensitive for the strings they accept:

  • BulletTypes::getBulletType
  • DamageTypes::getDamageType
  • Errors::getError
  • ExplosionTypes::getExplosionType
  • GameTypes::getGameType
  • Orders::getOrder
  • PlayerTypes::getPlayerType
  • Races::getRace
  • TechTypes::getTechType
  • UnitCommandTypes::getUnitCommandType
  • UnitSizeTypes::getUnitSizeType
  • UnitTypes::getUnitType
  • UpgradeTypes::getUpgradeType
  • WeaponTypes::getWeaponType

Player::playerType has been renamed to Player::getType.

The following PlayerTypes have been renamed:

  • NotUsed -> None
  • Human -> Player
  • Rescuable -> RescuePassive
  • Unknown0 -> Unknown4
  • ComputerSlot -> EitherPreferComputer
  • OpenSlot -> EitherPreferHuman
  • ClosedSlot -> Closed
  • Unknown1 -> Observer
  • HumanDefeated -> PlayerLeft
  • ComputerDefeated -> ComputerLeft

Bug Fixes:

  • Fixed a bug where Game::getLatency would return incorrect values for games played on BattleNet.
  • Fixed a bug where Unit::getGroundWeaponCooldown would always return 0 and Unit::isStartingAttack would always return false and for Protoss Reavers.
  • Fixed a bug with AIModule::onSendText.
  • Fixed a bug where AIModule::onUnitDestroy was being called for invisible units with complete map info disabled.
  • Fixed a bug where both cheat flags would automatically be enabled when running the AI as a client process.
  • Fixed a bug where Game::enableFlag would not work when called from a client process.

BWAPI Beta 2.7.2 (r2239) {#changes_272b}

Fixed a bug in GameImpl::spriteToUnit which caused the game to crash every once in a while.

BWAPI Beta 2.7.1 (r2224) {#changes_271b}

AIs can now connect from another process using BWAPIClient.lib.

New enums:

  • Added enum EventType

New classes:

  • Added class Event
  • Added class UnitCommand
  • Added class UnitCommandType

The following functions have been added:

  • Added AIModule::onSaveGame - called when the user saves the single player match. Currently is triggered twice.
  • Added Game::getEvents - returns the set of events for the frame
  • Added Game::indexToUnit - returns the Unit currently at the given index in Starcraft's internal Unit table. Only available when the Complete Map Information flag is enabled.
  • Added Game::isInGame - returns true if Broodwar is currently in a match
  • Added Unit::isAttacking - returns true if the unit is attacking. Does not yet work for siege tanks or goliaths.
  • Added Unit::isVisible(Player* player) - returns true if the given player can see the given unit. Only available in replays or if the complete map information flag has been enabled.
  • Added Unit::issueCommand - general purpose function to issue any valid unit command.

All member functions of Race, TechType, UnitType, UpgradeType, WeaponType now return other objects by value instead of by pointer. For example TechType::whatResearches returns a UnitType object rather than a const pointer to a UnitType object.

The following Orders have been renamed:

  • Nothing1 -> UnusedNothing
  • Powerup1 -> UnusedPowerup
  • Nothing2 -> Nothing
  • RallyPoint1 -> RallyPointUnit
  • RallyPoint2 -> RallyPointTile
  • Morph1 -> ZergUnitMorph
  • Morph2 -> ZergBuildingMorph
  • BuildSelf1 -> TerranBuildSelf
  • Build5 -> BuildNydusExit
  • Enternyduscanal -> EnterNydusCanal
  • BuildSelf2 -> ProtossBuildSelf
  • CarrierIgnore1 -> ReaverCarrierMove
  • HoldPosition1 -> CarrierHoldPosition
  • ReaverHold -> ReaverHoldPosition
  • RechargeShields1 -> RechargeShieldsUnit
  • Rechargeshields2 -> RechargeShieldsBattery
  • BuildingLiftoff -> BuildingLiftOff
  • DroneLiftoff -> DroneLiftOff
  • Liftoff -> LiftingOff
  • Harvest5 -> Interrupted
  • Pickup1 -> PickupIdle
  • Pickup2 -> PickupTransport
  • Pickup3 -> PickupBunker
  • Powerup2 -> PowerupIdle
  • HoldPosition2 -> HoldPosition
  • HoldPosition3 -> QueenHoldPosition
  • HoldPosition4 -> SuicideHoldPosition

Bug Fixes:

  • Fixed a bug where Unit::getGroundWeaponCooldown would always return 0 for Siege Tanks and Goliaths.
  • Fixed a bug where Unit::getAirWeaponCooldown would always return 0 for Goliaths.
  • Fixed a bug with Unit::isConstructing - now also returns true when the unit's order is TerranBuildSelf, ProtossBuildSelf, ZergBuildSelf, BuildNydusExit, and BuildAddon.
  • Fixed a bug with Unit::isIdle - now also returns true when the unit's order is Reaver, Neutral, TowerGuard, and Burrowed.
  • Fixed a bug with Unit::isMorphing - now also returns true when the unit's order is ZergBirth.
  • Fixed a bug where Unit::isTraining - would return true for morphing hatcheries, lairs, and hives.
  • Fixed a bug where Unit::useTech would not work for Archon_Warp or Dark_Archon_Meld.
  • Fixed a bug where Game::canBuildHere would return true for refineries over geysers that already have refineries on them.
  • Fixed a bug where Game::setScreenPosition would crash the game if given a position with negative coordinate values.
  • Fixed a bug where Game::isBuildable would return true for the inaccessible row of tiles at the bottom of the map.
  • Fixed a bug where Game::isWalkable would return true for the four inaccessible rows of tiles at the bottom of the map.
  • Fixed a bug where UnitType::maxGroundHits would return 0 for Terran Siege Tank Siege Mode, Terran Siege Tank Tank Mode, and Terran Goliath.
  • Fixed a bug where UnitType::maxAirHits would return 0 for Terran Goliath.

BWAPI Beta 2.6.1 (r1914) {#changes_261b}

  • Added Unit::getID - returns a unique ID for the unit.
  • Fixed a crash inadvertently introduced in BWAPI Beta 2.6 related to the new mouse and key state functionality.

BWAPI Beta 2.6 (r1910) {#changes_260b}

  • Added Unit::getLarva - returns a set of 0, 1, 2, or 3 larva units that have spawned from the given Hatchery, Lair, or Hive.
  • Added Unit::getHatchery - returns the Hatchery, Lair, or Hive that spawned the given larva. Returns NULL if the unit is not a Zerg Larva.
  • Added Unit::returnCargo - returns the worker's cargo (minerals/gas) to a nearby resource depot. Works the same way as the "Return Cargo" button in the Starcraft GUI.
  • Added Position::getApproxDistance - an approximate distance function similar to the one starcraft uses.
  • Added Player::isDefeated - returns true if the player has been defeated
  • Added Player::isVictorious - returns true if the player has achieved victory.
  • Added Game::getMousePosition - returns the position of the mouse on the screen.
  • Added Game::getScreenPosition - returns the position of the screen on the map.
  • Added Game::setScreenPosition - moves the screen to the given position on the map.
  • Added Game::pingMinimap - pings the given position on the minimap.
  • Added Game::getMouseState - returns true if the specified MouseButton is pressed
  • Added Game::getKeyState - returns true if the specified Key is pressed

The following functions have changed in functionality:

  • AIModule::onEnd is now called before any user interaction at the end of games and replays.
  • Game::getFrameCount no longer increases while the game is paused, however AIModule::onFrame is still called.
  • Unit::getRemainingTrainTime now returns the number of frames until the next larva spawns at the given Hatchery, Lair, or Hive. Works as before on other unit types.
  • Unit::getDistance(Unit* target) now computes the distance between units more similar to the way starcraft computes distance between units when determining if a unit is in attack range.
  • Unit::getDefenseMatrixPoints now returns actual defense matrix hit points (not multiplied by 256).

Bug fixes:

  • Fixed a bug where scourge that suicide into other units would not produce an AIModule::onUnitDestroy message.
  • Fixed a bug where Game::canUpgrade would sometimes return true even though the player did not have enough resources.
  • Fixed a bug where Unit::cancelTrain would not cancel Terran Nuclear Missiles when called on a Terran Nuclear Missile Silo.
  • Fixed a bug where Unit::isTraining would return false when called on a Terran Nuclear Missile Silo training a Terran Nuclear Missile.
  • Fixed a bug where Unit::getTrainingQueue would return and empty list when called on a Terran Nuclear Missile Silo training a Terran Nuclear Missile.

BWAPI Beta 2.5 (r1830) {#changes_250b}

  • Added a logging option to bwapi.ini - by default it is set to off.

  • Added TechType::getRace (the function was declared before but not actually implemented).

  • Added Unit::getBuildType - returns the building type a worker is about to construct. If the unit is a morphing Zerg unit or an incomplete building, this returns the UnitType the unit is about to become upon completion.

  • Fixed TechTypes::Restoration.whatResearches() so that it now returns UnitTypes::Terran_Academy.

  • Fixed a bug where Game::canBuildHere would return true even when a nexus/command center/hatchery was too close to invisible minerals/geysers. The function now uses static mineral and geyser data and assumes mineral fields exist unless it can see the build tile where the mineral is supposed to be, and cannot see the mineral unit.

  • Fixed a bug where Unit::isIdle would return false after a worker failed to start construction of a building.

  • Fixed a bug where using Siege Tanks would cause the game to crash.

  • Fixed a bug where BWAPI would crash on game end if a player left during the game.

  • Fixed a bug where Unit::isGatheringGas would sometimes return false for drones harvesting gas into a morphing Hatchery.

  • Fixed a bug where chat messages in multiplayer games would either appear garbled or not show at all.

BWAPI Beta 2.4 (r1689) {#changes_240b}

  • Added AttackType class, however this won't be of much use until the Attack class is implemented (which will let AI Modules "see" projectiles, bullets, psi storms, lurker attacks, etc).

  • Added Game::isExplored - returns true for tiles that are visible or were visible at some point earlier in the match.

  • Added Unit::isBeingGathered - returns true for mineral patches and the three types of refineries when a unit is gathering from it.

  • Renamed Game::buildable to Game::isBuildable

  • Renamed Game::walkable to Game::isWalkable

  • Renamed Game::visible to Game::isVisible

  • Renamed Game::groundHeight to Game::getGroundHeight

  • Added TilePosition versions of Game::isBuildable, Game::isVisible, Game::hasCreep, and Game::hasPower.

The following functions have changed in functionality:

  • UnitType::seekRange now returns the seek range in pixels.
  • UnitType::sightRange now returns the sight range in pixels.
  • UnitType::maxHitPoints now returns actual max hit points (not multiplied by 256).
  • Unit::getHitPoints now returns actual current hit points (not multiplied by 256).
  • Unit::getShields now returns actual current shields (not multiplied by 256).
  • Unit::getEnergy now returns actual current energy (not multiplied by 256).
  • UnitType::canAttack now returns false for overlords, dropships, and other types of units that cannot attack.
  • Player::hasResearched now returns true for abilities that the player has researched by default, such as Scanner Sweep.
  • Game::getFrameCount now counts from 0. So the first frame is frame 0.
  • Game::sendText now processes most cheat codes in single player games. For example, typing Broodwar->sendText("black sheep wall") will reveal the entire map.

Bug fixes:

  • Fixed a bug where Game::isVisible would crash the program when called during a replay.
  • Fixed a bug where Unit::setRallyPosition and Unit::setRallyUnit would not execute properly.
  • Fixed a bug where Unit::patrol would appear to change the position of the unit to the target position.
  • Fixed a bug where Unit::isStartingAttack would always be false for certain types of units, even when they were attacking.
  • Fixed a bug where scanner sweep (and possibly other tech types that don't need to be researched) would not work.
  • Fixed a bug where AIModule::onFrame would be called twice on the first frame.
  • Fixed a bug where Unit::train would not allow more than one unit to be added to the training queue.
  • Fixed a bug where AIModule::onUnitDestroy would not be called for units loaded into dropships/shuttles/overlords when the transport unit was destroyed.
  • Fixed UnitType::topSpeed, Unit::getVelocityX, and Unit::getVelocityY. Everything should now be in pixels per frame.

BWAPI Beta 2.3 (r1610) {#changes_230b}

  • bwapi.ini file no longer accepts curly brace definitions.

The following functions have been added:

  • AIModule::onUnitRenegade - called when a unit changes ownership.
  • AIModule::onPlayerLeft - called when a player leaves the game.
  • AIModule::onNukeDetect - called when a nuclear launch has been detected. If the target position is visible at the time of launch (or complete map information is enabled), the target position is provided.
  • Game::restartGame - restarts the single player match.
  • Unit::getUpgradeLevel - returns the upgrade level of the unit.
  • Unit::getVelocityX - returns the x component of velocity in pixels per frame.
  • Unit::getVelocityY - returns the y component of velocity in pixels per frame.
  • Player::leftGame - returns true if the player has left the game.
  • UnitType::upgrades - returns the set of upgrades that can affect this UnitType.
  • UpgradeType::whatUses - returns the set of unit types that are affected by this UpgradeType.

The following functions have been renamed:

  • Unit::getCurrentDirection has been renamed to Unit::getAngle

  • Player::researching has been renamed to Player::isResearching

  • Player::researched has been renamed to Player::hasResearched

  • Player::upgrading has been renamed to Player::isUpgrading

  • Player::upgradeLevel has been renamed to Player::getUpgradeLevel

  • Game::drawMapBox has been renamed to Game::drawBoxMap

  • Game::drawMouseBox has been renamed to Game::drawBoxMouse

  • Game::drawScreenBox has been renamed to Game::drawBoxScreen

  • Game::drawMapTriangle has been renamed to Game::drawTriangleMap

  • Game::drawMouseTriangle has been renamed to Game::drawTriangleMouse

  • Game::drawScreenTriangle has been renamed to Game::drawTriangleScreen

  • Game::drawMapCircle has been renamed to Game::drawCircleMap

  • Game::drawMouseCircle has been renamed to Game::drawCircleMouse

  • Game::drawScreenCircle has been renamed to Game::drawCircleScreen

  • Game::drawMapEllipse has been renamed to Game::drawEllipseMap

  • Game::drawMouseEllipse has been renamed to Game::drawEllipseMouse

  • Game::drawScreenEllipse has been renamed to Game::drawEllipseScreen

  • Game::drawMapDot has been renamed to Game::drawDotMap

  • Game::drawMouseDot has been renamed to Game::drawDotMouse

  • Game::drawScreenDot has been renamed to Game::drawDotScreen

  • Game::drawMapLine has been renamed to Game::drawLineMap

  • Game::drawMouseLine has been renamed to Game::drawLineMouse

  • Game::drawScreenLine has been renamed to Game::drawLineScreen

When complete map information is disabled, the following function no longer provide information about enemy units, regardless of visibility:

  • Unit::isHallucination
  • Unit::isLoaded
  • Unit::getTrainingQueue
  • Unit::getTransport
  • Unit::getLoadedUnits
  • Unit::getScarabCount
  • Unit::getSpiderMineCount
  • Unit::getTech
  • Unit::getUpgrade
  • Unit::getRemainingResearchTime
  • Unit::getRemainingUpgradeTime
  • Unit::isResearching
  • Unit::isUpgrading
  • Unit::getRallyPosition
  • Unit::getRallyUnit

To determine if a visible enemy unit is busy researching or upgrading, use Unit::isIdle.

The following functions have changed in functionality:

  • Unit::getAngle (renamed from Unit::getCurrentDirection) now returns the angle of the unit in radians.
  • UnitType::topSpeed now returns the correct top speed of the UnitType in pixels per frame.
  • Game::leaveGame now goes to the after-match stats screen, rather than going to the main menu.
  • AIModule::onEnd is now called with an argument isWinner, which is true if the ai module has won the game.

Bug fixes:

  • Fixed a bug where Game::drawTextMap would use screen coordinates. It now uses map coordinates as expected.
  • Fixed a bug where attackUnit, rightClick, and other orders which take a target unit would not target the right unit in the game.
  • Fixed a bug where Unit::isGatheringGas and Unit::isGatheringMinerals would sometimes return false, even though the unit was gathering gas/minerals.
  • Fixed a bug where getUnits() functions would return an incomplete list of units when called from onUnitMorph, onUnitShow, or onUnitHide.

Other changes:

  • Added documentation of how to draw text in different colors.
  • Increased speed of multiplayer menus.

BWAPI Beta 2.2 (r1491) {#changes_220b}

The following functions have been added:

  • AIModule::onUnitShow

  • AIModule::onUnitHide

  • AIModule::onUnitMorph

  • Unit::getInitialType

  • Unit::getInitialPosition

  • Unit::getInitialTilePosition

  • Unit::getInitialResources

  • Unit::getInitialHitPoints

  • Game::isMultiplayer

  • Game::isPaused

  • Game::getStaticMinerals

  • Game::getStaticGeysers

  • Game::getStaticNeutralUnits

  • Game::drawTextMap

  • Game::drawTextMouse

  • Game::drawTextScreen

  • Game::drawMapBox

  • Game::drawMouseBox

  • Game::drawScreenBox

  • Game::drawMapTriangle

  • Game::drawMouseTriangle

  • Game::drawScreenTriangle

  • Game::drawMapCircle

  • Game::drawMouseCircle

  • Game::drawScreenCircle

  • Game::drawMapEllipse

  • Game::drawMouseEllipse

  • Game::drawScreenEllipse

  • Game::drawMapDot

  • Game::drawMouseDot

  • Game::drawScreenDot

  • Game::drawMapLine

  • Game::drawMouseLine

  • Game::drawScreenLine

The following functions have changed in functionality:

  • Unit::exists - now returns false for inaccessible units, even if they exist.
  • AIModule::onUnitCreate is no longer called for invisible units when complete map information is disabled.

The following functions have been renamed:

  • Game::text has been renamed to Game::drawText
  • Game::inReplay has been renamed to Game::isReplay
  • AIModule::onAddUnit has been renamed to AIModule::onUnitCreate
  • AIModule::onRemoveUnit has been renamed to AIModule::onUnitDestroy

Other changes:

  • BWAPI no longer crashes on replays.

BWAPI Beta 2.1 (r1416) {#changes_210b}

  • Fixed a bug that produced phantom marines. An internal unit set in BWAPI was not being reset between matches, so units that existed in a previous match appeared to exist in the next game as phantom marines. Retrieving information from these non existant marines and/or issuing orders to them may have also caused Broodwar to crash.

BWAPI Beta 2 (r1400) {#changes_200b}

The following functions have been added:

  • Unit::isCarryingGas

  • Unit::isCarryingMinerals

  • Unit::isDefenseMatrixed

  • Unit::isEnsnared

  • Unit::isIrradiated

  • Unit::isMaelstrommed

  • Unit::isParasited

  • Unit::isPlagued

  • Unit::isStimmed

  • Game::leaveGame - replaces Game::surrender and now works correctly.

  • Game::setLocalSpeed - lets AIs increase the speed in single player games.

Other changes:

  • Fixed crash due to null sprite pointer in Broodwar memory
  • Minor update of UnitType information for spells and Terran Nuclear Missile.
  • Minor update of description text shown in Chaoslauncher text box.
  • Example AI Module compiles much faster due to new compile of BWTA.lib.