Why is it quicker to stop debugging than to stop within the editor?

This is probably a silly question but it’s been bugging me for awhile. When I build my project, drop my world object in, and press play, the game takes about 8-9 seconds to start. But when once the game starts if I hit the stop button it takes nearly a minute. Alternatively I have been hitting the “stop debugging” button within Visual studio which takes just a second or so to exit back to code. Am I forgetting to empty a container or something? Why does visual studio do it so quickly and UE4 takes so long? Ideally I would just hit the stop button and then I could hit play again - and wait my 8 seconds as opposed to stop debugging and then rebuilding - then hitting play - which actually takes less time than hitting stop in UE4.

Hello,

Does this also occur when not running in debug?

My environment settings are Development Editor - Win64. I typically right click on the project and find “debug” and click “Start new instance” inside of visual studio. After it’s built and has launched my project in UE4 Editor, I drop my world object in the scene and hit play, it takes about 8 seconds. The world starts. Then I want to abort and try and again - but hitting the UE4 stop button takes a long time to stop. So I typically just stop from inside of visual studio.

I’ve attempted to reproduce the slow PIE behavior that you are experiencing, but it seems to be fairly quick on my end. Is your project particularly complex?

Could you also try just launching the game through the .uproject file and see if you’re still experiencing the slow PIE exit?

The world is procedurally built, using HISMC and a many many instances. I believe I have a few large containers that are just there right now for debugging purposes. The project builds in less than 20 seconds, and the object that causes the world to build - drag and dropped in takes only a second or so, then play takes about 8 seconds before I have control again. That’s kind of why I was asking because I wasn’t sure if I should be emptying containers or something like that which would allow me to use the stop button in the editor. I’ll give the .Uproject file a shot and see how it goes.

It is likely that the procedural generation is what is causing the longer PIE times. However, I’d be interested to hear the results when you’re not running the project through Visual Studio. Let me know when you get this tested.

So I ran the Uproject file and it was identical to building from visual studio (only that I couldn’t stop it from visual studio anymore!). It took a long time for the editor to stop. I couldn’t discern any difference between it and the original method.

Hello Thumper,

I’ve attempted to reproduce the same slow PIE times, but haven’t seen it in any of the project’s I’ve tried. It is likely that it has something to do with your particular setup, so if you are able to discern the cause of the issue, feel free to reopen this question and we can continue to investigate it.

Have a great day