How can I compile code in the game?

Then let AI pawns do the corresponding behavior. Such as formation, movement, attack…
Can this be achieved? Sorry for my google translate English.

What exacly what to compile? AI Blackboard? You sure it can not be solved with variable switches?

Custom formation or custom flock(I am not sure about this word.)
Get the formation from the input math function. And composition of a variety of shapes. Such as triangles, quadrilaterals, circles, sinusoids.etc.
At least to be able to perform mathematical function calculations by input in the game.

You want multiple pawns to move in formation, arranging themselves almost as if they were vertices on a model (but following more loosely)?

I dont know how to do that but since I am not a genius I would probably just create an invisible pawn with lots of sockets or scene components and then assign each other pawn to use Homing Projectile movement component to follow its assigned socket or component’s location.
Should work as long as they dont have to avoid collisions.