I’m creating a server browser that allows players to create reserved servers and other players can join those servers. However, I’m conflicted on which way to send the data to the player so it can be displayed.
The following data needs to be sent: server name, player count, maximum player count, ping, server uptime, server location, server creator, server UUID, and possibly more in the future.
Here are my options:
A folder in ReplicatedStorage would be created to store the data of each server. Each server is a folder with attributes that contains the information said above.
A RemoteEvent/RemoteFunction would be used to send an array of arrays that contain the data mentioned above. Alternatively, I could only send batches at time, only when the player requests it (e.g., 10 at a time when they click the next page button).
My question is which would be easier to implement features such as filtering and sorting, and more importantly, the most performant (especially with a large player base).
MessagingService | Documentation - Roblox Creator Hub is the easiest way. Just update it around every 30 seconds per server. The harder way is MemoryStoreService | Documentation - Roblox Creator Hub. Ive seen people make real time cross server players using it because its less strict. But even I dont fully get how it works. Id stick to messaging service but if you want faster update speeds (like every 4 seconds) you can use this.
If you mean sending the data to the clients, RemoteEvents are sufficient.
I wrote the back-end before MemoryStoreService was released, so I was using MessagingService + DataStoreService. If it was temporary matchmaking, MemoryStoreService would be a godsend, but fortunately, that’s not what I’m making. I won’t elaborate further on this as the back-end design is not the topic.
For now, could you explain why Option 2 would be superior to Option 1, while I wait for more people to voice their opinions.
Messaging service would work for this, you could send a update every 30 seconds and on the server browser you could also update the data. For an example you send to the server browser how long the server has been up ie: 1 Day | 3 Hours | 5 Minutes | 3 Seconds and then the server browser could update that data every second and just sync the data when the next message comes in.
Maybe I should have worded my post better, I’m not talking about the back-end. I think your method is inefficient. I only PublishAsync when a new server gets created, or when a player joins/leaves. Ping gets sent along with the player count. As for server uptime, I just use os.time().
Option 1 would take more memory. It would have to load in the game, and if its updated frequency, it would replicate alot, causing some uneeded usage. Remotes are just simplier. Dont fire it every time a server updates, maybe beam all the servers to the client every 10 second, slightly below update speed you use to consider offsets.
To be honest, both would work fine, but, its up to you.
Now the question becomes which is faster: a bunch of attributes being replicated or multiple bytes of data (may be in the hundreds for the first request) being sent to each client. I might not even need a 10 second interval because the data is only being sent when the player count changes (ping gets bundled along with it).
If I can’t find any conclusive results, I’ll do a benchmark on a live game.
Remotes would be quicker. Theres no extra steps. You just send it. However, if you use multiple attributes it’ll have to replicate and fire roblox events and all that blah blah. Benchmarking would be a great test. Honestly, the difference between the two is not noticeable but a test would be conclusive.