python-sc2 icon indicating copy to clipboard operation
python-sc2 copied to clipboard

Returns ObserverAI to working order

Open dysonreturns opened this issue 6 months ago • 1 comments

  • The example observer file needs it's path to be cast to string, otherwise we get a TypeError.
  • ObserverAI dependend on deprecated self._client, self._game_data, self._game_info fields. They shoudl now be accessed directly.
  • Additionally, observing as Everyone (player 0) broke, because it had no race. When player is 0, we assign the race of Random and it has no concerns.

dysonreturns avatar Jun 26 '25 13:06 dysonreturns

Thanks for putting effort into it.

I would like to add at least one test case, too. Because otherwise the ObserverAI class is going to lack behind the BotAI class forever and only is being manually tested. This is especially bad since it inherits from BotAIInternal

Can you think of a (simple) strategy to test it? Will a real bot replay be needed? Perhaps one can be created during the test, and then run through the ObserverAI to validate. What if the replay is from an older patch? I am just asking for suggestions, I try to write one myself. I am not expecting you to add one, but that would be awesome of course.

BurnySc2 avatar Jun 26 '25 13:06 BurnySc2