A component could be something like: a position, player movement, 3D model, health-points and so on.
For the communication of components in our engine we used messages, events or let them directly search for components implementing a specified interface, which is illustrated in the following diagram: In component-based architecture we were mostly concerned about the component intercommunication, like the player movement for example: Should the Mover-component manipulate the position directly or send movement-messages?
Do we implement a new Random Mover-component, or do we need a new component,… just to encapsulate the random function into a component?
And how does this fit into the automatic Position-Mover-communication?
And if we want it to be a bit random, we just compose the output with the random function in the game-object definition.
A pure mathematical function is the most isolated, self-existing and reusable component you can get, as it depends (and only depends! There is no need the encapsulate a function into a component…
Game developers like abstract and re-usable game-engines after all.
The following diagram illustrates such a monolithic class hierarchy (adopted from the book ): Game-object components address these issues by reducing game-objects to identifiable containers of components, where each component encapsulates some reusable functionality and automatically communicates with other components.
Make unlimited video calls and stay in touch with your loved ones for free!
However big your gang is, ICQ has got room for everyone.
You can chat for free with many thousands of other people - you will always find nice people in our many chat rooms.