Implementation of Pathfinding on NPC Using A* Algorithm Into Game Platformer Application | Research Square window.SnipcartSettings = { analytics: { enabled: false } }; (function() { var accessVector = localStorage.getItem('access_vector') || ''; window.dataLayer = window.dataLayer || []; if (accessVector) { window.dataLayer.push({ user: { profile: { profileInfo: { snid: accessVector } } } }); } })(); (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','GTM-K279D39R'); Browse Preprints In Review Journals COVID-19 Preprints AJE Video Bytes Research Tools Research Promotion AJE Professional Editing AJE Rubriq About Preprint Platform In Review Editorial Policies Our Team Advisory Board Help Center Sign In Submit a Preprint Cite Share Download PDF Short Report Implementation of Pathfinding on NPC Using A* Algorithm Into Game Platformer Application Nigel Arnoldi, Yunita, Danny Matthew Saputra This is a preprint; it has not been peer reviewed by a journal. https://doi.org/ 10.21203/rs.3.rs-7473036/v1 This work is licensed under a CC BY 4.0 License Status: Posted Version 1 posted You are reading this latest preprint version Abstract The rapid advancement of game development driven by the latest technologies has become an engaging topic of study, particularly in the application of efficient pathfinding methods. This research implements the A* algorithm within a platformer game application to address the common challenge of pathfinding, which involves navigating obstacles and determining the most optimal route. The A* algorithm is widely recognized for its efficiency, simplicity, and strong real-time performance, making it a popular choice for such tasks. In this study, two key performance metrics were evaluated: the time required for a Non-Player Character (NPC) to locate the player and the resulting Frames Per Second (FPS). These metrics were measured under two conditions: when the main character was stationary and when it was in motion. The findings indicate that a stationary main character allows faster NPC search times and higher FPS, whereas a moving main character increases search time and reduces FPS. Theoretical Computer Science Pathfinding A* Algorithm NPC Platformer Game Figures Figure 1 Figure 2 Figure 3 Figure 4 Figure 5 Figure 6 Introduction The rapid advancement of game and video game development driven by the latest technologies has become an interesting subject of study. Platform games, a popular subgenre of video games, can generally be categorized into two types: puzzle-based and action-oriented. In a 2D platformer, players control a character or avatar and navigate through a series of platforms, which may be grounded or elevated depending on the level design. The main objective typically involves collecting specific items, such as coins or gold, while avoiding or defeating enemy characters [ 1 ]. Games of this type often incorporate several key techniques, including NPC state changes, pattern-based movement, chasing and evading mechanics, and pathfinding [ 2 ]. Among these techniques, one of the most common challenges in video games is pathfinding, which involves intelligently avoiding obstacles and determining the most efficient path across different terrains [ 3 ]. The A* algorithm is a well-established search algorithm widely used in the pathfinding research community. Its efficiency, simplicity, and modularity are often cited as key advantages, making it a popular choice among researchers for solving various pathfinding problems [ 4 ]. Moreover, A* not only provides fast pathfinding but also offers strong real-time performance, making it a widely adopted method in path planning applications [ 5 ]. It can also be used to determine the optimal path and handle geometric point inaccuracies [ 6 ]. In this study, the A* algorithm was implemented for Non-Player Characters (NPCs) in a platformer game application. The research demonstrated how A* could improve NPC behavior and pathfinding efficiency within the dynamic environment of a 2D platformer. Literature Study A. Platformer Game Platformer games are a subgenre of video games and can generally be divided into two types: puzzle-based and action-oriented. The main concept of a 2D platformer is that players control a character or avatar and guide them through a series of platforms, which may be grounded or elevated depending on the level design. A well-known example of a platformer game is Super Mario Bros . B. Non Player Character A Non-Player Character (NPC) is an entity within a game that can take the form of humans, animals, robots, or other objects. Unlike the player-controlled character, NPCs are controlled by the game’s system or software routines, commonly referred to as Artificial Intelligence (AI). Well-designed NPCs, whether functioning as allies or enemies, are an important factor in enhancing gameplay. Their primary purpose is to make the game more engaging and challenging. NPCs often follow specific behavioral patterns, such as awareness of their surroundings, decision-making initiatives, and the ability to change visual states [7]. C. A* Algorithm A* is an algorithm widely used for pathfinding and graph traversal, which involves efficiently determining paths between points known as nodes. Renowned for its accuracy and effectiveness, A* has been extended to many fields beyond gaming. It improves performance by incorporating heuristics and uses a Best-First Search (BFS) strategy to find the least-cost path from an initial node to a target node. The algorithm applies a heuristic function, often denoted as f(x) , which combines distance and cost to prioritize the order in which nodes are explored [8] The notation used by A* can be seen in the equation below: f(n) = g(n) + h(n) (1) Description: f(n) = Estimated lowest cost g(n) = Cost from the initial node to n-th node h(n) = Estimated cost from node n to the last node The value of h(n) is a fixed value based on the agreement on the A* Algorithm. Research Method A. Data Collection The data used in this study consists primarily of game assets and gameplay variables. The primary data includes images of the main character, NPC characters, and environmental objects used in the game. All images were collected from online sources and are referred to as game assets, stored in the .png format. Additional data used in this study include gameplay parameters such as the player’s health, score, NPC speed, player speed, and the distance between the player and NPC. B. Framework Based on the research steps described earlier, the overall process is presented in a framework for clarity, as illustrated in Figure 2. Based on Figure 2, the first step is processing the game assets, which are the data elements to be used in the game, such as character sprites. These assets are then incorporated into the game design. The next stage involves developing the game scripts, including all necessary supporting scripts and the A* pathfinding script implemented for the NPC characters. A testing scenario is then created to evaluate the performance of the implemented A* pathfinding. The results focus on comparing the processing time and frames per second (FPS) between Unity’s built-in A* implementation and the custom A* developed by the researcher Results and Discussion In this research, the results were divided into eight parts: four focused on time measurements and four on FPS. These tests were conducted both separately and simultaneously. Figure 3 shows the results when the main character is idle, and Figure 4 presents the results when the main character is moving, based on separate A* testing. The findings indicate that Unity’s built-in A* achieves shorter pathfinding times compared to the researcher’s implementation, while the custom A* developed by the researcher produces higher FPS than Unity’s A*. Figure 5 presents the results when the main character is idle, and Figure 6 shows the results when the main character is moving, based on simultaneous A* testing. The findings indicate that Unity’s built-in A* delivers shorter pathfinding times compared to the researcher’s implementation. However, the custom A* developed by the researcher provides slightly higher FPS than Unity’s A*, although the difference is minimal due to the simultaneous testing conditions. Conclusion The study demonstrated that Unity’s A* algorithm produced faster pathfinding times compared to the custom A* algorithm, while the custom implementation consistently delivered higher FPS than Unity’s version. The shortest average time was recorded in the simultaneous testing scenario with the main character remaining stationary, where Unity’s A* achieved a speed of 8.83 seconds (test scenario 2). The highest average FPS was obtained in the simultaneous testing scenario with silent characters, where both Unity’s A* and the custom implementation were tested together, with the custom A* reaching 1,244.2 FPS (test scenario 3). References Bhosale, T., Kulkarni, S., & Patankar, S. N. (2018). 2D PLATFORMER GAME IN UNITY ENGINE . www.irjet.net. Seeman, G., & Bourg, D. M. (2004). AI for Game Developers (1st ed.). O’Reilly Media. https://b-ok.asia/book/634655/ea743c. Cui, X., & Shi, H. (2011). A*-based Pathfinding in Modern Computer Games. In IJCSNS International Journal of Computer Science and Network Security (Vol. 11, Issue 1). https://www.researchgate.net/publication/267809499. Foead, D., Ghifari, A., Kusuma, M. B., Hanafiah, N., & Gunawan, E. (2021). A Systematic Literature Review of A*Pathfinding. Procedia Computer Science , 179 , 507–514. https://doi.org/10.1016/j.procs.2021.01.034. Tang, G., Tang, C., Claramunt, C., Hu, X., & Zhou, P. (2021). Geometric A-Star Algorithm: An Improved A-Star Algorithm for AGV Path Planning in a Port Environment. IEEE Access , 9 , 59196–59210. https://doi.org/10.1109/ACCESS.2021.3070054. Espinoza-Andaluz, M., Pagalo, J., Ávila, J., & Barzola-Monteses, J. (2022). An Alternative Methodology to Compute the Geometric Tortuosity in 2D Porous Media Using the A-Star Pathfinding Algorithm. Computation , 10 (4). https://doi.org/10.3390/computation10040059 Lankoski, P., & Björk, S. (2007). Situated Play, Proceedings of DiGRA 2007 Conference Gameplay Design Patterns for Believable Non-Player Characters . Bagus, I., Wahyu, G., & Dalem, A. (2018). PENERAPAN ALGORITMA A* (STAR) MENGGUNAKAN GRAPH UNTUK MENGHITUNG JARAK TERPENDEK. In 41 JURNAL RESISTOR (Vol. 1, Issue 1). Online. http://jurnal.stiki- indonesia.ac.id/index.php/jurnalresistor. Additional Declarations The authors declare no competing interests. Cite Share Download PDF Status: Posted Version 1 posted You are reading this latest preprint version Research Square lets you share your work early, gain feedback from the community, and start making changes to your manuscript prior to peer review in a journal. As a division of Research Square Company, we’re committed to making research communication faster, fairer, and more useful. We do this by developing innovative software and high quality services for the global research community. Our growing team is made up of researchers and industry professionals working together to solve the most critical problems facing scientific publishing. Also discoverable on Platform About Our Team In Review Editorial Policies Advisory Board Help Center Resources Author Services Accessibility API Access RSS feed Manage Cookie Preferences © Research Square 2026 | ISSN 2693-5015 (online) Privacy Policy Terms of Service Do Not Sell My Personal Information {"props":{"pageProps":{"initialData":{"identity":"rs-7473036","acceptedTermsAndConditions":true,"allowDirectSubmit":true,"archivedVersions":[],"articleType":"Short Report","associatedPublications":[],"authors":[{"id":506463323,"identity":"0b8bcdf7-c697-4fd9-bf69-fc359982ef63","order_by":0,"name":"Nigel Arnoldi","email":"","orcid":"","institution":"Sriwijaya University","correspondingAuthor":false,"prefix":"","firstName":"Nigel","middleName":"","lastName":"Arnoldi","suffix":""},{"id":506463324,"identity":"f99f0548-c550-49a7-9df7-cbbdfe26c388","order_by":1,"name":"Yunita","email":"","orcid":"","institution":"Sriwijaya University","correspondingAuthor":false,"prefix":"","firstName":"","middleName":"","lastName":"Yunita","suffix":""},{"id":506463325,"identity":"91b4a360-3917-4656-bd55-3190aaad7975","order_by":2,"name":"Danny Matthew Saputra","email":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAAAyAQMAAABI0h/eAAAABlBMVEX///8AAABVwtN+AAAACXBIWXMAAA7EAAAOxAGVKw4bAAAA9klEQVRIiWNgGAWjYDCCAyi8CiBmZm4gVgszEJ8B0YykaGFsAzEIaOE7fvbYYx6GOnlzifxjH37Oq43mbwdq+VGxDacWyTN56cY8DIcNd85IZp7Zu+147ozDjA2MPWdu49RicCDHTJqH4QDjhhvJzAy8247lNgC1MDO24dFy/g1IS509SAvj3znHcucT1HIDbAtzIkgLM29DTe4GQlokb7wxk5xjcDh5Z89jY2aZYwdyNwK1HMTnF77zOWYSbyrqbLezJz5mfFNTlzvv/OGDD35U4NYCAkw8BkAXQtiHweQBvOqBgPEHA1xLHSHFo2AUjIJRMAIBAELPWi2nBW0CAAAAAElFTkSuQmCC","orcid":"https://orcid.org/0009-0000-1144-7092","institution":"Sriwijaya University","correspondingAuthor":true,"prefix":"","firstName":"Danny","middleName":"Matthew","lastName":"Saputra","suffix":""}],"badges":[],"createdAt":"2025-08-27 15:21:13","currentVersionCode":1,"declarations":{"humanSubjects":false,"vertebrateSubjects":false,"conflictsOfInterestStatement":false,"humanSubjectEthicalGuidelines":false,"humanSubjectConsent":false,"humanSubjectClinicalTrial":false,"humanSubjectCaseReport":false,"vertebrateSubjectEthicalGuidelines":false},"doi":"10.21203/rs.3.rs-7473036/v1","doiUrl":"https://doi.org/10.21203/rs.3.rs-7473036/v1","draftVersion":[],"editorialEvents":[],"editorialNote":"","failedWorkflow":false,"files":[{"id":90081016,"identity":"cb684b13-6b63-4e0e-a954-c0649c7c7dac","added_by":"auto","created_at":"2025-08-28 09:02:15","extension":"png","order_by":1,"title":"Figure 1","display":"","copyAsset":false,"role":"figure","size":202169,"visible":true,"origin":"","legend":"\u003cp\u003eSuper Mario Bross\u003c/p\u003e","description":"","filename":"1.png","url":"https://assets-eu.researchsquare.com/files/rs-7473036/v1/e6db03da0e996ab557c4ca30.png"},{"id":90081975,"identity":"c1c2a4f7-af64-4933-98ff-6f829717e333","added_by":"auto","created_at":"2025-08-28 09:10:16","extension":"png","order_by":2,"title":"Figure 2","display":"","copyAsset":false,"role":"figure","size":19925,"visible":true,"origin":"","legend":"\u003cp\u003eFramework\u003c/p\u003e","description":"","filename":"2.png","url":"https://assets-eu.researchsquare.com/files/rs-7473036/v1/b7720caf020e7b33e85ab545.png"},{"id":90081024,"identity":"6a4f5be2-5e41-444e-ad04-68280da4dba8","added_by":"auto","created_at":"2025-08-28 09:02:16","extension":"png","order_by":3,"title":"Figure 3","display":"","copyAsset":false,"role":"figure","size":62784,"visible":true,"origin":"","legend":"\u003cp\u003eTime and FPS results on main character idle (Separated)\u003c/p\u003e","description":"","filename":"3.png","url":"https://assets-eu.researchsquare.com/files/rs-7473036/v1/a25e6eb3e757dc6e56ccb6d4.png"},{"id":90081018,"identity":"27dc1efe-ca44-4d94-9c75-9b5af1980bf6","added_by":"auto","created_at":"2025-08-28 09:02:15","extension":"png","order_by":4,"title":"Figure 4","display":"","copyAsset":false,"role":"figure","size":67447,"visible":true,"origin":"","legend":"\u003cp\u003eTime and FPS results on main character moves (Separated)\u003c/p\u003e","description":"","filename":"4.png","url":"https://assets-eu.researchsquare.com/files/rs-7473036/v1/91e01f9ce4ab2e15808845b4.png"},{"id":90081042,"identity":"0183932d-fe5b-486b-b51f-9ff481e5ff40","added_by":"auto","created_at":"2025-08-28 09:02:17","extension":"png","order_by":5,"title":"Figure 5","display":"","copyAsset":false,"role":"figure","size":69849,"visible":true,"origin":"","legend":"\u003cp\u003eTime and FPS results on main character idle (Simultaneously)\u003c/p\u003e","description":"","filename":"5.png","url":"https://assets-eu.researchsquare.com/files/rs-7473036/v1/c6192fb2f243078bb9c5061d.png"},{"id":90081985,"identity":"f14747ac-ca58-4079-8075-b648c448b5dd","added_by":"auto","created_at":"2025-08-28 09:10:17","extension":"png","order_by":6,"title":"Figure 6","display":"","copyAsset":false,"role":"figure","size":69381,"visible":true,"origin":"","legend":"\u003cp\u003eTime and FPS results on main character moves (Simultaneously)\u003c/p\u003e","description":"","filename":"6.png","url":"https://assets-eu.researchsquare.com/files/rs-7473036/v1/614ff194d159ed016887520c.png"},{"id":90082326,"identity":"5a779a17-e4d8-4870-85be-3ff47599879b","added_by":"auto","created_at":"2025-08-28 09:18:21","extension":"pdf","order_by":0,"title":"","display":"","copyAsset":false,"role":"manuscript-pdf","size":737178,"visible":true,"origin":"","legend":"","description":"","filename":"manuscript.pdf","url":"https://assets-eu.researchsquare.com/files/rs-7473036/v1/76309dee-5b74-48a5-a5dc-58a5710d6149.pdf"}],"financialInterests":"The authors declare no competing interests.","formattedTitle":"\u003cp\u003eImplementation of Pathfinding on NPC Using A* Algorithm Into Game Platformer Application\u003c/p\u003e","fulltext":[{"header":"Introduction","content":"\u003cp\u003eThe rapid advancement of game and video game development driven by the latest technologies has become an interesting subject of study. Platform games, a popular subgenre of video games, can generally be categorized into two types: puzzle-based and action-oriented. In a 2D platformer, players control a character or avatar and navigate through a series of platforms, which may be grounded or elevated depending on the level design. The main objective typically involves collecting specific items, such as coins or gold, while avoiding or defeating enemy characters [\u003cspan citationid=\"CR1\" class=\"CitationRef\"\u003e1\u003c/span\u003e]. Games of this type often incorporate several key techniques, including NPC state changes, pattern-based movement, chasing and evading mechanics, and pathfinding [\u003cspan citationid=\"CR2\" class=\"CitationRef\"\u003e2\u003c/span\u003e].\u003c/p\u003e\u003cp\u003eAmong these techniques, one of the most common challenges in video games is pathfinding, which involves intelligently avoiding obstacles and determining the most efficient path across different terrains [\u003cspan citationid=\"CR3\" class=\"CitationRef\"\u003e3\u003c/span\u003e]. The A* algorithm is a well-established search algorithm widely used in the pathfinding research community. Its efficiency, simplicity, and modularity are often cited as key advantages, making it a popular choice among researchers for solving various pathfinding problems [\u003cspan citationid=\"CR4\" class=\"CitationRef\"\u003e4\u003c/span\u003e]. Moreover, A* not only provides fast pathfinding but also offers strong real-time performance, making it a widely adopted method in path planning applications [\u003cspan citationid=\"CR5\" class=\"CitationRef\"\u003e5\u003c/span\u003e]. It can also be used to determine the optimal path and handle geometric point inaccuracies [\u003cspan citationid=\"CR6\" class=\"CitationRef\"\u003e6\u003c/span\u003e].\u003c/p\u003e\u003cp\u003eIn this study, the A* algorithm was implemented for Non-Player Characters (NPCs) in a platformer game application. The research demonstrated how A* could improve NPC behavior and pathfinding efficiency within the dynamic environment of a 2D platformer.\u003c/p\u003e"},{"header":"Literature Study","content":"\u003cp\u003eA. Platformer Game\u003c/p\u003e\n\u003cp\u003ePlatformer games are a subgenre of video games and can generally be divided into two types: puzzle-based and action-oriented. The main concept of a 2D platformer is that players control a character or avatar and guide them through a series of platforms, which may be grounded or elevated depending on the level design. A well-known example of a platformer game is \u003cem\u003eSuper Mario Bros\u003c/em\u003e.\u003c/p\u003e\n\u003cp\u003eB. Non Player Character\u003c/p\u003e\n\u003cp\u003eA Non-Player Character (NPC) is an entity within a game that can take the form of humans, animals, robots, or other objects. Unlike the player-controlled character, NPCs are controlled by the game\u0026rsquo;s system or software routines, commonly referred to as Artificial Intelligence (AI). Well-designed NPCs, whether functioning as allies or enemies, are an important factor in enhancing gameplay. Their primary purpose is to make the game more engaging and challenging. NPCs often follow specific behavioral patterns, such as awareness of their surroundings, decision-making initiatives, and the ability to change visual states [7].\u003c/p\u003e\n\u003cp\u003eC. A* Algorithm\u003c/p\u003e\n\u003cp\u003eA* is an algorithm widely used for pathfinding and graph traversal, which involves efficiently determining paths between points known as nodes. Renowned for its accuracy and effectiveness, A* has been extended to many fields beyond gaming. It improves performance by incorporating heuristics and uses a Best-First Search (BFS) strategy to find the least-cost path from an initial node to a target node. The algorithm applies a heuristic function, often denoted as \u003cem\u003ef(x)\u003c/em\u003e, which combines distance and cost to prioritize the order in which nodes are explored [8]\u003c/p\u003e\n\u003cp\u003eThe\u0026nbsp;notation\u0026nbsp;used\u0026nbsp;by\u0026nbsp;A*\u0026nbsp;can\u0026nbsp;be\u0026nbsp;seen\u0026nbsp;in\u0026nbsp;the\u0026nbsp;equation\u0026nbsp;below:\u003c/p\u003e\n\u003cp\u003ef(n)\u0026nbsp;=\u0026nbsp;g(n)\u0026nbsp;+ h(n) (1)\u003c/p\u003e\n\u003cp\u003eDescription:\u003c/p\u003e\n\u003cp\u003ef(n)\u0026nbsp;=\u0026nbsp;Estimated\u0026nbsp;lowest\u0026nbsp;cost\u003c/p\u003e\n\u003cp\u003eg(n)\u0026nbsp;=\u0026nbsp;Cost\u0026nbsp;from\u0026nbsp;the\u0026nbsp;initial\u0026nbsp;node\u0026nbsp;to\u0026nbsp;n-th node\u003c/p\u003e\n\u003cp\u003eh(n)\u0026nbsp;=\u0026nbsp;Estimated\u0026nbsp;cost from\u0026nbsp;node\u0026nbsp;n\u0026nbsp;to\u0026nbsp;the\u0026nbsp;last node\u003c/p\u003e\n\u003cp\u003eThe value of h(n) is a fixed value based on the agreement on the A* Algorithm.\u003c/p\u003e"},{"header":"Research Method","content":"\u003ch2\u003eA. Data Collection\u003c/h2\u003e\n\u003cp\u003eThe data used in this study consists primarily of game assets and gameplay variables. The primary data includes images of the main character, NPC characters, and environmental objects used in the game. All images were collected from online sources and are referred to as game assets, stored in the \u003cem\u003e.png\u003c/em\u003e format. Additional data used in this study include gameplay parameters such as the player\u0026rsquo;s health, score, NPC speed, player speed, and the distance between the player and NPC.\u003c/p\u003e\n\u003ch2\u003eB. Framework\u003c/h2\u003e\n\u003cp\u003eBased on the research steps described earlier, the overall process is presented in a framework for clarity, as illustrated in Figure 2.\u003c/p\u003e\n\u003cp\u003eBased on Figure 2, the first step is processing the game assets, which are the data elements to be used in the game, such as character sprites. These assets are then incorporated into the game design. The next stage involves developing the game scripts, including all necessary supporting scripts and the A* pathfinding script implemented for the NPC characters. A testing scenario is then created to evaluate the performance of the implemented A* pathfinding. The results focus on comparing the processing time and frames per second (FPS) between Unity\u0026rsquo;s built-in A* implementation and the custom A* developed by the researcher\u003c/p\u003e"},{"header":"Results and Discussion","content":"\u003cp\u003eIn this research, the results were divided into eight parts: four focused on time measurements and four on FPS. These tests were conducted both separately and simultaneously.\u003c/p\u003e\n\u003cp\u003eFigure 3 shows the results when the main character is idle, and Figure 4 presents the results when the main character is moving, based on separate A* testing. The findings indicate that Unity\u0026rsquo;s built-in A* achieves shorter pathfinding times compared to the researcher\u0026rsquo;s implementation, while the custom A* developed by the researcher produces higher FPS than Unity\u0026rsquo;s A*.\u003c/p\u003e\n\u003cp\u003eFigure 5 presents the results when the main character is idle, and Figure 6 shows the results when the main character is moving, based on simultaneous A* testing. The findings indicate that Unity\u0026rsquo;s built-in A* delivers shorter pathfinding times compared to the researcher\u0026rsquo;s implementation. However, the custom A* developed by the researcher provides slightly higher FPS than Unity\u0026rsquo;s A*, although the difference is minimal due to the simultaneous testing conditions.\u003c/p\u003e"},{"header":"Conclusion","content":"\u003cp\u003eThe study demonstrated that Unity\u0026rsquo;s A* algorithm produced faster pathfinding times compared to the custom A* algorithm, while the custom implementation consistently delivered higher FPS than Unity\u0026rsquo;s version. The shortest average time was recorded in the simultaneous testing scenario with the main character remaining stationary, where Unity\u0026rsquo;s A* achieved a speed of 8.83 seconds (test scenario 2). The highest average FPS was obtained in the simultaneous testing scenario with silent characters, where both Unity\u0026rsquo;s A* and the custom implementation were tested together, with the custom A* reaching 1,244.2 FPS (test scenario 3).\u003c/p\u003e"},{"header":"References","content":"\u003col\u003e\n\u003cli\u003eBhosale, T., Kulkarni, S., \u0026amp; Patankar, S. N. (2018). \u003cem\u003e2D PLATFORMER GAME IN UNITY ENGINE\u003c/em\u003e. www.irjet.net.\u003c/li\u003e\n\u003cli\u003eSeeman, G., \u0026amp; Bourg, D. M. (2004). \u003cem\u003eAI for Game Developers \u003c/em\u003e(1st ed.). O\u0026rsquo;Reilly Media. https://b-ok.asia/book/634655/ea743c.\u003c/li\u003e\n\u003cli\u003eCui, X., \u0026amp; Shi, H. (2011). A*-based Pathfinding in Modern Computer Games. In \u003cem\u003eIJCSNS International Journal of Computer Science and Network Security \u003c/em\u003e(Vol. 11, Issue 1). https://www.researchgate.net/publication/267809499.\u003c/li\u003e\n\u003cli\u003eFoead, D., Ghifari, A., Kusuma, M. B., Hanafiah, N., \u0026amp; Gunawan, E. (2021). A Systematic Literature Review of A*Pathfinding. \u003cem\u003eProcedia Computer Science\u003c/em\u003e, \u003cem\u003e179\u003c/em\u003e, 507\u0026ndash;514. https://doi.org/10.1016/j.procs.2021.01.034.\u003c/li\u003e\n\u003cli\u003eTang, G., Tang, C., Claramunt, C., Hu, X., \u0026amp; Zhou, P. (2021). Geometric A-Star Algorithm: An Improved A-Star Algorithm for AGV Path Planning in a Port Environment. \u003cem\u003eIEEE Access\u003c/em\u003e, \u003cem\u003e9\u003c/em\u003e, 59196\u0026ndash;59210. https://doi.org/10.1109/ACCESS.2021.3070054.\u003c/li\u003e\n\u003cli\u003eEspinoza-Andaluz, M., Pagalo, J., \u0026Aacute;vila, J., \u0026amp; Barzola-Monteses, J. (2022). An Alternative Methodology to Compute the Geometric Tortuosity in 2D Porous Media Using the A-Star Pathfinding Algorithm. \u003cem\u003eComputation\u003c/em\u003e, \u003cem\u003e10\u003c/em\u003e(4). https://doi.org/10.3390/computation10040059\u003c/li\u003e\n\u003cli\u003eLankoski, P., \u0026amp; Bj\u0026ouml;rk, S. (2007). \u003cem\u003eSituated Play, Proceedings of DiGRA 2007 Conference Gameplay Design Patterns for Believable Non-Player Characters\u003c/em\u003e.\u003c/li\u003e\n\u003cli\u003eBagus, I., Wahyu, G., \u0026amp; Dalem, A. (2018). PENERAPAN ALGORITMA A* (STAR) MENGGUNAKAN GRAPH UNTUK MENGHITUNG JARAK TERPENDEK. In \u003cem\u003e41 \u003c/em\u003e\u003cem\u003eJURNAL\u003c/em\u003e\u003cem\u003e RESISTOR \u003c/em\u003e(Vol. 1, Issue 1). Online. http://jurnal.stiki- indonesia.ac.id/index.php/jurnalresistor.\u003c/li\u003e\n\u003c/ol\u003e"}],"fulltextSource":"","fullText":"","funders":[],"hasAdminPriorityOnWorkflow":false,"hasManuscriptDocX":true,"hasOptedInToPreprint":true,"hasPassedJournalQc":"","hasAnyPriority":true,"hideJournal":true,"highlight":"","institution":"Sriwijaya University","isAcceptedByJournal":false,"isAuthorSuppliedPdf":false,"isDeskRejected":"","isHiddenFromSearch":false,"isInQc":false,"isInWorkflow":false,"isPdf":false,"isPdfUpToDate":true,"isWithdrawnOrRetracted":false,"journal":{"display":true,"email":"
[email protected]","identity":"researchsquare","isNatureJournal":false,"hasQc":true,"allowDirectSubmit":true,"externalIdentity":"","sideBox":"","snPcode":"","submissionUrl":"/submission","title":"Research Square","twitterHandle":"researchsquare","acdcEnabled":true,"dfaEnabled":false,"editorialSystem":"","reportingPortfolio":"","inReviewEnabled":false,"inReviewRevisionsEnabled":true},"keywords":"Pathfinding, A* Algorithm, NPC, Platformer Game","lastPublishedDoi":"10.21203/rs.3.rs-7473036/v1","lastPublishedDoiUrl":"https://doi.org/10.21203/rs.3.rs-7473036/v1","license":{"name":"CC BY 4.0","url":"https://creativecommons.org/licenses/by/4.0/"},"manuscriptAbstract":"\u003cp\u003eThe rapid advancement of game development driven by the latest technologies has become an engaging topic of study, particularly in the application of efficient pathfinding methods. This research implements the A* algorithm within a platformer game application to address the common challenge of pathfinding, which involves navigating obstacles and determining the most optimal route. The A* algorithm is widely recognized for its efficiency, simplicity, and strong real-time performance, making it a popular choice for such tasks. In this study, two key performance metrics were evaluated: the time required for a Non-Player Character (NPC) to locate the player and the resulting Frames Per Second (FPS). These metrics were measured under two conditions: when the main character was stationary and when it was in motion. The findings indicate that a stationary main character allows faster NPC search times and higher FPS, whereas a moving main character increases search time and reduces FPS.\u003c/p\u003e","manuscriptTitle":"Implementation of Pathfinding on NPC Using A* Algorithm Into Game Platformer Application","msid":"","msnumber":"","nonDraftVersions":[{"code":1,"date":"2025-08-28 09:02:10","doi":"10.21203/rs.3.rs-7473036/v1","editorialEvents":[{"type":"communityComments","content":0}],"status":"published","journal":{"display":true,"email":"
[email protected]","identity":"researchsquare","isNatureJournal":false,"hasQc":true,"allowDirectSubmit":true,"externalIdentity":"","sideBox":"","snPcode":"","submissionUrl":"/submission","title":"Research Square","twitterHandle":"researchsquare","acdcEnabled":true,"dfaEnabled":false,"editorialSystem":"","reportingPortfolio":"","inReviewEnabled":false,"inReviewRevisionsEnabled":true}}],"origin":"","ownerIdentity":"9c4a74c9-725e-46f6-a744-c3c3e791355f","owner":[],"postedDate":"August 28th, 2025","published":true,"recentEditorialEvents":[],"rejectedJournal":[],"revision":"","amendment":"","status":"posted","subjectAreas":[{"id":53828042,"name":"Theoretical Computer Science"}],"tags":[],"updatedAt":"2025-08-28T09:02:10+00:00","versionOfRecord":[],"versionCreatedAt":"2025-08-28 09:02:10","video":"","vorDoi":"","vorDoiUrl":"","workflowStages":[]},"version":"v1","identity":"rs-7473036","journalConfig":"researchsquare"},"__N_SSP":true},"page":"/article/[identity]/[[...version]]","query":{"redirect":"/article/rs-7473036","identity":"rs-7473036","version":["v1"]},"buildId":"8U1c8b4HqxoKbykW_rLl7","isFallback":false,"isExperimentalCompile":false,"dynamicIds":[84888],"gssp":true,"scriptLoader":[]}
Text is read by the "Ask this paper" AI Q&A widget below.
Extraction quality varies by source — PMC NXML preserves structure
cleanly, OA-HTML may include some navigation residue, and OA-PDF can
have broken hyphenation. The publisher copy
(via DOI)
is the canonical version.