The idea of not all units routing is good since not every man is the same. Some more courageous ones would probably stay and fight even if their general is dead. That would of course be very hard to programme and to control on the battlefield.