In some castles, the space behind the gate was designed to be as narrow as possible, in order to limit the number of attacking enemy soldiers by creating congestion between the gate and the turrets.
You can see such an arrangement in this photo taken inside the Matsuyama castle, where the attackers were forced to enter an area where they were surrounded by walls and yagura turrets.
EXIF info:
Nikon Df
Lens: 14mm F/2.8D
Focal Length: 14mm
Aperture: F/7.1
Shutter Speed: 1/1000s
ISO Sensitivity: ISO 500