Hello,
I am implementing a multiplayer game using UE5.1 with Dedicated Server. I have a question regarding level transitions for multiple players.
When I use OpenLevel or ServerTravel to move Player A from Level A to Level B, Player B also moves from Level A to Level B simultaneously. Is it possible to move only Player A to Level B while keeping Player B in Level A?
Furthermore, after Player A moves to Level B, I would like both players to be able to see each other when I move Player B to Level B as well.
Thank you.
The built-in ServerTravel & Open Level simply change the map on the currently connected server. So you aren’t leaving it. A single server instance can only run a single map at a time. All players connected to it will be on the same map/level.
Moving from one server to the next requires a “Quit/Leave” on the current server. This is because you are literally disconnecting from the current server. Severing connection.
The architecture needed depends on the max number of players a level can hold and how many levels there are. Yet overall you need a Matchmaking service that the game servers and/or the player (client) can communicate with directly.
Player A is on Map Y and wants to go to Map X.
Game server Y sends information to MM… [player A to map X request].
MM sends a quit & join command to Player A to join game server X.
Therefore, you will need a dedicated server for MM.
If you want all players on Map Y to be able to join the Map X server that Player A is, but at various times. Then MM needs to group all players into an array per server instance.
When Player B/C/D/E etc eventually want to go to Map X. MM looks up his/her group, sees which instance is running Map X (server IP) and sends Player B the join notification.
This is a very complex setup. I’m not sure you will find any pre-existing code or marketplace assets for this.
You will also probably need on-demand instancing. Meaning if Player A wants to go to Map X and there currently isn’t a server running Map X, one needs to be spun up for it.
Running 24/7 instances of each map on dedicated boxes will get costly, very quickly. So Cloud based “On-Demand” servers (AWS, Google, IBM) would be the best route. A kubernetes (K8) architecture to automate a lot of this would be highly recommended.
2 Likes