Start the battle by going to the first base and capturing it by defeating the officer there. Wait until Zhao Yun announces himself, which will make all of the enemy come to him, letting the main forces concentrate on going to Tianshui Castle. However, on the way will be an ambush, so take them out and continue to another ambush, this time with some ballistae. Destroy those first and then take out the officers that are there.
Once they are gone, there will be a short scene where Jiang Wei will appear. Defeat him and he will temporarily retreat, where he will head towards Andang. The game tells you to capture it before Jiang Wei reaches it, but it is quite difficult to do and if you don't, three pyrocannons will spawn.
The next event is the same thing, but with Nan'an Castle. You can't directly go to the castle and capture it, as you need to go after the garrison a little to the south to set up some siege weapons. When you capture the garrison, a battering ram appears, but Pan Sui will activate some ballistae nearby. Defeating Pan Sui will deactivate the ballistae, so go ahead and do that.
As before, there isn't too much of a difference whether you don't make it in time or not. Once you capture Nan'an, Ma Zun will opt to try and escape from Tianshui, so head over there. Capture Tianshui by defeating Xiahou Mao, then defeat Ma Zun once the gates open. After that, all that is left is to take down the isolated Jiang Wei to finish the battle.