Giter Site home page Giter Site logo

purplewave's Introduction

PurpleWave

A tournament-winning AI player of StarCraft: Brood War

About

PurpleWave is a StarCraft: Brood War AI written in Scala. It can play all three races and a large variety of professional-style strategies.

PurpleWave has won:

PurpleWave has also ranked #1 on the BASIL, SSCAIT, and SAIL ladders.

Credits

Thanks to:

  • Nathan Roth (Antiga/Iruian) for strategy advice and consulting -- so much of the polish in PurpleWave's strategies comes from his wisdom and replay analysis
  • @JasperGeurtz @Bytekeeper and @N00byEdge for JBWAPI
  • @vjurenka for BWMirror
  • @Cmccrave for Horizon and BWEB
  • @MrTate for JBWEB
  • @lowerlogic for BWTA
  • Igor Dimitrijevic for BWEM
  • @JasperGeurtz for the Java port of BWEM
  • @kovarex and @heinermann for BWAPI
  • @michalsustr and @certicky for SC-Docker and @Bytekeeper for its BASIL port for powering PotatoPeeler
  • @jabbo16 for configuring PurpleWave's Maven build
  • @davechurchill @certicky @krasi0 @Bytekeeper @bgweber @SonkoMagnus Nathan Roth and the Cognition & Intelligence Lab at Sejong University for hosting Brood War competitions and environments that have given PurpleWave visibility and purpose
  • @chriscoxe for diagnosing and solving technical issues in tournament environments that have affected PurpleWave's ability to compete
  • @jaj22/JohnJ and Ankmairdor for lots of advice navigating Brood War mechanics
  • @IMP42 @AdakiteSystems and @tscmoo for helping me get BWAPI up and running when I was getting started
  • @tscmoo for OpenBW
  • NepetaNigra, ChoboSwaggins, @Nitekat, and CH Miner for sharing PurpleWave's games with the world and helping tell our story

The community around BWAPI and StarCraft AI is amazing and PurpleWave could not exist without building on the decade of work these folks have done.

How to build PurpleWave

See build instructions in install.md

Steps:

  • Clone or download this repository (I keep it in c:\p\pw but it should work from anywhere)
  • If you cloned the repository git submodule sync; git submodule update --init --recursive to clone JBWAPI
  • Open IntelliJ IDEA
  • In IntelliJ IDEA: File -> Settings -> Plugins -> Check off Scala
  • In IntelliJ IDEA: File -> Open -> Select the PurpleWave directory
  • In IntelliJ IDEA: File -> Project Structure -> Select the Java Development Kit directory (like c:\Program Files\Java\jdk\1.8.0_121)
  • In IntelliJ IDEA: File -> Project Structure -> Modules -> The green "+" -> Scala -> Create... -> Download... -> 2.12.6... -> OK
  • In IntelliJ IDEA: File -> Project Structure -> Modules -> Dependencies -> Under "Export" check scala-sdk-2.12.6
  • In IntelliJ IDEA: Build -> Build Artifacts... -> Build

This will produce PurpleWave.jar. See below for "How to run PurpleWave"

How to run PurpleWave

  • From IntelliJ IDEA: Run -> Run 'PurpleWave' or Debug 'PurpleWave'
  • As a JAR:
    • cd to the StarCraft directory
    • mkdir -p bwapi-data/AI; mkdir -p bwapi-data/read; mkdir -p bwapi-data/write to create the standard directories for BWAPI bot data
    • Copy PurpleWave.jar to bwapi-data/AI
    • java.exe -jar bwapi-data/AI/PurpleWave.jar <-- Run this from the StarCraft directory

Questions and feedback

Say hi! Post an issue here on Github or email dsgant at gmail

License

PurpleWave is published under the MIT License. I encourage you to use PurpleWave as a starting point for your own creation!

purplewave's People

Contributors

dgant avatar jabbo16 avatar n00byedge avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

purplewave's Issues

Why the strategy of PurpleWave is using all initial probes to attack?

Sorry to bother you. I have a problem about PurpleWave.

As the install.md shows, I use BWAPI 4.1.2 and 32-bit java to run PurpleWave AI. PurpleWave.dll, PurpleWave.jar, run_proxy.bat which are downloaded from AIIDE Starcraft AI competition web are included in the bwapi-data\AI document. When I use java to run the PurpleWave.jar and start the Starcraft game, the cmd shows " Game ready!". At the beginning of the game, PurpleWave let all initial probes to attack and will not build new probe. There is no double that PurpleWave lose the game.

This game strategy is very different to the replays of PurpleWave in 2017th Starcraft AI competition. Is there anything I've done wrong here?

Build failed

Hi! I can not build current github version successfully. The version AIIDE 2017 is ok, so I think I followed How to build correctly. There are 14 errors listed as follows.
D:\Work\PurpleWave\src\Information\Economy.scala
Error:(35, 100) type mismatch;
found : ProxyBwapi.UnitInfo.UnitInfo
required: ProxyBwapi.UnitInfo.FriendlyUnitInfo
Error occurred in an application involving default arguments.
private val ourActiveMinersCache = new Cache(() => With.units.countOurs(u => isActivelyMining(u) && u.gatheringMinerals))
Error:(36, 100) type mismatch;
found : ProxyBwapi.UnitInfo.UnitInfo
required: ProxyBwapi.UnitInfo.FriendlyUnitInfo
Error occurred in an application involving default arguments.
private val ourActiveDrillersCache = new Cache(() => With.units.countOurs(u => isActivelyMining(u) && u.gatheringGas))
D:\Work\PurpleWave\src\Information\Intelligenze\Fingerprinting\Generic\AbstractFingerprintQuantityBy.scala
Error:(13, 16) ambiguous reference to overloaded definition,
both method countEnemy in class UnitTracker of type (predicate: ProxyBwapi.UnitInfo.ForeignUnitInfo => Boolean)Int
and method countEnemy in class UnitTracker of type (matcher: Planning.Composition.UnitMatchers.UnitMatcher*)Int
match argument types (ProxyBwapi.UnitInfo.UnitInfo => Boolean) and expected result type Int
With.units.countEnemy(u =>
D:\Work\PurpleWave\src\Micro\Actions\Combat\Tactics\Tickle.scala
Error:(85, 36) ambiguous reference to overloaded definition,
both method countOurs in class UnitTracker of type (predicate: ProxyBwapi.UnitInfo.FriendlyUnitInfo => Boolean)Int
and method countOurs in class UnitTracker of type (matcher: Planning.Composition.UnitMatchers.UnitMatcher*)Int
match argument types (ProxyBwapi.UnitInfo.UnitInfo => Boolean)
val workersHere = With.units.countOurs(u => u.unitClass.isWorker && u.zone == zone)
D:\Work\PurpleWave\src\Micro\Squads\Goals\GoalBasic.scala
Warning:(80, 25) enclosing method offer has result type Unit: return value discarded
if ( ! acceptsHelp) return Iterable.empty
D:\Work\PurpleWave\src\Planning\Composition\UnitCounters\UnitCountExcept.scala
Error:(9, 68) type mismatch;
found : ProxyBwapi.UnitInfo.UnitInfo
required: ProxyBwapi.UnitInfo.FriendlyUnitInfo
val cap = With.units.countOurs(unit => With.recruiter.eligible(unit) && matcher.accept(unit))
D:\Work\PurpleWave\src\Planning\Plans\GamePlans\Zerg\ZvT\TwoHatchMuta.scala
Error:(122, 20) ambiguous reference to overloaded definition,
both method countOurs in class UnitTracker of type (predicate: ProxyBwapi.UnitInfo.FriendlyUnitInfo => Boolean)Int
and method countOurs in class UnitTracker of type (matcher: Planning.Composition.UnitMatchers.UnitMatcher*)Int
match argument types (ProxyBwapi.UnitInfo.UnitInfo => Boolean)
Error occurred in an application involving default arguments.
With.units.countOurs(_.gasLeft > 0)),
D:\Work\PurpleWave\src\Planning\Plans\Macro\Automatic\AddAddons.scala
Error:(11, 16) ambiguous reference to overloaded definition,
both method countOurs in class UnitTracker of type (predicate: ProxyBwapi.UnitInfo.FriendlyUnitInfo => Boolean)Int
and method countOurs in class UnitTracker of type (matcher: Planning.Composition.UnitMatchers.UnitMatcher*)Int
match argument types (ProxyBwapi.UnitInfo.UnitInfo => Boolean) and expected result type Int
With.units.countOurs(b => b.is(unitClass.whatBuilds.1) && b.addon.isEmpty)
D:\Work\PurpleWave\src\Planning\Plans\Macro\Automatic\TrainContinuously.scala
Error:(72, 37) value buildType is not a member of ProxyBwapi.UnitInfo.UnitInfo
|| (unit.is(Zerg.Egg) && unit.buildType == unitClass))
D:\Work\PurpleWave\src\Planning\Plans\Macro\Automatic\TrainDynamic.scala
Error:(72, 37) value buildType is not a member of ProxyBwapi.UnitInfo.UnitInfo
|| (unit.is(Zerg.Egg) && unit.buildType == unitClass))
D:\Work\PurpleWave\src\Planning\Plans\Macro\Protoss\MeldArchons.scala
Error:(21, 36) ambiguous reference to overloaded definition,
both method countOurs in class UnitTracker of type (predicate: ProxyBwapi.UnitInfo.FriendlyUnitInfo => Boolean)Int
and method countOurs in class UnitTracker of type (matcher: Planning.Composition.UnitMatchers.UnitMatcher*)Int
match argument types (ProxyBwapi.UnitInfo.UnitInfo => Boolean)
val templarLow = With.units.countOurs(u => u.is(Protoss.HighTemplar) && u.energy < maxEnergy)
D:\Work\PurpleWave\src\Planning\Plans\Macro\Terran\BuildBunkersAtBases.scala
Error:(42, 40) ambiguous reference to overloaded definition,
both method countOurs in class UnitTracker of type (predicate: ProxyBwapi.UnitInfo.FriendlyUnitInfo => Boolean)Int
and method countOurs in class UnitTracker of type (matcher: Planning.Composition.UnitMatchers.UnitMatcher*)Int
match argument types (ProxyBwapi.UnitInfo.UnitInfo => Boolean)
lazy val towersInZone = With.units.countOurs(u => u.is(Terran.Bunker) && u.zone == zone)
D:\Work\PurpleWave\src\Planning\Plans\Macro\Terran\BuildMissileTurretsAtBases.scala
Error:(34, 36) ambiguous reference to overloaded definition,
both method countOurs in class UnitTracker of type (predicate: ProxyBwapi.UnitInfo.FriendlyUnitInfo => Boolean)Int
and method countOurs in class UnitTracker of type (matcher: Planning.Composition.UnitMatchers.UnitMatcher*)Int
match argument types (ProxyBwapi.UnitInfo.UnitInfo => Boolean)
val turretsInBase = With.units.countOurs(unit => unit.is(Terran.MissileTurret) && unit.zone == zone)
D:\Work\PurpleWave\src\Planning\Plans\Macro\Zerg\BuildZergStaticDefenseAtBases.scala
Error:(44, 40) ambiguous reference to overloaded definition,
both method countOurs in class UnitTracker of type (predicate: ProxyBwapi.UnitInfo.FriendlyUnitInfo => Boolean)Int
and method countOurs in class UnitTracker of type (matcher: Planning.Composition.UnitMatchers.UnitMatcher*)Int
match argument types (ProxyBwapi.UnitInfo.UnitInfo => Boolean)
lazy val towersInZone = With.units.countOurs(unit => Vector(Zerg.CreepColony, towerClass).contains(unit.unitClass) && unit.zone == zone)
D:\Work\PurpleWave\src\Planning\Plans\Predicates\Scenarios\WeAreBeingWorkerRushed.scala
Error:(14, 16) ambiguous reference to overloaded definition,
both method countEnemy in class UnitTracker of type (predicate: ProxyBwapi.UnitInfo.ForeignUnitInfo => Boolean)Int
and method countEnemy in class UnitTracker of type (matcher: Planning.Composition.UnitMatchers.UnitMatcher*)Int
match argument types (ProxyBwapi.UnitInfo.UnitInfo => Boolean)
With.units.countEnemy(unit => unit.unitClass.isWorker && unit.zone.bases.exists(
.owner.isUs)) >

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.