# Improved Belgian AI Algorithm for Dynamic Management in Action Role-Playing Games
## 4 Results and Discussion
### System Tests
#### 4.2.2 Dynamic Tests  
The dynamic tests aimed at testing the attack mechanism of enemies, the allocation logic of the stage manager, as well as the execution process of the RID algorithm. The combat diversity, game balance, stage manager's request process logic, and the strengthened effect of control and scope of application for the stage manager of the RID algorithm are compared and verified with the management through BAI and IBAI. Table 5 shows the type and number of enemies used in each dynamic test. Figure 5: Tests for the number of enemies that can be held. (**a**) BAI; (**b**) IBAI. Figure 6: Tests for the interaction area between enemies and the player. (**a**) BAI; (**b**) IBAI. * Attack mechanism tests In the BAI level and IBAI level, the player enters the attack decision area of enemies from the first stage to the third stage successively. As the BAI level is shown in Figure 7a, the four enemies in the eight grids belong to the first stage; the two above and on the right of the player outside the grids belong to the second stage, and the one on the left outside belongs to the third stage. Two EnemyMelee3 use Skill2 to attack the player. The EnemyMelee2 below uses Skill1, while the one in the upper left uses a normal attack. Thereafter, the player kills the EnemyMelee3 on the bottom left, and then the two enemies in the second stage enter the grids (shown in Figure 7b). EnemyMelee1, EnemyMelee2, and EnemyMelee3 attack with normal attacks, Skill1, and Skill2, respectively. Figure 8a shows the test process of IBAI. The enemies in the first stage are the four in the melee area, among whom EnemyMelee3 attacks with Skill2, Skill1, and a normal attack, and EnemyMelee2 attacks below and on the top left of the player with Skill1 and a normal attack. After EnemyMelee3 on the bottom left is killed by the player, the two enemies in the buffer area in the second stage enter the melee area while the one in the third stage does not (shown in Figure 8b). At this moment, [PERSON], [PERSON], and [PERSON] use Skill2, Skill1, and normal attack alternately, and normal attack simply to attack the player. \begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline \begin{tabular}{c} **Dynamic** \\ **Tests** \\ \end{tabular} & **Stages** & \begin{tabular}{c} **Enemy** \\ **Melee1** \\ \end{tabular} & \begin{tabular}{c} **Enemy** \\ **Melee2** \\ \end{tabular} & \begin{tabular}{c} **Enemy** \\ **Melee3** \\ \end{tabular} & \begin{tabular}{c} **Enemy** \\ **Ranged1** \\ \end{tabular} & \begin{tabular}{c} **Enemy** \\ **Ranged2** \\ \end{tabular} & \begin{tabular}{c} **Enemy** \\ **Ranged3** \\ \end{tabular} \\ \hline \multirow{3}{*}{\begin{tabular}{c} Attack \\ mechanism \\ \end{tabular} } & First & 0 & 2 & 2 & 0 & 0 & 0 \\  & Second & \(1\) & 1 & 0 & 0 & 0 & 0 \\  & Third & 1 & 0 & 0 & 0 & 0 & 0 \\ \hline \multirow{3}{*}{\
\begin{tabular}{c} Allocation \\ logic \\ \end{tabular} } & First & 1 & 0 & 3 & 0 & 0 & 0 \\  & Second & 0 & 1 & 0 & 0 & 0 & 0 \\  & Third & 2 & 0 & 0 & 0 & 0 & 0 \\ \hline \multirow{3}{*}{
\begin{tabular}{c} RID \\ algorithm \\ \end{tabular} } & First & 1 & 0 & 0 & 0 & 0 & 0 \\  & Second & 1 & 0 & 1 & 1 & 1 \\ \cline{1-1}  & Third & 0 & 1 & 0 & 0 & 0 \\ \cline{1-1}  & Fourth & 1 & 0 & 0 & 0 & 0 \\ \cline{1-1}  & Fifth & 0 & 0 & 0 & 1 & 0 & 0 \\ \cline{1-1}  & Sixth & 0 & 0 & 0 & 1 & 0 & 0 \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Type and number of enemies used in each dynamic test. Figure 7: Attack mechanism tests of BAI. (**a**) The first combat scene; (**b**) The second combat scene. The results of attack mechanism tests demonstrate that enemies will constantly use the same attack type until the number of enemies that have gained the attack right changes when authorized by the stage manager with BAI. Additionally, the same type of enemy may attack the player with the same attack type at the same time. Compared with BAI, IBAI can provide higher combat diversity and maintain the game's balance. Enemies can use another attack type that meets the requirement of AWT if an attack type is in cooldown.