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



Hi,

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 (http://www.starcraftai.com/wiki/Main_Page) 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 Battle.net without getting kicked off?

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

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!



None.

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 Battle.net 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 Battle.net 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.



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[10:41 am]
v9bettel -- Nice
[01:39 am]
Ultraviolet -- no u elky skeleton guy, I'll use em better
[10:50 pm]
Vrael -- Ultraviolet
Ultraviolet shouted: How about you all send me your minerals instead of washing them into the gambling void? I'm saving up for a new name color and/or glow
hey cut it out I'm getting all the minerals
[10:11 pm]
Ultraviolet -- :P
[10:11 pm]
Ultraviolet -- How about you all send me your minerals instead of washing them into the gambling void? I'm saving up for a new name color and/or glow
[2024-4-17. : 11:50 pm]
O)FaRTy1billion[MM] -- nice, now i have more than enough
[2024-4-17. : 11:49 pm]
O)FaRTy1billion[MM] -- if i don't gamble them away first
[2024-4-17. : 11:49 pm]
O)FaRTy1billion[MM] -- o, due to a donation i now have enough minerals to send you minerals
[2024-4-17. : 3:26 am]
O)FaRTy1billion[MM] -- i have to ask for minerals first tho cuz i don't have enough to send
[2024-4-17. : 1:53 am]
Vrael -- bet u'll ask for my minerals first and then just send me some lousy vespene gas instead
Please log in to shout.


Members Online: IlyaSnopchenko, Roy, jun3hong