Entity communication: Message queue vs Publish/Subscribe vs Signal/Slots
Posted
by
deft_code
on Game Development
See other posts from Game Development
or by deft_code
Published on 2010-07-22T07:01:07Z
Indexed on
2011/01/17
19:59 UTC
Read the original article
Hit count: 273
How do game engine entities communicate?
Two use cases:
- How would
entity_Asend atake-damagemessage toentity_B? - How would
entity_Aqueryentity_B's HP?
Here's what I've encountered so far:
- Message queue
entity_Acreates atake-damagemessage and posts it toentity_B's message queue.entity_Acreates aquery-hpmessage and posts it toentity_B.entity_Bin return creates anresponse-hpmessage and posts it toentity_A.
- Publish/Subscribe
entity_Bsubscribes totake-damagemessages (possibly with some preemptive filtering so only relevant message are delivered).entity_Aproducestake-damagemessage that referencesentity_B.entity_Asubscribes toupdate-hpmessages (possibly filtered). Every frameentity_Bbroadcastsupdate-hpmessages.
- Signal/Slots
- ???
entity_Aconnects anupdate-hpslot toentity_B'supdate-hpsignal.
- Something better?
Do I have a correct understanding of how these communication schemes would tie into a game engine's entity system?
How do entities in commercial game engines communicate?
© Game Development or respective owner