Charlemagne was king from 771 - 814. He united most of Western Europe during the early Middle Ages, he became holy roman emperor on Christmas day 800 AD, and Charlemagne had multiple wives and mistresses and perhaps as many as 18 children.
Charlemagne had a positive impact during that time period because he united all most of western Europe.
Castles brought protection because the had moats and the also had very high walls.