Closed Frigerius closed 6 years ago
A little update to my issue. By following Coordinator::Update()
I found the method ObservationImp::UpdateObservation()
which updates the observation of my Agent. By adding a std::cout
to the following code I can see any message in my console:
chat_.clear();
for (auto& message : response_->chat()) {
chat_.push_back({message.player_id(), message.message()});
std::cout << "sc2_client " << message.message() << std::endl;
}
but if I try to read them in OnStep()
most of the messages are not shown as if they get deleted before I can read them.
OK, now I got it. ControlInterface::GetObservation()
is called as often as Coordinator::Update()
. But ControlInterface::IssueEvents(...)
is only called if the following not returns...
if (observation_imp_->current_game_loop_ == observation_imp_->previous_game_loop) {
return false;
}
And this is why you do not get all chat messages if you run the bot in real time -.-
My workaround is adding
virtual void OnChatMessagesReceived(const std::vector<ChatMessage>& /*messages*/) {}
to sc2_client.h and calling it in ControlInterface::IssueEvents(...)
if the observation has any messages.
Hi, I have the following issue. I'm creating a simple test-bot and I try to read the chat messages to parse some commands. While starting a game in non-realt ime, in each
OnStep()
I get each send message with callingObservation()->GetChatMessages()
. But if I start thesc2::Coordinator
with real time set to true I don't get all messages, as if some get scipped.Am I doing smth. wrong or is this a bug?