MessagingService: Creating an 'infinite player server'

Even if the Cframe is in a table, it can’t be published?

1 Like

Yep, if it’s not a UTF-8 character, even in a table, you will receive an error. Instead, do:

local position = part.Position
local table = {X = position.X, Y = position.Y, Z = position.Z}
publish(table)

function receiveTable(table)
	local position = Vector3.new(table.X, table.Y, table.Z)
end
1 Like

How about JSON encoding and decoding the table?

EDIT: Woops, sorry I forgot that you can only JSON encode strings, numbers, tables, and booleans.

1 Like

Just made a PvP infinite player server on my own version of this, it isn’t the best since it doesn’t replicate health, no death body parts breaking effect, superball gear equipping not replicating, etc. but it is sure worth checking out!
(So far you can use a sword and a superball!)
https://www.roblox.com/games/2982617349/PvP-Infinite-Player-Crossroads

3 Likes

Could you walk through the code in a little more detail sometime?

1 Like

The future is now. This is quite impressive!

I mean seriously. This opens so many doors, even on the development-side of things. I’d love to see players interacting with my game in real-time via studio. I never would have imagined using MessagingService for this, so huge props to you!

4 Likes

How do you Handle the resource usage of Humanoids in large quantities impacting Performance?

1 Like

As explained in the main post, literally hiding NPCs (character.Parent = nil) when their position exceeds the filter limit and blocking all information about them. By doing this, you hardly have to worry about the cost large amounts of humanoids pose in the first place.

If you were looking to handle lots of humanoids however, a good method is as Rawblocky proposed, anchoring the HRP and using TweenService instead of humanoid:MoveTo().

You’ll find a great deal of developers create their own character rigs without humanoid because of the cost it has on performance in large quantities.

5 Likes
Didn't see that in Search

I am currently working on a game featuring a large amount of NPCs after researching and testing I found that Disabling HumanoidStates and Collision isn’t enough to handle 200+ NPCs (for my laptop).

I thought Character.Parent is locked last time I messed with it

I’ll take note of anchoring the HRP and using TweenService instead of humanoid:MoveTo() and creating a Custom Humanoid or maybe look into using Luanoid.



Thank you for the Response.

4 Likes

Wow i never thought the service could be used for something like this. How creative!

3 Likes

This is simply amazing! Great job on this! Also, maybe perhaps start working on reducing the delay?

WOW! This helps game developers to reduce the lag on a server, it’s incredible :star_struck:

1 Like

I’ve been meaning to include this since I first made the post; here’s the footage of @Alvin_Blox hitting 200+ players for the first time:

5 Likes

This is really neat and useful. Thanks aha

1 Like

Yes! I had the exact same idea! A really cool thing to try would be updating. As a server shuts down when the player leaves, you would eventually have all the servers at the same version and there would be no need to shutdown the game.

1 Like

Would it be possible to only replicate users in a certain area (f.e. inside of a 10x10 square), rather than replicating a whole server.
Also adding on to that, would it also be possible to duplicate administartive commands working on those servers, for example you type :m test on one server, would that replicate to the rest of them?

I wouldn’t recommend using this as the method relied on the old MessagingService limitations, to which the current one is limited and does not scale well for large numbers of players.

1 Like

With the new limitations, we’re restricted to ~1 message every 3 seconds, as apposed to ~1 message every 0.3 seconds when I first wrote the article. It’s absolutely still possible, it just means there will be a more visible delay.

Instead of recording and sending data of every player in the server, simply do the same but for players located within a restricted area (i.e. using functions such as FindPartsInRegion3, GetTouchingParts or DistanceFromCharacter). I’ll probably have a go at this myself when I have some time in the near future.

I’m actually setting up a global system to do exactly that for HD Admin, so feel free to use the source code from that once it’s released.

2 Likes

If you complete it with HD Admin - try to use Kohls (Infinite) as it is also one of the larger administrative command modules.

I might make this but with an external server to get much better speed and more messages/sec. Keep an eye out

4 Likes