The rulers of the Vijayanagara Empire created the cities with the main object of protection against invasions. They created first level of Fortification that encircled not only the city but also its agricultural hinterland and forests. The second line of fortification went around the inner core of the urban complex. A third line surrounded the royal center, within which each set of major buildings was surrounded by its own high walls.
The goal of medieval sieges was to starve the defenders to death. These sieges could last for several months, if not years. Typically, rulers attempted to prepare for such situations by constructing large granaries within fortified areas but the rulers of Vijayanagara through fortification managed to protect themselves through many attacks.
Visitors to the city, irrespective of their guilds and intentions had to travel through heavily fortified and protected environs before reaching the main urban core, passing through so much fortification also acted as a deterrent for those who conspired to invade the Vijayanagara empire.