I remember learning about in world history a civilization would have their houses close together and only/mostly accessible through the rooftops to mostly keep out enemies. What is this civilization called?
This sort of defensive strategy has had long and widespread. It can be found at Çatalhöyük, some 9000 years ago. And it can be found much more recently among the various Pueblo peoples in the American Southwest. Those two are perhaps the most famous to use this sort of architecture, though, so was either of them what you were thinking of?