-
Book Overview & Buying
-
Table Of Contents
Game Development Patterns with Unreal Engine 5
By :
If you need a fast way of creating many variants of something in your game as a form of expanding the content available to players, then the type object pattern is for you. Type object takes the ideas of implicit and explicit data we covered as part of the flyweight pattern back in Chapter 3 and expands it into the world of gameplay. The principle is the same: we separate out all data that is common across all instances of a type, but instead of just linking to it from everywhere, we mix it up and produce lots of variations of this data. The result is a connected web of objects that all have the same functionality but vary in which set of implicit data they use.
Figure 9.15: Diagram from Chapter 3 where we discussed the Flyweight pattern
Figure 9.15 shows the Flyweight pattern saving space by storing implicit data about the idea of a tree in one place in memory.
Figure 9.16: Diagram showing the expansion of...