The Granary is an economic building available in Age of Empires. It becomes available in the Stone Age and functions as a drop-off point for Villagers gathering food but only for Gatherers, Foragers, and Farmers. The Granary is also the research building for technologies used to build Walls and Towers, such as the Small Wall and Watch Tower. Since the majority of buildings require prior construction of a granary, it can be argued that the granary is the second most important economic structure behind the Town Center.
The importance of this structure can be tested in the Scenario Editor where placing no Berry Bushes on a blank map resulted in technological stagnation of the computer opponent regardless of the amount of resources the computer player has in their disposal and the amount of Trees or Gold Mines placed on the map, since the only reason the computer player constructs a granary is to provide a convenient drop off point for Foragers. Likewise, if the computer player is encouraged to build the Storage Pit but discouraged from building a Granary, technological stagnation would ensue indefinitely.
Following the advance of farming, humans faced the first time the happy problem of how to safely store large quantities of food grains. The Granary made it possible to preserve growing season surpluses for consumption during winter months. The Granary was a central location where grain could be warehoused, guarded, and distributed fairly as needed. The need to protect food supplies was an early reason for building walls and fortifications. Without protection, the surpluses in the Granary were easily taken by raiders from nearby hunting and gathering groups.