Application of the Finite State Machine Method in the Desktop-Based “Heroes of Dawn” RPG Turn-Based Game

- FSM (Finite State Machine) is a method of implementing artificial intelligence that is applied to make a decision on NPC (Non Player Character). The application of FSM that is often encountered is to form an NPC with intelligence, so that the NPC can respond to the player's character so that the NPC seems to be able to think. Games have various types (genres) and are increasingly varied in line with the development of hardware and software technology. Writing will focus on games with the Role Playing Game genre or often called RPG


I. INTRODUCTION
FSM (Finite State Machine) is a method of implementing artificial intelligence that is applied to make a decision on NPC (Non Player Character). The application of FSM that is often encountered is to form an NPC with intelligence, so that the NPC can respond to the player's character so that the NPC seems to be able to think. When compared to the methods in the Empirical Study, the method used for this writing spurs more to the movements and intelligence of the NPCs. (Astari, 2011) Games have various types (genres) and are increasingly varied in line with the development of hardware and software technology. Currently, games have penetrated almost every society in Indonesia from children to adults, the development of games in the 90s era had an interesting plot and a very cool mode to play in its time even though the visual (2D) images were not attractive. as it is now. And nowadays, there are various kinds of 3D games, which have very interesting storylines and image quality, such as Dragon Nest, Black Dessert, Devil May Cry, Final Fantasy and many more. FPS or First Person Shooter genre games have begun to appear, such as: Point Blank, Counter Strike, Resident Evil, Far Cry, Apex Legend, Fortnite and many more, by looking at the games above, this writing will focus on the game genre Role Playing Game or often called RPG. (Herlambang, 2019).
Games in general use Artifical Intelligence in their systems to make the game more interesting to play. Artifical Intelligence is usually applied to NPC (Non Player Character) / Enemy in the game or opponents who must be defeated, one of the applications of Artifical Intelligence in the game to be used in this research is the Finite State Machine (FSM) method. The Finite State Machine itself was chosen because it is a very suitable method for the games that will be applied in this paper. Finite State Machine is a method that uses a control system design that describes the behavior or working principles of the system using the following three things: State (state), Event (event), (Baani, 2019) Action (action) so that the enemies in the game could be an equal opponent to the main character. The application of the Finite State Machine method in this writing is used so that the Character can be fulfilled when an Event occurs which will trigger a State associated with the Event and after that it will run an Action related to the State, State and Action depending on the event that occurs in the game. Based on the above background, a study entitled "Application of the Finite State Machine Method in the game Heroes Of Dawn Using Desktop-based Unity 3D" (QAMAL AND MARZIAN, 2017)

A. Game
According to Henry (2010), a game or game is something that can be played with certain rules so that some win and some lose, usually in the context of not being serious with the aim of refreshing. Playing games can already be said to be the lifestyle of today's society. Starting from the age of children to adults also like video games. It's all because playing video games is fun. TEPIAN Vol. 2 No. 2 (June 2021) p-ISSN 2721-5350 e-ISSN 2721-5369 Sanjaya, M. F., Pratiwi, H., & Adytia, P. (2021). Application of the Finite State Machine Method in the Desktop-Based "Heroes Of Dawn" RPG Turn-Based Game. TEPIAN, 2(2). https://doi.org/10.51967/tepian.v2i2.348 -70 -

B. Turn-Based RPG
Turn Based RPG battles are more of a strategy. Where we have to give orders to characters such as Attack, Magic, Skill and choose the enemy that is attacked in every battle. The advantage of Turn Based RPG is that we are required to make tactics so that in a battle our characters can win the battle and get experience points. (Muhammad, 2011)

C. Unity 3D Game Engine
According to Pranata, (2015), Unity 3D is a game engine developed by Unity Technologies. This software was first launched in 2005 and is one of the many game engines used by many professional game developers in the world. Unity 3D is a game development tool with integrated rendering capabilities. By using its sophisticated features and high working speed. Unity 3D can create an interactive program not only in 2 dimensions, but also in 3 dimensions.

D. Artificial Intelligence
According to Russel and Norvig (2010), in the English meaning, artificial means artificial, while intelligence means an adjective that means intelligent. So, artificial intelligence is an intelligence that is created or an intelligent imitation. Intelligent intent here is the intelligence to think and act like humans.

E. Finite State Machine Algorithm
Millington and Funge (2010), Finite State Machine (FSM) is a control system design methodology that describes the behavior or working principles of the system using the Finite State Machine (state), event (incident) and action (action).
In a State Machine, the system occupies one state (State). The system will switch or transition to another state if it gets input for certain events. The system will continue to perform the same action in a state until the system receives certain events, either from external devices or from the system components themselves (Fanani, 2012).

A. Multimedia Development Methods
According to Nugroho, Sofyan (2011), multimedia in Picture 1 is a combination of several elements (audio, animation, text, video images, graphics, sound) that can create a dynamic and interactive presentation and have tools for navigation for users and can be online (internet) and offline. Multimedia in this case can also provide more text but also bring text to life by including sounds, images, music, animation and video.

Picture 1. Multimedia Development Stage
According to Binanto (2010), the multimedia development methodology consists of six stages, namely concept, design, material collecting, assembly, testing and distribution.

B. Use Case Diagram.
Use Case Diagram of the Main Menu in Picture 2 can be seen when the game is first opened, the main menu display will appear, the main menu display contains several buttons and displays including the New Game button to start a new game, the Continue button to continue the game that was saved, the button Credits to display credits, Option button to display options, and Exit button to exit the game. (Pressman, 2010) Picture 2. Use Case Diagram New Game

C. Activity Diagram.
New Game Activity Diagram in Picture 3, the user clicks on play game then the system directs to the main menu view. After that the user clicks the New Game button then the system directs to the display in the new game game. The main character approaches the save point to save data, if the character dies, the system will direct the user to the game over scene where there is an option to back to main menu and restart the game. If you win, the user will continue the game until it's finished (Wijaya, 2013) TEPIAN Vol. 2 No. 2 (June 2021) p-ISSN 2721-5350 e-ISSN 2721-5369 Sanjaya, M. F., Pratiwi, H., & Adytia, P. (2021) Sequence Diagram of Game Play in Picture 4, the user clicks play game then the system directs to the game view. if the character wins, the system will direct the user to the winning scene where the user will continue the game until it's finished. If you lose, the system will direct you to the game over scene which gives the option Exit to main menu to end the game then return to the main menu scene display and Restart from last save to return to the last point of storage Picture 4. Sequence Diagram Play

E. UML (Unifed Modeling System)
According to Nugroho (2010), UML (Unified Modeling Language) is a modeling language for systems or software that have an object-oriented paradigm. Modeling is actually used to simplify complex problems in such a way that they are easier to learn and understand.

A. Implementation of the Finite State Machine
Algorithm in Enemy For enemies that have been implemented with FSM (Finite State Machine) in Picture 5, they have several unique movements each so that each enemy character has its own movement, FSM (Finite State Machine) will respond in a way if the player character approaches the enemy character.
Picture 5. Example of Idle Movement

1) Silent State Diagram
At a distance of less than 1.5m in Picture 6 the enemy will chase, if the distance is more than 1.5m the enemy will return to the patrol position, and if the distance is equal to 0 it will enter battle mode.
It can be concluded that the application of the Breadth First Search Algorithm at sketch level 1 gets the 10 most optimal lines. After making a test case to validate by testing with the program. So that the expected results can be seen in accordance with the results of the application. The following are some of the codes used in the test scenario in Table 1 Heroes Of Dawn Game development through 6 stages of multimedia development including Concept, Design, Material Collection, Assembly, Testing and Distribution. Application of the finite state machine (FSM) method to the enemy which can make the enemy walk, attack and have an idle position. The application of the finite state machine (FSM) in games has an important role in determining the response and behavior of enemies.
In this game, players can freely explore every detail in the game and fight enemies The White-Box test conducted shows the coding of the FSM method on enemies and Beta Testing shows the level of satisfaction of friends who are willing to become respondents in this game.