-
Notifications
You must be signed in to change notification settings - Fork 182
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
Duplicate actions in Realtime mode #38
Comments
I have this too. I'll try to look at it. Might be an issue with the API itself, but more likely my mistake. |
Yeah, I actually talked with some people on Discord that are using other frameworks, and I think they had similar issues too, so I'm afraid it might be a problem with the Blizzard API itself like you say! |
I guess a small workaround could be to use if iteration % x == 0: # where x is some number between 2 and 6 in places where you want to make sure that you never queue a second unit or never build a second building. So in the proxy rax bot, that if statement could look like this: if self.can_afford(SCV) and self.workers.amount < 16 and cc.noqueue and iteration % 6 == 0:
await self.do(cc.train(SCV)) EDIT: After some testing, this only makes sense to use in realtime=True mode |
@Dentosal any luck? |
No matter realtime true or false when I try to get tech lab ability for my factory it's gonna build an extra factory . Sometimes I have to move it ! |
I noticed that some actions are run twice when realtime=True in sc2.run_game(), even though they shouldn't. This doesn't seem to happen when realtime=False.
For example, if I run examples/proxy_rax.py in realtime, there is sometimes an extra SCV queued at the CC, even though the code says that it should only train an SCV if the CC queue is empty. I also sometimes get NotEnoughMinerals error for the same reason, because it runs the build SCV action twice, but can't afford the second one (even though there's the self.can_afford(SCV) check).
I'm on Windows 10, if this has anything to do with it.
The text was updated successfully, but these errors were encountered: