Preview window going black after 5 minutes or so?

While previewing my game, I’ve begun to notice that after about 5 minutes (or possibly a little longer), the preview window will turn to a black screen. I tried using the debugger to see if there was an issue that it would point out, but once the preview window goes black, the debugger says there isn’t a preview running (and therefore nothing to debug) despite the black preview screen still being up. I tried starting a preview and just letting the game sit idle for 5 minutes, not making any inputs or changes. The preview window still turns black after 5 minutes or so, despite me leaving the game sit idle for that time.

Does GDevelop have some kind of timeout for the preview window or something that I’m not aware of? I couldn’t find any mention of such a thing on here or in the documentation. Or are there certain things I should be looking for in the dubugger while the game is running and the screen isn’t black? If not, does anyone have any ideas as to why this might be happening so I know where to start looking for issues? Thank you in advance. I know this is a pretty vague explanation, but I’m seriously becoming concerned if my game won’t be able to run for more than 5 minutes without the screen turning black.

EDIT: I opened the console (Ctrl+Shift+I) while the game preview was running and when the screen went black after 5 minutes, this is the message that was showing in the console:

What exactly does “Render process gone” mean?

If you are using the online version, then try installing the platform. The online version often has problems

1 Like

An update:

JekaN, I’m using the desktop version. After hours of messing around last night, I kept restoring a saved backup on the external hard drive which I back up my game to a couple times a week. I was able to recreate the issue going back about a month and a half ago. Before that, when I loaded up the project from previous saved backups, the problem wasn’t there. So I was able to use this method to pinpoint what things I changed from one backup to another. As it turned out, I had added some code with no conditions (updating on every frame) from one day to another to make something work with the health bar in the game. So using this logic, that code had to be the culprit.

Once I loaded up the most recent backup of the game data and disabled that problematic code, the issue seems to have gone away! Apparently, something about running the events I was running on every frame was somehow “overloading” the game data or something like that after about 5 or 6 minutes. So, I’ll have to go back when I’m ready and adjust that code to have conditions which keep it from firing off on every frame, which completely ruined the game performance.

So I guess what I would say to anyone who runs into a similar issue is to start by looking back in your code for any events you have which are firing on every frame (no conditions). This is a good place to start. Also check any For Each loops you have and make sure they’re optimized (many great folks on this forum will help you do that). These two kinds of conditions can be very resource-heavy if they’re not optimized and implemented correctly, and they can cause major performance/stability issues down the road. If the preview window is crashing right away when you load it up, check any events with the “At the beginning of scene” conditions. Disable them one by one and see if the issue goes away. That will allow you to zero in on the issue.

I hope this experience helps someone else out there who runs into a similar issue!!!

2 Likes