Spearmen can also stop charging cavalry if they are facing the charge, though spearmen with poor defence will be pushed back.

They also still get their rank bonus in a forest, it is simply less likely for them to get it as the trees force rear ranks into each other and jumble them up making it difficult to get a straight line of 4 men behind one guy who is fighting up front.