You will not have time to react – be it sending your villagers away from danger or determining the correct counter units – unless you know well in advance what your units your enemy has and tracking where they are.

If you have your starting scout, use that to identify whether your opponent has a stable or an archery range. Later in the game, if you do not have map control, use that scout to track the enemy army. If you don’t have a scout, or if you’re paranoid that the enemy will show up, add some outposts in the perimeter of your town and invest in town watch. You will never be surprised then.