DrInfy / sharpy-sc2

Python framework for rapid development of Starcraft 2 AI bots
MIT License
69 stars 28 forks source link

Update sc2pathlib to v0.3 #50

Closed merfolk closed 4 years ago

merfolk commented 4 years ago
> py sc2pathlibp-update.py
Finding download url from ... https://api.github.com/repos/DrInfy/sc2-pathlib/releases/latest
Downloading zip from ... https://github.com/DrInfy/sc2-pathlib/releases/download/v0.3/sc2pathlibp.zip
Saving to file ... sc2pathlibp.zip
Detected version: v0.3
Renaming folder sc2pathlibp ... sc2pathlibp_old
Extracting file ... sc2pathlibp.zip
Removing folder sc2pathlibp_old
Removing file sc2pathlibp.zip
merfolk commented 4 years ago

This change will crash bots, as PathingManager relies on the reset() method that for some reason is missing in sc2pathlib v0.3.

reproduce

py run_custom.py -p1 12pool -p2 zealot

stack trace

ERROR:sc2.main:AI step threw an error
Traceback (most recent call last):
  File "python-sc2\sc2\main.py", line 174, in _play_game_ai
    await ai.on_step(iteration)
  File "C:\Dev\sc2\sharpy-sc2\sharpy\knowledges\knowledge_bot.py", line 122, in on_step
    await self.knowledge.update(iteration)
  File "C:\Dev\sc2\sharpy-sc2\sharpy\knowledges\knowledge.py", line 259, in update
    await manager.update()
  File "C:\Dev\sc2\sharpy-sc2\sharpy\managers\pathing_manager.py", line 63, in update
    await self.update_influence()
  File "C:\Dev\sc2\sharpy-sc2\sharpy\managers\pathing_manager.py", line 118, in update_influence
    self.path_finder_terrain.reset()  # Reset
AttributeError: 'PathFinder' object has no attribute 'reset'
merfolk commented 4 years ago

Seems like the released version v0.3 of sc2-pathlib is in fact older than the one used by sharpy-sc2, since reset() method does exist in the repo's master branch.

https://github.com/DrInfy/sc2-pathlib/blob/master/sc2pathlibp/path_finder.py#L52

merfolk commented 4 years ago

A new release of sc2-pathlib needs to be made, before this is of any use. For now sharpy-sc2 contains some version of sc2-pathlib.