There's also a few additions to your fortress that can be used when the shape of the wall or terrain is suitable.
I you have a wall where your defenders have a shorter range, you can extend the range of your defense with a barbican. The barbican is a heavy bastion outside the walls connected to the walls with a walkway or a wall.
Multiple small couryards can be contructed by addong walls between the layers. Each courtyard can be defended separatley.
Putting the gates in a slope allows the defenders to roll logs or burning hay-bales through the gate onto the assaulting forces.
Smaller fortresses outside the main fortress on strategic locations is called block-houses or redoubts and can be used to defend choke points.

This is the end of this first chapter on my essay on how plan fortifications. My final note is about how you plan a map.
When you sketch it out, think about how the city grows and plan the defences for each stage, don't be afraid to leave some parts of town outside the walls. Think defensivly and plan your walls to be as effective as possible as cheaply as possible.
Any fort will be built as tight as possible with most of the city outside. A ring wall can be put up around the whole town, but is not the main defense, it's there to ward off raiders and to keep a siege protracted.
Oh. and a round shape is more cost effective than a square.