Service guidance on mmorpg

Hi Guys.
I’m solo currently developing a 2d MMORPG, it will be based off the game Tibia in some aspects of the gameplay and also Runescape.
I’m currently in the process of choosing how I’ll network the game
I’ve had a few options in mind but I’d like to know which one you guys would suggest
Scenario:
Authoritative server
100 CCU cap per instance, 4 instances in 4 different region.

Since i’m a solo developer and currently studying my 3rd year in Computing Science, I’d rather options that makes the integration easier.
Gamelift, playfab, UGS?
If picking for example gamelift or playfab I still need some networking solution like photon?
Photon seems so expensive, 100usd per instance with 100ccu max.

@Gus_1

I’ll not reiterate how difficult MMOs are to make (typically a very bespoke network solution and shipping new content is king), but consider this more as a “large scale multiplayer” question. Will quote myself from previous discussions about netcode choices in context of large scale multiplayer. There are a number of options:

In an MMO you’ll generally be wanting to look for strong interest management capabilities (area of interest, network loding/relevancy, etc) and eventual consistency vs snapshots.

The quoted post is presuming you are not using ECS, otherwise Netcode for Entities is your only real option and it can handle 100 CCU per server just fine… as demonstrated by the studio behind Tibia: https://www.youtube.com/watch?v=6V_ugU4L9nk

You’ll also need to consider long-lived servers, but if no players are online and no long live logic needs to run… automatically turn them off. This is dynamic allocation and orchestration logic that scales to player load. Presuming there is data persistence you’ll need to integrate players or worlds with some database strategy, I’d recommend focusing on player data and make your world as data ephemeral as possible.

With UGS you could configure Multiplay servers with a longer ttl beyond 60 minutes (see docs) You could create a lobby from the dedicated game server runtime, keep it alive with a heartbeat, and use that to browse your available server/region for players. Add logic to kill a server if no players are in the session and rehydrate when players want to join, but that would require a separate allocation flow. Some UGS Cloud Code functions with access to service account token to spin up the dedicate game servers could potentially work there as well. Or a lightweight REST allocation service hosted on your pick of cloud provider.

I will! :stuck_out_tongue_closed_eyes:

Ain’t gonna happen. :slight_smile:

But don’t let that stop you from trying.

It’s just, when you say this:

It tells me you have absolutely no idea of the cost structure of an MMORPG.

If you think you can spend less than $1,000 per month on server infrastructure and services for a multi-region (presumably global) game even with relatively low daily CCU, you’re gravely mistaken.

The ready-made services are not cost-effective at the scale that an MMO demands, practically every MMO in existence has developed its own infrastructure to support the game, including sharding, matchmaking, ingame moderation, support requests, and so forth.

You got to try and shave off every byte of your traffic to keep the traffic costs low. You got to try and shave off every CPU cycle and every megabyte of memory usage to keep the server hosting costs low. You got to shave off every byte from the backend database to ensure it’s handling queries fast with minimal traffic, even allowing localized caching. You got to make deals with server and service providers … except they’ll at best point you to their publicly available servers and services because you’re not a big player.

Besides that, the subscription-based MMOs (if you aim for that) are all but dead for reasons of costs not scaling, respectively you can’t just ask users to pay more per month if costs rise. Plus monthly fees hurt playerbase growth.

So if anything, the game would have to monetize in any way it can outside a monthly fee. That means you will find it hard to generate enough revenue as you would have to constantly figure out and optimize ways of making money but you don’t have the budget that allows you to do this since, yes, you will be paying first while alpha and beta-testing your game (semi-)publicly. There are unavoidable up-front costs possibly going for years before you can even hope get some money in return.

And that’s not even considering the amount of content you’d have to pour into an MMORPG. All by yourself, that’ll be years of work all by itself. Plus when you do have 100+ daily CCUs, you also get to manage all the support requests. You’re looking forward to this? “Halp, I’m stuck!” “I want my money back!” “Holy shit, what the fuck, this place is not kid friendly with all the swearing!” “Someone stole my account!!1” “This person keeps following me, make him stop!”

Your best shot at this is to start small, no, start tiny. One server, hosted for real cheap, that can handle at most 100 users (if at all) and see how far you can take it. Consider this a learning experience, not something you’re ever going to release and make it big. Because that has never happened to a solo-developed MMO (if there ever was a true MMORPG that was truly solo-developed - doubtful).

Sorry if that was blunt but I’m sure you’ll get something off of it, if only to consider the plethora of things that actually go into making an MMORPG. And I only covered the surface.

Focus on making something for your friends and make that fun, you can grow it from there. So really the best advice is to build everything modular so that you can replace individual features, services and frameworks and replace them with something else, be it networking or database or other services without much fuss. Effectively a microservices architecture. Only by doing this will you not lock yourself into provider X who just happened to double their costs, or filed for bankruptcy.

Sorry, I could just go on and on. :slight_smile:

A little bit more context on what is the current state of my game and what optimizations I’ve set in order to start networking:

Basically, all the game mechanics I’ve created in fields where networking behavior will be implemented already have placeholders to test mechanics, with the thought that I’ll add networking later. I use Firestore database, and I’ve fully integrated it with my mechanics so far—inventory, inventory items, crafting, bank system, enchanting, player authentication, login, all stats and skills, and quest logs.

For Firebase, the optimization I’ve done is batching the saves to every 10 seconds or on player disconnect. With this approach, I stay within the free tier for database writes and reads, which works so far.

My enemy AI movement is handled by the A* pathfinding algorithm. I managed to cluster the game map into smaller clusters, with the idea that this could further benefit networking—making sure the client only gets updates for relevant clusters. Enemy AI has two states: Patrol (hardcoded waypoint coordinates) and Chase (using the pathfinding algorithm). This way, I know patrol mode will have minimal impact on CPU and network, while chasing might require some modifications later. So far, there’s no bottleneck.

Networking Tools & Systems
I was going to use Mirror, but I get the feeling (perhaps my own imagination) that Mirror might lose developer support and become deprecated at any moment.

The questing system will be handled and validated only on the client side, unless there’s a quest that requires a global interface. I plan to leverage Firestore and networking to make the game as efficient and cost-effective as possible.

I’m a 3rd-year Computer Science student. Last summer, I spent 50 to 70 hours per week studying and slowly progressing with Unity and its tools—it’s been a steep learning curve, but I’ve come a long way. I’m currently doing my internship, so I have time to read documentation during work hours, and I’ve been doing that. However, I don’t have much time at home, so I want to “invest” my limited time in a networking solution that can handle around 80 to 100 CCU per server instance, given the optimizations I plan to make.

EDIT----------
I’ve played Tibia since I was very young (8 years of age) in a dial up computer in my home country (brazil). It was what got me to study Computer Science 17 years later in Ireland. I currently dont expect to make revenue and the game will be free to play. I dont plan to make it a Pay to Win game, Pets and Skins will be monetized and I’ll be accepting Patreon donations. My main goal is to put all my ideas into a game and give people the same sensation I had when I played Tibia years ago. I also plan to develop it for both Mobile and Steam. So, with that in mind, and also the fact that the game is pixel art, I find it hard to grasp not being able to handle 100ccu with modern mobile phones probably being better than the computer I had back in early 2000s

Doubtful, it’s rather popular because for a long time, it was the only full fledged networking solution for Unity and easy to use.

It does have a serious drawback: it is not updating on discrete ticks which is inadequate for a network framework. It’s also said to scale badly with number of users, despite MMO frameworks built around it.

If you can manage to go low-level the best solution here really is Unity Transport, or any transport for that matter. Just a single point where you can get to decide when, what and how to send and receive data packets. This allows for important optimizations such as collecting all the transforms that changed in a frame and sending them out all bundled together, possibly compressed. There are traffic savings to be had doing so upwards of factor 5.

How many CCUs are possible has almost nothing to do with your choice of networking framework. Give or take a few bytes. And of course, like I mentioned above, you can’t afford to rely on any built-in conveniences like NetworkTransform if you truly want to scale beyond 100+ CCU.

How many CCUs a game can handle, assuming the same server-side hardware, depends 99% on your ability to code well and optimize CPU time, memory usage, and most importantly traffic. It may require making clever choices, ie reducing the update rates of anything past a certain threshold around a player, and not updating anything at all past another threshold. The network object visibility system many frameworks have can help you with this, but it still may require custom coding nevertheless.

You also need to think hard about what needs to be network synchronized, and what doesn’t. Many devs assume that the weapon a player is holding is also a networked object, and then they struggle with proper parenting, as well as moving the weapon between hand, inventory, and world. But really, only the world item is network synchronized, and it really doesn’t do anything other than waiting to be picked up. Once picked up, it’s just a matter of sending to other clients whether the weapon is equipped or not, and whether the player is firing or not - both of which the player object should handle, not the weapon.

Applaudable! And I’m sure it works great for motivation!

They can handle it, each on their own. It’s just a bunch of sprites and some network traffic. Although that traffic needs to be very well optimized because you’ll want them to still have a good experience on a slow network (3G or less).

Apart from that it’s mostly the dedicated server executable that needs to be able to handle 100 CCUs in terms of CPU time and memory usage. Say each player consumes 10 MB of memory on the server, times 100, the game would utilize 1 GB of memory. But you’d really want to run as many instances per machine as possible though, so in the case of an 8 GB server this would alread limit you to 7 instances (you can’t use up all memory to the last bit). Then those 7 instances need to be able to perform 700 players doing some things on just two CPU cores.

Those are Unity’s Multiplay server hosting specs: dual-core, 8 GB memory. Others vary but in essence, you want to be able to run the game on a low-cost system like a Google Cloud Compute machine (same as Unity resells to you in their service).

So the main challenge really is about supporting perhaps 10 or more dedicated server instances per machine even at 100% utilization, rather than a single instance on a single server supporting 100 players. You will want to be able to run multiple server instances, not just one, on the same cloud server to save costs. Each instance on the same server would only minimally increase costs, mostly additional traffic.

2 Likes