Backtracking and k-Nearest Neighbour for Non-Player Character to Balance Opponent in a Turn-Based Role Playing Game of Anagram

Anagram is a turn-based role-playing game where two players construct words by arranging given letters. A significant aspect of playing a game is the challenge. A good challenge comes from an opponent with a close ability. In a two-player game like Anagram, the second player can be a nonhuman player...

Full description

Saved in:
Bibliographic Details
Main Authors: Prakosa, Yosa Aditya, Suni, Alfa Faridh
Format: UMS Journal (OJS)
Language:eng
Published: Department of Informatics, Universitas Muhammadiyah Surakarta, Indonesia 2022
Subjects:
Online Access:https://journals.ums.ac.id/index.php/khif/article/view/16902
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1805342467773431808
author Prakosa, Yosa Aditya
Suni, Alfa Faridh
author_facet Prakosa, Yosa Aditya
Suni, Alfa Faridh
author_sort Prakosa, Yosa Aditya
collection OJS
description Anagram is a turn-based role-playing game where two players construct words by arranging given letters. A significant aspect of playing a game is the challenge. A good challenge comes from an opponent with a close ability. In a two-player game like Anagram, the second player can be a nonhuman player called Non-Playable Character (NPC). A balanced game is more engaging. Therefore, it is imperative to insert artificial intelligence (AI) into an NPC to make it possess a balance ability. This study investigates the AI algorithm that is the most appropriate to make a balance NPC for Anagram games. We tested three scenarios: Descending AI, Random AI, and AI with k-Nearest Neighbour (k-NN). Descending AI gets an Anagram solution by selecting a word with the highest score from all possible answers. Random AI picks a word randomly from the possible answers, while AI with k-NN chooses a word closest to one of the human players. The results show that Descending AI is the best algorithm to make the strongest NPC, which always gets the highest score, followed by Random AI and AI with k-NN. However, AI with the k-NN algorithm makes the constructed NPC has the highest number of turns at an average of 18, while Descending AI gets 14 turns and Random AI has 15 turns. Looking at the remaining lives at the end of the game, AI with k-NN makes the NPC has 25 lives left, while Descending AI has 59 lives, and Random AI has 48 lives. Less remaining lives suggest that NPC containing AI with the k-NN algorithm matches closer to the human player and therefore is more suitable for Anagram NPC.
format UMS Journal (OJS)
id oai:ojs2.journals.ums.ac.id:article-16902
institution Universitas Muhammadiyah Surakarta
language eng
publishDate 2022
publisher Department of Informatics, Universitas Muhammadiyah Surakarta, Indonesia
record_format ojs
spelling oai:ojs2.journals.ums.ac.id:article-16902 Backtracking and k-Nearest Neighbour for Non-Player Character to Balance Opponent in a Turn-Based Role Playing Game of Anagram Prakosa, Yosa Aditya Suni, Alfa Faridh anagram; artificial intelligence; game; non-player character Anagram is a turn-based role-playing game where two players construct words by arranging given letters. A significant aspect of playing a game is the challenge. A good challenge comes from an opponent with a close ability. In a two-player game like Anagram, the second player can be a nonhuman player called Non-Playable Character (NPC). A balanced game is more engaging. Therefore, it is imperative to insert artificial intelligence (AI) into an NPC to make it possess a balance ability. This study investigates the AI algorithm that is the most appropriate to make a balance NPC for Anagram games. We tested three scenarios: Descending AI, Random AI, and AI with k-Nearest Neighbour (k-NN). Descending AI gets an Anagram solution by selecting a word with the highest score from all possible answers. Random AI picks a word randomly from the possible answers, while AI with k-NN chooses a word closest to one of the human players. The results show that Descending AI is the best algorithm to make the strongest NPC, which always gets the highest score, followed by Random AI and AI with k-NN. However, AI with the k-NN algorithm makes the constructed NPC has the highest number of turns at an average of 18, while Descending AI gets 14 turns and Random AI has 15 turns. Looking at the remaining lives at the end of the game, AI with k-NN makes the NPC has 25 lives left, while Descending AI has 59 lives, and Random AI has 48 lives. Less remaining lives suggest that NPC containing AI with the k-NN algorithm matches closer to the human player and therefore is more suitable for Anagram NPC. Department of Informatics, Universitas Muhammadiyah Surakarta, Indonesia 2022-10-02 info:eu-repo/semantics/article info:eu-repo/semantics/publishedVersion application/pdf https://journals.ums.ac.id/index.php/khif/article/view/16902 10.23917/khif.v8i2.16902 Khazanah Informatika : Jurnal Ilmu Komputer dan Informatika; Vol. 8 No. 2 October 2022 Khazanah Informatika; Vol. 8 No. 2 October 2022 2477-698X 2621-038X eng https://journals.ums.ac.id/index.php/khif/article/view/16902/7952 Copyright (c) 2022 Khazanah Informatika: Jurnal Ilmu Komputer dan Informatika http://creativecommons.org/licenses/by/4.0
spellingShingle anagram; artificial intelligence; game; non-player character
Prakosa, Yosa Aditya
Suni, Alfa Faridh
Backtracking and k-Nearest Neighbour for Non-Player Character to Balance Opponent in a Turn-Based Role Playing Game of Anagram
title Backtracking and k-Nearest Neighbour for Non-Player Character to Balance Opponent in a Turn-Based Role Playing Game of Anagram
title_full Backtracking and k-Nearest Neighbour for Non-Player Character to Balance Opponent in a Turn-Based Role Playing Game of Anagram
title_fullStr Backtracking and k-Nearest Neighbour for Non-Player Character to Balance Opponent in a Turn-Based Role Playing Game of Anagram
title_full_unstemmed Backtracking and k-Nearest Neighbour for Non-Player Character to Balance Opponent in a Turn-Based Role Playing Game of Anagram
title_short Backtracking and k-Nearest Neighbour for Non-Player Character to Balance Opponent in a Turn-Based Role Playing Game of Anagram
title_sort backtracking and k nearest neighbour for non player character to balance opponent in a turn based role playing game of anagram
topic anagram; artificial intelligence; game; non-player character
topic_facet anagram; artificial intelligence; game; non-player character
url https://journals.ums.ac.id/index.php/khif/article/view/16902
work_keys_str_mv AT prakosayosaaditya backtrackingandknearestneighbourfornonplayercharactertobalanceopponentinaturnbasedroleplayinggameofanagram
AT sunialfafaridh backtrackingandknearestneighbourfornonplayercharactertobalanceopponentinaturnbasedroleplayinggameofanagram