MessagingService: Creating an 'infinite player server'

Update: this no longer works with the recently imposed restrictions, although I’ll consider recreating something similar in the future to work with these changes.

With the release of MessagingService, a wave of creations originally impossible to achieve have began popping up. Developers can now create global chatrooms, easily broadcast global announcements and setup basic match-making systems. However, out of all these, one particular concept really caught my attention: @Hanfian’s ‘infinite player server’

“How on earth did he do that?” was my initial reaction, followed by a week of experimentation with the new API. By the end of the task, I’d created a place where players could walk, swim, climb, dance, chat and interact with other players from completely separate servers live to 3/10th of a second:

https://i.imgur.com/7ZEShcN.mp4


How it was made

  1. Every 1/10th of a second, record information on the server about the player (e.g. did the player jump, chat, where are they standing, facing, etc?)
  2. Every 3/10th of a second, gather these records and fire them to all servers using PublishAsync. We’re firing off every 0.3 seconds as the limitation is 150 + 60 * number of players = 210 per minute = 3.5 a second which means we could fire off a message every 0.286 seconds (to 3dp) before throttling the service.
  3. When the server receives data on a player via SubscribeAsync, add this to a table which is then fired to the client every 1/10th second (we do this to prevent throttling the client).
  4. On the client, use this information and setup NPCs accordingly for each player, replicating their original movements.
  5. If data on a player is not received after x amount of seconds (e.g. 5 seconds), assume the player left and delete the clone.

Creating the first ‘200+ player server’

So obviously I didn’t stop there. With the foundation in place, I set off to create the first ever ‘200+ player server’. Of course this wouldn’t be a ‘real server’ but more of a projection of one to give the illusion that everyone is in one single server.

The first attempt was like a blue whale atop a straw-bridge. As soon as it hit 100+ players, clients would begin to disconnect under the immense strain.

This is where I came up with the plan to introduce a filter system: depending on your ‘intensity level’ (which is automatically set based on the number of players and can also be toggled), information on clones will stop being processed from a certain distance away and their parents set to nil. Additionally, the system was adapted to only introduce 2-3 clones per second, instead of all at once when joining the game. This significantly reduced lag and ultimately helped in hitting the goal of a 200+ player server.

image

On the Saturday, 5 days after beginning development and with the help of @Alvin_Blox, KreekCraft, @DeeterPlays and @ObliviousHD, we achieved our goal of a ‘200+ player server’:

https://i.imgur.com/5AqjLY6.mp4

Above: Hitting 200 players for the first time

https://i.imgur.com/JOtHTrX.mp4

Above: An in-depth look at the filter system with 300+ players


Future possibilities

You can find an open-source version of the project here. Hopefully with more minds involved the concept can evolve beyond a good 'ol rick-roll. Some thoughts so far include:

  • Immersive RPGs/Worlds where players explore all together.
  • Social games like Habbo Hotel or custom houses/builds where players can join other rooms instantly without having to teleport between servers.
  • Playing in-game with others while you play in Studio Test Mode (studio access for MessagingService would have to be enabled first).
243 Likes

Wow! It’s amazing that you guys actually did it! It would be epic to see this implemented, as you said, in RPGs and such. Imo, you guys should make a way to find your friends in a crowd such as this. Maybe have their avatar higlighted with a beacon or something? Thought I could see that being abused in PvP games

21 Likes

Whoever came up with the idea, nice job! Its pretty sick to see there is a way to create a 200+ player server without 200 people actually being in one server.

12 Likes

Wow, that’s actually amazing. I was thinking of how I could do a huge procedurally-generated world where players can play together. Looks like I found the solution. Thanks for making it open source!

12 Likes

Impressive idea, you should definitely try even larger servers. I’m sure it wouldn’t be total chaos.

This is already a thing with Team Create, unless you mean actual servers.

5 Likes

With the GetFriendsAsync API this shouldn’t be a problem! The filter system could also be bypassed in future to exclude certain users, such as friends, ‘clan-members’, people you’re fighting etc, from being hidden.

I haven’t experimented with PvP yet as there’s the additional difficulty of a 0.3 second delay and server verification, however it’s definitely something I’d like to play around with if I have time in the future.

@fireboltofdeath

For this I meant clicking ‘Play Solo’ in a normal studio where you could then mix and interact with other players from actual in-game servers. :wink:

Studio API access hasn’t been enabled for MS yet, however I imagine it would look something like this:

8 Likes

This is probally the coolest configuration of the new updates i’ve seen so far. Amazing what you can do!

8 Likes

I made this before MessagingService came out with an external server, but this is super cool!

1 Like

I can imagine making a continuous world that runs on one server with this. If you have ever played Worlds Adrift, it’d be similar to that. Instead of using messaging service, I’d use my own external server, though.

7 Likes

An excellent idea, this is great in Roblox. :+1:

3 Likes

I have a couple of questions, you said here

does this mean that you can in no way affect other players? like, for example, push them around or jump on their head etc.
My other question is: does the filtering affect people in your server if you had a server with more than one person?

1 Like

When you’re ‘pushing’ someone you’re not actually pushing them. You are pushing a clone of them which was projected onto your client. This means you might see players pushing other players, however that might not be the exact movement they performed originally.

The current project is only designed to work with single-player servers, however I’m sure it could work if adapted slightly.

4 Likes

This is a great usage of the messaging service. especially for RP games for e.x if you want to join your friends but the server is physically full. I’m impressed and can’t wait to see what the community has in store with this service!

6 Likes

Nice use of The new service, although I wouldn’t say this was impossible before. I did this a bunch of times with different ideas with HttpService. I made an infinite player habbo hotel game a while back actually.

5 Likes

This is really cool! I really hope we can see more games create amazing things like this. One thing i plan to do for my game is a cross server faction chat and DM system.

One thing though, why not create like 30 player servers for efficiency? single player servers just seem like a waste, at least like 20 would be good in my view

4 Likes

I know exactly what I would do with this. Is PvP possible?

2 Likes

Good call! Feel free to adapt the system to do this; I designed it like this for the 201 project as it had more of a ‘wow factor’ for players when they realised everyone was in completely separate servers. Obviously you’d have to iterate through players 300 times per second instead of 10 (for 30 PS), however I imagine this wouldn’t be too intensive as you’re only reading data.

@i_ncendiarism PvP is possible, however wouldn’t work in the traditional way where the server receives a request to do damage, verifies the request and damages the target humanoid. Instead, the server would receive a request to damage a player, verify the request, fire this information over the messaging service, and respond accordingly for all clones of the damaged player. The Laggy Cannons principle would be vital for this otherwise players would see obvious delays between striking a player and damage occurring.

4 Likes

Last night i spent way too much time on it, but i’m working on a infinite city system using the open source thing from this thread. It supports building inside and loading it cross server.

It loads the building you’re currently in, so theoretically could be an infinite city size

As you go between buildings, the previous one will get unloaded


using my garbage little building system i made before, i setup predefined objects players can place in their building

my ultimate idea is a fully player generated city that will eventually have cities skylines like building, except each building will have its own interior, and custom buildings as well. Not sure how i want to do it, but i think it’d be a cool tech demo.

17 Likes

Awesome, love how you’re already making good use of the project!

How do you plan on generating the plots for players to build upon and for others to view? For example, is every plot in a fixed position in the world, or will plots appear randomly from a list of pre-generated-player-plots as you walk down the street?

6 Likes

honestly, still trying to figure this out, i think i’m going to attempt to have a “city planner” role that only 1 person can have, and they create roads and place land along it, but idk, it’s really complex and hard to do alone, this is just a tech demo anyway. I dont want it to be a massive grid of squares

6 Likes