Creating an MMO
Published: 2024-02-20 07:32:24


Hi, I'm z and I'll be blogging my journey from start to finish.  Highlighting the problems I encountered along the way and how Identified them. I may not be able to discuss those solutions in fine detail, but you can always reach out to me and I'll make one for you. 

## Introduction

When I was a kid, I used to play an MMO RPG game all day long. And often sneak past my parents just to get an hour of it. Why am I so addicted in the first place? Well, grinding for hours and fighting those annoying mobs all that long and finally getting the item you wanted was the best feeling I had, And I just can't stop from grinding that stuff. The sense of achievement and pride just keeps going. More than that you could work with other players to get more stuff.

Fast forward, I get the chance to play another MMO RPG but something's off. I'm not feeling the sense of pride and joy I had when I was a kid. Was the child inside of me dead? Was I a good boy working too much for my fam? A lot of questions came up to my mind.
But no, it's not me this time. It's the damn game I'm playing. And no matter what I pick, it sucks. On Intro, I'm bombarded with tons of item drops so much that I forgot some of them even existed. Plus, the play-to-win scheme. I'm not hating their business model, it's great, but it's really not for me.

So, I'm building my own MMO RPG with Unity. How will I do that? Through dedication, courage, and maximum effort - dead pool style.

Jokes aside, without much of an experience, it'll be a wild ride. So, starting from scratch, I made a list of the features I'll be adding to the game. Including:

- Hero Class
- Skill & Buff System
- Quest System
- Armor System
- Wear & Tear
- Merchant System
- Inventory System
- Event System
- Announcement System
- Battle Mechanics
- Mobs
- Boss Fights
- Party System
- Shop System
- Currency System
- Network Layer
- Web Server
- Entity System

Did I mention it will be a Player vs. enemies (PvE) only? I know, I'm sad as well, but as long as you could grind why not? Grind? Just grind? Yes. And with those items you earned, you could use it to grind more items.
I just want to keep things simple, and not too overly complex during the development. I may be able to plan a PvP but I can't make promises.
Now finished with scratch, I immediately prioritize buying some assets at Unity Assets Store. I don't want to waste time drawing my own artwork, so I bought some. The design I'm looking for is mostly Poly Art. Poly Art Style is simple yet has an impact and it cost less than the rest.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k4gik4yiejc3w190fctg.png)


With the start of Unity Sale, I began questioning my life.
In just a press of a button, I got a ton of assets available for me to develop. I also took the free ones, it never hurts.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/njbmcv1l6qdiag5dqf3q.png)


Weekend, I started my project, trying out the latest assets I got, hoping they work on the latest version of Unity 2022. And everything looks great.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fh2i9p2sv0v0b2lr7kfr.png)



Cool, cool. Now to coding… Where should I start? Looking at my procrastination list, I started on Entity System. It'll be one of my core systems of my game along-side with Skill & Buff System.
The structure of my entity system is separating the Body from the controller, these game objects are separated and have their own sets of components. This structure I had in mind is to efficiently re-used the controller component, and it will be extended via a sub controller. So that I could use it both on players and different kinds of mobs with different sets of body and animations.
You could say that the controller is our head, and the sub controller is someone's subconscious, like from our ai or us (players).


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/88bk65cm742l03lwo8zp.png)



Notice the red ones (Skills), those are scriptable objects inheriting the ASkill abstract class, implementing it, allows those scriptable objects to create custom skills.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w54sf773fackchtv7si3.png)



So, I started with the attack skill for my mob here, Skeletee.
But before that, I had to fix its predefined animations. I duplicated the default animation and named `Skeleton.controller` to` Skeleton.modified.controller` so I know which is which. I used a blend tree for movements and some animation keys. For the parameters, I always kept them short, and snake_case.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rilvqmxj9ve73fi8vpvq.png)



After that I fed it to the EntityAnimator, we'll be using it as a Facade to Animator component since I don't want to always deal with those text variables most of the time. Besides, it's clean coding.
Back to making skills, I created the attack skill and attached the necessary events.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w90vz4ul1dhwcq77yrif.png)


that's the entire content of a single skill. But it can do more, just too lazy to explain. The scriptable object looks like this.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n1dhihje2m24mnozgukb.png)



Amazing, I'm amazed my brain didn't fry during those abstractions. Moving forward, I attached the components to our brother-at-arms Skeletee - to his body and head. And finally, the skills.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a4pkangwlil1elci6lin.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dtp05itdl7legprki1x0.png)



Now to see our efforts, I ran the program for the first time after four hours of coding.



It works, flawlessly……

There goes my insanity.

---

If you wish to see parts 2 & 3 you may check it here. The next blog will be posted on dev.to 

[Part 1](https://medium.com/@happyman404/game-dev-log-mmo-rpg-1-409e8e5088d6)

[Part 2](https://medium.com/@happyman404/mmo-rpg-2-dev-log-d73420f16101)