The next problem is the corners and fronts of our walls. A long stretch of flat wall can be broken with a ram or with siege engines. To shore up this weakness we again thicken the walls at intervals and put towers on top. Ideally we should have as short stretches of flat walls as possible, but here's the effectivness vs cost dilemma again.
Next we have the the corners. They have good fields of fire, but are a weak point. To solve the problem and give us a bit of adge, we put some even bigger and heavier towers, right at the corners. These are called bastions and can be as big as the keep itself.
Now we have a small fortress. Let's keep going shall we. We'll add another layer to the defenses.