[Bug] Demo Playback Problem

Hi! I’ve got a problem playing demos.

I’ve recorded a demo in the “Development” build configuration in a cooked/packaged version of my game. When I play this demo back with the console command, “demoplay test” it works fine. When I try to play it back using the UGameInstance::PlayReplay method, or using a faked console command via the APlayerController::ConsoleCommand method, it does not.

By works fine, I mean the map loads and stuff happens. As expected.

By not working fine, I mean the game freezes. Task manager shows it using 0% cpu and “not responding.” I cannot tab into the game (it doesn’t appear,) but it happily waits in the background if I minimize all other windows. All threads (debugged with VS) sit in FWinEvent::Wait, the main thread blocking on the WaitPhysScenes() call in the UWorld::EnsureCollisionTreeIsBuilt() method during level load.

The log I get when trying to play the demo is attached. The number of thread exits at the end varies from 2 to 3.

I’ve tried making the call from both the input event (co-opted from APlayerController::InputEvent or APlayerController::ProcessInput) and from a tick event. Both give the same results.

I really have no idea why this works when entering the console command directly, but not when faking the console command through code or calling the UGameInstance method directly.

I’ve attached the log file, thread list and call stack of the main thread.

Any ideas? Thanks.

Edit: It’s in a 4.8.3 source build and running on w10 64bit.

Hello ,

I’m currently looking into this issue for you. Just for clarity’s sake, can you post the code where you’re calling the console command with these two methods that don’t work?

Hi . Thanks for the reply. I’m using the following:

GEngine->GetFirstLocalPlayerController( GetWorld() )->ConsoleCommand( "demoplay " + DemoName, false );


UGameInstance* GameInstance = GetWorld()->GetGameInstance();

GameInstance->PlayReplay( DemoName );

DemoName in both these cases has the value “test”

Hello ,

I tried the first method you listed and that worked without a problem. To be exact, I created a ShooterGame project and added that line to the SetInfiniteAmmo function in the ShooterPlayerController just so I had an easy way to trigger it. When I attempted the second method however, I was given a message stating that the demo I was trying to play was not found (I’ll be looking into this separately). Can you give this a try in ShooterGame to see if you get the same results as you’re getting with your project? If you do continue to have these issues, it could be a problem with Windows 10 and I’ll be able to test that out if so.

We haven’t heard from you in a while, . Are you still experiencing this issue? If so, please let me know if you’ll be able to test it out in ShooterGame and what OS you’re using. In the meantime, I’ll be marking this issue as resolved for tracking purposes. If you wish to continue the discussion, please leave a comment and the issue will reopen.

Yes, sorry. I’ve been rather busy. I’ll give it a try now.

I created a new First Person C++ project. Recorded a short demo. Tried to play the demo and it crashes because it’s trying to load the PIE map name in the demo… which doesn’t exist. And if I change the name of the map in the demo header to remove the PIE prefix, it can’t load the map because it’s not a PIE map. Funnily enough, it’s using the right file name.


Separate issue: fix demo playback in PIE. :confused:

Building a shipped version of the FP project so I can test that.

After packaging it in development, it seems to record and play the demo just fine. “Just fine” being the demo not having the player in it, but at least I am able to move about with the spectator camera and it doesn’t crash.

Thank you for giving that a try . I tried using the console commands in PIE in 4.8.3, 4.9.2, and 4.10. It seems that 4.9.2 and 4.10 have a more severe problem in PIE where the crash occurs immediately as you use demorec. I’ve placed a bug in for that under the number UE-23215.

In the packaged version, is this through the console commands or through the code lines that we previously used?

This was all through console commands. I’ll give the play replay method a go. Seems I forgot with all the PIE problems!

And… it froze. I added the following to the character blueprint that came with the project:


I recorded a demo (demorec test123 and then demostop.) I then hit the ‘k’ key and it froze, 0% cpu, etc.

I’ve placed another bug in the demoplay freezing problem. The same thing occurs in our internal build of 4.11 but in my case of testing it on 4.8.3, I get an assert and a crash report than just freezing. Unfortunately, other than using the actual console commands themselves, I can’t think of any other type of workaround in the meantime. I’ll update you here if the issue is fixed.

Have a nice day!

Thanks a lot! Hope it’s fixed soon. :slight_smile:

Any news on this? With play in stand alone game (demorec doesn’t work in pie) I get some type of hang with half the window being white and the other gray, I can’t move around in this state. I can however trigger the console.
It doesn’t seem like any console commands are working though and when I exit the program I get an engine crash. (Engine 4.14)

Change the map first and THEN play the demo.