Greetings!
I’m attempting to create a game using multiple dedicated servers hosted on a single machine.
Most of the functionality is working, but I can’t seem to use ServerTravel to change maps. When I try, I see this message in the log:
Command not recognized: ServerTravel /Game/FirstPersonBP/Maps/GameplayMap
Since trouble-shooting networking issues tends to involve a lot of background information, I’m going to try to provide a thorough explanation of my setup. Boring details to follow!
General Architecture
I’m attempting to run multiple sessions on a single physical dedicated server.
To achieve that, I have a copy of my game server running before launching the clients. This server is built using the instructions found here.
When a client starts up, I connect to that game server using the OpenLevel blueprint node, specifying the IP address and port of the server.
From this centralized server, clients are able to launch new server instances or find existing server instances to join. Doing either action should move the player to a lobby and (eventually) into a game.
The Test Project
For testing purposes, I display this UI when a client connects to the centralized server:
This user interface breaks down several of the connection activities I’m performing so that I can test them in isolation.
- Refresh List Refreshes the list of buttons on the right based on active servers
- Launch Server Runs the executable for server to start a new server instance (using the next available port)
- Travel Attempts to perform a ServerTravel to change maps
- Close & Exit Some preliminary attempts to terminate remote server instances. Out of the scope of this question, I think
- Join Button (7778) Buttons on the right represent running servers - click to join
Procedure:
- I click Launch Server and wait for the server to finish loading (I send the -log argument for now so that I can watch the server start)
- I click Refresh List. A new button appears on the right with the server’s port.
- I click the button on the right. The server log shows that a client joined it.
- I click Travel. The client log shows the message above (“Command not recognized: ServerTravel”)
Here’s the blueprint code for Launch Server and the join buttons on the right:
And here’s the blueprint code for the Travel button:
Some notes about the travel code:
- The Full Path checkbox switches between using the map’s full path and just its name
- The Replicate checkbox switches between calling the LaunchMap function locally and as an RPC on the server
- For the ExecuteConsoleCommand node, I’ve tried with the player controller connected and with it disconnected
For your viewing pleasure, here’s my configuration for Maps & Modes and the selected game mode. I do have seamless travel checked on.
It’s probably worth noting that I’m not attempting to create/find/join sessions. I was under the impression that using the OpenLevel node to access a dedicated server played a similar role to the session management nodes for listen servers.
If that’s not the case, let me know and I’ll tinker with my test project a bit more.
Here’s the log from my client (with slight modifications and notes):
[Client Log][5]
There are several lines in the log with this message:
SetActiveLevelCollection attempted to use an out of date NetDriver: GameNetDriver
I think this issue is unrelated, but I’d be happy to hear any suggestions for how to solve it, especially if it might explain why the ServerTravel command isn’t being recognized!