Here's the recipe... just take a city calls Chevreuse, in the valley which has the same name. Add a lord, Guy I. You'll get a keep raised in 1075 on a plateau surround by deep ravines...
Between 1366 and 1393, Pierre de Chevreuse altered surrounding walls by adding two towers in south-west and north-west angles. These towers housed latrine and chimneys, in short... the ultimate comfort! Later, while anglo-burgundian troops seized the fortress, lords of Chevreuse built a drawbridge.
From 1440, the new owner, Nicolas de Chevreuse, began embellishments. Surrounding walls were flanked by square towers perfectly fit to live in, and dwellings were raised to the south. But the castle, which fell to cardinal of Lorraine in the 16th century, was abandoned.
In the 17th century, did you know young author Racine was put by his uncle in charge of keeping an eye on the restoration (began in 1661)?
The castle was transformed into a jail in 1686 and housed nuns in 1693. County Council of Yvelines restored it in 1981 and nowadays, it houses the seat of the Nature reserve of Chevreuse valley.