Blizzard / s2client-proto

StarCraft II Client - protocol definitions used to communicate with StarCraft II.
MIT License
3.76k stars 431 forks source link

Hello world bot example #15

Open ghost opened 6 years ago

ghost commented 6 years ago

Could you provide a "hello world" bot example? Or rewrite for python this tutorial: https://github.com/Blizzard/s2client-api/blob/master/docs/tutorial1.md

jvanelteren commented 6 years ago

Agree, I think this whole project is awesome and would like to explore it to increase my machine learning skills on my favorite game. However I can only program in Python and not in C++.

AnthonyBrunasso commented 6 years ago

An equivalent Hello World example using Python and the protocol would be more complex. The reason being the C++ library code has a lot of additional functionality built into it that may be overwhelming to put in a single tutorial. In order to use the protocol you'd have to compile the proto files for python, create a web socket connection to the game and speak directly to the protocol. Having said that I do think there is some value in writing such a tutorial for people looking to create their own equivalent library in whatever language so it may be worth investigating.

As an aside, have you tried looking at Deepmind's library? It offers different functionality from our own but is more suited for Machine Learning studies. https://github.com/deepmind/pysc2

jvanelteren commented 6 years ago

Thanks Anthony. I think I'm somewhat confused over here. I tried to get the deepmind project going on my computer. I've got pysc2 installed and it runs. I also found some .py agents in the folders of pysc2.

Im now figuring out how to make my own python agent and train it, possibly with the replay pack. I was under the assumption I needed this package and commandcenter but that could be wrong.

KevinCalderone commented 6 years ago

For other people's reference:

It looks like some other people have already posted some example python code here: https://us.battle.net/forums/en/sc2/topic/20758617110

AnthonyBrunasso commented 6 years ago

@jvanelteren Deepmind's project will consume this protocol as a pip package. You do not need to use our C++ library or commandcenter. Technically, the only thing you need is this protocol compiled to some language. Deepmind wrote a python library that uses this protocol while we wrote a C++ library. commandcenter is a library built on top of our C++ library. The dependency chain is a bit confusing for sure.

jvanelteren commented 6 years ago

OK that clarifies things. With me being 'somewhat' versed in python I'll check out the battle.net link Kevin posted. Thanks

KevinCalderone commented 6 years ago

Another thing for other people's reference:

I posted a python multiplayer example here: https://us.battle.net/forums/en/sc2/topic/20758617484#post-8