I want the castle designs of my fantasy world to reflect the technology and ability of the world. Our castle designs were very effective and optimized for a world where people couldn't fly. I want to know what sorts of defensive features walled cities or castles might put in to deal with this kind of a threat.
My universe is somewhat similar to a late medieval level of technology, the people have fought with typical medieval weapons, they started to develop firearms and cannons for a time but those were outlawed by the wizard classes as "dishonorable weapons of scoundrels and brigands" so those weapons exist but they aren't commonly used.
The way the ability to fly is utilized in battle is, a wizard is able to summon a sort of ethereal familiar that kind of looks like his spirit animal but with wings and is able to fly and the wizard can ride on the creature's back and has enough room for one passenger. This requires a constant projection from the wizard so he isn't able to perform any other magic while riding one. Typically he would carry one riding wizard on his familiar that is able to cast defensive or offensive magic though.
Now, when assaulting a castle the wizard would summon his familiar and they would attach a wooden platform to it with strong chains, anywhere from about 50 to 60 heavily armored specially selected men would then crowd onto the platform. The platform has walls on it to not only protect the soldiers from falling out but also to protect them from arrow fire. Then the wizard will take off dragging these men under him and just fly above the range of enemy archers then lower them into the enemy city, and while they're being lowered in there will be 3 escort wizards on separate familiars casting a mostly complete protective bubble around the wizard carrying the soldiers to keep him safe from arrow fire. I say mostly complete because the occasional arrow can get through a weak spot. Once behind the walls the soldiers can do a number of things such as try to open the gates or take up a defensive stance and wait for more soldiers to be dropped in, or just be a presence that the enemy must draw soldiers from somewhere else to deal with them. That's one of the main functions, actually, to force the defenders to respond to small groups of enemies being dropped in behind their defenses.
One obvious defense you might say is "have other wizards just attack them." and that does happen sometimes, but wizards in this universe are a very small elite group of warriors. To become a fully competent battle ready wizard, it takes 30 years and intense training from a very young age to become proficient enough in controlling magic that you can really be devastating in battle, to become a master wizard, who are the guys with the flying familiars, it takes 45 to 50 years. They are a very small group of people, but the presence of them in a battle alone can absolutely turn a battle. So the government gives them a very large pension and the best schooling available so they can spend their entire lives dedicating themselves to learning magic. If you send these guys out in these medieval sorties to fight other wizards in the air, and one of them dies, you are NOT going to be able to replace him very quickly. So you don't want to be sending them out to fight other wizards cause there is a very high chance they will be killed, you want to save them and use them for tasks where they will be kept relatively safe, I mean, as safe as you can be in a battle. And then also, wizards aren't always going to be available to help you defend your city or castle so there need to be other methods for dealing with this situation.
Then one of the battles will actually be fought against a rebel faction that rebelled specifically against the wizards cause... the wizards are actually very unpopular so there are going to be more uses of guns and less uses of magic in those battles.
One possible answer I'm thinking of is that walled cities and castles might be rendered obsolete by this, but I don't think so because the walls still keep the vast majority of the attacking army out and make the attackers work harder to get in.