Michał Kmiecik

Michał Kmiecik

Poznań, Polska

I’m a full-time dev building indie startups after hours. I’ve just started making my first small profits — and I’m sharing everything I learn along the way 👇

See behind the scenes ↓

I recently made my first few $ from indie projects. Follow the journey as I build more — and try to make it sustainable.

Building an indie MMORPG – part 1: idea, goals, and tech stack

July 2, 2024

6 min read

Why I’m building a browser-based MMORPG from scratch, how it will work, and which technologies I chose to bring it to life.

Early development screenshot of a 2D MMORPG game I started building

Motivation

I started the project, whose development process I will be describing over the next few months, around mid-March 2024, almost four months before the publication of this post. For the curious, the current stage of work is shown in the thumbnail. Let's begin with why I decided to undertake this project. First and foremost, as I wrote in my first post, playing the MMORPG game MMORPG called Tibia at the turn of primary and middle school sparked my immense interest in how the game was created and how it works. My dream was to learn programming so that I could create a similar project in the future. I was extremely attracted to the fact that the game itself is very clear and intuitive, yet incredibly engaging and available online. Below, I have included a sample video showing the gameplay (in the example, we are watching a demon boss hunt ;P).

The second reason that had the most impact on this decision was simply a temporary boredom with writing business applications and a desire to create something different, using new technologies. I needed a project that would be challenging, fun, allow me to play around with programming, and ultimately, one that I would use myself. Around mid-March 2024, I decided to dive headfirst into this project on my own. My only experience in game development was a few 2D mobile games in Unity, although I already knew that the biggest challenge in this project would be the server, since the graphics are relatively primitive. However, until this point, I had no experience in building online games.

I must emphasize right away that I do not have high financial expectations for this project. I certainly don't assume that this game will achieve great success and have thousands of players. As I mentioned, I am doing it mainly for fun and further technical development. However, if it turns into something substantial, I might consider creating an online course on building online games (especially MMORPGs), because according to my initial analysis, there is a lack of this type of material on YouTube - there are only videos on how to create an RPG game.

Concept

Above all, I dream of creating this game according to the expectations of the players. In other words, I want to stay in touch with users and actively discuss new, interesting functionalities. Of course, I am aware of the possibility that no one will want to play it, and then I will have to think of everything myself.

However, I have a certain concept of gameplay in mind, which will take me several months to a year to implement. The design of the game will resemble Tibia, meaning I will use an isometric perspective where all vertical objects will be drawn at a 45-degree angle, and the map itself will consist of square tiles. The animation of moving objects, such as players or monsters, will be achieved by combining 2-3 sprites depicting successive stages of movement. I plan to handle the communication system similarly: a general chat, private chats, group chats, and a game chat where messages are seen only by players within range.

The attacking system will be programmed similarly, meaning the player clicks on a target, and everything happens automatically. A significant difference will be the damage calculation algorithm, which will become much more complex and dependent on a larger number of various character skills. In the first stage, I plan to introduce only melee combat and the following player attributes that can be developed:

The next big change will be the absence of a system of different professions. I envision it so that as a player gains experience, they achieve higher levels. After each level up, they receive a few skill points to distribute as they see fit. This will result in greater diversity and flexibility in character development. Of course, in the future, skills related to ranged combat and magic will be added.

The above statistics will influence combat, carrying capacity (which allows for more equipment to be worn), and other aspects that will emerge during development.

More ambitious plans

Regarding my ideas that will be more challenging or longer to implement and will require deeper consideration, they include:

Technology choice

This stage took me a good 2-3 days. I had to decide what to use for writing the server, the client, and which protocol to use for communication. The most important thing for me was to easily share the game with other users, so the first decision was to create the client in the browser.

Protocol

As for the protocol, I was considering between UDP, TCP, and WebSocket. UDP was attractive due to its speed, but unfortunately, because of the possibility of packet loss, I couldn't use it for my game, where the client must 100% reflect the server state. Since I chose the browser, raw TCP was also out of the question. So, I settled on WebSocket, but I planned to organize the module and class structure so that if I decided to introduce a desktop client in the future, adding TCP communication would be simple and wouldn't require changes to the existing code. I knew that a hexagonal architecture would allow me to maintain proper separation of the code responsible for business logic.

Backend

Knowing that the server code could be quite complex, I decided to write it in Java, as it is the language I am most proficient in. In my daily work of writing backend for business applications, I use the classic configuration of the Spring Boot framework, which under the hood uses the blocking (each HTTP request is handled in a separate thread) application server Tomcat. For the game, I needed a non-blocking server, so the next choice was Spring Webflux with Netty.

Frontend

Choosing Next.js would be a bit of overengineering, so for building the UI, I decided to use React, and I decided to create the gameplay itself in the Phaser engine. After a brief research, I knew that integrating both tools would not be a problem.

Summary

And so, after a few hours of analysis, I had chosen the basic technology stack, thought through the basic rules of the game, and planned the next steps. The first concrete task I wanted to do was to integrate Spring Webflux and React using WebSockets and create a simple chat. This and all other stages will be described in subsequent posts, so stay tuned :).