When I load the MainMenu level, everything works fine. Then I load the Lobby level using OpenLevelByName, and that also works. However, if I try to load MainMenu again afterward, the game may crash during shader loading. Similarly, the game can also crash during shader loading when opening the Lobby level directly.
The crash happens as an access violation exception (EXCEPTION_ACCESS_VIOLATION) during the shader compilation or loading phase, which prevents proper level transitions and causes the game to crash.
Crashes tied to EXCEPTION_ACCESS_VIOLATION are usually related to the engine accessing invalid, corrupt, or missing data, with multiple possible causes.
We can implement a few workaround to fix the problem. First of all, update your video drivers to the latest version, or switch to Developer drivers (pick the “Clean Install” option, if available). After that, perform a shader cache clear in your project, via deleting the following folders from the main directory:
Saved/ShaderDebugInfo
DerivedDataCache
Intermediate
After that, rebuild your project. You can also try switching between DX11 and DX12 during your tests.
Still, we will need more specific information in order to pinpoint the exact cause of the crash. Please send the full crash log, that can be found in your PC, as detailed below:
Where To Find Local Crash Reports
Crash reports from the editor are stored on your local machine in your project’s Saved/Crashes folder.
Alternatively, you can find crash reports on a user’s local machine in C:\Users[Your Windows Username]\AppData\Local[Project Name]\Saved\Crashes.
After several tests with Unreal Engine 5, I’ve found that the levels load correctly as long as I don’t use the session system. However, as soon as I activate the Advanced Steam Sessions plugin to create and destroy a session, the game crashes when the levels load, more precisely when the session is successfully destroyed, just before or during the opening of the level.