Development of Non-Player Character for 3D Kart Racing Game Using Decision Tree

Nashrul Azhar Mas'udi, Eriq Muhammad Adams Jonemaro, Muhammad Aminul Akbar, Tri Afirianto


Racing game is one of the genre that’s still popular today. Unity is one of many game engines one can use to develop a racing game. At Unity Asset Store, there is a free template called Micro-Game Karting which can only be played alone. In order to play player versus enemy mode, an artificial intelligence (AI) is needed for directing non-player character (NPC) who acts as the opponent. In racing game, the AI requires the use of movement algorithm and decision making system. For this study, the movement algorithm will use pathfinding. The algorithm is used as a guiding path when NPC is moving and avoiding obstacles in the way. Pathfinding will use waypoint system and raycasting to accomplish it. The decision making technique that will be used is decision tree. It functions as decision maker for NPC so it can determine the correct action to be done at certain time. Result of black box and white box testing showed NPC is functional. As for FPS (frame per second) test, performance suffers 0.2-0.3 FPS decrease for every addition of 2 NPCs. According to lap time test, the developed NPC is faster than ML NPC and driving test showed favorable outcome.


racing game, Unity, non-player character (NPC), waypoint system, raycasting, decision tree

Full Text:


Article Metrics

Abstract view : 0 times
PDF - 0 times


[1] J. Sirani, “Top 10 Best-Selling Video Games of All Time,” IGN, 2019. (accessed Aug. 30, 2019).

[2] E. Jones, “All Upcoming Racing Games of 2019 |,” 2019. (accessed Aug. 30, 2019).

[3] D. Sirlin, “Playing To Win – Becoming the Champion: Introduction — Sirlin.Net — Game Design,” 2000. (accessed Jul. 10, 2020).

[4] I. Millington and J. Funge, Artificial Intelligence for Games, 2nd ed. Burlington: Morgan Kaufmann, 2009.

[5] M. T. Chan, C. W. Chan, and C. Gelowitz, “Development of a Car Racing Simulator Game Using Artificial Intelligence Techniques,” Int. J. Comput. Games Technol., vol. 2015, 2015, doi: 10.1155/2015/839721.

[6] J. Glover, “Learn and Understand Raycasting in Unity3D – Zenva | GameDev Academy,” 2017, Accessed: Oct. 03, 2019. [Online]. Available:

[7] T. B. Yoon, K. H. Park, J. H. Lee, and K. M. Lee, “User Adaptive Game Characters Using Decision Trees and FSMs,” Lect. Notes Comput. Sci. (including Subser. Lect. Notes Artif. Intell. Lect. Notes Bioinformatics), vol. 4496 LNAI, pp. 972–981, 2007.

[8] L. D. Pyeatt, “Reinforcement Learning with Decision Trees,” IASTED Int. Multi-Conference Appl. Informatics, vol. 21, pp. 26–31, 2003.

[9] M. Claypool, K. Claypool, and F. Damaa, “The Effects of Frame Rate and Resolution on Users Playing First Person Shooter Games,” Multimed. Comput. Netw. 2006, vol. 6071, p. 607101, 2006, doi: 10.1117/12.648609.

[10] C. Bennett and D. V. Sagmiller, Unity AI Programming Essentials, 1st ed. Birmingham: Packt Publishing, 2014.

[11] R. Graham, H. McCabe, and S. Sheridan, “Pathfinding in Computer Games,” ITB J., vol. 4, no. 2, 2003, doi: 10.21427/D7ZQ9J.

[12] M. Buckland, Programming Game AI by Example. Texas: Wordware Publishing, Inc., 2005.

[13] R. S. Pressman, Software Engineering: A Practitioner’s Approach, 5th ed. New York: McGraw-Hill, 2001.


  • There are currently no refbacks.