Movement in formation with intelligent slot selection and pathfinding with obstacles.