Adding Custom Anim Node causes editor with -game to crash

Hi there,

I’ve recently just added the Anim Node from this answer: How to play a random animation from a list - Character & Animation - Epic Developer Community Forums

I have made some very minor changes to the AnimNode, but I have placed the AnimGraphNode in our Editor module, and the AnimNode to our main game project.

In-editor and in a cooked build it works as expected, but when we run the editor with -game it crashes on startup.

It seems to be trying to recompile the Anim Blueprint, but failing miserably.

We’re currently running version 4.5.1 of the engine.

I’ve attached an image of the link and a copy of the log: [Log Link][1]

The Crash Stack is below:

Access violation - code c0000005 (first/second  not available)

UE4Editor_KismetCompiler!`FAnimBlueprintCompiler::PruneIsolatedAnimationNodes'::`2'::FNodeVisitorDownPoseWires::TraverseNodes() + 305 bytes [d:\perforce\evan_evan-pc\submerged_git\engine\source\editor\kismetcompiler\private\animblueprintcompiler.cpp:439]
UE4Editor_KismetCompiler!FAnimBlueprintCompiler::PruneIsolatedAnimationNodes() + 195 bytes [d:\perforce\evan_evan-pc\submerged_git\engine\source\editor\kismetcompiler\private\animblueprintcompiler.cpp:453]
UE4Editor_KismetCompiler!FAnimBlueprintCompiler::ExpandGraphAndProcessNodes() + 1010 bytes [d:\perforce\evan_evan-pc\submerged_git\engine\source\editor\kismetcompiler\private\animblueprintcompiler.cpp:589]
UE4Editor_KismetCompiler!FAnimBlueprintCompiler::ProcessStateMachine() + 1811 bytes [d:\perforce\evan_evan-pc\submerged_git\engine\source\editor\kismetcompiler\private\animblueprintcompiler.cpp:805]
UE4Editor_KismetCompiler!FAnimBlueprintCompiler::ProcessAnimationNode() + 899 bytes [d:\perforce\evan_evan-pc\submerged_git\engine\source\editor\kismetcompiler\private\animblueprintcompiler.cpp:284]
UE4Editor_KismetCompiler!FAnimBlueprintCompiler::ProcessAllAnimationNodes() + 881 bytes [d:\perforce\evan_evan-pc\submerged_git\engine\source\editor\kismetcompiler\private\animblueprintcompiler.cpp:530]
UE4Editor_KismetCompiler!FAnimBlueprintCompiler::MergeUbergraphPagesIn() + 333 bytes [d:\perforce\evan_evan-pc\submerged_git\engine\source\editor\kismetcompiler\private\animblueprintcompiler.cpp:1066]
UE4Editor_KismetCompiler!FKismetCompilerContext::CreateAndProcessUbergraph() + 511 bytes [d:\perforce\evan_evan-pc\submerged_git\engine\source\editor\kismetcompiler\private\kismetcompiler.cpp:2551]
UE4Editor_KismetCompiler!FKismetCompilerContext::CreateFunctionList() + 35 bytes [d:\perforce\evan_evan-pc\submerged_git\engine\source\editor\kismetcompiler\private\kismetcompiler.cpp:2997]
UE4Editor_KismetCompiler!FKismetCompilerContext::Compile() + 4518 bytes [d:\perforce\evan_evan-pc\submerged_git\engine\source\editor\kismetcompiler\private\kismetcompiler.cpp:3232]
UE4Editor_KismetCompiler!FKismet2CompilerModule::CompileBlueprintInner() + 529 bytes [d:\perforce\evan_evan-pc\submerged_git\engine\source\editor\kismetcompiler\private\kismetcompilermodule.cpp:119]
UE4Editor_KismetCompiler!FKismet2CompilerModule::CompileBlueprint() + 408 bytes [d:\perforce\evan_evan-pc\submerged_git\engine\source\editor\kismetcompiler\private\kismetcompilermodule.cpp:159]
UE4Editor_UnrealEd!FKismetEditorUtilities::GenerateBlueprintSkeleton() + 382 bytes [d:\perforce\evan_evan-pc\submerged_git\engine\source\editor\unrealed\private\kismet2\kismet2.cpp:487]
UE4Editor_UnrealEd!FBlueprintEditorUtils::RegenerateBlueprintClass() + 670 bytes [d:\perforce\evan_evan-pc\submerged_git\engine\source\editor\unrealed\private\kismet2\blueprinteditorutils.cpp:1109]
UE4Editor_CoreUObject!ULinkerLoad::RegenerateBlueprintClass() + 960 bytes [d:\perforce\evan_evan-pc\submerged_git\engine\source\runtime\coreuobject\private\blueprint\blueprintsupport.cpp:124]
UE4Editor_CoreUObject!ULinkerLoad::CreateExport() + 4605 bytes [d:\perforce\evan_evan-pc\submerged_git\engine\source\runtime\coreuobject\private\uobject\linkerload.cpp:3226]
UE4Editor_CoreUObject!ULinkerLoad::IndexToObject() + 116 bytes [d:\perforce\evan_evan-pc\submerged_git\engine\source\runtime\coreuobject\private\uobject\linkerload.cpp:3425]
UE4Editor_CoreUObject!ULinkerLoad::operator<<() + 100 bytes [d:\perforce\evan_evan-pc\submerged_git\engine\source\runtime\coreuobject\private\uobject\linkerload.cpp:3597]
UE4Editor_CoreUObject!UClass::Serialize() + 1633 bytes [d:\perforce\evan_evan-pc\submerged_git\engine\source\runtime\coreuobject\private\uobject\class.cpp:3038]
UE4Editor_CoreUObject!ULinkerLoad::Preload() + 2061 bytes [d:\perforce\evan_evan-pc\submerged_git\engine\source\runtime\coreuobject\private\uobject\linkerload.cpp:2765]
UE4Editor_CoreUObject!ULinkerLoad::CreateExport() + 5039 bytes [d:\perforce\evan_evan-pc\submerged_git\engine\source\runtime\coreuobject\private\uobject\linkerload.cpp:3272]
UE4Editor_CoreUObject!ULinkerLoad::IndexToObject() + 116 bytes [d:\perforce\evan_evan-pc\submerged_git\engine\source\runtime\coreuobject\private\uobject\linkerload.cpp:3425]
UE4Editor_CoreUObject!ULinkerLoad::CreateExport() + 3088 bytes [d:\perforce\evan_evan-pc\submerged_git\engine\source\runtime\coreuobject\private\uobject\linkerload.cpp:3046]
UE4Editor_CoreUObject!ULinkerLoad::LoadAllObjects() + 98 bytes [d:\perforce\evan_evan-pc\submerged_git\engine\source\runtime\coreuobject\private\uobject\linkerload.cpp:2518]
UE4Editor_CoreUObject!LoadPackage() + 911 bytes [d:\perforce\evan_evan-pc\submerged_git\engine\source\runtime\coreuobject\private\uobject\uobjectglobals.cpp:831]
UE4Editor_CoreUObject!ULinkerLoad::VerifyImportInner() + 544 bytes [d:\perforce\evan_evan-pc\submerged_git\engine\source\runtime\coreuobject\private\uobject\linkerload.cpp:2154]
UE4Editor_CoreUObject!ULinkerLoad::VerifyImport() + 173 bytes [d:\perforce\evan_evan-pc\submerged_git\engine\source\runtime\coreuobject\private\uobject\linkerload.cpp:1947]
UE4Editor_CoreUObject!ULinkerLoad::VerifyImportInner() + 844 bytes [d:\perforce\evan_evan-pc\submerged_git\engine\source\runtime\coreuobject\private\uobject\linkerload.cpp:2190]
UE4Editor_CoreUObject!ULinkerLoad::VerifyImport() + 173 bytes [d:\perforce\evan_evan-pc\submerged_git\engine\source\runtime\coreuobject\private\uobject\linkerload.cpp:1947]
UE4Editor_CoreUObject!ULinkerLoad::CreateImport() + 1085 bytes [d:\perforce\evan_evan-pc\submerged_git\engine\source\runtime\coreuobject\private\uobject\linkerload.cpp:3375]
UE4Editor_CoreUObject!ULinkerLoad::IndexToObject() + 233 bytes [d:\perforce\evan_evan-pc\submerged_git\engine\source\runtime\coreuobject\private\uobject\linkerload.cpp:3419]
UE4Editor_CoreUObject!ULinkerLoad::operator<<() + 100 bytes [d:\perforce\evan_evan-pc\submerged_git\engine\source\runtime\coreuobject\private\uobject\linkerload.cpp:3597]
UE4Editor_CoreUObject!ULinkerLoad::Preload() + 2061 bytes [d:\perforce\evan_evan-pc\submerged_git\engine\source\runtime\coreuobject\private\uobject\linkerload.cpp:2765]
UE4Editor_CoreUObject!UStruct::Link() + 125 bytes [d:\perforce\evan_evan-pc\submerged_git\engine\source\runtime\coreuobject\private\uobject\class.cpp:448]
UE4Editor_CoreUObject!UFunction::Link() + 14 bytes [d:\perforce\evan_evan-pc\submerged_git\engine\source\runtime\coreuobject\private\uobject\class.cpp:3754]
UE4Editor_CoreUObject!UStruct::Serialize() + 1734 bytes [d:\perforce\evan_evan-pc\submerged_git\engine\source\runtime\coreuobject\private\uobject\class.cpp:1411]
UE4Editor_CoreUObject!UFunction::Serialize() + 26 bytes [d:\perforce\evan_evan-pc\submerged_git\engine\source\runtime\coreuobject\private\uobject\class.cpp:3685]
UE4Editor_CoreUObject!ULinkerLoad::Preload() + 2061 bytes [d:\perforce\evan_evan-pc\submerged_git\engine\source\runtime\coreuobject\private\uobject\linkerload.cpp:2765]
UE4Editor_CoreUObject!UStruct::Link() + 125 bytes [d:\perforce\evan_evan-pc\submerged_git\engine\source\runtime\coreuobject\private\uobject\class.cpp:448]
UE4Editor_CoreUObject!UClass::Link() + 117 bytes [d:\perforce\evan_evan-pc\submerged_git\engine\source\runtime\coreuobject\private\uobject\class.cpp:2785]
UE4Editor_CoreUObject!UClass::Serialize() + 750 bytes [d:\perforce\evan_evan-pc\submerged_git\engine\source\runtime\coreuobject\private\uobject\class.cpp:2950]
UE4Editor_CoreUObject!ULinkerLoad::Preload() + 2061 bytes [d:\perforce\evan_evan-pc\submerged_git\engine\source\runtime\coreuobject\private\uobject\linkerload.cpp:2765]
UE4Editor_CoreUObject!ULinkerLoad::CreateExport() + 5039 bytes [d:\perforce\evan_evan-pc\submerged_git\engine\source\runtime\coreuobject\private\uobject\linkerload.cpp:3272]
UE4Editor_CoreUObject!ULinkerLoad::IndexToObject() + 116 bytes [d:\perforce\evan_evan-pc\submerged_git\engine\source\runtime\coreuobject\private\uobject\linkerload.cpp:3425]
UE4Editor_CoreUObject!ULinkerLoad::CreateExport() + 3088 bytes [d:\perforce\evan_evan-pc\submerged_git\engine\source\runtime\coreuobject\private\uobject\linkerload.cpp:3046]
UE4Editor_CoreUObject!ULinkerLoad::LoadAllObjects() + 98 bytes [d:\perforce\evan_evan-pc\submerged_git\engine\source\runtime\coreuobject\private\uobject\linkerload.cpp:2518]
UE4Editor_CoreUObject!LoadPackage() + 911 bytes [d:\perforce\evan_evan-pc\submerged_git\engine\source\runtime\coreuobject\private\uobject\uobjectglobals.cpp:831]
UE4Editor_CoreUObject!ULinkerLoad::VerifyImportInner() + 544 bytes [d:\perforce\evan_evan-pc\submerged_git\engine\source\runtime\coreuobject\private\uobject\linkerload.cpp:2154]
UE4Editor_CoreUObject!ULinkerLoad::VerifyImport() + 173 bytes [d:\perforce\evan_evan-pc\submerged_git\engine\source\runtime\coreuobject\private\uobject\linkerload.cpp:1947]
UE4Editor_CoreUObject!ULinkerLoad::VerifyImportInner() + 844 bytes [d:\perforce\evan_evan-pc\submerged_git\engine\source\runtime\coreuobject\private\uobject\linkerload.cpp:2190]
UE4Editor_CoreUObject!ULinkerLoad::VerifyImport() + 173 bytes [d:\perforce\evan_evan-pc\submerged_git\engine\source\runtime\coreuobject\private\uobject\linkerload.cpp:1947]
UE4Editor_CoreUObject!ULinkerLoad::CreateImport() + 1085 bytes [d:\perforce\evan_evan-pc\submerged_git\engine\source\runtime\coreuobject\private\uobject\linkerload.cpp:3375]
UE4Editor_CoreUObject!ULinkerLoad::IndexToObject() + 233 bytes [d:\perforce\evan_evan-pc\submerged_git\engine\source\runtime\coreuobject\private\uobject\linkerload.cpp:3419]
UE4Editor_CoreUObject!ULinkerLoad::operator<<() + 100 bytes [d:\perforce\evan_evan-pc\submerged_git\engine\source\runtime\coreuobject\private\uobject\linkerload.cpp:3597]
UE4Editor_CoreUObject!UObjectProperty::SerializeItem() + 55 bytes [d:\perforce\evan_evan-pc\submerged_git\engine\source\runtime\coreuobject\private\uobject\propertyobject.cpp:23]
UE4Editor_CoreUObject!FPropertyTag::SerializeTaggedProperty() + 208 bytes [d:\perforce\evan_evan-pc\submerged_git\engine\source\runtime\coreuobject\public\uobject\propertytag.h:133]
UE4Editor_CoreUObject!UStruct::SerializeTaggedProperties() + 11921 bytes [d:\perforce\evan_evan-pc\submerged_git\engine\source\runtime\coreuobject\private\uobject\class.cpp:1159]
UE4Editor_CoreUObject!UStructProperty::SerializeItem() + 480 bytes [d:\perforce\evan_evan-pc\submerged_git\engine\source\runtime\coreuobject\private\uobject\propertystruct.cpp:125]
UE4Editor_CoreUObject!UArrayProperty::SerializeItem() + 330 bytes [d:\perforce\evan_evan-pc\submerged_git\engine\source\runtime\coreuobject\private\uobject\propertyarray.cpp:77]
UE4Editor_CoreUObject!FPropertyTag::SerializeTaggedProperty() + 208 bytes [d:\perforce\evan_evan-pc\submerged_git\engine\source\runtime\coreuobject\public\uobject\propertytag.h:133]
UE4Editor_CoreUObject!UStruct::SerializeTaggedProperties() + 11921 bytes [d:\perforce\evan_evan-pc\submerged_git\engine\source\runtime\coreuobject\private\uobject\class.cpp:1159]
UE4Editor_CoreUObject!UObject::SerializeScriptProperties() + 300 bytes [d:\perforce\evan_evan-pc\submerged_git\engine\source\runtime\coreuobject\private\uobject\obj.cpp:882]
UE4Editor_CoreUObject!UObject::Serialize() + 662 bytes [d:\perforce\evan_evan-pc\submerged_git\engine\source\runtime\coreuobject\private\uobject\obj.cpp:824]
UE4Editor_CoreUObject!ULinkerLoad::Preload() + 2061 bytes [d:\perforce\evan_evan-pc\submerged_git\engine\source\runtime\coreuobject\private\uobject\linkerload.cpp:2765]
UE4Editor_CoreUObject!EndLoad() + 755 bytes [d:\perforce\evan_evan-pc\submerged_git\engine\source\runtime\coreuobject\private\uobject\uobjectglobals.cpp:1089]
UE4Editor_CoreUObject!LoadPackage() + 973 bytes [d:\perforce\evan_evan-pc\submerged_git\engine\source\runtime\coreuobject\private\uobject\uobjectglobals.cpp:831]
UE4Editor_Engine!UEngine::LoadMap() + 5238 bytes [d:\perforce\evan_evan-pc\submerged_git\engine\source\runtime\engine\private\unrealengine.cpp:8584]
UE4Editor_Engine!UEngine::Browse() + 1552 bytes [d:\perforce\evan_evan-pc\submerged_git\engine\source\runtime\engine\private\unrealengine.cpp:7874]
UE4Editor_Engine!UGameInstance::StartGameInstance() + 438 bytes [d:\perforce\evan_evan-pc\submerged_git\engine\source\runtime\engine\private\gameinstance.cpp:281]
UE4Editor_Engine!UGameEngine::Init() + 1256 bytes [d:\perforce\evan_evan-pc\submerged_git\engine\source\runtime\engine\private\gameengine.cpp:478]
UE4Editor!FEngineLoop::Init() + 551 bytes [d:\perforce\evan_evan-pc\submerged_git\engine\source\runtime\launch\private\launchengineloop.cpp:1853]
UE4Editor!GuardedMain() + 292 bytes [d:\perforce\evan_evan-pc\submerged_git\engine\source\runtime\launch\private\launch.cpp:128]
UE4Editor!GuardedMainWrapper() + 26 bytes [d:\perforce\evan_evan-pc\submerged_git\engine\source\runtime\launch\private\windows\launchwindows.cpp:125]
UE4Editor!WinMain() + 249 bytes [d:\perforce\evan_evan-pc\submerged_git\engine\source\runtime\launch\private\windows\launchwindows.cpp:201]
UE4Editor!__tmainCRTStartup() + 329 bytes [f:\dd\vctools\crt\crtw32\dllstuff\crtexe.c:618]

Any ideas?

Could you set break point and point exactly where and why it crashes? It’s odd that it works in cooked, but in -game. It seems it’s properly set up. I suppose you have your custom editor module?

Thanks,

–Lina,

I have the exact same issue, with the same causes: a custom anim graph node in our custom editor module, and a custom anim node in our game module.
log is the same:

[2015.01.05-22.11.59:992][227]LogUObjectGlobals:Warning: Failed to load ‘/Script/MyGameNameEditorCustomization’: Can’t find file ‘/Script/MyGameNameEditorCustomization’
[2015.01.05-22.11.59:992][227]LogLinker:Warning: Can’t find file for asset ‘/Script/MyGameNameEditorCustomization’ while loading NULL.

[2015.01.05-22.12.00:004][227]LogLinker:Warning: CreateExport: Failed to load Outer for resource ‘EdGraphPin_12917’: AnimGraphNode_MyCustomNode /Game/Character/Common_NPC/Common_NPC_AnimBlueprint.Common_NPC_AnimBlueprint:AnimGraph.AnimGraphNode_MyCustomNode_1

in FNodeVisitorDownPoseWires::TraverseNodes:

				for (int32 j = 0; j < MyPin->LinkedTo.Num(); ++j)
				{
					UEdGraphPin* OtherPin = MyPin->LinkedTo[j];
					UEdGraphNode* OtherNode = OtherPin->GetOwningNode();

OtherPin seems to be null: there is one null LinkedTo element.

The Editor is crashing on this line:
AnimBlueprintCompiler.cpp:439

Specifically within:

void FAnimBlueprintCompiler::PruneIsolatedAnimationNodes()

void TraverseNodes()

The editor is attempting to recompile all blueprints, however it is not loading the ‘UE4Editor-SubmergedEditor.dll’ which is our editor module.

Because of that the following is showing up in the log:

[2015.01.05-22.14.17:544][  0]LogUObjectGlobals:Warning: Failed to load '/Script/SubmergedEditor': Can't find file for asset '/Script/SubmergedEditor' while loading NULL.

It is attempting to clip any unnecessary nodes.

It gets to the following node where I have attached my custom node:

Node = 0x0000000025ca8a00 (Name=0x0000000002479bb8 "AnimGraphNode_StateResult"_30)

Inside this object it has a single linked node, but it is NULL due to it not being able to create the AnimGraphNode:

LinkedTo = Num=1
[0] = 0x0000000000000000 (Name=)

So due to the -Game it does not load our editor module, but it tries to compile blueprints anyway.

The full Log is in the question above, so I hope that is enough info.

Cheers.

EDIT:

Forgot to mention; further up in the crash stack, it checks whether we are using cooked content or not. As we are not, it attempts to go through the editor path, which is causing the recompile.

It’s a simple matter of it not taking the -game into account correctly.

Are you on 4.6 or 4.5.1 like myself?

Just wondering if an engine upgrade might fix the issue.

on 4.5.0 still

Hey -

Does this still happen for you in 4.6.1 or the current preview version of 4.7? If you are still experiencing this problem let us know and we will continue to investigate.

Cheers

We’ll be upgrading the engine to 4.6 sometime in the near future.
I’ll let you know if i’m still having issues when we do.

Cheers.

So we’ve just finished upgrading to 4.6 and this issue is still happening.
I’m in the middle of grabbing the latest 4.7 build so I can test that as well.

I’ll post again when I have finished testing 4.7. (Probably later today.)

And I’ve just finished testing on the latest 4.7.
This issue is still there.

This issue is one currently stopping us from shipping.
If this is fixed in the near future, could we get the specific Change List so we can manually merge this in?

Also did you need a demo project with this issue?

Cheers guys.

Hi ,

If you have a small demo project that reflects this issue that you can provide, that would be great. I was unsuccessful at recreating this issue myself.

Hey again, I’ve attached a Test Project.

It’s based on a FPS starter project. (I ripped out the starter content to get it to fit.)

So you’ll need to create a new FPS project named Test47 and then Unzip the zipped content over the top. (Replacing everything.)

Once you copy the zipped source/content over the top, run the editor and add a “TestActor” blueprint into the level.

Then modify the “Character\Test_AnimBlueprint” so it causes it to want to recompile. Now save the Anim Blueprint but DO NOT recompile it. (This is important.)

Quit the Editor and start it again with -game. It should now crash on start-up.

Let me know if you need any further help with the issue.

Hey, I haven’t heard anything back on this.
Is this still being looked into?

Cheers.

Sorry for the delay. I have a few dozen issues all demanding my attention and I sometimes get drawn away from one of them for a while. I am still looking into this issue, though.

I plan on taking a closer look at the test project you provided (thank you for that) tomorrow morning. Am I correct in assuming that you used one of the 4.7 Preview versions from the Launcher to make it?

Yes it is created from a 4.7 preview project.

Cheers for the update. :slight_smile:

Hey, following a suggestion by Nick Whiting, we are manually loading the modules involved in anim graph compilation:

So I added this to our game project’s StartupModule:

#if WITH_EDITOR
		FModuleManager::Get().LoadModule( TEXT("BlueprintGraph") );
		FModuleManager::Get().LoadModule( TEXT("AnimGraph") );
		FModuleManager::Get().LoadModule( TEXT("MyGameEditor") ); // <- contains the anim graph node
#endif

Since WITH_EDITOR is only true on game modules for standalone or cooking (and editor, obviously), this shouldn’t end up pulling editor modules into a cooked game build.

I’m not 100% sure this is a definitive fix, but so far it addresses crashing both during cook and loading standalone with an uncompiled anim blueprint.

Thanks for that, that’s fixed the issue for me as well.
I didn’t realize there was a way to manually load game modules.

Cheers for the fix and info. :slight_smile:

Thank you for the information, cmartel. I wasn’t aware that manually loading modules could be used as a workaround.

I will keep poking around with this to see if I can narrow down the issue further. Unfortunately I have already updated to 4.7 Preview 5, and it seems that it is not happy with the sample project that was provided. I’ll try creating a new project using the sample project as a guide instead of copying the files over directly.

Oh man, you and Nick are absolute champs - this saved me quite a lot of time :smiley: Thanks for sharing!

For anyone who wants a specific example of how to make their own game module, replace this (in your MyGame.cpp):

#include "MyGame.h"

IMPLEMENT_GAME_MODULE(FDefaultGameModuleImpl, MyGame);

With this:

#include "MyGame.h"

class FMyGameModule
	: public FDefaultGameModuleImpl
{
#if WITH_EDITOR
	virtual void StartupModule() override
	{
		FModuleManager::Get().LoadModule(TEXT("MyGameEditor"));
	}
#endif // WITH_EDITOR
};

IMPLEMENT_GAME_MODULE(FMyGameModule, MyGame);

Hi , I’ve confirmed that this is still the case for me in 4.8.2.
Am using a custom AnimNode and custom editor module which will crash when running Standalone game. The above workaround fixed my issue.