As simulation becomes more present in the military context for variate purposes, the need for accurate behaviors is of paramount importance. In the air domain, a noteworthy behavior relates to how a group of aircraft moves in a coordinated way. This can be defined as formation flying, which, combined with a move-to-goal behavior, is the focus of this work. The objective of the formation control problem considered is to ensure that simulated aircraft fly autonomously, seeking a formation, while moving toward a goal waypoint. For that, we propose the use of artificial potential fields, which reduce the complexities that implementing a complete cognition model could pose. These fields define forces that control the movement of the entities into formation and to the prescribed waypoint. Our formation control approach is parameterizable, allowing modifications that translate how the aircraft prioritize its sub-behaviors. Instead of defining this prioritization on an empirical basis, we elaborate metrics to evaluate the chosen parameters. From these metrics, we use an optimization methodology to find the best parameter values for a set of scenarios. Thus, our main contribution is bringing together artificial potential fields and simulation optimization to achieve more robust results for simulated military aircraft to fly in formation. We use a large set of scenarios for the optimization process, which evaluates its objective function through the simulations. The results show that the use of the proposed approach may generate gains of up to 27% if compared to arbitrarily selected parameters, with respect to one of the metrics adopted. In addition, we were able to observe that, for the scenarios considered, the presence of a formation leader was an obstacle to achieving the best results, demonstrating that our approach may lead to conclusions with direct operational impacts.