Maybe that this has been dealt with in other threads before, but thought it was worth starting up a thread on castle attack/defence tactics.

Attacking - well, the most obvious 'tactic' is to autoresolve if you outnumber the enemy as you'll invariably get a win with hardly any casualties, whereas a live battle will probably be hard won. I've yet to devise a solid attacking tactics that don't involve losing a lot of men (unless you seriously outnumber the defenders). Be interested in others best tactics.

Defense - my favoured tactic if you have enough troops to merit a player battle (what is a no-hope situation varies on the number of attackers who the defenders are), and you have a good mix of missiles/infantry is to put your missiles on the walls (the inner most wall if you're in a developed castle), with your melee troops lined up along the base of the wall, in guard mode, and spearwall if they're ashigaru. This seems counter-intuitive, as you miss out on the advantages of melee-defending a wall, but in actual fact your infantry can generally survive for quite a while (but keep flanks covered), whilst your missile troops rain down arrows/shot on your enemies from above un-interupted, pummeling their morale and generally avoiding friendly-fire because of the high angle. If its a developed castle, enemy units will have already suffered casualties and morale from scaling numerous walls and fire from towers too. If its only a fort/stronghold then your melee troops will suffer quite heavy casualties from enemy archers - so don't put in spearwall until their melee troops close for combat.

In my experience this tactic definitely beats retreating missile units from the walls when attackers start climbing and replacing with melee (or having the missiles on outer walls and leaving them to their fate). Some of the most epic battles (and wins) i've had have been putting a full stack of armoured naginata and ashigaru teppo (half/half) in a castle and having 4 stacks of experienced enemy samurai assault (as what tends to happen at the start of realm divide). Absolute massacre with teppo getting hundreds of kills each. However, even with mediocre troops with poor morale (standard ashi spears/archers), this approach can still be used to beat much larger samurai forces.