[Pogamut-list] Am I dead?

schrum2 pogamut-forum at artemis.ms.mff.cuni.cz
Wed Oct 15 16:31:20 CEST 2008


Re: Re: Am I dead?
Thank you very much! I'm going to use listeners in a lot of other places in my code now. They are obviously a much better way to implement reactive behaviors. Thanks again!

> Yes - that's a glitch of the Pogamut unfortunately.
> 
> Here is some info:
> 1) Every agent has two threads - one is communication thread that is reading and parsing messages from GameBots propagating them to the Agent's internals (AgentBody, AgentMemory, GameMap, etc...) second thread is logic thread - that is a thread where your "doLogic" is run. 
> 
> 2) all messages from GameBots are written to the history in batches ... whenever END_MESSAGE come - new batch is created (and only synchronous messages are propagated into them).
> 
> Here is a scenerio:
> You're doing your work in doLogic() (after BOT_KILLED check) ... you end ... BOT_KILLED came ... END_MESSAGE came (BOT_KILLED is not present in current HisoryBatch) ... next iteration of your logic occures - you missed the message.
> 
> Solution:
> Create a listener for the BOT_KILLED message ... body.addTypedMsgRcvListener() (or something like this).
> 
> Cheers, Jakub

----

Reply Link: <https://artemis.ms.mff.cuni.cz/pogamut/tiki-view_forum_thread.php?forumId=5&comments_reply_threadId=298&comments_parentId=287&post_reply=1#form>





More information about the Pogamut-list mailing list