Medieval Portuguese fortresses tended to be very compact. People lived in the walled towns and the fortress was just for the local ruler as well as a refuge when the town was under attack. The tall towers served to store grains and other supplies needed to withstand a siege and also provided a perfect high platform for firing down on would-be attackers.