Environmental path-entropy and collective motion