-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Overall API design #2
Comments
I like what you had done in #3 as a start - I'm going to take some time later this evening to study it more in detail. I believe pysc2 takes a similar approach and s2client-api has the pull-style interface. |
@Michael-F-Bryan I've started to update my ping example and made a couple of changes to ActionSet and Action. I've also added a couple of questions in the Engine. Is this inline to how you envisioned the API working? https://github.com/ttdonovan/sc2-api-rs/tree/ttdonovan/ping-bot |
I missed your last reply in #3 you can disregard some of my questions above. So basically I'm still trying to wrap my head around the response types and their meaning from the web socket API but from what I can gather GameState will have single Observation for a game loop. |
Pretty much. I was going to use an
Looking through the C++ API, their My understanding is you'll send some sort of message to the server and update the
Yep, looks good to me! Although bots probably won't be sending a |
If Bot's will not being performing actions like |
Yep, I believe their That way the |
@Michael-F-Bryan does the purposed draft above align with your envision of how the various components should interact and work. |
@ttdonovan did you end up figuring out how to communicate to a websocket running on another thread? This is a pretty annoying issue in that how we deal with it will directly affect the crate's API. |
I think I have a working solution. Might not be the best code but able to
read and write over the socket connection. I put it in another pull
request, if it’s a good enough solution I’ll merge it into master.
…On Sat, Sep 30, 2017 at 00:30 Michael Bryan ***@***.***> wrote:
@ttdonovan <https://github.com/ttdonovan> did you end up figuring out how
to communicate to a websocket running on another thread? This is a pretty
annoying issue in that how we deal with it will directly affect the crate's
API.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAAo3KLrd5Zu2p8sAE-L3vAxMxqHH5hRks5sne4ogaJpZM4Pdmn8>
.
|
After having a quick skim through the StarCraft II protocol I imagine a typical user experience would be like this:
Engine
and configures it (e.g. setting endpoint URL and other game options)Bot
traitBot
trait ison_tick()
, this takes in some representation of the game world then internally creates someActionSet
thing, where you call various methods on it to queue up actions to be executed, then when you return theActionRecorder
theEngine
sends it back to the serverrun()
function which will tell the game engine to run infinitely until it's told to stop.Alternatively you could create a pull-style interface, where the player continually calls
engine.next_frame()
to advance the game one tick. Then you again create anActionSet
and have to manually tell theEngine
to send it back to the server.What are your thoughts?
The text was updated successfully, but these errors were encountered: