Blizzard / s2client-api

StarCraft II Client - C++ library supported on Windows, Linux and Mac designed for building scripted bots and research using the SC2API.
MIT License
1.66k stars 282 forks source link

Functions, depend on SampleImageData don't work #317

Closed KsanfFillum closed 5 years ago

KsanfFillum commented 5 years ago

There are some calls that depend on SampleImageData function, for example Observation()->IsPlacable or Obervation()->HasCreep. All of them are throwing an assert here:

sc2_client::SampleImageData(const std::string& data, int width, int height, const Point2D& point, unsigned char& result):

assert(data.size() == width * height); (Line 439)

There is no difference in which frame or function you call this.

mboedigh commented 5 years ago

I noticed it too. The issue seems to be that sc2 protocol is returning 1 bit images, and the c++ sc2 api can't cope I put some sample code that fixed the problem for me in a previous issue #311. I don't know how to make a pull request (and have also changed other things so I don't think I should anymore), or I would have uploaded it.

KsanfFillum commented 5 years ago

I noticed it too. The issue seems to be that sc2 protocol is returning 1-bit images, and the c++ sc2 API can't cope I put some sample code that fixed the problem for me in a previous issue #311. I don't know how to make a pull request (and have also changed other things so I don't think I should anymore), or I would have uploaded it.

Found it, thanks. For some reason, I see that developers decide not to merge any pull request, but thank you for your solving. I think I close my issue.