skjb / pysc2-tutorial

Tutorials for building a PySC2 bot
https://medium.com/@skjb/building-a-basic-pysc2-agent-b109cde1477c
MIT License
287 stars 85 forks source link

Contributor guidelines? #1

Open yeungegs opened 6 years ago

yeungegs commented 6 years ago

@skjb I would love to contribute to this project - I am working on tutorials for getting set up with the SC2LE and for making a basic Protoss agent. Are you open to PRs?

skjb commented 6 years ago

@yeungegs If you have any code corrections, sure. Since this repo is designed for my tutorial set, it might be better for you to create your own repo that matches your style :)

ghost commented 6 years ago

I am also interested in your project, is there a final smart_agent.py? i run smart_agent_step5.py and get: I1018 21:39:13.069766 7268 sc2_env.py:200] Environment is ready. I1018 21:39:13.073795 7268 sc2_env.py:240] Starting episode: 1 Took 0.691 seconds for 0 steps: 0.000 fps I1018 21:39:13.765357 7268 sc2_env.py:327] Environment Close I1018 21:39:13.766354 7268 sc2_env.py:342] Traceback (most recent call last): File "C:\Python36\lib\runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "C:\Python36\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "C:\Python36\lib\site-packages\pysc2\bin\agent.py", line 112, in app.run(main) File "C:\Python36\lib\site-packages\absl\app.py", line 272, in run _run_main(main, argv) File "C:\Python36\lib\site-packages\absl\app.py", line 237, in _run_main sys.exit(main(argv)) File "C:\Python36\lib\site-packages\pysc2\bin\agent.py", line 98, in main run_thread(agent_cls, FLAGS.map, FLAGS.render) File "C:\Python36\lib\site-packages\pysc2\bin\agent.py", line 77, in run_thread run_loop.run_loop([agent], env, FLAGS.max_agent_steps) File "C:\Python36\lib\site-packages\pysc2\env\run_loop.py", line 37, in run_loop a.reset() File "C:\Python36\lib\site-packages\pysc2\agents\base_agent.py", line 38, in reset self.episodes += 1 AttributeError: 'SmartAgent' object has no attribute 'episodes' I1018 21:39:13.791857 7268 sc2_env.py:327] Environment Close I1018 21:39:13.792357 7268 sc2_env.py:342] I1018 21:39:13.792857 7268 sc2_env.py:327] Environment Close I1018 21:39:13.793359 7268 sc2_env.py:342] W1018 21:39:16.905425 7268 sc_process.py:183] Killing the process. I1018 21:39:17.349722 7268 sc_process.py:166] Shutdown with return code: 1

skjb commented 6 years ago

@agent932 I am not sure why reset() is being called, however you should be able to add this line to the top of your init() method to fix it:

super(SmartAgent, self).__init__()

ghost commented 6 years ago

that worked perfect i inserted it on line 97 and it executed without error

ghost commented 6 years ago

I have created a discord server @ https://discord.gg/j6DHfZm if you guys would like to chat more about this

yeungegs commented 6 years ago

in case you're not already involved @agent932 there is a sc2ai discord server - http://sc2ai.net/ - i couldn't tell if your server invite was to the same destination since the link you included above already expired..