Packaged Game crashes when removing PCGStamp Actors from map before packaging (UE 5.7.4)

I have a very big map and many PCGStamp Actors. (result of Clear PCG Link)
If i leave them in the game, everything packages fine and the game runs.
They are too big and they cause performance issues (too many Static Mesh Instances), so I need to remove them.

If I remove them by deleting the actors or by setting them Editor Only and then package the game, the game packages, runs fine (main menu and everything) up until the point the map is loaded and the player would be able to move.

Right at that point, the game crashes with following error:

Fatal error!

Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0x0000000000000188

0x00007ff616ff6f21 SuedtirolGame.exe!UnknownFunction
0x00007ff6170722be SuedtirolGame.exe!UnknownFunction
0x00007ff6189ca152 SuedtirolGame.exe!UnknownFunction
0x00007ff6199061eb SuedtirolGame.exe!UnknownFunction
0x00007ff6199058f1 SuedtirolGame.exe!UnknownFunction
0x00007ff619899657 SuedtirolGame.exe!UnknownFunction
0x00007ff61989a34b SuedtirolGame.exe!UnknownFunction
0x00007ff61989a8d7 SuedtirolGame.exe!UnknownFunction
0x00007ff6198bd5ef SuedtirolGame.exe!UnknownFunction
0x00007ff618adfc1e SuedtirolGame.exe!UnknownFunction
0x00007ff618adb42d SuedtirolGame.exe!UnknownFunction
0x00007ff618cfe221 SuedtirolGame.exe!UnknownFunction
0x00007ff619e81e2f SuedtirolGame.exe!UnknownFunction
0x00007ff619e8fded SuedtirolGame.exe!UnknownFunction
0x00007ff619e8feda SuedtirolGame.exe!UnknownFunction
0x00007ff619e92aca SuedtirolGame.exe!UnknownFunction
0x00007ff619e9e924 SuedtirolGame.exe!UnknownFunction
0x00007ff620059d1a SuedtirolGame.exe!UnknownFunction
0x00007fffbde3e8d7 KERNEL32.DLL!UnknownFunction

I am getting desperate, because this error is now persisting for some time…
I tried with different Unreal Engine Versions, tried with Plugins enabled/disabled, I even recompiled the Engine from source in different versions and with and without Plugins.
I get this error every time I try to run the game without those PCGStamp Actors.
I also removed everything except the folders “Config” and “Content” and the .uproject-File before packaging, to make sure there are no old cached files causing trouble.

If i leave them in, the game runs (with loading spikes, because the PCGStamps are to heavy, my fault, made them too big) but I need those actors gone.

PlayInEditor works fine.

Unreal Engine Version 5.7.4

Hello there @PinnaRandolf!

That sounds like you are encountering a null reference error, UE is trying to access something that is no longer there. From what I could find around the community, the Clear PCG function turns PCG content into regular actors, but WP will still look for them in their original state, thus resulting in the EXCEPTION_ACCESS_VIOLATION (reading 0x188) when PCG loads up.

As for why it works in play editor, any of these missing references would be brushed off as warnings there. But in an isolated, packaged build, it will just make it fail. There are a few methods to test in order to avoid this issue, let’s cover them one by one:

  • After you applied the clean PCG command, go to your Outline and look for any elements named “PCGSceneData” or similar, and delete them. And since you are working with WP, there may be multiple instances of these, as well as “PCGPartitionActor”, check all your levels

  • Next, check your BPs for any node or reference looking for a PCG actor, and correct them. After that, pick up your Content folder, right click on it, and apply “Fix Up Redirectors”

  • You mentioned clearing up cache by deleting most of the project folder, but you only need to clear up DerivedDataCache, both in your project’s main directory, as well as it’s copy in Local App Data, inside Unreal’s own directory

  • Your HLODs may also still hold reference to PCG actors, so please make you apply “Clear HLODs”, then rebuild them

After all these changes, save your project, repack, and test again. Hope this helps, and good luck!

Thank you for your response.

I tried the steps you mentioned, but unfortunately it still doesn’t work.

I keep trying, but since every build run takes about 10 hours, it may take me some time to find a solution xD