Penerapan State Pattern dan Retrieval-based Chatbot pada NPC Game Visual Novel di Unity Engine
Keywords:
NPC, State Design pattern, chatbot, cosine similarity, digital games, gim digitalAbstract
Penelitian ini membahas integrasi antara State Design pattern dan chatbot berbasis retrieval dalam Non-Playable Character (NPC) untuk meningkatkan interaksi pemain dalam Unity Game Engine. NPC dirancang memiliki tiga kondisi emosional utama: Happy, Normal, dan Angry, yang masing-masing memengaruhi dataset percakapan yang digunakan. Chatbot menggunakan algoritma cosine similarity untuk mencocokkan masukan pemain dengan respons yang paling relevan dari dataset berdasarkan emosi aktif. Metodologi penelitian yang digunakan adalah model waterfall, dengan tahapan implementasi, pengujian transisi state, dan evaluasi respons chatbot. Hasil menunjukkan akurasi pemilihan respons sebesar 95,65% dari 230 data uji, serta tingkat adaptabilitas chatbot sebesar 45% terhadap konteks emosi. Penelitian ini membuktikan bahwa integrasi state emosi dengan chatbot berbasis retrieval mampu menciptakan interaksi NPC yang lebih realistis dan kontekstual, meskipun masih terdapat keterbatasan dalam pemahaman semantik dan keberagaman respons.
References
Z. Jiang, “Emotional Simulation in Game AI and Its Impact on Player Experience,” International Journal of Education and Humanities, vol. 13, no. 2, pp. 11–13, Apr. 2024, doi: 10.54097/pbhsqy34.
J. P. W. Hardiman, D. C. Thio, A. Y. Zakiyyah, and Meiliana, “AI-powered dialogues and quests generation in role-playing games using Google's Gemini and Sentence BERT framework,” Procedia Computer Science, vol. 245, pp. 1111–1119, 2024, doi: 10.1016/j.procs.2024.10.340.
M. Ç. Uludağlı and K. Oğuz, “Non-player character decision-making in computer games,” Artificial Intelligence Review, vol. 56, pp. 14159–14191, Dec. 2023, doi: 10.1007/s10462-023-10491-7.
S. Pandey and S. Sharma, “A comparative study of retrieval-based and generative-based chatbots using deep learning and machine learning,” Healthcare Analytics, vol. 3, p. 100198, 2023, doi: 10.1016/j.health.2023.100198.
D. W. Prakoso, A. Abdi, and C. Amrit, “Short text similarity measurement methods: A review,” Soft Computing, vol. 25, no. 6, pp. 4699–4723, Jan. 2021, doi: 10.1007/s00500-020-05479-2.
K. Kevin, O. Pribadi, and Hendri, “Implementation of fuzzy logic algorithm to improve NPC decision-making in 2D adventure games using Unity,” Journal of Artificial Intelligence and Engineering Applications, vol. 4, no. 3, Jun. 2025. doi: 10.59934/jaiea.v4i3.1175.
M. D. Fadhol, F. Marcellino, D. D. Rabani, F. F. Azzahra, S. Amalia, and A. Abdiansah, “AI-driven traffic simulation using Unity: Implementing finite state machines for adaptive NPC behaviour,” J. Intell. Comput. Health Inform., vol. 5, no. 2, pp. 73–78, Sep. 2024, doi: 10.26714/jichi.v5i2.14595.
Z. Hu, D. Uhryn, and A. Kalancha, “Comparison and clustering of textual information sources based on the cosine similarity algorithm,” Information Systems and Networks, vol. 17, pp. 34–43, 2025, doi: 10.23939/sisn2025.17.034.
U. Srinivasarao, R. Karthikeyan, M. J. Bilal, and S. Hariharan. (Jun. 2023). Comparison of different similarity methods for text categorization. Dipresentasikan di Innovations in Data Analytics, Singapore. [Online]. Tersedia: https://doi.org/10.1007/978-981-99-0550-8_39.
M. S. Utomo, J. S. Wibowo, and E. N. Wahyudi, “Text summarization pada artikel berita menggunakan vector space model dan cosine similarity,” J. Rekayasa Sist. dan Teknol. Inf. (RESTI), vol. 6, no. 6, pp. 980–987, Dec. 2022, doi: 10.29207/resti.v6i6.9163.
Y. Xu, J. Zhu, M. Wang, F. Qian, Y. Yang, and J. Zhang, “The impact of a digital game-based AI chatbot on students’ academic performance, higher-order thinking, and behavioral patterns in an information technology curriculum,” Applied Sciences, vol. 14, no. 15, p. 6418, 2024, doi: 10.3390/app14156418.
C. S. González-González, V. Muñoz-Cruz, P. A. Toledo-Delgado, and E. Nacimiento-García, “Personalized gamification for learning: A reactive chatbot architecture proposal,” Sensors, vol. 23, no. 1, p. 545, 2023, doi: 10.3390/s23010545.
F. C.-T. Wu, O. N.-J. Hong, A. J. C. Trappey, and C. V. Trappey, “VR-enabled chatbot system supporting transformer mass-customization services,” in Transdisciplinary Engineering for Complex Socio-technical Systems – Real-life Applications, J. Pokojski et al., Eds. Amsterdam, Netherlands: IOS Press, 2020, pp. 291–300, doi: 10.3233/ATDE200088.
D. Rato, F. Correia, A. Pereira, and A. Paiva, “Robots in games,” International Journal of Social Robotics, vol. 15, pp. 37–57, Jan. 2023, doi: 10.1007/s12369-022-00944-4.
S. Sintaro, D. T. Salaki, L. A. Latumakulita, M. I. Takaendengan, Bernard, A. Surahman, and N. Islam, "Implementation and comparison in using state pattern on main character movement (case study: Pocong Jump video game version 1.0)," BAREKENG: Journal of Mathematics and Its Applications, vol. 17, no. 2, pp. 955–968, Jun. 2023. doi: 10.30598/barekengvol17iss2pp0955-0968.
C. Nugraha, A. I. Purnamasari, A. Bahtiar, and E. Tohidi, “Implementation of finite state machine on NPCs to improve game productivity,” Journal of Artificial Intelligence and Engineering Applications (JAIEA), vol. 4, no. 3, pp. 1673–1677, Jun. 2025, doi: 10.59934/jaiea.v4i3.982.
S. Choo and W. Kim, "A study on the evaluation of tokenizer performance in natural language processing,” Applied Artificial Intelligence, vol. 37, no. 1, pp. e2175112, 2023. doi: 10.1080/08839514.2023.2175112.
Downloads
Published
Issue
Section
License

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
Copyright of this journal is assigned to Jurnal Buana Informatika as the journal publisher by the knowledge of author, whilst the moral right of the publication belongs to author. Every printed and electronic publications are open access for educational purposes, research, and library. The editorial board is not responsible for copyright violation to the other than them aims mentioned before. The reproduction of any part of this journal (printed or online) will be allowed only with a written permission from Jurnal Buana Informatika.
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.






