Play in Editor always resizes to 720x720 and freezes for 30 seconds before working fine

Hi, I’m hoping someone can shed some light on this bug I’ve been trying to fix for several days now.
Whenever I click play in editor, my game freezes for a good 30 seconds or so, and if it has opened in a new window, it always resizes the window to 720x720 pixels, no matter what data is in the Game/Saved/Config/EditorPerProjectUserSettings.ini file

Some other important information:

  • This issue started around when I started messing with the window size using the GetGameUserSettings, SetScreenResolution, and ApplyResolutionSettings blueprint nodes, but to be fair I hadn’t played in editor for a bit before that, so it could well not be the cause. And I have since tried removing all that code and it didn’t help at all.

  • This is using a source build of Unreal 4.27.2. I was in the middle of transferring this project to a clean build as the old one was a mess anyway, and thought that would probably fix the issue, but it did not. The old project’s config file had a field called “NewWindowWidth” in it which was set to 720, and I tried changing that to 1280 and adding a “NewWindowHeight” field, but that did nothing, and in fact got reset every time I closed the PIE window, so I thought this could be part of the issue, but having searched the config file in the new build, that field just doesn’t exist at all.

  • I found that with Editor Preferences → Level Editor → Play → Always center first viewport window to screen unchecked, the New Viewport Resolution setting got reset to whatever the viewport resolution was every time I closed the PIE window (720x720 unless I fullscreen it, then it’s 1920x1016), whereas with it checked, the window still appeared at 720x720, but the setting stayed as whatever I set it to.

  • As for the freezing part, using the blueprint debugger, it seems like all beginPlays get called, then everything ticks twice, and then only the player controller ticks for at least 30 seconds, at a significantly lower framerate than the game runs at after the freeze.

  • I should also add that this is only in the play in editor mode, none of these issues happen in the packaged game.

Sorry for so much text, I thought I should get all the details I could think of laid out. Any help would be much appreciated!