Unreal Engine Freezes then crashes when oppening Blueprints or Levels

Context: I recently started working with a team of people on GitHub, and one of my collaborators (person one) can’t seem to open any blueprint or level.

Person one’s (ThinkPad, Will add specs later) freezing until they need to restart their device or a crash happens, they can open flip books, create and open new blueprints and such but the moment they try to open a level or blueprint freeze and crash

On my PC (Specs) when I do the following, it freezes for a while but eventually opens.
Although, I’ve noticed any attempt to validate my assets crashes with the message: Fatal error: [File:D:/Build/++UE4/Sync/Engine/Source/Runtime/Engine/Private/ShaderCompiler/ShaderCompiler.cpp] [Line: 924] ShaderCompileWorker crashed! Fatal error!

On my laptop(specs) opening a level or a blueprint would freeze and crash unreal with the following message: Fatal error: [File:D:/Build/++UE4/Sync/Engine/Source/Runtime/Windows/D3D11RHI/Private/D3D11Util.cpp] [Line: 198] Unreal Engine is exiting due to D3D device being lost. (Error: 0x887A0020 - 'INTERNAL_ERROR')
Yet unreal opens faster on my laptop

Person two on a newer model ThinkPad (specs) doesn’t have the problem as person 1

It seems like it is a memory issue. When you open a level all of the assets need to be loaded into memory and if there is not enough memory, the software crashes. I would check for huge textures or assets. Also check if they can open an empty level.

Huge textures or assets within the level? Also, unreal acts the same way when opening a level that is completely empty, I.E. when I open my menu level which has nothing but the main menu UI as a 2D widget

Hmm, not sure then what it could be. One thing that you can check is if you have a custom game instance that has references to some assets. I would also try to just create a completely empty level and see if that works. Also check if you have overrides for game mode which can reference some assets.

I have a custom game instance, but what exactly do you mean by referencing to some assets, it references to classes

Here is what my Custom Game instance looks like

Although recently I’ve merged it with another Game instance from a visual novel project
All its functions and variables
image

But I don’t think it has assets large enough to freeze my device the way it is
image

What can happen is that one reference can reference 10 other things that reference another 10 things and in the end you have to load your whole project just to open an empty map. Try creating an empty map and remove the game mode and game instance and see if that works.

This might be the cause but, how do I stop it from referencing said 10 Things, is it referencing them because it’s a class reference and not an asset reference? And it loads every actor of the class

Ok so this is the world outliner for GridMap
image

This is the referance viewer:
Depth Limit 1:

Depth Limit 2:

Depth Limit 3:


Goes out of view

Ok, so how would I go about resolving this?

Does doing things like this make it do a referance loop?
image

There are few ways to fix this. You can use soft object references(that is a variable that is just a path to where the actor is, so you don’t have to have the whole object in memory). You can use data assets, asset registries or also try to change the structure a bit, so everything is not so coupled.
Just to illuminate the problem, you are not getting a reference loop, you just have objects referencing a lot other objects. When you create a variable that is, lets say, your actor class or actor, when the object with that variable is loaded into memory, he will have to load the whole actor into memory. That is called hard object reference. The references can also be “hidden” sometimes. If an actor1 has a node to spawn actor2, then the actor2 will be in the memory as long as actor1 is instanced. If you are not familiar with this area, I would suggest researching it, since it will be pretty important, especially if you are creating games for iOS or android. Here is one useful video: Demystifying Soft Object References | Inside Unreal - YouTube

1 Like

Funnily enough just finished that video, thank you for your help
The only thing that is new to me here is what are data assets and asset registries, and what do you mean by change the structure.

No problem :+1:
Data assets and asset registries are useful to use when you want to load groups of assets. Not sure how to explain it succinctly, so I would recommend researching them as well and see how you can use them in your project.
There are many was that you can structure your project. If you want your project to be modular, you might want to use components or data assets. If it is a small project, you might want to keep it cohesive with just few classes or maybe you can combine different ways to implement features. You can use inheritance, components, interfaces, singletons like a game instance, function libraries, data assets/registries or any other tool to structure your project, so it is the most readable, performant and optimized. For more abstract understanding of this I would suggest reading about design patterns.