NPC Braking Decision for Unity Racing Game Starter Kit Using Naïve Bayes
DOI:
https://doi.org/10.21111/fij.v4i2.3591Keywords:
Braking Decision, Racing Game Starter Kit, Naïve Bayes, Machine Learning, Unity EngineAbstract
AbstractRacing video game genre was still being popular today. One way to develop racing games quickly is by using a template or kit that is on the game engine. Racing Game Starter Kit (RGSK) was being the most popular racing game template for Unity game engine. However, there was problem in racing game’s NPC especially in RGSK related to NPC vehicle’s braking decision. The commonly used method is the Brake Zone, but the developers must manually place the zone themselves in the designated locations for braking. The solution that can be applied for that problem is see the angle formed by the vector of the NPC vehicle with the vector from 2 next following waypoint then determine the best configuration angle threshold for NPC braking, but this also has its shortcoming in which to get the best result, a proper threshold configuration is needed in each track. To resolve the problem, researcher proposed the method of machine learning, Naïve Bayes for the braking decision. Naïve Bayes uses two output classes (brake or no brake) in which the data will be obtained from the player. We use data from players who can control racing car games well or have never hit a wall and have fast lap times. The purpose of this study is to provide an alternative braking method to RGSK that can provide fast lap times but does not affect the game's FPS and without the need to determine or change any parameters on each track. The test result using RGSK v1.1.0a in Unity Game Engine showed that the proposed method can be an alternative method in RGSK braking decisions. Our NPC has faster lap time and was able to prevent the vehicle from crashing with the outer wall without dropping the game’s FPS (Frames per Second).Keywords: Braking Decision, Racing Game Starter Kit, Naïve Bayes, Machine learning, Unity engine AbstrakGenre video gim balap masih populer saat ini. Salah satu cara untuk mengembangkan game balap dengan cepat adalah menggunakan template atau kit yang ada di game engine. Racing Game Starter Kit (RGSK) adalah templat game balap paling populer pada Unity Game Engine. Namun, terdapat permasalahan NPC pada gim balapan terutama di RGSK terkait dengan keputusan pengereman kendaraan NPC. Metode yang digunakan untuk eksperimen jenis ini adalah Zona Rem. Namun, pengembang harus secara manual menempatkan zona tersebut di lokasi tertentu pada setiap lintasan. Solusi dari masalah ini yang sudah diterapkan pada RGSK v1.1.0a yaitu dapat menggunakan sudut yang dibentuk oleh vektor kendaraan NPC dengan vektor dari 2 titik arah berikutnya, kemudian menentukan ambang sudut terbaik untuk pengereman NPC, tetapi ini juga memiliki masalah yaitu untuk mendapatkan hasil putaran terbaik atau cepat, perlu menentukan konfigurasi ambang batas yang tepat di setiap trek. Untuk mengatasi masalah tersebut, peneliti mengusulkan metode pembelajaran mesin, Naïve Bayes untuk keputusan pengereman. Naïve Bayes menggunakan dua kelas output (rem atau tidak ada mengerem) di mana data akan diperoleh dari pemain. Kami menggunakan data dari pemain yang dapat mengontrol permainan mobil balap dengan baik atau tidak pernah menabrak tembok dan memiliki waktu putaran yang cepat. Tujuan dari penelitian ini adalah untuk memberikan metode pengereman alternatif untuk RGSK yang dapat memberikan waktu putaran yang cepat namun tidak mempengaruhi FPS game dan tanpa perlu menentukan atau mengubah parameter apa pun di setiap trek. Hasil pengujian menggunakan RGSK v1.1.0a di Unity Game Engine menunjukkan bahwa metode yang diusulkan dapat menjadi metode alternatif dalam keputusan pengereman RGSK. NPC kami mempunyai waktu putaran yang lebih cepat dan mampu mencegah kendaraan agar tidak menabrak dinding luar tanpa menjatuhkan FPS game (Frame per Detik).Kata kunci: Keputusan Pengereman, Racing Game Starter Kit, Naïve Bayes, Pembelajaran Mesin, Unity EngineReferences
[1] F. Totu, “100 million Need for Speed Games Have Been Sold to This Day.” .[2] Electronics Arts, “Need For Speed Payback.,” 2017. .[3] Unity, “Unity Asset Store.” .[4] J. Wang, “Classification of Humans and Bots in Two Typical Two-player Computer Games,” in 2018 3rd International Conference on Computer and Communication Systems (ICCCS), 2018, pp. 502–505.[5] I. Mabruroh and D. Herumurti, “Adaptive Non Playable Character in RPG Game Using Logarithmic Learning For Generalized Classifier Neural Network (L-GCNN),” Kinet. Game Technol. Inf. Syst. Comput. Network, Comput. Electron. Control, vol. 4, no. 2, p. 127, 2019.[6] Y. Sazaki, A. Primanita, and M. Syahroyni, “Pathfinding car racing game using dynamic pathfinding algorithm and algorithm A∗,” in Proceedings - ICWT 2017: 3rd International Conference on Wireless and Telematics 2017, 2018, vol. 2017-July, pp. 164–169.[7] C. Bennett and D. V. Sagmiller, Unity AI Programming Essentials. Packt Publishing Limited, 2014.[8] 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, pp. 1–6, 2015.[9] D. Loiacono et al., “The 2009 simulated car racing championship,” IEEE Trans. Comput. Intell. AI Games, vol. 2, no. 2, pp. 131–147, 2010.[10] Y. Sazaki, H. Satria, and M. Syahroyni, “Comparison of A∗ and dynamic pathfinding algorithm with dynamic pathfinding algorithm for NPC on car racing game,” Proceeding 2017 11th Int. Conf. Telecommun. Syst. Serv. Appl. TSSA 2017, vol. 2018-Janua, pp. 1–6, 2018.[11] I. Game, “Racing Game Starter Kit,” 2016. .[12] M. Botta, V. Gautieri, D. Loiacono, and P. L. Lanzi, “Evolving the optimal racing line in a high-end racing game,” 2012 IEEE Conf. Comput. Intell. Games, CIG 2012, pp. 108–115, 2012.[13] H. Tang, C. H. Tan, K. C. Tan, and A. Tay, “Neural network versus behavior based approach in simulated car racing game,” 2009 IEEE Work. Evol. Self-Developing Intell. Syst. ESDIS 2009 - Proc., vol. 117576, pp. 58–65, 2009.[14] J. E. Cechanowicz, C. Gutwin, S. Bateman, R. Mandryk, and I. Stavness, “Improving player balancing in racing games,” Proc. first ACM SIGCHI Annu. Symp. Comput. Interact. Play - CHI Play ’14, pp. 47–56, 2014.[15] K. Wang and W. Shang, “Outcome prediction of DOTA2 based on Naïve Bayes classifier,” Proc. - 16th IEEE/ACIS Int. Conf. Comput. Inf. Sci. ICIS 2017, no. 1994, pp. 591–593, 2017.[16] M. A. Jabbar and S. Samreen, “Heart disease prediction system based on hidden naïve bayes classifier,” 2016 Int. Conf. Circuits, Control. Commun. Comput. I4C 2016, pp. 1–5, 2017.[17] Y. An, S. Sun, and S. Wang, “Naive Bayes classifiers for music emotion classification based on lyrics,” Proc. - 16th IEEE/ACIS Int. Conf. Comput. Inf. Sci. ICIS 2017, no. 1, pp. 635–638, 2017.[18] W. Hamilton and M. O. Shafiq, “Opponent resource prediction in starcraft using imperfect information,” Proc. - 9th IEEE Int. Conf. Big Knowledge, ICBK 2018, pp. 368–375, 2018.[19] G. Synnaeve and P. Bessière, “A Bayesian model for opening prediction in RTS games with application to StarCraft,” 2011 IEEE Conf. Comput. Intell. Games, CIG 2011, pp. 281–288, 2011.[20] F. Thabtah, L. Zhang, and N. Abdelhamid, “NBA Game Result Prediction Using Feature Analysis and Machine Learning,” Ann. Data Sci., vol. 6, no. 1, pp. 103–116, 2019.[21] A. Ashari, I. Paryudi, and A. Min, “Performance Comparison between Naïve Bayes, Decision Tree and k-Nearest Neighbor in Searching Alternative Design in an Energy Simulation Tool,” Int. J. Adv. Comput. Sci. Appl., vol. 4, no. 11, pp. 33–39, 2013.[22] S. Raschka, “Naive Bayes and Text Classification I - Introduction and Theory,” pp. 1–20, 2014.[23] S. J. Russell and P. Norvig, Artificial Intelligence A Modern Approach; PearsonEducation. 2003.[24] K. T. Claypool and M. Claypool, “On frame rate and player performance in first person shooter games,” Multimed. Syst., vol. 13, no. 1, pp. 3–17, 2007.
Downloads
Submitted
Accepted
Published
Issue
Section
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.