Any and all things about the formations that you wish to know have been explain in detail by Darth Vader in the Scriptorium.

“MODIFYING FORMATION AI”

“Modifying Formation AI version 2"