Staredit Network > Forums > General StarCraft > Topic: BWAPI Questions
BWAPI Questions
Jan 7 2017, 1:51 am
By: sethmachine  

Jan 7 2017, 1:51 am sethmachine Post #1


I am interested in making an AI/bot for a custom map that is not too dissimilar from melee.

I understand the BWAPI project is still active ( and would be the best way to accomplish this.

I have a few questions--

1) Is it possible to run an AI on the iCCUP / Abyss in without getting kicked off?

2) If the to 1) is yes, how would I run an AI while on

3) Has anyone used BWAPI to write an AI for a custom map? If so, would you mind sharing how you did it or advice?

4) Has anyone used Machine Learning to create an AI?

5) If yes to 4), is it possible to train an AI using:

1. Saved replays
2. Live training--e.g. have the AI record how I play, so that it plays the game like me?

6) I notice people made a JNI wrapper for BWAPI. Are there any limitations to using the Java library? Because I know Java but don't know C++.

I would also love to Skype if anyone would like to discuss!


Jan 7 2017, 3:54 am Heinermann Post #2

SDE, BWAPI owner, hacker.

1) Yes, ICCUP is the preferred means of running your AI on enabled multiplayer.
2) Simply run Chaoslauncher as you would otherwise and join a game. It should work as it would in single player.
3) People have used BWAPI to write AIs for the campaign (which are custom maps).
4) Yes.
5) I know people have used thousands of replays as training material. I don't know about live training.
6) I recommend BWMirror, since it is closest in use cases to the C++ API. There are some limitations, such as lack of Filters API and such.

Jan 7 2017, 2:38 pm sethmachine Post #3

1 +2) I was able to get the Java example bot running on normal starcraft single player.
When I used Chaoslaunched and selected "iCCup", the Java robot could't find the game tables and never connected.

Is there a different API I need to use to connect to a game? Or did iCCup/ChaosLaunch disable the injection of the BWAPI.dll ?

4 + 5) Can you provide any examples as how to use a replay for training data? Does BWAPI have an API for examining a replay frame by frame?

6) What is the Filters API?

In regards to Machine Learning, how would I train an AI to build supply depots at the appropriate times? For example, the Java example bot just keep training SCVs and orders them to mine. Once it hits 10 supply, the robot can't build more SCVs. A sub-optimal solution would be to order the construction of a supply depot when the supply gets close to the current limit. A more optimal solution will time the construction of the supply depot with the start of the next constructed unit, so that depots are created just as they are or will be needed. There's other problems too--suppose you need to tech up, but only have limited minerals and you're going to run out of supply. How does the AI decided to allocate minerals to depot construction versus teching up?

I suppose this is just a complex weight learning problem. How would I use a replay of myself to train the AI the weights associated with each action so that it make good enough decisions?

Or what has been the general approach to this? Do you have a pointer to an example?

Jan 7 2017, 5:43 pm CecilSunkure Post #4

Personally I would recommend putting more thought into the design of what you feed your network. For building supply depots I would actually hand-code in some openers, and use some nets to solve sub-problems. For example say your AI can do one of 3 different openers in the first 5 minutes, and only plays on Lost Temple. You can feed the net inputs like where the enemy spawned, what buildings they have, etc. Then use this information to place structures at good locations. For supply depots certainly you want to follow a build opener, but in the later part of the game you always want a good 10-20 supply above your total pop count. In this case I think supply depot location is much more important than timing, since timing is easier solved by hand compared to an AI.

For example you could train the network to place depots like human players; in a cluster and away from Barracks/Factories, and away from ramps.


  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[06:07 pm]
UndeadStar -- :wob:
[12:00 pm]
Ultraviolet -- :wob:
[10:38 am]
jjf28 -- :wob::wob:
[10:32 am]
Zycorax -- :wob: intensifies.
[08:51 am]
Zincoshine -- :wob:
[04:43 am]
RdeRenato -- :wob:
[04:43 am]
RdeRenato -- : wob :
[2021-10-21. : 4:52 pm]
jjf28 -- :wob: cause you failed to prefix your message with :wob:
[2021-10-21. : 2:48 pm]
MTiger156 -- *wobbing stops* :massimo:
[2021-10-21. : 1:44 pm]
lil-Inferno -- nah
Please log in to shout.

Members Online: Roy, O)FaRTy1billion[MM], X405