x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Replication issue of actors placed in "always loaded" sublevels when seamless travel is enabled

Synthesis:

Replication issue of actors placed in "always loaded" sublevels when seamless travel is enabled.

Question:

Should replication work in the same way regardless the travel mode chosen? (Seamless or not)

Case:

We create a blueprint project.

We create two actors that replicate. One of the actors is placed in a sub level.

We travel from the level “lobby” to the “level_1”.

We expect to see the two cubes increase in their height (listening server and client side).

What we observe is that the cube placed in the sublevel is not properly replicating on the client.

(Debugging the engine code we notice that UNetDriver::IsLevelInitializedForActor() keeps returning false even when the actor is shown in the client.)

Steps to reproduce the issue:

  • Launch the engine.

  • Select New Project.

  • BluePrint ThirdPerson.

  • (Optional Give name).

  • CreateProject.

  • Wait until loading is complete.

  • Remove the ThirdPersonCharacter from the WorldOutliner of the level.

  • Select TemplateLabel in the World Outliner and change the field named “Text” in the Details window to "Lobby".

  • Save.(Ctrl-s)

  • File SaveAs.

  • Click on ThirdPersonBP folder.

  • Click on Maps.

  • Change field “Name” into "Level_1".

  • Select TemplateLabel in the World Outliner and change the field named “Text” in the Details window to "Level_1".

  • Drag a Basic Cube into the world.(Fig 1)alt text

  • Click on Details panel, Blueprint/Add Script.

  • Click on Create Blueprint.

  • Select Always Relevant and Replicates.(Fig 2)

  • Compile and Save.

  • Click on Event Graph and copy the Blueprint from Fig 2.alt text

  • Be aware of the flags in the “Custom Event Server” node (Run on Server, Reliable) and the “Custom Event Client” node (Multicast, Reliable).

  • Compile , Save and close the Blueprint editor.

  • Save the level.(Ctrl-s)

  • Click on Blueprints.(In the top bar, between settings and cinematics[Matinee in the version 4.9])

  • Under Project Settings select "GameMode: Edit ThirdPersonGameMode" - "Edit ThirdPersonGameMode".

  • Enable "Use Seamless Travel".

  • Compile , Save and close the blueprint editor.

  • Click on Window and select Levels.

  • Click On Levels Create New, name it SubLevel and save.

  • RightClick on Sublevel and select Change Streaming Method to Always Loaded. (Fig 3)

alt text

  • World Outliner select Cube_Blueprint , duplicate it using Ctrl-w. (this copy will go into the SubLevel because is the one is selected now)

  • Move the Cube_Blueprint2.(Fig 4)

alt text

  • Save. (Ctrl-s)

  • Select the down arrow near the Play button and press "Change Play Mode and Play Settings".

  • Select Advanced settings.

  • Scroll down to Multiplayer Options, change Number of Players to 2, remove "Use Single Process", Select "Play As Listen Server" inside Editor Multiplayer Mode.

  • Close Editor Preferences.

  • Open the lobby using File Open Level "ThirdPersonExample".

  • Select the down arrow near the Play button and press "Change Play Mode and Play Settings".

  • Select Standalone Game.

  • Select the server window (if you don't know which one is just try one) (generally the client window is the one that has focus when you launch the game).

  • Open the console. (Generally ~key )

  • Issue the command "servertravel level_1". (If it is not doing anything is the client window. Select the other window and retry)

  • Verify in the client window that the second box (the one in the sublevel) does not grow. (You need to navigate a little with the character to see it) alt text

    To verify that this works when seamless travel is disabled:

  • Close the client and the server windows.

  • Click on Blueprints(between settings and cinematics), under Project Settings select "GameMode: Edit ThirdPersonGameMode" - "Edit ThirdPersonGameMode".

  • Disable "Use Seamless Travel".

  • Play.

  • Select the server window.

  • Open the console.

  • Issue the command "servertravel level_1". (if it is not doing anything is the client window. Select the other window and retry)

    Final Notes/Considerations:

The replication issue is present on Win64(8.1). Engine version 4.9.2/4.10.0

The issue also occurs if a C++ template project is used.

The issue does not occur if the game is started from that level_1. (It only happens after travelling)

The replication seems to work again if the client issue a reconnect command after that the seamless travel is finished. (But that is what we are trying to avoid using the seamless travel)

Product Version: UE 4.10
Tags:
fig1.jpg (10.8 kB)
fig2.jpg (100.2 kB)
fig4.jpg (18.0 kB)
fig5.jpg (5.9 kB)
fig6.jpg (28.4 kB)
more ▼

asked Dec 04 '15 at 12:21 PM in Bug Reports

avatar image

StefanoPeranzoni
6 1 1 2

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

Hey Stefano,

Thanks for the report! I was able to reproduce this issue in 4.10.1 as well as our internal build, so I've created a bug report for the developers to consider (UE-24280). I'll post here if I see any updates on it. Thanks!

more ▼

answered Dec 09 '15 at 06:42 PM

avatar image sds-michael Dec 10 '15 at 01:42 AM

Just FYI we are seeing the exact same issue in Space Dust Racers using UE4.10.

avatar image sds-michael Dec 10 '15 at 04:28 AM

Thanks a lot of this extensive bug report and repro case. A colleague and I spent a few hours today digging through the code with the information provided and have found some more information and a temporary workaround.

The problem lies in UWorld::AddToWorld (around line 1921), with this call being made on the client at the end of the server travel:

 It->PlayerController->ServerUpdateLevelVisibility(PackageName, true);

This RPC never gets sent from the client to the server, and so the server never gets informed about the sublevel visibility for the client's connection. If you step into the RPC call you'll see why it's not sending - inside AActor::ProcessEvent it fails on a check to GetWorld()->AreActorsInitialized().

We looked around elsewhere in the codebase and found a gem inside NUTUtilNet.cpp on line 517 -

 // Hack-mark the world as having initialized actors (to allow RPC hooks)
 ReturnVal->bActorsInitialized = true;

It seems somebody else has experienced the same RPC limitation, haha! So back in UWorld::AddToWorld, if you hack bActorsInitialized = true then perform the ServerUpdateLevelVisibility RPCs, then restore the original bActorsInitialized value afterwards, everything works as expected.

Obviously this is just a workaround, but hopefully it helps the Epic team come up with a proper fix.

Ben, you may want to add this information to UE-24280.

Cheers, Michael

avatar image Ben Halliday STAFF Dec 10 '15 at 05:16 PM

Thanks! I've added the information you provided.

avatar image Mentos Oct 03 '16 at 04:38 PM

Hey was UE-24280 ever addressed?

In our game we have flag objectives that when placed on a sublevel do not replicate after ServerTravel. For now we will just bring them back up to the main level but it adds a bit of redundancy to our map organization.

avatar image Sean L ♦♦ STAFF Oct 11 '16 at 07:08 PM

Hey Mentos,

Here's the link to the public tracker so you can keep an eye on this issue: https://issues.unrealengine.com/issue/UE-24280

avatar image Tolc 5 days ago

Sorry for grave digging, but...it's been 3 years, and the bug still hasn't been fixed. Do you have any update Sean?

Because the hack is fine and all, but I don't feel like anyone should have to make a custom engine to have such an important feature working properly...

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question