I'm working on a game with a component-based architecture. An
Entity owns a set of
Component instances, each of which has a set of
Slot instances with which to store, send, and receive values. Factory functions such as
Player produce entities with the required components and slot connections.
I'm trying to determine the best level of granularity for components. For example, right now
Acceleration are all separate components, connected in series.
Acceleration could easily be rewritten into a uniform
Delta component, or
Acceleration could be combined alongside such components as
Gravity into a monolithic
Should a component have the smallest responsibility possible (at the cost of lots of interconnectivity) or should related components be combined into monolithic ones (at the cost of flexibility)? I'm leaning toward the former, but I could use a second opinion.
© Game Development or respective owner