Delve into the engineering marvel of medieval castles, each uniquely shaped by its historical context and topographic constraints. Focus on Carrickfergus Castle in Northern Ireland, which evolved from a simple stone enclosure into a formidable, multilayered defensive system, complete with thick crenellated walls, towers, a gatehouse, and other characteristic features of medieval military architecture.