Are persistent game servers possible. (24/7 servers)

You could save their current server ID + game version into a datastore and then if they reconnect, teleport them back if the prior server is still up to date.

No servers on Roblox are up 24/7. They go down when Roblox updates or does maintenance or if there is an outage. So keeping a server ‘alive’ is not the route you want to go. Instead you will want to simply save their current progress. You can keep their stuff in that server so if they join the same server, their stuff will still be there if you did not clear it when they left, however if they join a new server, you will have to load their data again. You would then need to simulate any time passing if you want things to happen to their stuff while they were offline.

1 Like

I understand that 24/7 servers are currently not available.
I was looking more for a better way to approach this desired effect. It would work with multiple players rather than one. You could choose like Server #1 leave with house 21 owned and re-join and still own it. And your neighbours would also stay the same (assuming they didn’t sell the house etc)

An easier way to put it is like FiveM if you don’t know what that is, it’s a GTAV client addon used mainly for roleplay servers.

Associate data with a server name. When a new server starts register it as one of those server names. Then when the server is initializing you can go ahead and load “Alpha” server’s data as long as no “Alpha” server currently exist.

Then players who played on “Alpha” recently can go ahead and resume where they left off. Assuming all of the data you saved for the “Alpha” server was properly serialized.

You would have to save game states then. And have players join into different game states from the available server listing that you provide (See TeleportService:ReserveServer() ). If a world is full they would have to wait until a slot is open or join a different server (which would have different content because the player’s stuff is in Server 1 instead of Server 2.)

The issue with this though, is that actual games that implement this have the same problem. So the solution you’re recommending here isn’t even a proper solution. There’s things like priority queues etc. But if the server is full the server is full. You’ll need to wait anyway. That’s the thing about a unique persistent world. Only one exist.

There’s also games with offline raid protection which helps with this issue.

Yeah, I would implement a queue system. And have a lot of servers to make up for it. Some different sizes, voice chat enabled. Different regions maybe?

Currently voice chat is limited to 30 player experiences. Different sizes sounds like an interesting plan though. As far as the different regions go. I’ve also thought about going that way with my game. But currently have no plans to do so. I’d recommend to build the first world first before tackling those extra things. As currently they would just make development more difficult if you don’t have a solid foundation.

Great point, will definetly get basic features like a few houses then experiment with 24/7 server stuff. < we need a name for that lmao.

edit: let’s just go with “Resumeable Server”

1 Like

You can just save on an interval. Plus you can save the state of the world when the server is closing using game:BindToClose.

@DrShockz the official term for it is a persistent game server.

This has me really interested in making a persistent server module. I will now add that to my todo list. I will get see if I can get a prototype working by tomorrow and update this here.

Edit: So this is a lot more in-depth than I thought. While I still believe it to be possible, it is quite involved. Saving parts and their properties is easy, but saving everything is rather difficult. It may take longer than a day to get a feasible prototype lol

2 Likes

Thanks for that terminology. Will look into.

1 Like

Sounds great! I’ll also share my progress down the track.

I’ve also found this thread: Persistent Servers?
and video in it: Roblox server persistence - YouTube

This thread looks promising!

You can create the illusion of persistent servers by defining, say, Server 1, Server 2, Server 3, and then creating a server browser GUI where players can select one of the servers. Once a player tries to join a server, you have to load all the data that’s been saved on it.

Yep, plan on having lets say two databases, one for storing data to a server name. And another for checking wheter or not that server is already live.

It is 100% impossible. You wouldn’t expect a bot to be in a server for 24/7 because no one would do that and Roblox will automatically kick the bot after 20 minutes of inactivity.

An actual persistent server is, as ROBLOX doesn’t support that, but you can imitate it as by the examples others have said in this thread. Namely using :SavePlaceAsync()

I was working on something like this a while back.

You can use datastores to store static data under a generated static id (the data you want to persist after shutdown) and memorystore to store temporary data such as the server’s static id and player count under a dynamic id, for which I used the code returned by ReserveServer.

Next you’ll need a way to display a server list. I used messagingservice to send constant pings from the running game servers, which lobbies then caught and displayed. When someone tried to join a server, a ping would be sent to check if the server is trully running (dynamic data might persist if the server crashes). This is actually where I encountered an issue. Messagingservice can throttle, meaning a response might not arrive on time, so you might end up with multiple instances of the same server.

Finally, if you want a genuine persistent server feeling, you can increment actions such as item smelting by comparing the current timestamp to the one before the shutdown.

3 Likes

Thanks! This is very handy. Will tryout soon!