How to make central server?

Hi,
I need to make central server for:

  1. Saving data as when players ship is in battle, …
  2. Doing matchmaking (bec now, it is that players lobby send join request, game server will recive it and check it, if the new players skills mach with other players skills, it will send invite and the players lobby will choose the invite to server with most player, but this isnt as effective as possible)

So I need to know, if / how it is possible to create server, that will do central tasks, and share info with new servers. Do I need to use third party bot?

1 Like

I believe you can share info between game servers using MessagingService. You should check that out.

1 Like

Assuming you want to do global matchmaking you could use MessagingService for this. Here is an existing thread talking about global matchmaking with MessagingService and it also got a response for a Roblox engineer: Global Matchmaking.

In the future we should be getting a couple of features that will help us do matchmaking and storing temporary data. However they were on the 2019 roadmap but got deferred:

For the time being you could try using MessagingService and HttpService but this really depends on your use case.

@waterrunner and @DesiredFlamingFire
Ik this, but i need to know how to make some central server, that will do it.

This is very possible but I would strongly recommend you do not do this unless you either know a lot about web development/web services or you want to spend a while getting to learn them.

First of all why would you not want to do this?

  • Almost anything you want to do can be achieved already via DataStores or MessagingService.
  • Creating your own external service adds a new point of complexity and failure.
  • You have to work with a new language, most likely js.
  • Roblox handles scale extremely well for you in a way you don’t really have to worry about.

When you instead create your own solution you have to understand that if 10,000 players suddenly joined your game it could likely kill your web service. If you have an accident and delete a bunch of data, no one is there to help you. Making a prototype of this kind of system is reasonably easy, making sure it is able to handle live prime time usage is very hard and not something you want to underestimate.

Now how would we do this?
This is actually something I have a lot of experience with. The current game I am working on boasts full cross server replication support and many other goodies via a custom backend I have made. To do this you need two distinct parts.

  1. You need an http server (I use and reccomend Express on NodeJS for this)
  2. You need a database (I use redis due to performance requirements, I’d reccomend a more conventional db)

Essentially your http server hosts an http api which puts information into the database and retreives information back from it. You need to be careful to ensure that someone can’t ruin/abuse your db just because they have the url to your api! You’ll also need to host this on a vps (I use google cloud platform).

If you have never done this before then this will be difficult and will probably take a long time. Please only do this as a learning experience/technical demo and not as a method you intend to use in a live game.

2 Likes

This is my problem, bec roblox doesnt have feature to add background worker, running 24/7. So for datastores, my problem is the cooldown, bec there can be many changes in temporary storage. And for messaging service, this is good, but it need the background worker, that will collect data and manipulate with it.
Edit: So data stores can be used only in 1 thing, but they have cooldown and messaging server can be used in both things, but there is also problem.

I’m not sure if this is of any use, but I am able to make a server using C++ and SFML (an external, open-source everything you need in 2D library). However, C++ is very difficult to learn, so I would recommend you try to use a nicer language like JS, or even PHP (both of which I am not good at, so good luck). You may need to reference external sources to learn these things.

1 Like