To Component, or not to Component. That is the quest ion.

(yeah I had to put a space in question so it would let me post the topic).

There are two projects I’ve been spending lots of time on recently, an Entity-Component-View-Controller library for games, and a game engine.

My current debate is whether I should refactor my game engine into an entity-component architecture (use my entity library essentially).

Pros:

  • It would greatly simplify my code and my user’s code when it comes to: particle systems, sprites, steering behaviors, networking, spatial database, animation, sound, the list goes on.

Cons:

  • The overhead of get/set methods for an Entity-Component design is more compared to using interfaces. I’m all about efficiency, and when I think about someone having 100,000 particles on their screen… it will be twice as fast when it’s interfaces compared to Entity-Component (I strongly suspect - I should actually do a test).

You may be thinking THIS ISN’T EVEN DEBATABLE FOOL! But just the thought of refactoring it and having it end up being a little bit slower makes me resistant.

Help me JGO, you’re my only hope!