Procedural game systems are incredibly versatile by nature. Therefore, the frameworks and infrastructures that they're implemented into need to share the same properties. Component-based systems, such as the Unity game engine, excel at this, and typically offer more versatility over traditional inheritance-based systems.
When building a large, dynamic system such as a game engine, a tradition inheritance-based approach will present problems. Inheritance structures become messy and objects become larger as they are required to do more. As a result, behavior becomes less encapsulated. A component-based approach solves these issues, so to finish our work we'll branch off a little to take a look at what a component-based system is, why it works hand in hand with procedural generation, and how we can improve the existing engine to benefit from it.
In this chapter, we'll cover the following topics:
Problems with a traditional inheritance approach
The pros and...