Development of Non-Player Character for 3D Kart Racing Game Using Decision Tree
DOI:
https://doi.org/10.21111/fij.v6i2.4678Keywords:
racing game, Unity, non-player character (NPC), waypoint system, raycasting, decision treeAbstract
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.References
[1] J. Sirani, “Top 10 Best-Selling Video Games of All Time,” IGN, 2019. https://www.ign.com/articles/2019/04/19/top-10-best-selling-video-games-of-all-time (accessed Aug. 30, 2019).[2] E. Jones, “All Upcoming Racing Games of 2019 | Heavy.com,” 2019. https://heavy.com/games/2019/01/top-best-upcoming-racing-games-2019/ (accessed Aug. 30, 2019).[3] D. Sirlin, “Playing To Win – Becoming the Champion: Introduction — Sirlin.Net — Game Design,” 2000. http://www.sirlin.net/ptw-book/introduction (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: https://gamedevacademy.org/learn-and-understand-raycasting-in-unity3d/.[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.
Downloads
Submitted
Accepted
Published
Issue
Section
License
Copyright (c) 2021 Fountain of Informatics Journal
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
Please find the rights and licenses in the Fountain of Informatics Journal (FIJ). By submitting the article/manuscript of the article, the author(s) agree with this policy. No specific document sign-off is required.
1. License
The non-commercial use of the article will be governed by the Creative Commons Attribution license as currently displayed on Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
2. Author(s)' Warranties
The author warrants that the article is original, written by the stated author(s), has not been published before, contains no unlawful statements, does not infringe the rights of others, is subject to copyright that is vested exclusively in the author, and free of any third party rights, and that any necessary written permissions to quote from other sources have been obtained by the author(s).
3. User/Public Rights
FIJ's spirit is to disseminate articles published are as free as possible. Under the Creative Commons license, FIJ permits users to copy, distribute, display, and perform the work for non-commercial purposes only. Users will also need to attribute authors and FIJ on distributing works in the journal and other media of publications. Unless otherwise stated, the authors are public entities as soon as their articles got published.
4. Rights of Authors
Authors retain all their rights to the published works, such as (but not limited to) the following rights;
- Copyright and other proprietary rights relating to the article, such as patent rights,
- The right to use the substance of the article in own future works, including lectures and books,
- The right to reproduce the article for own purposes,
- The right to self-archive the article (please read out deposit policy),
- The right to enter into separate, additional contractual arrangements for the non-exclusive distribution of the article's published version (e.g., post it to an institutional repository or publish it in a book), with an acknowledgment of its initial publication in this journal (Jurnal Optimasi Sistem Industri).
5. Co-Authorship
If the article was jointly prepared by more than one author, any authors submitting the manuscript warrants that he/she has been authorized by all co-authors to be agreed on this copyright and license notice (agreement) on their behalf, and agrees to inform his/her co-authors of the terms of this policy. FIJ will not be held liable for anything that may arise due to the author(s) internal dispute. FIJ will only communicate with the corresponding author.
6. Royalties
Being an open accessed journal and disseminating articles for free under the Creative Commons license term mentioned, author(s) aware that FIJ entitles the author(s) to no royalties or other fees.
7. Miscellaneous
FIJ will publish the article (or have it published) in the journal if the article’s editorial process is successfully completed. FIJ's editors may modify the article to a style of punctuation, spelling, capitalization, referencing, and usage that deems appropriate. The author acknowledges that the article may be published so that it will be publicly accessible and such access will be free of charge for the readers as mentioned in point 3.