Alternative to D2837 and D2767 for the patrol case.
This makes units wait a few seconds between each patrol waypoint. It negates the "dancing" aspect of patrol entirely.
It doesn't fix the order case, which isn't as bad but still problematic, so it should probably be used with one of the above two.
It reduces duplication between the formation and the regular-unit case by using a common factory generator. This is debatable.