The Design and Development of Backend System for a Game Application

This paper is discussed a technical report regarding the backend system and the web application to manage the game and the API that the game client of Dishcover Indonesia will frequently request to a web application is one of the many ways that can be used to manage content that is saved on the backend for a system. An API is also a method. The author, part of a team development for a game, will attempt to provide a solution so that to easily maintain the content of the game and a method for the client to access with them Keywords—component; database; backend; CMS; lootbox; API; JSON; Session;


I. INTRODUCTION
Video game has been a popular hobby for people over the past few decades, played in many different platforms and enjoyed by many [1]. It has been enjoyed by many and can be used for many more advantages, such as introducing a new experience to the player as an interactive media and bring an introduction to many things, such as the Indonesian culture.
This game as a whole includes the opportunity of both better experience and education. Experience includes as in a new way of use of the existing technology to provide a new experience for the players. The education meant about the different value of cultural information about the food that will be shown in the game about Indonesia. A cooking game is a sub category of the simulation category of video games where it would attempt to simulate reality, where in this case it includes the simulation of the processes of or relates to the cooking.
Games may sometimes will need to have many "objects" in the game, this can be either something that the players will use in the game, used depending on. To manage all of the items, however, would need some assistance to keep on adding and managing the items information and its relationship with each other, therefore a way for the game manager to easily manage them. Also, a way for the game client to keep track of such new information about the game, keep save of their progresses, and the content of the game.
In short, the main objective is the development of a new game that introduces new mechanic related to cooking and also brings an educational value to the players. There would also need a way for the game client to have an online service such as login, progress save and purchases, and a way to maintain and manage all the item for the game would need a backend to handle all of those.

A. Game
Games are various activities where the people who are engaging in the activity of skills where there exist rules and constraints on what is allowed to do to reach a goal, where the activity is done for entertainment or sport [2]. A popular modern category of it would be video games, where it involved a huge majority of the activity happening virtually, represented with digital images that are displayed from computers [3] the interaction, limitation, and goals of the games will vary with each games, as each games will consist of many different controls, mechanic, and challenges for the players.

B. Mobile Gaming
Mobile games refer to the video games that are played on mobile platforms, such a smartphones, tablets, and many other mobile computing devices. It is more of categorization based on the platform compared to the genre of the game, as there are many genres that are mobile games. The games are available with purchasing or obtaining them from the app store of devices, as they are limited by the set OS and software. Such games take advantage of the things that is provided by the phone to maximize what players can experience such as tilting, movement, GPS, and many more compared to other platform, but in exchange usually the games content such as depth of mechanics and graphics is reduced as mobile devices have small computing power [4].

C. Lootboxes
Game monetization is one of the most important aspect related to game development the game, as it affects on the income that can be obtained from the game and could potentially affect the gameplay as well. Lootboxes are one of such category. It involves random numbers and probability, where purchasing them, the players will have a chance to obtain a set number of items, with the items determined by a set percentage of a set selected of items by the developer [5]. This is a successful way of monetization with many companies doing it [6] [7], but designing it fairly is critical as there are events where the players of the game landed backlashes for games with unfair monetization [8].

D. Unity
Unity is a game engine platform on which developers can use to develop video games, accessible for download for the developers who wishes so. Developing the game would require some C# and Javascript knowledge for the developer to work with, and also the development is created with a OOP (Object Oriented Programming) [9]. Unity provides many controls and services for the development of projects easier, such as options to modify the properties of the game, in built asset store, online services like sharing, and also provide support in their website from the developers and the communities. Developing with unity enable to make many different forms of video games, ranging form many platforms and many genre of games [9][10] [11].

E. Android
Android is an operating system that is the largest used for mobile phones. Developed by google, it is an OS that is Linux based, and can be used also in many other devices such as camera, tablet, TV, and many more [12]. It is one of the most popular because of its open-source software, which makes it more attractive for many hardware developers as it's all there, making Android the largest market use.

F. REST API
An API (Application Programming Interface) is a set of routines for a way to act as a middleware between the communication of 2 different ends. It is important as this is the way to set protocols and to properly convert information from the sender system to become usable in the receiving system [13].
REST API is a category of such thing. Specifically, it follows the routine on how browsers request and receive their content. They usually follow the request via URL links. Their content is does not have any restrictions technical wise as long as a format is picked, and the content and restriction of access will be determined by the developers later on [14].

G. JSON
JSON is a string-based data format that can be used by most systems. It is a format that can freely make its own custom structure. It is commonly used for data transmission. The structure needs only 2 components: a key to determine location of value, and the value itself, which can be either a string, integer, object, or an array. There are many reasons to use this data format, such a s its simplicity, usability in many places, and the use of Javascript makes it easy for it to process within web browsers [15].

H. Server
Servers are computers that are specially designed in terms of hardware and software as a central processing unit and manager for a set system. It is made to serve requests from the clients appropriately set. In video games, they are either used to manage and host all the multiplayer interactions of players against/with each other, or to manage all the online services that a game provides, ranging from progress save, item purchase, and many more [16].

I. PHP 7
PHP is a type of server-side script. It is used in server-side programming to set how to process the request of the clients in the server, or a set to contain a set of instructions for the server. It is crucial as it will set the protocol and the performance of the system. PHP stands for PHP: Hypertext Preprocessor. It requires no installation on the server, and the content can be set dynamically, so the output can be directly made processible and it gives a form of platform independence. It is good to be used for beginners and experts as it has an easy syntax to be used and has many functions so that professional developers can make complicated procedures with ease [17]. A performance test was done, and it shows that PHP 7 is one of the best performing programming languages to use for the backend [18] J. RDBMS An RDBMS (Relational Database Management System) is a database management system that stores data in many different structures of table. With an emphasis of features that can easily manage relations between many tables. Accessing the information would need the use of SQL and proper use of Keyword. To determine the tables needed, all the needed information for the system is listed down and then a process called normalizations is used to break down the structures to make it simpler, an exchange between processing speed and storage space. This is an advantageous system to store items with an emphasis of the relations of the data with each other [19].

K. CMS
CMS stands for Content Management System, it is a system used to manage digital content that exists in a web server. It can range to many items such as content of a page or the details of an item. Its purpose is to provide an easy and efficient way to manage a large sum of digital items online and the flexibility to expand it as well. With such system, a non-developer would have access to all the items he wants to be able to manage and could do so easily [20].

A. Mobile Games
Games has been something that people wanted to play and enjoy, with also a cooking game has a high demand from the respondents of the survey, showing there is an opportunity in the market to create such product to satisfy that need. Also, as mentioned above in the research relating to the increasing size of the market share for the gaming industry adds to the weight that demand in the following years would only increase [2]. It would need to be something unique or different mechanic that introduces an amazing experience for the players to enjoy and remember the game, giving it a very high number of player count.

B. Content Management system
Games have many contents in it, its variable that will always need to be added or modified can become constant. There could exist a system for which to manage the content of the game and be able to maintain all of its relations of the items with each other, something that is scalable and for something that the game manager in the future could easily work on.

C. Lootbox system
To enhance the business model within the video game industry, a model that focuses more on the microtransaction can be implemented as another source of revenue, with the large amount of real money is used to purchase virtual items, up to the amount to 2.1 billion USD alone in the year 2007 [21].
However, there are also constraints that is needed to be implemented. There are games that has been receiving huge backlash over lootbox monetization as it was too closed and ruins the experience for the players. A good example would be from Star Wars battlefront 2, where the game received a massive backlash from the community. The ideal way is to create a model that will not ruin the game experience and give transparency towards the player [8].

A. Cooking mama
Cooking mama is one of the most popular examples of an existing solution of a cooking game. Played on Nintendo DS first, it is a simulation cooking game where the challenge includes the players to engage the cooking part of the food, following the actual recipe in real life, and challenges the players to do it quickly and properly as possible. This game solid experience is to provide a realistic cooking procedure, but people have complaint on the game for being too plain as the game becomes repetitive, as different food have similar instructions and that the limit of possible food in the game [22]

B. Chef war
Chef war is a mobile cooking game that focuses more on contest and recipe discovery. It is the game where the players travel to many places in order to collect various ingredients and craft different food, so that they would learn to use them on competitions. In the competition, the player would use their knowledge to serve the food that has taste/flavor that suits all the judges the most in order to beat the NPC opponent and win the competition. This game experience focuses more on the crafting of food recipe and the use of competitions, but lacks gameplay on many other fronts making it somewhat bland [23]

C. Hot dog bush
Hot dog bush is a web browser game that involves the cooking of food and serving them to the customers. The game focuses on management of the procedure of cooking and the juggling between serving the customers, the game experience that the players will have to make sure to prepare food properly and prioritize the order of customers to make the most income. The mechanic is simple as it involves a drag and drop [24]

D. Overcooked
Overcooked is a party game, played between one to four players. The challenge is that the players move one cook in the kitchen between many cooking stations in order to serve the food. The challenge is however, is that the kitchen will have bizarre obstacles and situation that the cooks will have to play on. The experience of the game is mostly on players interacting on a party game to obtain a goal, with cooking more of the theme [25].

A. Proposed solution
As stated in the previous chapters, there would be a need to make a backend system that serves to help to manage the items for the game and their relations for the items to be maintained in a game, and a need for a way to open and maintain a way for communication for the game client and the server, ranging from receiving information to purchasing items.

B. CMS
The content management system is the proposed idea for the first problem, which is to manage the content of game items in the game. A proposed solution is to create a web application to do this, where the game manager can use it to add and edit the items. The first thing they see after going through the login page would be a dashboard, showing statistic of the game such as daily player count and the items sold in the Lootbox, and also all pages come with the entire left column as a header to navigate between each category if items or section of the items for the manager to work on. Navigating to the other pages will first show the table view for that category of items where there will be presented all the item related to that category can be found.  Table View for Category In this part the interaction will be to click add new, leading them to a new page with a form where there are fields accordingly set to the category that is needed for that, and the user is required to fill all fields before selecting "add" in order to add it to the database. The other option would before the "update", but unlike adding, selecting it will open the form page filled with the previously entered information for that item, and updating it will update it to the newly entered information. Such functions will fall to the game objects of the following category: There are also different parts of the web application that would be needed to be made differently than the first mentioned design: • Table version: it would be a simple input from a form to set the latest version of the tables • Food: food will be created will have, at all times, 3 instructions under it and may include variations as well. In a technical point of view, updating food will include at least 3 other items. • Variations: Some food will have variations, under the condition that it will have a specific instruction. It could be added and edited within the items set within the needed instruction. Variation for each food with the met requirements would also come with their own list views • Shops: shops are divided further into 3 subcategories with their own separate rules, though technically they would possess the same technical function of add and edit: Daily, Special, Premium • Players: player table on the page can only be edited to determine whether a player should be activated, archived, or banned. In other words, it only function as a very limited update.

C. API
The API is the solution proposed to solve the other problem, for the game client to access the server for all online services. The clients will use the REST-ful API links to access for each information in the server. The interaction of the API can be shown in the following as a flowchart. In the figure, the access and input validation is needed to make sure the received request is appropriate and has all the needed information, or that the sender has the needed credentials to access it. Output result is either a response of success as return message or a return with a list of object as well.

D. Lootbox system
The Lootbox system has been designed as one way to obtain ingredients from the game. This is a system that uses random numbers to determine the result that a player will obtain resources. The following would be a set design component of the Lootbox system that will be implemented in the result determination process: • Weight: each ingredient will be given a weight in the Lootbox, determining its possibility to be selected. Each weight will increase its possibility to be selected. • Amount: The amount determines the number of ingredients the purchasing player will obtain. Each ingredient will be determined by the roll, so the number of rolls attempted will be equal to the amount of ingredient received. • Guarantees: A guarantee system can be set to increase the odds of the player on getting ingredients that are hard to obtain. This is done to make items in the game more obtainable. The guarantees has been set to the 5 categories of the ingredients to make the odds a bit more dynamic to be set • Boost: This is the system to give the player the small boost on getting better items in the game. The odds that are improved would be through increasing the weight for the items ingredient in the category of rare, super rare, and legendary. The small boost would be given to the players who have purchased a premium currency before, but it is made to make sure that the amount paid will not give a significant advantage over every other player.

E. Cronjob
A few of the commands/scripts will be necessary in order to maintain the game, all of them to be triggered to be on a set rate. To conduct this, Cron jobs will be used as it enables to schedule a command or a script to be executed in a set rate.

A. CMS Testing
Conducting the result of the CMS would require the use of the web browser to use the web application. All the features that exist in the current development was tested to determine whether it works, and the result can be seen/compared to on the database or the detailed view by selecting the "Update". When all the test are done it was concluded that it was successfully executed

B. API Testing
Conducting test for the API will require a help of a thirdparty application called Postman. It would send request for the server with a body for the request and receive a body of JSON as a response from the server. All the test with the server have concluded that the result was successful

C. Cronjob Testing
Conducting the test with the cronjob would need an analysis on the database to see if the script is called to determine change before and after a set time. After conducting such task, it appears that all of it works properly.

VII. CONCLUSION AND RECOMMENDATION
In conclusion with the proposed design for the solution and its implementation to solve the problem, it has become very effective solution for the problems, with all items can be managed and the client can be made to request to the server appropriately. It has a potential to become very usable for other things a swell, with different categories can be inserted when needed for an expansion for the game content, or even used by other applications as well. As this provides online services, it could be used to make other services that includes data mining, with all the processes related to information related to the gameplay, information related to the players behavior could be obtained to help decisions for the game in the future. In short, the CMS would be able to provide an ease of control over the game content, capable of processing information within the game, and many more.