the prototype pattern you can verify that your results match these results[knight typeknight life speed attack power attack range weaponshort sword [archer typearcher life speed attack power attack range weaponlong bow players will be able to build multiple versions of the same buildingas we discussed beforeand we want the levels and types of units that specific building can generate to change based on the level of the building level barracks generates only level knightsbut once the barracks is upgraded to level it unlocks the archer unitand as an added bonus it now generates level knights instead of the level knights from before upgrading one building only has an effect on the units that it is able to generateand not on the capabilities of all the buildings of the same type that the player built we cannot simply keep track of single instance of unitnow every building needs to track its own version of the unit every time building wants to create unitit needs to look up what units it can create and then issue command to create the selected unit the unit class then has to query the storage system to find the relevant parameterswhich are then read from storage before they are passed into the class constructor of the instance being created this is all very inefficient if one building has to generate units of the same typeyou have to make duplicate requests of the storage system you chose multiply this by the number of buildingsand then add the lookups each building needs to do to decide which units it should be capable of generating massive game like eve onlineor any other modern rts for that matterwill kill your system in short order if it is required to go through this process every time it needs to generate unit or build building some games take this step further by allowing specific add-ons on buildings that give units generated in that building different capabilities from the general unit typewhich would make the system even more resource hungry