Castletowns were military centers where government officials and samurai lived in Japan. They were designed strategically to be prepared for battle with fortified walls to keep armies out, while also providing a safe place for residents. The layout placed the castle in the center, surrounded by zones for different social classes - with highest ranking samurai closest to the castle, then lower ranking samurai, peasants, artisans, and merchants furthest from the center.