I always imaged the major castles of the world being fortified granaries. Feudalism in their world starting out of a need to store food for the long winters and defending that food against the starving masses. while the summers are gluts of food, huge population increases and war.