-
Notifications
You must be signed in to change notification settings - Fork 19
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
Minimal Working Example of client.py #56
Comments
You need python 3.7 per requirements
…On Thu, Jun 6, 2019 at 8:37 PM Rylan Schaeffer ***@***.***> wrote:
The example client.py script in the README.md (copied below) has a number
of ambiguous and problematic aspects. Where should this script be located
within the repo? Should protobuf be replaced with protos? Why does my IDS
say Unresolved reference 'await'? Could we have a minimal working
example? I discovered this old example
<https://github.com/TimZaman/dotaservice/blob/92be54c229a44a2f5ac835578ce3ad0e56dd3dbe/examples/client.py>,
but it appears to have been removed.
from grpclib.client import Channel
from protobuf.DotaService_grpc import DotaServiceStub
from protobuf.DotaService_pb2 import Action
from protobuf.DotaService_pb2 import Config
# Connect to the DotaService.
env = DotaServiceStub(Channel('127.0.0.1', 13337))
# Get the initial observation.
observation = await env.reset(Config())
for i in range(8):
# Sample an action from the action protobuf
action = Action.MoveToLocation(x=.., y=.., z=..)
# Take an action, returning the resulting observation.
observation = await env.step(action)
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#56?email_source=notifications&email_token=AB25ERCFAJ2AREZ2ZKYXEULPZHJZDA5CNFSM4HVPUDOKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4GYFGAVQ>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AB25ERFXUVJJKHNW7HT6KDLPZHJZDANCNFSM4HVPUDOA>
.
|
And the readme instructions are psuedocode, indeed outdated. For a recent
example just check https://github.com/TimZaman/dotaclient
…On Thu, Jun 6, 2019 at 8:47 PM Tim Zaman ***@***.***> wrote:
You need python 3.7 per requirements
On Thu, Jun 6, 2019 at 8:37 PM Rylan Schaeffer ***@***.***>
wrote:
> The example client.py script in the README.md (copied below) has a number
> of ambiguous and problematic aspects. Where should this script be located
> within the repo? Should protobuf be replaced with protos? Why does my
> IDS say Unresolved reference 'await'? Could we have a minimal working
> example? I discovered this old example
> <https://github.com/TimZaman/dotaservice/blob/92be54c229a44a2f5ac835578ce3ad0e56dd3dbe/examples/client.py>,
> but it appears to have been removed.
>
> from grpclib.client import Channel
> from protobuf.DotaService_grpc import DotaServiceStub
> from protobuf.DotaService_pb2 import Action
> from protobuf.DotaService_pb2 import Config
>
> # Connect to the DotaService.
> env = DotaServiceStub(Channel('127.0.0.1', 13337))
>
> # Get the initial observation.
> observation = await env.reset(Config())
> for i in range(8):
> # Sample an action from the action protobuf
> action = Action.MoveToLocation(x=.., y=.., z=..)
> # Take an action, returning the resulting observation.
> observation = await env.step(action)
>
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub
> <#56?email_source=notifications&email_token=AB25ERCFAJ2AREZ2ZKYXEULPZHJZDA5CNFSM4HVPUDOKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4GYFGAVQ>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AB25ERFXUVJJKHNW7HT6KDLPZHJZDANCNFSM4HVPUDOA>
> .
>
|
I upgraded to Python 3.7 and tried compiling the protos, but received the following error:
|
We had to additionally run |
You dont have to compile the protos though, i have checked them in verbatim.
…On Sat, Jun 8, 2019, 13:36 Rylan Schaeffer ***@***.***> wrote:
Closed #56 <#56>.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#56?email_source=notifications&email_token=AB25ERHZLOEXJWIYEPUDHZ3PZQJ3NA5CNFSM4HVPUDOKYY3PNVWWK3TUL52HS4DFWZEXG43VMVCXMZLOORHG65DJMZUWGYLUNFXW5KTDN5WW2ZLOORPWSZGOR375QUA#event-2399131728>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AB25ERAHNIR5LMTSLTQGIALPZQJ3NANCNFSM4HVPUDOA>
.
|
I got this error with old client.py : |
@RylanSchaeffer did you ever get a minimal working example running? I'm hoping to use this just to quickly spin up bot vs bot games. I'm sure it should be doable relatively easily. I runnable example I can play with would be extremely helpful though. |
Yeah, but it wasn't straightforward and I couldn't do what I subsequently wanted, so eventually I gave up :/ |
Would you mind sharing what you had? I'm getting this error:
I'd love to just get a really basic toy example running |
It's been a while since i looked at this sorry guys :( |
Tim, all good - your code was still super helpful :)
Ben, I would if I could, but I don't have it anymore. I had cloned the
repo, made local changes, realized I didn't need dotaservice and removed
the directory from my machine. I didn't commit anything :/
Cheers,
Rylan Schaeffer
…On Wed, Sep 25, 2019 at 6:30 PM Tim Zaman ***@***.***> wrote:
It's been a while since i looked at this sorry guys :(
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#56?email_source=notifications&email_token=ACEHLC6ABHUOPQNU7CDJ7XLQLPRA5A5CNFSM4HVPUDOKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7TUCFY#issuecomment-535249175>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACEHLC37IFKPSGNWOJLKCNLQLPRA5ANCNFSM4HVPUDOA>
.
|
what are you guys trying to do? |
Nostrademous, I'm working on an AI project specifically for draft strategy. All I want to be able to do is spin up bot vs bot games with specified heroes and record the outcome. |
@bglick13 what problems did you and @RylanSchaeffer have? I have no issues running the code as currently checked in locally. Note, I do not run it via docker. |
@Nostrademous I appreciate you getting back to me! I suppose my issues are in understanding how to actually start simulating games. I can clone the repo and run python3 -m dotaservice successfully, but it is unclear to me how to then spin up games from there. Do you have an example client script you're using, or think you could explain how to write a client script that just starts bot games? I understand my use case is a bit strange, since I'm not actually implementing my own agent to act inside the environment, but I assume it should still be doable. Thanks again! |
You need to run three separate python modules. They are spread across two repos: DotaService and DotaClient (both maintained by Tim and Cloned by me as I do some of my own tweaks).
|
A lot of this was documented here by me: All the code changes to remove GCP are un-needed as we added the Note, that once you get it up and running and want to see the bots fight you need to change the mode from DEDICATED to GUI and then once you are logged in you need to type The mode setting is done by the agent (which writes the configuration file to launch Dota2 with) |
Works like a charm! I really appreciate you taking the time to provide such thorough responses |
The example client.py script in the README.md (copied below) has a number of ambiguous and problematic aspects. Where should this script be located within the repo? Should
protobuf
be replaced withprotos
? Why does my IDS sayUnresolved reference 'await'
?Could we have a minimal working example? I discovered this old example, but it appears to have been removed.
The text was updated successfully, but these errors were encountered: