Genetic Algorithm for Artificial Neural Networks in Real-Time Strategy Games - Yudi Widhiyasana; Maisevli Harika; Fahmi Faturahman Nul Hakim; Fitri Diani; Kokoy Siti Komariah; Diena Rauda Ramdania (JOIV : International Journal on Informatics Visualization, 2022)
Controlling each member of the soldiers to carry out battle with Non-Playable Characters (NPC) is one of the secrets to winning Real-Time Strategy games. The game could be more complicated and offer a more engaging experience if every NPC acts like humans rather than machines with patterned behavior. Like people during a war, each army member's command requires rapid reflexes and direction to strike or evade attacks. An intelligent opponent based on ANN as NPC can react quickly to their opponents. The accuracy of ANN could be enhanced by weight modifications using a Genetic Algorithm (GA). The crossover and mutation rates significantly impact GA's performance as an ANN setup. This research aims to find the best crossover and mutation rates in GA as a weight adjustment in ANN. Experiments were conducted using an RTS game simulator using 20 scenarios on a maximum of 4000 iterations. The initial setup of each troop is random, with a seven-unit type available. In this research, the troops won because their men were subjected to fewer attacks than the opposing forces. The GA optimal crossover and mutation rates are determined using troop victories as a baseline. According to the findings, the best crossover rate for GA as an ANN weight adjustment is 0.6, whereas the specific mutation rate is 0.09. The crossover rate of 0.6 has the highest average win value and tends to increase every generation. As for the mutation rate of 0.09, it has the highest average win value. Thus, this preliminary study can develop NPC more humanly.