# How can I change the level for all connected clients in a multiplayer game?

**URL:** <https://forums.unrealengine.com/t/how-can-i-change-the-level-for-all-connected-clients-in-a-multiplayer-game/284760>\
**Category:** Multiplayer & Networking\
**Tags:** unreal-engine, Multiplayer, question\
**Created:** [June 2, 2014, 12:52am UTC](https://forums.unrealengine.com/t/how-can-i-change-the-level-for-all-connected-clients-in-a-multiplayer-game/284760 "2014-06-02T00:52:39Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rouby](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Rouby](https://forums.unrealengine.com/u/Rouby)\
**Post date:** [June 2, 2014, 12:52am UTC](https://forums.unrealengine.com/t/how-can-i-change-the-level-for-all-connected-clients-in-a-multiplayer-game/284760/1 "2014-06-02T00:52:39Z")

</div>

How can I change the level for all connected clients in a multiplayer game? Preferably in blueprints…

I currently try to multicast a “Open level” node with the new level name. The level gets loaded on all clients but the clients seem to be not in the same level (they do not see each other)

Also I would like to pass on some information, how do I do this in blueprints?

---

<div class="post-metadata">

**Author:** ![Steve\_Allison](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Steve\_Allison](https://forums.unrealengine.com/u/Steve_Allison)\
**Post date:** [June 2, 2014, 8:50pm UTC](https://forums.unrealengine.com/t/how-can-i-change-the-level-for-all-connected-clients-in-a-multiplayer-game/284760/2 "2014-06-02T20:50:30Z")

</div>

Hey Rouby,

This is similar to a question asked previously, seen here: [How do I switch maps with a host and bring the clients along? - Multiplayer & Networking - Epic Developer Community Forums](https://answers.unrealengine.com/questions/41834/console-command-to-bring-clients-with-host.html)

Hope that helps!

-Steve

---

<div class="post-metadata">

**Author:** ![Rouby](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Rouby](https://forums.unrealengine.com/u/Rouby)\
**Post date:** [June 3, 2014, 8:41am UTC](https://forums.unrealengine.com/t/how-can-i-change-the-level-for-all-connected-clients-in-a-multiplayer-game/284760/3 "2014-06-03T08:41:24Z")

</div>

I tried that command, but the clients dont load the map?  
The console spams this line:

LogNet: NotifyAcceptingConnection: Server Chess refused

Also there are some hints, that the old gamemode gets carried over?

LogNet: Browse: 127.0.0.1//Game/Maps/DesertArena?game=/Game/Blueprints/ChessGameMode.ChessGameMode\_C

---

<div class="post-metadata">

**Author:** ![Steve\_Allison](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Steve\_Allison](https://forums.unrealengine.com/u/Steve_Allison)\
**Post date:** [June 3, 2014, 9:57pm UTC](https://forums.unrealengine.com/t/how-can-i-change-the-level-for-all-connected-clients-in-a-multiplayer-game/284760/4 "2014-06-03T21:57:47Z")

</div>

Just to clarify, you’re running that command from the server only, correct?

---

<div class="post-metadata">

**Author:** ![Rouby](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Rouby](https://forums.unrealengine.com/u/Rouby)\
**Post date:** [June 4, 2014, 12:02am UTC](https://forums.unrealengine.com/t/how-can-i-change-the-level-for-all-connected-clients-in-a-multiplayer-game/284760/5 "2014-06-04T00:02:06Z")

</div>

Yes, I have a “switch has authority” inbefore and am sending the command to reliably execute on the server (on my game state blueprint)

If I play without a dedicated server, only the (listen)server jumps to the next level, if that helps

---

<div class="post-metadata">

**Author:** ![Rouby](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Rouby](https://forums.unrealengine.com/u/Rouby)\
**Post date:** [June 5, 2014, 7:25pm UTC](https://forums.unrealengine.com/t/how-can-i-change-the-level-for-all-connected-clients-in-a-multiplayer-game/284760/6 "2014-06-05T19:25:24Z")

</div>

Any news on this topic?

---

<div class="post-metadata">

**Author:** ![Crzyhomer](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Crzyhomer](https://forums.unrealengine.com/u/Crzyhomer)\
**Post date:** [June 5, 2014, 8:24pm UTC](https://forums.unrealengine.com/t/how-can-i-change-the-level-for-all-connected-clients-in-a-multiplayer-game/284760/7 "2014-06-05T20:24:24Z")

</div>

Tell me a little more about what is going on.

You start a game with `mapname?listen` and several clients join somehow? Via `open someipaddr` on the console window?

Now you have several clients connected to an existing server and you want to have the map switch?

You should be using seamless travel (`bUseSeamlessTravel` set on the `AGameMode` class) and then do this

```
FString UrlString = TEXT("nextmapname?otheroptionsyouwant");
GetWorld()->ServerTravel(UrlString);

```

This will keep connections alive for all existing clients, load a transition map, unload your old map, then load the new map. This keeps high memory watermarks from causing Out Of Memory conditions.

To do seamless travel you need some settings in DefaultEngine.ini

```
[/Script/EngineSettings.GameMapsSettings]
GameDefaultMap=/Game/Maps/MyGameEntry
ServerDefaultMap=/Game/Maps/MyGameEntry
GlobalDefaultGameMode="/Script/MyGame.MyGameMode"
GlobalDefaultServerGameMode="/Script/MyGame.MyGameMode"
TransitionMap=/Game/Maps/MyGameTransition

```

The transition map can be anything; a blank, empty map is best. You can actually have things load and display during the map transition (like the Gears of War scoreboard with particles floating in the background), which will go away when the new map is loaded. I don’t know much about how the content is setup for that, but an empty map should suffice for now.

Clients shouldn’t have to do anything special during seamless travel. If you see

```
LogNet: NotifyAcceptingConnection: Server Chess refused

```

It’s most likely because seamless travel is off, the clients were disconnected, and they are trying to get back in. If you “hard travel” back to another world and didn’t include the ?listen then the new server destination won’t be setup to receive clients. Seamless travel handles this for you.

Also, during seamless travel there is a garbage collection step that takes place between loading the new world and unloading the old. We make sure nothing references the old world (causing a memory leak). If you have any AActors or UObjects that refer to the old UWorld that get carried over to the new map then you’ll get an assert about the old world still staying around. Hopefully this won’t be the case for you, but if it does we can talk about that too.

I hope this helps. This stuff isn’t that straightforward and documentation is on the way.

---

<div class="post-metadata">

**Author:** ![Rouby](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Rouby](https://forums.unrealengine.com/u/Rouby)\
**Post date:** [June 5, 2014, 9:19pm UTC](https://forums.unrealengine.com/t/how-can-i-change-the-level-for-all-connected-clients-in-a-multiplayer-game/284760/8 "2014-06-05T21:19:41Z")

</div>

Hi, thanks for the in-depth answer.

I am currently doing all my game-logic inside of blueprints. Is it possible to do this seamless travel (or any travel at all) via blueprints at this moment (or anytime)?

I start my debug-session with two clients via the play-in-editor feature with Num. clients set to “2” and checked “Run Dedicated Server”.

---

<div class="post-metadata">

**Author:** ![Crzyhomer](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Crzyhomer](https://forums.unrealengine.com/u/Crzyhomer)\
**Post date:** [June 10, 2014, 6:42pm UTC](https://forums.unrealengine.com/t/how-can-i-change-the-level-for-all-connected-clients-in-a-multiplayer-game/284760/9 "2014-06-10T18:42:29Z")

</div>

Sorry for the delay.

I was looking through the GameplayStatics to see if there was a travel function exposed to blueprints. I’m told there is, but I haven’t found it yet. I see OpenLevel, but I’m not sure that is going to do what you want. It calls SetClientTravel which would move a client to another server, but I don’t believe it will take a server and bring clients along with it. You could try that for now and see what happens.

It is already on the roadmap to make travel/multiplayer a lot more friendly to blueprints.

---

<div class="post-metadata">

**Author:** ![Rouby](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Rouby](https://forums.unrealengine.com/u/Rouby)\
**Post date:** [June 10, 2014, 9:59pm UTC](https://forums.unrealengine.com/t/how-can-i-change-the-level-for-all-connected-clients-in-a-multiplayer-game/284760/10 "2014-06-10T21:59:35Z")

</div>

I did try to use OpenLevel before I used the execute console command method. It didnt travel with clients / reset the connection.

---

<div class="post-metadata">

**Author:** ![Rouby](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Rouby](https://forums.unrealengine.com/u/Rouby)\
**Post date:** [June 16, 2014, 1:12am UTC](https://forums.unrealengine.com/t/how-can-i-change-the-level-for-all-connected-clients-in-a-multiplayer-game/284760/11 "2014-06-16T01:12:57Z")

</div>

I did implement the steps you mentioned in your first post, but when I execute the Travel-function the editor crashes:

> **[!Id:1e14875c631d9e7506678363f9b3ba37Unknown exception - code 00000001 (first...](https://pastebin.com/qgqvKQQQ)**
>
> Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.

Also I get this message in my log files

[2014.06.16-01.20.17:112][975]LogWindows: World /Game/Maps/DesertArena.DesertArena not cleaned up by garbage collection!  
World /Game/Maps/DesertArena.DesertArena [target] (root) (standalone)

I couldnt reply to your top-post somehow…

---

<div class="post-metadata">

**Author:** ![Crzyhomer](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Crzyhomer](https://forums.unrealengine.com/u/Crzyhomer)\
**Post date:** [June 16, 2014, 2:35pm UTC](https://forums.unrealengine.com/t/how-can-i-change-the-level-for-all-connected-clients-in-a-multiplayer-game/284760/12 "2014-06-16T14:35:41Z")

</div>

The crash you mention in the pastebin I’m not sure what that is because it is in some custom code, ServerMovePieceToField\_Implementation().

You’d have to tell me what engine function you are calling on line chessgamestate.cpp:108

However, the log you provide above indicates a common problem when dealing with seamless travel and is an indication of a potential memory leak. This is why we assert there. Some AActor or UObject has a reference chain that leads back to the old UWorld. When this happens, the entire world would fail to unload through garbage collection.

After that message above should be a reference chain list from the world to the offending object. You may need to clear out a UObject pointer reference or use a weak pointer on some object to break the chain.

---

<div class="post-metadata">

**Author:** ![Rouby](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Rouby](https://forums.unrealengine.com/u/Rouby)\
**Post date:** [June 16, 2014, 3:07pm UTC](https://forums.unrealengine.com/t/how-can-i-change-the-level-for-all-connected-clients-in-a-multiplayer-game/284760/13 "2014-06-16T15:07:36Z")

</div>

Im just calling GetWorld()-\>ServerTravel(UrlString);

> **[\[2014.06.16-15.04.54:378\]\[722\]LogLoad: World...](https://pastebin.com/WAVXtFrX)**
>
> Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.

Is this the reference-graph you mentioned? If so I cant tell what I need to fix…

---

<div class="post-metadata">

**Author:** ![Crzyhomer](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Crzyhomer](https://forums.unrealengine.com/u/Crzyhomer)\
**Post date:** [June 16, 2014, 10:12pm UTC](https://forums.unrealengine.com/t/how-can-i-change-the-level-for-all-connected-clients-in-a-multiplayer-game/284760/14 "2014-06-16T22:12:22Z")

</div>

Can you tell me a little bit more about the transition process. What map do you start in, what is your transition map name, what is your destination map name? Are they all different, if only to test. You can go A-\>transition-\>A. But shouldn’t try to go A-\>A directly.

---

<div class="post-metadata">

**Author:** ![Rouby](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Rouby](https://forums.unrealengine.com/u/Rouby)\
**Post date:** [June 16, 2014, 11:27pm UTC](https://forums.unrealengine.com/t/how-can-i-change-the-level-for-all-connected-clients-in-a-multiplayer-game/284760/15 "2014-06-16T23:27:25Z")

</div>

I start in a simple map with a chessboard and the pieces, at some point my gamestate get the server-replicated call from one client to move a piece to a specific position, the gamestate then calls ServerTravel (to the arena-map)

I dont think I create any objects or actors that have pointers to the current map (chess-map)… how can I check this?

Start map : /Game/Maps/Chess

Transition map : /Game/Maps/TransitionToArena

Destination map: /Game/Maps/DesertArena

---

<div class="post-metadata">

**Author:** ![Rouby](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Rouby](https://forums.unrealengine.com/u/Rouby)\
**Post date:** [June 19, 2014, 1:47pm UTC](https://forums.unrealengine.com/t/how-can-i-change-the-level-for-all-connected-clients-in-a-multiplayer-game/284760/16 "2014-06-19T13:47:36Z")

</div>

Im still stuck at the garbage collection error, can you please tell me more on what I should focus? Seamless travel still crashes the whole editor, normal travel works, but I would like to get my clients follow the server to the new map 😕

---

<div class="post-metadata">

**Author:** ![Crzyhomer](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Crzyhomer](https://forums.unrealengine.com/u/Crzyhomer)\
**Post date:** [June 19, 2014, 3:06pm UTC](https://forums.unrealengine.com/t/how-can-i-change-the-level-for-all-connected-clients-in-a-multiplayer-game/284760/17 "2014-06-19T15:06:38Z")

</div>

Sorry, trying to stay on top of this, but GC bugs can be hard to track down sometimes.

Can you run your game outside the editor? Still using the editor binary, but with

UE4.exe YouGameName mapname?listen -game -log

and then do your travel. I would like to see if it’s something special about PIE or if the same GC problem occurs. There are ways to debug GC, I will probably need to ask for some assistance with people who know it better. The reference graph in your case isn’t very descriptive unfortunately.

---

<div class="post-metadata">

**Author:** ![Crzyhomer](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Crzyhomer](https://forums.unrealengine.com/u/Crzyhomer)\
**Post date:** [June 20, 2014, 2:41pm UTC](https://forums.unrealengine.com/t/how-can-i-change-the-level-for-all-connected-clients-in-a-multiplayer-game/284760/18 "2014-06-20T14:41:28Z")

</div>

Still working on this, I haven’t forgotten about you 🙂

The new map is the one that is showing up in the error message, I didn’t notice that until just now. Our function may be missing something.

You are running within the editor right, loading Chess, clicking the PLAY button (what are you settings there?), then clicking something in your game that initiates the travel right?

---

<div class="post-metadata">

**Author:** ![Rouby](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Rouby](https://forums.unrealengine.com/u/Rouby)\
**Post date:** [June 20, 2014, 2:58pm UTC](https://forums.unrealengine.com/t/how-can-i-change-the-level-for-all-connected-clients-in-a-multiplayer-game/284760/19 "2014-06-20T14:58:23Z")

</div>

Thanks 😉

Yes im testing this all in the editor, I have it setup to run 2 clients (and tried with or without dedicated server) and the travel occures when I move a chesspiece onto a specific field.

---

<div class="post-metadata">

**Author:** ![Crzyhomer](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Crzyhomer](https://forums.unrealengine.com/u/Crzyhomer)\
**Post date:** [June 20, 2014, 6:31pm UTC](https://forums.unrealengine.com/t/how-can-i-change-the-level-for-all-connected-clients-in-a-multiplayer-game/284760/20 "2014-06-20T18:31:15Z")

</div>

Ok I’m going to work with QA to see if we can repro this. Our editor validation code is slightly different (and newer).

Have you tried running your game outside the editor? It might work just fine. Not a solution but a stopgap.

[Next page](https://forums.unrealengine.com/t/how-can-i-change-the-level-for-all-connected-clients-in-a-multiplayer-game/284760.md?page=2)
