Hilariously, the Age of Empires II AI sometimes did precisely the opposite--its troops would smash all your walls, but leave gates standing.  Your civilization would be reduced to rubble...but at least your rubble would have gates.