Multiple Dedicated Server Management

I have set up a dedicated server using EniGmaa’s Dedicated Server Guide. Now I want to travel between a few servers more like UEtopia’s project (Dynamically create/destroy servers, Server to server travel). He uses asset blueprints onCollide to teleport the player to the other dedicated servers, which is what I want to do. I can’t really follow along since the videos are so heavily compressed, but I only really want to know the basics of starting/shutting down servers from another dedicated server and how to point the client to a different server.

I figure that I can make the server level maps different simply by using the OpenLevel blueprint based on a command-line parameter when starting “MyDedicatedServer.exe -log -MAP=‘Leve84Map’” (for example). If this wise? If not, what would be a better way of managing several dozen dedicated server instances with different maps/content? How does the client select a different DedicatedServer.exe instance to connect to on the same IP address? I already plan on coordinating game info between the server instances with VaRest and a Django/MariaDB miniserver. I think the dedicated servers themselves would save their state in standard save slots.

How do I handle the enterprise of building a few dedicated servers?

Thanks for your help!

P.S. I’m zoyic on IRC freenode #unrealengine
P.S.S. This disappearing post thing happens a lot, doesn’t it…? I think it doesn’t like my links…

Some handy resources I’ve looked at below (collection for future devs):

Dedicated Server Guide (Windows & Linux), Support Thread

Login, Persistence and Server Travel walk-through
UEtopia Server Travel Walk-through (Youtube) 1 2 3 4
Server Travel and Persistence
Infinite Worlds
Youtube: Unreal Engine 4 Good to Know - Shutting Down A Dedicated Server
Gameplay Framework Quick Reference
Unreal Engine 4 Documentation: Networking and Multiplayer
Youtube: Replication | Live Training | Unreal Engine
Youtube: Unreal Engine 4 Good to Know - Shutting Down A Dedicated Server

As your first post, it has to be approved by a moderator. That is why your other threads did not become visible.

I’ve since learned a lot since I wrote topic: I can open 4 dedicated server instances from the command-line. I can use collidable sphere actor blueprints to trigger client-travel to other servers (mostly). I can control non-character Pawns from server (possessed physics vehicles), but I can’t yet use them to trigger client-travel to other servers.

Creating/Destroying Servers: You can use command-line arguments to start dedicated servers on a specified port and into a specified map. Right now I do this with a batchfile (on Win) with lines like this: “START NetServer.exe /Game/Maps/map_MyMap -PORT=7778 -log”. According to this video, I can shut them down from a blueprint, too (say, from a delay after having no players. I haven’t actually done this yet, though). The short-term goal is to have a client boot up, make a VaREST query to figure out what IP/Port it should connect to, the RESTful miniserver will boot up the server if it’s not already up, and when ready the client OpenLevel’s to it. I hear running many of these dedicated servers is performance intensive, so it needs to be actively managed. I figure dozens of worlds with hundreds of players and I’ll need to start spinning off to other hardware/virtual servers (it fits my needs right now, though, thinking about dozens of players on a handful of maps).

Controlling Clients and Pawns: I’m having a hell of a time figuring out when code is running on the server and when it’s running on client. I think I’m going to assume that it’s always running on the server unless (a) it comes from an input, (b) it’s in the PlayerController blueprint, or (c) I made a Custom Event specifically set to ‘Replicates: Run on Server’ or ‘Replicates: Run on Owning Client’. I think I simply require a better understanding of the blueprints architechture and what does where: PlayerControllers, PlayerStates, GameModes, GameInstances, Pawn blueprints, etc). Youtube: Replication | Live Training | Unreal Engine and Unreal Engine 4 Documentation: Networking and Multiplayer were really good here, but I still can’t get my OpenLevel->another-dedicated-server to run only on the client I want; it keeps either sending all players to the other server or no one at all (and occasionally, back to EntryMap, for some reason). I am making liberal use of IsPlayerController.

When using ThirdPersonCharacter I can mostly get it working [1]. When possessing Pawns, I am attaching my Pawn’s (say, a possessable directly-controller hoverboard blueprint) original PlayerController (before the server was the Controller), and using IsPlayerController, but this always returns FALSE no matter what. I am connecting the MoveForward, e.g inputs directly to RunOnServer CustomEvents, in which I do the actual translation. I think IsPlayerController is FALSE because this RunOnOwningClient SendToAnotherServer Custom Event is in my TeleportPortal Blueprint, which I think is ‘owned’ by the server. I was thinking it was best to make a NetEnabledPawn parent blueprint so that server-controlled pawns know my original PlayerController. Otherwise it may be better to reformat my project to properly use PlayerControllers and to run my CustomEvent(RunOnOwningClient)->OpenLevel->another-dedicated-server blueprints in that PlayerController for it to work. Does anyone know?

Does this thinking make sense? Or have I fundamentally misunderstood something about the way dedicated servers work in UE4?

[1] I have gotten it to work on occasion, though, with a hack. I make a Custom Event that casts GetPlayerController into PlayerController and then onFail is prints an error. This works even when I don’t use the resulting PlayerController for anything. Weird.

Hey Zoyic.

Check out the new 4.17 updated walkthroughs.