Entity Type specific updates in entity component system

Posted by Nathan on Game Development See other posts from Game Development or by Nathan
Published on 2012-11-21T22:20:34Z Indexed on 2012/11/21 23:12 UTC
Read the original article Hit count: 375

I am currently familiarizing myself with the entity component paradigm.

For an example, take a collision system, that detects if entities collide and if they do let them explode.

So the collision system has to test collision based on the position component and then set the state of those entities to exploding.

But what if the "effect" (setting the state to exploding) is different for different entities? For example, a ship fades out while for an asteroid a particle system must be created. Since entities and components are only data, this must happen in some system.

The collision system could do it, but then it must switch over the entity type, which in my opinion is a cumbersome and difficult to extend solution.

So how do I trigger "entity type dependend" updates on an entity?

© Game Development or respective owner

Related posts about component-based

Related posts about entity-system