I got a strange question. Imagine you’re creating a game, and that game has sub-places. Is there a way to make it so that if you join a private server and then try joining the sub-place in that private server, they are also a private server?
But when the player leaves the private server, the sub-place no longer exists, or at least it stays and can be reused non-stop for that person’s private game without using datastore.
Currently, there’s a thing called TeleportService in Roblox , and most people online say to use ReserveServer to basically create a private server within a private server. But the issue is, a friend would need a code to that reserved server to join which is fine I guess. Secondly, if you use ReserveServer, that server is always there, even if the player leaves and no one is in it and also no one owns that reserved server. Lastly Some people said use datastore to save the reserveServer for that private Server but now you need to relay on datastore which I don’t want to use .
The goal is it possible to create a private server for a specific place instance and have that private server have a id a friend can use to join and also have that server be deleted when no one is in it.
The photo below is an example of how that sub private server is only for that private game and will be gone once it’s shut down.
you can make a private server with a reserved server and copy the code and save it in a datastore then if a friend trys to join you can use the Player.FriendStatusand and PlayerService:GetFriendsAsync(), to see if the friends tries to join private server and then if they try you can get the code from datastore and send them to the reserved server. idk if this will work but i would do it like this, also there might be some settning out there so you don’t need to do this steps
This method is what most people use but the issue is what a reserved sever actually is. No one owns it and once’s it’s created it’s always there. My issue is I don’t wanna have to use a datastore for a reserved servers to keep track of the join ID.
It’s another datastore having to manage in the game, memory stores could work. However an issue is that the game would probably have many requests for getAsync already because the main game is just a hub like place where everyone’s data is being displayed, in total I’d say there’s around 3 requests per player because of the 3 game-mode data being requested ( game modes are completely different games technically so they don’t share data between modes ). However other than that the main issue is the reserved server that’s never gone I want it gone when it’s not longer in use and not have to store that server.
There is no limit to how many datastores you can have so I don’t see a problem in this. Yes, memory stores are also a great alternative but I would suggest you use datastores, you can use SetAsync to set a reserved server and never use it again as reserved servers last forever.
As for rate limits, you said 3 per player. How often is this “3 per player” though since datastore and memory store rate limits depend on the player count 60 + 10 * (number of players in the server) for getasync and setasync; 1000 + 100 * (number of concurrent users) for memory stores.
You could also try lowering this limit by saving them in a single key but I do not know how your game functions / if they hold large amounts of data.
can’t really give a example of the amount of data per gamemode but lets say that one of the game modes saved data could be on par with a a game like Creatures Of Sonaria or a dinosaur game with extra bits of info like skill points. Reserved servers last forever. Is there a limit to how many Reserved servers I can have? So if I make one and then never reuse the same one, does it matter?
Also, how would most games, like Doors or your average horror game, handle this where people get teleported as parties to an empty server? are those reserved servers they get teleported to or are they something different entirely and if they aren’t Reserved servers can people be teleported to them anytime?
Afaik there is no limit to how many reserved servers you can have or else most games like doors as you mentioned could potentially break.
You can use TeleportToPrivateServer to teleport players to a reserved server. The player paramater acceps an array of players so that is how games like doors teleport multiple players to a game. And no, you can’t teleport inside a reserved server unless you have the access code.
As for data / rate limiting, the rate limits above are minute based rate limits so as long as you aren’t going above those per minute you are fine to use SetAsync and GetAsync.
What do you mean exactly? There is no guarantee that a player will be friends with another when joining a private server, they might have joined through a link.
so one thing I could do is just make a reserved server and then never reuse? there wouldn’t be any issues if I just make a new one every time? do most horror games teleport people to reserved servers that are premade or a new one ever time I doubt they save reserved servers id to join again
They probably make a new one, you don’t have to save the access code for those types of games but for your type, you do. This is needed so players are able to teleport to the same reserved server instead of a new one preventing seperation. Now, the reserved server can get full, to prevent this you can either track the player count using Datastores or use TeleportResult to determine if it is full or not; in this case you would have to reserve a new server and direct players there.
The method I mentioned above is only if you can dynamically teleport to these places (for example Player A joins the subplace leaving the private server, Player B later joins to the subplace through the private server expecting to be in the same server as Player A in which you would need to save the reserved code), if it’s a one time teleport then you can simply reserve a server and teleport the players there.
Couldn’t I instead use a system that sees all your friends in-game, and then if they are in a private server, it uses a messaging service to get their servers I’d code to allow them to join, so friends can join without us needing to use a datastore, and to make it even easier, if I can’t get the code for the server to join for some reason, I can just send it as a piece of data through the server teleportation service part that allows us to send data when the Reserved server is being created, and then on that place instance, it saves that key somewhere where the messaging service can use it to send to your friend when they try to join that so we don’t need to use datastores? Or is this not a good idea?
Hmm, I thought you were dynamically teleporting from a place to a subplace (basically creating a reserved server on the subplace which acts like the normal private server, whenever players are teleporting to the subplace from the private server they will be teleported to the reserved server) sorry if I misunderstood you.
Yes, this is another way. For this you can utilize GetFriendsOnline. Loop through the table to check for any friends playing the game.
The idea is to basically create a private server in a sub place. What I’m thinking is basically create a reserved server for that sub place if the player joins through private servers and then if a friend tries to join it use messaging service to get the id of the reserved server they are in to allow them to teleport to that sub place reserved server. And ya the GetFriendsOnline will help like you said.
Hmm, not all users that have access to a private server are that users friends though, they can join through a link unless you are talking about a custom system.
Your idea seems valid though, you can use placeid_privateserverownerid for the message topic so it doesnt collide with other requests.
Also is there any reason for avoiding datastores, yes they have rate limits but they are much easier to setup in occasions like this.