[Bug] Blueprint classes recompiled when starting standalone game

I recently added an Editor-only module to my project, containing a custom anim node. The editor module contains the AnimGraphNode and the game module only the AnimNode runtime. This works well in the editor.

When starting the game in standalone (not cooked), it crashes complaining that the editor module cannot be found. The callstack looks like this:

UE4Editor-KismetCompiler.dll!FAnimBlueprintCompiler::ExpandGraphAndProcessNodes(UEdGraph * SourceGraph, UAnimGraphNode_Base * SourceRootNode, UAnimStateTransitionNode * TransitionNode, TArray<UEdGraphNode *,FDefaultAllocator> * ClonedNodes) Line 589	C++
....
UE4Editor-CoreUObject.dll!ULinkerLoad::RegenerateBlueprintClass(UClass * LoadClass, UObject * ExportObject) Line 39 C++
...
UE4Editor-CoreUObject.dll!ULinkerLoad::CreateExport(int Index) Line 3193  C++
UE4Editor-CoreUObject.dll!ULinkerLoad::LoadAllObjects(bool bForcePreload) Line 2505 C++
UE4Editor-CoreUObject.dll!LoadPackage(UPackage * InOuter, const wchar_t * InLongPackageName, unsigned int LoadFlags) Line 825 C++
UE4Editor-Engine.dll!UEngine::LoadMap(FWorldContext & WorldContext, FURL URL, UPendingNetGame * Pending, FString & Error) Line 8382 C++

Isn’t it a problem that ULinkerLoad::RegenerateBlueprintClass() gets called, when my blueprints are already compiled ?
I can’t see any obvious reason why it does by looking at the ULinkerLoad::CreateExport() function.

If it’s normal, what is the proper way to put editor functionality in a separate module ?

In my .uproject, I have this:

"Modules": [
  {
    "Name": "MyGame",
    "Type": "Runtime",
    "LoadingPhase": "Default"
  },
  {
    "Name": "MyGameEditor",
    "Type": "Editor",
    "LoadingPhase": "Default"
  }
],

If both are set to “Runtime”, it works fine, but then I have issues in non-editor builds.

Though this doesn’t help much about the problem itself, in either the project or editor settings (Maybe under “Experimental”?) there’s a setting to enable/disable BP compiling on launch. It might be worth trying to at least pinpoint the problem.

Good idea, the actual option is Editor preferences > PIE > Auto Recompile Blueprints. I’ll try disabling it.

Unfortunately, this doesn’t solve the problem. AnimBP still get recompiled when starting in standalone, causing a crash.

I have been having this exact same issue with my custom AnimGraphNode Editor module (and a corresponding AnimNode Runtime module). This is with 4.4.1 compiled from GitHub, with the first few lines of the crash dump:

`FAnimBlueprintCompiler::PruneIsolatedAnimationNodes'::`2'::FNodeVisitorDownPoseWires::TraverseNodes() 0xdd661e91 + 16 bytes [File=c:\dave\github\unrealengine-fork\engine\source\editor\kismetcompiler\private\animblueprintcompiler.cpp:439] [in C:\Dave\GitHub\UnrealEngine-Fork\Engine\Binaries\Win64\UE4Editor-KismetCompiler.dll]
`FAnimBlueprintCompiler::PruneIsolatedAnimationNodes'::`2'::FNodeVisitorDownPoseWires::TraverseNodes() 0xdd661ec4 + 0 bytes [File=c:\dave\github\unrealengine-fork\engine\source\editor\kismetcompiler\private\animblueprintcompiler.cpp:436] [in C:\Dave\GitHub\UnrealEngine-Fork\Engine\Binaries\Win64\UE4Editor-KismetCompiler.dll]
FAnimBlueprintCompiler::PruneIsolatedAnimationNodes() 0xdd64e6e3 + 0 bytes [File=c:\dave\github\unrealengine-fork\engine\source\editor\kismetcompiler\private\animblueprintcompiler.cpp:453] [in C:\Dave\GitHub\UnrealEngine-Fork\Engine\Binaries\Win64\UE4Editor-KismetCompiler.dll]
FAnimBlueprintCompiler::ProcessAllAnimationNodes() 0xdd64ae35 + 16 bytes [File=c:\dave\github\unrealengine-fork\engine\source\editor\kismetcompiler\private\animblueprintcompiler.cpp:530] [in C:\Dave\GitHub\UnrealEngine-Fork\Engine\Binaries\Win64\UE4Editor-KismetCompiler.dll]

In the same log, I’m also seeing:

[2014.09.08-06.04.30:680][  0]LogLinker:Warning: Can't find file '/Script/HCTDEditor'
[2014.09.08-06.04.30:680][  0]LoadErrors: Info Failed to load /Game/HCTD/Players/BP_Mike.BP_Mike_C Referenced by AnimGraph Property /Script/Engine.EdGraph:Nodes

where “HCTDEditor” is my Editor module that contains the custom AnimGraphNode. What to do? This is really slowing down my Oculus Rift development as I can only test that in a standalone session and not in PIE (where this module setup works just fine). Thanks!

BTW, thanks trethaller for pointing out that switching my Editor module to Runtime at least allows me to get Standalone mode running at all. I just need to remember to switch it back to Editor when cooking the final game.

  • Dave

Yes, I gave-up and I added an extra step in my cooking script to patch the .uproject and revert it when done cooking… pretty hacky but does the job

We are getting the same problem.

We’ve implement our own node for animation blueprint purposes. Everything works fine, If the game is running with cook mode, but when we run the game with uncooked (i.e., running the editor with -game parameter), it crash in:

“PruneIsolatedAnimationNodes” method. AnimBlueprintCompiler.cpp in the next line:

UEdGraphNode* OtherNode = OtherPin->GetOwningNode()

Anybody knows how to solve this problem??

I will post any clue.

Thanks in advance,

Just posted a new question about the same problem on UE 4.5.1… only to find this thread a couple of minutes later! Did you have any chance solving this in the end?

BTW thanks for sharing the Editor/Runtime trick, at least we’re able to test the game again.

Update, the bug is still occurring in 4.6.1

I am also still experiencing this issue in version 4.6.1, and have found some other posts from a long time ago about similar issues, also unanswered.

is there any news on this issue?

I don’t know if this is going to be usefull for you but, if the module that is using those AnimGraphNode is the editor, you can set this in your .uproject file in order to avoid the crash:

	{
		"Name": "YourGameEditor",
		"Type": "Developer",
		"LoadingPhase": "Default"
	},

Juan,

from my understanding it is not allowed to ship that includes editor-only stuff, which is one of the reasons for splitting up a project in multiple modules like this, so that one module can include editor-only stuff (like the AnimGraphNode) and then not be included in a final shipping build.

Would this solution indeed make sure the editor-only features are not included in a shipping build?

Of course. That’s why there is an option in Unrealfrontend where you select that build that you are going to cook (for example), it is a WindowsNoEditor Build. This means that the features of your editor module, are not going to be included in the build.

Setting the ‘.uproject’ like I said before, you can run the UE4Editor with your custom AnimGraphNode and run the game without uncooked content (in VS, -game in UnrealVS command line) without crashes.

I think that setting any module as Runtime, forces the compilation to include it in the final product.

Thanks!

Note: It will be nice to get some documentation from Epic about the .uproject files.