1) Defenses, Defenses, DefensesThose pretty walls of yours are virually useless without defenses. The MOST important thing you can build are Archer Towers - build as many as possible.
You will want a smaller amount of traps & abatis, but by far you should have the most AT's.
Rolling Logs are virtually useless - build them only to claim the Quest Reward.
Defensive Trebuchets (aka "Rockfalls") are effective, but cost a lot of resources & time, & they need to be rebuilt after every attack.
2) Tax at 50%Debate rages over the best tax rate, but to get the most "value" out of your peasants, tax at 50%. (Turosian has proven it mathematically, ask him
)
Yes, you could set it to 100% for maximum return, but if you forget, or the server crashes, you could log back in to an empty city.
The only problem should be with loyalty - to get people to move in, use Comforting techniques to keep them happy. It's also a good idea to have at least twice the pop limit as you have population.
If, in the event of repeated attacks, it is strongly recommended to lower your tax rate as much as possible to raise loyalty.
3) Idle Pop = Future TroopsKeeping large amounts of the unemployed is not a bad thing. The peasants will not revolt if they don't have jobs. Despite the fact they're begging for crusts of bread, your unemployed still pay tax! So that's not an issue.
Idle Pop is where you draw your troops from - so have a lot.
4) Gates ClosedAssuming you've followed Juma Rule #1, when under attack ensure your gates are closed! Your defenses are far more effective at killing enemy troops & you'll only have 1 thing to rebuild, instead of defenses AND troops.
The ONLY exception to this rule is when you need to be reinforced by an alliance mate.
5) Always ScoutDon't assume you "know" what a valley will hold, or a player city.
It is also strongly advised that you send a scout shortly before an attack is going to land, to make sure that the target has not been reinforced & you can recall the attack.