In contrast, in this work, we utilize the APF method to quantify the degree of influence of the unit at the spatial point
p. The specific calculation of the potential field value at
p is shown in Fig.
2. We first zone the environment, converting the whole environment into a
\(C \times C\) discrete environment. The spatial point
p is the center point of one of the regions, and the potential field values are the same everywhere in the same region. Then, we design the potential field function
U to calculate the potential field value of each unit at point
p. The
U consists of an attractive function
\(U_{\text {att}}\) and a repulsive function
\(U_{\text {rep}}\). The attractive function is designed to increase as our unit
i approaches the spatial point
p, i.e. the closer our unit
i is to the point
p, the greater its positive influence at the point
p. While the repulsive function is negative, its absolute value increases as the enemy unit
j approaches the spatial point
p, i.e. the closer the enemy unit
j is to the point
p, the greater its negative influence at the point
p. Formally, the attractive function
\(U_{\text {att}}\) and repulsive function
\(U_{\text {rep}}\) can be described as follows:
$$\begin{aligned} U_{\text {att}}(i,p) = {\left\{ \begin{array}{ll} \frac{3}{\pi } \left[ 1-\frac{{\hat{d}}(i)}{d^{*}}\right] ^2 \lambda _i({\hat{e}}_{i,b_{\text {pro}}}), \quad &{} {\hat{d}}(i) \le d^{*}\\ 0,\quad &{} {\hat{d}}(i) > d^{*} \end{array}\right. } \end{aligned}$$
(9)
and
$$\begin{aligned} U_{\text {rep}}(j,p) = {\left\{ \begin{array}{ll} \frac{3}{\pi } \left[ \frac{{\check{d}}(j)}{d^{*}} - 1 \right] ^2 \kappa _j({\check{e}}_{j,b_{\text {pro}}}), \quad &{} {\check{d}}(j) \le d^{*}\\ 0,\quad &{} {\check{d}}(j) > d^{*} \end{array}\right. }. \end{aligned}$$
(10)
Here,
\({\hat{d}}(i)\) and
\({\check{d}}(j)\) are the Euclidean distances from the current positions of our unit
i and the enemy unit
j to the point
p, respectively.
\(d^{*}\) is the distance threshold.
\({\hat{e}}_{i,b_{\text {pro}}}\) and
\({\check{e}}_{j,b_{\text {pro}}}\) are the intrinsic properties of our unit
i and the enemy unit
j, such as shooting range, shooting power, health status, and sight range, etc., respectively.
\(\lambda _i({\hat{e}}_{i,b_{\text {pro}}})\) is the
\(b_{\text {pro}}\) property value of the our unit
i and
\(\kappa _j({\check{e}}_{j,b_{\text {pro}}})\) is the
\(b_{\text {pro}}\) property value of the enemy unit
j.
According to Eqs.
9 and
10, we can calculate the influence value of our unit
i or the enemy unit
j at the point
p. Finally, the influence of all units in the environment at point
p is superimposed to obtain the final potential field value. Formally, the final potential field value can be described as follows:
$$\begin{aligned} f_{b_{\text {pro}}}(p) = \sum _{i=1}^{N} [U_{\text {att}}(i,p)] + \sum _{j=1}^{K}[U_{\text {rep}}(j,p)], \end{aligned}$$
(11)
where
N and
K are the numbers of our units and enemy units in the environment, respectively. For the different properties of the unit at
p, we use the Eq.
11 to calculate the final potential field values of different properties, which can be described as follows:
$$\begin{aligned} {\mathcal {F}}=[f_{b_1}(p), \dots ,f_{b_M}(p)], \end{aligned}$$
(12)
where the
M is the number of the units’ property. The original environment state feature is transformed into a discrete potential field feature
\(H^\textrm{apf}: M \times C \times C\).