NetworkReplay: PlayReplay causes crash

Hello guys,

currently I want to try out the network replay interface. I’ve already implemented simple blueprint wrapper functions to start / stop recording. Also I have got the “demo listing” up and running.

But now I have dashed against my last task: Playing the demo.

This code should do the stuff (I thought so). While “FastPlayDemoName” is a simple FString containing the (technical) demo name of the last demo found with EnumerateStreams (https://docs.unrealengine.com/latest/INT/API/Runtime/NetworkReplayStreaming/INetworkReplayStreamer/EnumerateStreams/index.html)

GetGameInstance()->PlayReplay(FastPlayDemoName);

When I trigger the function which should run this line (including some logging but nothing more) my engine crashes (in-editor version and built version).
A breakpoint is triggered when I the demo level is already loaded but not if another level is loaded. The breakpoint is leading me to the UnrealEngine.cpp file (UEngine::LoadWorld function).
Directly to this checking line:

// Find the newly loaded world.
NewWorld = UWorld::FindWorldInPackage(WorldPackage);

// If the world was not found, it could be a redirector to a world. If so, follow it to the destination world.
if ( !NewWorld )
{
	NewWorld = UWorld::FollowWorldRedirectorInPackage(WorldPackage);
	if ( NewWorld )
	{
		WorldPackage = NewWorld->GetOutermost();
	}
}
check(NewWorld);

The replay directory have been found.
While NewWorld is checked, it is just NULL causing the crash. But I have no clue why. :smiley:

Maybe someone had the same problem or provide any suggestions and could help me?

Many thanks :slight_smile:

Addition: When I am trying to start the replay demo from the same level the as the demo has been recorded, it is going to result in my first described bug / breakpoint.
When I am trying to start the demo from another level (so a level switch is needed), the engine crashes in the ticking main loop (random parts [eg. input stack handling or calling some delegates] but always in the tick function).

Maybe you could use this information. :slight_smile:

Has there been any resolution on this?? I have this exact same issue if I copy over a Demo into the Saved folder while the game is still running, and then try to load it. This error doesn’t happen however if I restart the game with the Demo already there. I don’t really understand why this would make any difference.

No I knew that PIE was an issue so I have been doing it from exported / packaged versions.

Do you try it from PIE?

I found out that recording and replaying a demo only works when the project has been exported. Just give it a try. :slight_smile: