So I have been working with implementing various types of Entity/Component Systems, and I really like the model which follows:
Entities are only IDs, Components are bags of data/properties, Systems act on one or more components that they're interested in.
This is all fine, but here's something I don't quite get ---
In my model, when something happens to a component, an event is raised, and other systems that care about that event respond. How does one determine the "firing" order of these events so that it's not totally random the order in which systems respond to events?
For example, in a CollisionSystem, if two entities have a CollisionComponent and collide, the system would fire off an event into the wild saying so. How can you efficiently guarantee the the responses to this event are fired in the right order?