We Built a Mobile Game: Here’s What We Learned

Alexandru Grigoraș
13 min readJan 28, 2022

Mobile games are a great place where people can escape from the real world and get immersed in the virtual world. It makes you develop new skills to achieve the objectives. There are a lot of game genres and multiple platforms to choose from. You can play games anywhere, using Gaming PCs, consoles, or mobile smartphones. That makes the gaming industry popular and continuously growing.

I am sharing the story of creating Khyron Realm, an MMO strategy game designed for mobile phones and oriented toward casual users. This guide is intended for those that want to build their first game and start their game developer journey.

Designing a game is not an easy task. Depending on the game type and platform, it can take upwards of a few years to complete a game. The following steps were taken to create the game:

  • Create the initial concept;
  • Imagine a story around it;
  • Set the development strategy;
  • Create an original design;
  • Develop the game and the networking server;
  • Test the game using focus groups;
  • And improve the game if necessary to make it better.

It is always recommended to have a team when creating a game, as the amount of work necessary to do is too much for a single person to finish something in a reasonable amount of time. A few of the important roles are: game producer, game designer, concept artist and sound effects producer. The Khyron Realm game is not the product of only my work, but the cumulative work of a team of passionate people that made this game came to life!

1. Start with the concept

When I was younger, PC games were a part of my life. They offered me a place to relax and test my skills. In the beginning, there were a lot of PC games. Strategy games, adventure, and shooters are just a few examples of great titles. Besides PC games, I also loved browser games, that offered great multiplayer experiences. Some examples were Tribal Wars, Gladiatus, The West, Club Penguin, and others. With the increasing performance of smartphones, these games came to mobile, and it was better because I could play them everywhere. Clash of Clans and similar games were the best in their class and offered great experiences.

My team and I decided to create a similar game, that is situated in the present future and uses technology at its core. We decided on a strategy MMO (Massively Multiplayer Online) with a core loop presented below.

Khyron Realm’s game loop

You can build robots — and upgrade them — cooperate with other players to achieve the objectives, gather resources through mining in a mountain, and convert them to create energy. In this way, you can improve and achieve more milestones in the game.

Pretty simple, right? Well … this is only the core loop, and more activities should be added to make it more enjoyable.

2. Continue with the story

The story is a very important part of the game. It transposes the player into the world of the game, Khyron, a beautiful Earth-like planet that has the possibility of becoming the next home for humanity.

Khyron planet

In the case of this game is split into four phases:

  • Beginning: The story begins in the future, in the year 2422. Traveling through the universe with the destination to Khyron. A throwback to the present day, 2022, explains how and why we are going to another planet;
  • Arrival: Here the story gets more complicated. Some unexpected solar storms damaged our ships, but we landed on the planet with a few scratches;
  • Community: The purpose is to establish a colony there, and we need to collaborate to do this. Our equipment is damaged and needs to be repaired to work at full capacity;
  • Supplies: The ships have limited payload capacity, which means we need to gather supplies from the planet. The needed resources are: silicon, lithium, and titanium. We collect them by using robots to mine in the designated locations.

This is only the background information shared at the beginning of the game. The continuation of the story will be found by playing the game.

When coming up with ideas for the story, reading a lot of books helps to get great stories that people can relate to. And use your imagination as much as possible. The game is not only programming but a new story that appeals to the public.

3. Planning the development steps

Now I will enter into more technical details, for those who are curious about it. The game was developed using the Unity game engine. It is great for building cross-platform games without creating them from scratch. It uses C#, a general-purpose, multi-paradigm programming language. We designed the game to work best on the iOS and Android platforms.

Multiplayer was needed to facilitate the interaction between users. We used a C# library for handling the connection with the game servers. DarkRift Networking 2 was chosen because it offers a high-performance, multi-threaded networking system for Unity designed for speed and flexibility.

Cloud services are used to host the game server and be accessible for each player in the world. We used Google Compute Engine(GCE), an Infrastructure as a Service component of Google Cloud Platform. GCE has a free tier for testing (available for 3 months) and after that, per-usage pricing, depending on the services used and the performance of the Virtual Machine(VM). DarkRift networking uses a C# console application that runs on a Linux-based VM on GCE. On the first version, the scalability was not a priority, only the proof of work to test the game with a limited number of users. After this, DarkRift’s clustering is used to increase the scalability of the solution for a large number of players.

Besides the server hosting, a database is needed for data persistence. The game uses MongoDB, a document-oriented non-relational database. It offers flexibility for storing the necessary player and game data and faster access. The hosting used for the database is MongoDB Atlas which offers a free tier for testing and paid tiers for performance and higher storage capacity.

Having multiple developers, we split the game and networking to develop them in parallel. We used an Agile development methodology, SCRUM. For planning the sprints, we used the Atlassian Jira, software planning tool. The first game iteration had 4 main parts: headquarters, map, auctions, and mine. We planned two-week sprints for each of them to complete a first working version of the game. Each part had multiple subtasks that needed to be handled by each developer.

When working in teams, it is always recommended to use collaboration and versioning software (in our case we used GitHub). It is helpful to collaborate and share the code with all the developers and also to store the history of the code modifications. In this way, you can work on multiple versions and use the ones that are needed for each part.

Let’s not forget the design of the game and the sound effects. These were also done by different people and went in parallel with the development to keep the project deadlines.

Well … it does not always go according to plan. Knowing when to make small trade-offs helps to be on track. This is not useful all the time, but staying too long to solve some problems is not as helpful either.

4. Creating the design

Great design comes from creative people that have great ideas. We imagined a game with 2D graphics and a flat style design, similar to Kurzgesagt. The theme is colorful and is suitable for everyone.

The first part is coming up with the idea. Then a quick sketch to illustrate it is always good. Below is an image of a hand-drawn sketch of one of the robots. It has multiple parts that are necessary for the game: head (which contains the vision system), body (with the propulsion system for movement), and arms (that contains the tools necessary for mining operation).

Hand-drawn sketch of the Crusher robot

After this comes the computer design. It is made in Adobe Illustrator, a vector graphics and design editor. Below is the finished version with all the details added. The design process is time-consuming and needs a few iterations to get the best design possible. It cannot be rushed, otherwise, the results will be sub-par.

Computer design of the Crusher robot

The environment is very important because it uses a lot of space and creates the virtual world of the game. The background and the different foregrounds are shown in the following image. Selecting the color schemes and how the correlation between the elements is extremely important for the game’s success.

Environment design

Popups are an essential part of each game, offering methods for interacting with the game and isolating the game elements for better clarity. We wanted to create a symmetrical design and position the elements correctly in the frame to be easily accessible. On the left side are the elements that need to be interacted with (in this case selecting the robot type) and on the right side are the buttons for doing certain actions (for example upgrading the robot or exiting the popup).

Popups design

Let’s not forget about the User Interface(UI) and User Experience(UX). The UI design contains the buttons, progress bars, and other elements that the user interacts with or views information from. Blending the UI with the environment was challenging and it needed multiple iterations to get the ideal option. And the UX represents the positioning of the elements. Designing for smartphones should take into consideration that the ideal touch locations are on the lower left and lower right sides. And the top side should be used for offering useful information. A version of the UI is shown below.

UI design

Even though the process is time-consuming, it is rewarding and it always surprises us with how things came out. I am proud of the shipped design and the game.

5. Development

Now the coding part of the game. These are quick descriptions of how the game works. For more details, consult the Unity documentation for the game and the DarkRift documentation for the netcode.

Unity game

Depending on the action performed by the player, or the background actions executed, the game is separated into multiple classes. Below is an example of the BuildRobots class. It is used for training new robots. It uses a timer to create a background task because training a robot takes a certain amount of time. It is split into multiple regions: Input data for the player selected actions, Start & Stop Building process for starting or stopping the training, Show number of robots for displaying data to the player, Show Time for displaying the remaining time, and Building process that keeps the building action and invokes an event when finished.

Take into consideration that the following code sections are stripped-down versions of the code for the explanation!

Unity code for the game

Netcode client

DarkRift library offers a message passing framework. The client code is represented below. The HeadquartersManager class handles the communication with the server for the headquarters screen. PlayerData is a class that represents the necessary information for the player that is stored on the server database. The Awake method is Unity specific and is called on the initialization of the game. This can be used for initializing variables or other actions that are needed to be done only the first time. OnDataHandler handles the messages received from the server. Depending on their tag, certain actions are taken. PlayerConnected method is a confirmation that the player connected successfully to the server. ConversionError is an error message from the server that the conversion of the resources was not successful. This triggers the event OnCoversionError that is handled in another class. The last method, PlayerDataRequest sends a message to the server to request the player data. SendMode.Reliable uses a TCP connection to ensure the message is sent and data arrives correctly.

Client code for the networking part

Netcode server

The server code is similar to the client code. The HeadquartersPlugin class extends the Plugin class from Darkrift to be used in the server application. The Loaded method ensures the plugin is loaded correctly. The constructor assigns the OnPlayerConnected and OnPlayerDisconnected handlers. These are called when a player is connected to the server or disconnected. OnPlayerConnected has also a handler for the received messages. OnMessagesReceived executes the necessary actions when a message is received. For example, it sends the PlayerData to the client, according to the username.

Server code for the networking part

Testing

Testing the communication is necessary at each step to ensure the functionality of the code. Debugging can be done using the IDE’s debugger or using the console messages. I recommend using the debugger initially for the initial steps and communication. After the game is in an advanced state and uses different modules, debugging becomes harder and sometimes, the console messages can help. Below is a screenshot of the game running in the Unity simulator and the server console and some of the communication messages between them to ensure the system is working as intended.

Khyron Realm game development

I have not included a comprehensive explanation of the testing, these are just simple testing methods to ensure normal use. The recommendation is to have another developer for testing the game in all the edge cases to ensure the game acts as intended and cannot be hacked easily.

6. Testing the users' reaction

Hooray … the initial version of the game is ready and working now. The next part is to launch the game on the app stores in the beta version (not the release version yet, as we intend to test the game to see the users’ reaction and find eventual bugs). This is a launch checklist from Android but will be similar to Apple’s App Store.

The first step is to release a game executable. We can do this from Unity. For Android, an apk file is generated, and for iOS, XCode generates the necessary file. It should be taken into consideration that the iOS version requires an iOS smartphone and Mac device to release an app or game. Then the app is submitted to the App Store to review and test if it conforms with its rules. If all is ok, the app is published and a link can be sent to the users to install and test the app. The Android version uses a Play Store link and needs a gmail account for testing, while the iOS uses the TestFlight app for testing. We selected a small group (maximum 50 people) of friends and other gamers. Below is a screenshot of the game released on an iPhone. To gather a community, a Discord server is a good idea to communicate with the players.

Khyron Realm game, iOS version

This is a short video with the gameplay.

Khyron Realm gameplay

The feedback from players is crucial for game development. In this way, we can improve the game and see if it has good potential in the future.

7. Next steps

The agile development methodology proposes a continuous cycle of planning, development, and review. Now that we have done the first cycle, we need to repeat it to improve the game.

Here also comes the question of whether the game is accepted by the community or not. Not every game is received well by the players. Their expectations are high and is hard to find the best combination of story, gameplay, and rewards received by the players. This determines the success of the game. For your game, you should do your own analysis to determine if you are on the right path or not.

If the feedback is great, the development should be continued. And don’t forget about the marketing. It is important to promote the game for people to find out about it. The website is the first necessary thing, where you can explain the game and features, and also a wiki with the story and gameplay. After that the social media presence, where Twitter and Reddit are some of the best alternatives.

If you’re not sure about how are the steps for promoting the game, I suggest looking at Game Thinking, a proven innovation system that synthesizes modern product development with world-class game design.

Conclusion

From the start to all the steps involved, it was a great journey. We developed new skills and improved ourselves. This is the best reward that we could have got. I loved every part of it, even those that have not gone as planned, and we had a lot of those.

Although the game did not have the traction that we expected, this guide is for newcomers that need an insight into the process of creating a game. These steps should not be followed as is, and need to be adapted for each use case. I hope this is useful for some of you to learn from our process.

As a bonus, we’ve open-sourced the game and can be seen on the Khyron Realm’s GitHub organization.

Resources

--

--

Alexandru Grigoraș

Solving business problems using technology - interested in AI, robotics, space exploration and DIY products