Skip to content
This repository has been archived by the owner on Sep 21, 2021. It is now read-only.

SC2 bot #121

Open
lpil opened this issue Feb 3, 2021 · 0 comments
Open

SC2 bot #121

lpil opened this issue Feb 3, 2021 · 0 comments
Labels
area:application An application to be written in Gleam

Comments

@lpil
Copy link
Member

lpil commented Feb 3, 2021

https://github.com/SimonPrins/ExampleBot

https://github.com/UltraMachine/rust-sc2/blob/master/src/client.rs

Dan_The_ManYesterday at 23:31
Welcome!

Yeah, the protobuf definitions are what you're looking for. For interest's sake, which language are you going to use to create a bot?
(I'm a big fan of Embark and their Rust usage + sponsorship of Rust libs, if we're talking about the same Embark studios)
lpilYesterday at 23:46
Ah yes! I'm on the ecosystem team as an open source rust engineer
I'd like to make something in Gleam (https://github.com/gleam-lang/gleam/), but honestly I doubt I'll have time for maybe a year. Super busy
Looks like I'd also need to contribute an Erlang runtime for the ladder if I was going to get involved there
Dan_The_ManYesterday at 23:51
Yeah, I don't think a lot of people here has dealt with Erlang, but if the need arises, we can definitely add support.
lpilYesterday at 23:53
Can you recommend and open source bot to check out that uses the websocket API directly? Preferably not C++, I'm dreadful at it
To satisfy my curiosity
Dan_The_ManYesterday at 23:54
I know a C# bot, if that's better?
Most of the communication are abstracted behind APIs for obvious reasons
Dan_The_ManToday at 00:00
Actually, I don't think any bot uses direct websocket communication. I thought Tyr did, but he does not.


It's a pretty simple process though -
Start game, receive observation with the game state, do what you need to do with that information, send back your actions, request a game step to step the game forward.
lpilToday at 00:04
Yeah I'm just curious as to what it looks like in practice really
Since i don't have time to play
I'll read some of the API wrapper libraries maybe
Dan_The_ManToday at 00:08
https://github.com/UltraMachine/rust-sc2/blob/master/src/client.rs

This library is mostly based on a python library, but it has everything you might need to figure out how it works in practice
GitHub
UltraMachine/rust-sc2
SC2 API for Rust. Contribute to UltraMachine/rust-sc2 development by creating an account on GitHub.

lpilToday at 00:09
Wow, there's a Linux sc2 binary?
Dan_The_ManToday at 00:09
fn run_game is the function that starts and controls the game
Dan_The_ManToday at 00:09
Yup, that's what we use on the ladder. It's headless as well
lpilToday at 00:09
Now there's something I don't think I would have believed 10 years ago
Dan_The_ManToday at 00:10
With optional headfull mode, but you have to render it yourself, you just get Image Data
You can't use it for ladder games though, it was made for bot games
KetrocToday at 00:12
Tyr originally created a bare bones wrapper for c# here: https://github.com/SimonPrins/ExampleBot
GitHub
SimonPrins/ExampleBot
This repository contains an example bot to play Starcraft 2. - SimonPrins/ExampleBot

lpilToday at 00:12
Hey, thanks
Great series btw Ketroc
I presume I would need both expansions? I've not played since launch more or less
Dan_The_ManToday at 00:13
That's the one I was looking for! I thought it was TyrP.
Dan_The_ManToday at 00:14
You don't need anything. You can play games with the free version
lpilToday at 00:14
Oh cool, that makes things easier
Thanks again
@lpil lpil added the area:application An application to be written in Gleam label Feb 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area:application An application to be written in Gleam
Projects
None yet
Development

No branches or pull requests

1 participant