These days, I'm doing some research on component-based entity systems. I had a first approximation, using a blackboard pattern at the entity level, and with components sharing this blackboard to do communication.

Doing this research, I found an entity framework called Artemis, that follows a FRP structure for the entity management. The idea seems pretty good, and I'm thinking of integrating in to my engine. I have some questions that need to be solved to fully understand this "odd" architecture:

  1. In my first approximation, the way components shared data is pretty straight forward, following the blackboard pattern. How should this be done, following FRP? It seems each system would be the ones holding all dependencies to the components, making components totally decoupled. If the collision system needs to know about physic component, movable system, etc; the collision system would import all of these components, and do all needed work with them. Is that right?

  2. Would each system be a homogeneous or heterogeneous component container? I guess its system has to be homogeneous, related to the component type it holds, because the system needs to know the component data, to play with it during updates. This leads me to next question:

  3. Does this architecture lead to too many system/components?

  4. How does an event system fit in to this structure? I usually have slot/signals in game objects, for this, but it seems there is no "Entity" concept with the Artemis structure.

  • 2
    \$\begingroup\$ Artemis is just a component-based entity management system. I don't think it's related to functional reactive programming. \$\endgroup\$
    – Zach Conn
    Nov 5, 2012 at 1:10

2 Answers 2


Not an expert, but doing something fairly similar; my thoughts:

1) In general, each system will scan the components (of all entities) that are of a type in which it is interested for some condition that it can handle. A “Gravity” system might ignore “position” components that have a “flying” flag, for example. One way of handling the component data locking and preserving immutable data (although I haven't looked into Artemis) is to remove the “previous” state from the set, pass it into the system, and have that system return the “new” immutable state.

2) I believe the answer is “homogenous,” although I'm unclear as to how you mean it. Each component (e.g. “position” or “affinity to spontaneously combust”) is a “record;” every component of a given type has the same fields; but every type of component has distinct (and non-duplicated) fields.

3) Entity systems are designed around that idea. The “ideal” system would have one system for every type of interaction in the game. In real life, sometimes things that are closely related are ganged together for efficiency.

4) Events can be replaced by state changes in the components. Entity systems, of course, don't lend themselves to having “objects” in the OOP sense; but where an “entity” is a “game object,” an “event” could be:

  • attaching a new component to the entity (making it susceptible to effects from other systems)
  • changing the state of that component (thus, systems listening for that state change would be triggered)

The “blackboard system” dispatcher would them be responsible for observing new records being inserted and triggering the systems that might want/need to handle those records in their new state, subject to (perhaps) timer-based rate limits or other effects.

  • \$\begingroup\$ So, to sum up: 1) We agree that ussually a system will hold just a component type. 2) During the creation of a new entity (for me it will be just an id), components are requested to the systems they belong (I see systems as a factory too) and the system will be responsible to play with it when updating. 3) Did you mean that systems where the ones that registered to other systems events? Example: GraphicSystem needs to know position from PositionComponent, so, GraphicSystem listens to onChange event in PositionComponent that will be fired when the update method of the system updates positioncom \$\endgroup\$
    – Notbad
    Dec 22, 2011 at 18:54
  • \$\begingroup\$ Essentially, yes, that would be my idea. — In the system I'm building, I actually have each system provide a “filter” function, such that changes to components run through the (hopefully fast) filter function and then get queued into a worker task to be processed if they match its (perhaps approximate) conditions. EG: the graphics system for a certain viewport might provide a super-fast but potentially overly-broad filter to grab anything it "might" see, without having to cull 90% of the world. (Only changes that begin or end within potentially-viewable range are passed into the work task) \$\endgroup\$
    – BRPocock
    Dec 22, 2011 at 19:08
  • \$\begingroup\$ I see. Have to think a bit more about it. If anyone has any other idea, etc... I would be really happy to hear it. \$\endgroup\$
    – Notbad
    Dec 22, 2011 at 21:38

I worked with both "componentbased game-objects" and "functional reactive programming". As you've used "functional programming" in the title already, I will give an answer from an functional programming perspective, but still keep in mind your componentbased perspective.

Doing this research I found an entity framework called Artemis, that follows a FRP structure for the entity managment.

This doesn't make any sense. Please look up the definition of FRP! FRP is a concept on how to handle calculations and depdencies between data in reaction to an external event. I took a quick look at Artemis and I think it's called a componentbased game-object architecture.

The idea seems pretty good and I'm thinking of integrating in my engine.

Please consider extending an existing engine.


shared data is pretty straight forward following the blackboard pattern

Believe me, you don't want to share data. You're creating something similar to a global variable, and we all learned that we shouldn't use them, didn't we? Mathematically speaking you're breaking functional dependency and you will get in a lot trouble with interdependencies and in the long run your brain will explode.

How should this be done following FRP?

You differ between intra-object communication (via reactive values. think signal/slots) and inter-object communication (via messages).

I mean, if the collision system needs to know about physic component, movable system, etc... The collision system would import all this components and do all needed work with them. Is this right?

The collision system handles functionality concerning more than one game object, thus it must be separate from an independent actor and only communicate via messages. The collision system doesn't need to know anything except the position and physical extension of the object.

@2 see BRPocock's answer. But yet again, the system shouldn't know anything about a components data.


Doesn't this architecture leads to have too many system/components?

Correct. Object-oriented programming at it's best ;)


How does an event system fit in this structure? I ussually have slot/signals in game objects for this but it seems with artemis structure there's no "Entity" concept.

Aren't there any identites of some kind? If not, than I assume there's an "implicit protocol" based on component types. Have fun then!


Not the answer you're looking for? Browse other questions tagged .