Multiplayer Game Crashes on Stand Alone

Assertion failed: GIsEditor || bCreatingCDO || !InClass->HasAnyClassFlags(CLASS_Abstract) [File:D:\Build++UE4+Release-4.13+Compile\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\UObjectGlobals.cpp] [Line: 2214]

UE4Editor_Core!FDebug::AssertFailed() [d:\build\++ue4+release-4.13+compile\sync\engine\source\runtime\core\private\misc\outputdevice.cpp:421]
UE4Editor_CoreUObject!StaticAllocateObject() [d:\build\++ue4+release-4.13+compile\sync\engine\source\runtime\coreuobject\private\uobject\uobjectglobals.cpp:2215]
UE4Editor_CoreUObject!StaticConstructObject_Internal() [d:\build\++ue4+release-4.13+compile\sync\engine\source\runtime\coreuobject\private\uobject\uobjectglobals.cpp:3141]
UE4Editor_CoreUObject!FObjectInitializer::CreateDefaultSubobject() [d:\build\++ue4+release-4.13+compile\sync\engine\source\runtime\coreuobject\private\uobject\uobjectglobals.cpp:3590]
UE4Editor_CoreUObject!UObject::CreateDefaultSubobject() [d:\build\++ue4+release-4.13+compile\sync\engine\source\runtime\coreuobject\private\uobject\obj.cpp:87]
UE4Editor_AdvMovProject!AInventoryItem::AInventoryItem() [c:\users\fang\desktop\networking_1.0\networking\source\advmovproject\private\inventoryitem.cpp:13]
UE4Editor_CoreUObject!UClass::CreateDefaultObject() [d:\build\++ue4+release-4.13+compile\sync\engine\source\runtime\coreuobject\private\uobject\class.cpp:2524]
UE4Editor_CoreUObject!UObjectLoadAllCompiledInDefaultProperties() [d:\build\++ue4+release-4.13+compile\sync\engine\source\runtime\coreuobject\private\uobject\uobjectbase.cpp:745]
UE4Editor_CoreUObject!ProcessNewlyLoadedUObjects() [d:\build\++ue4+release-4.13+compile\sync\engine\source\runtime\coreuobject\private\uobject\uobjectbase.cpp:830]
UE4Editor_CoreUObject!TBaseStaticDelegateInstance<void __cdecl(void)>::ExecuteIfSafe() [d:\build\++ue4+release-4.13+compile\sync\engine\source\runtime\core\public\delegates\delegateinstancesimpl.h:1017]
UE4Editor_Core!TBaseMulticastDelegate<void>::Broadcast() [d:\build\++ue4+release-4.13+compile\sync\engine\source\runtime\core\public\delegates\delegatesignatureimpl.inl:921]
UE4Editor_Core!FModuleManager::LoadModuleWithFailureReason() [d:\build\++ue4+release-4.13+compile\sync\engine\source\runtime\core\private\modules\modulemanager.cpp:461]
UE4Editor_Projects!FModuleDescriptor::LoadModulesForPhase() [d:\build\++ue4+release-4.13+compile\sync\engine\source\runtime\projects\private\moduledescriptor.cpp:398]
UE4Editor_Projects!FProjectManager::LoadModulesForProject() [d:\build\++ue4+release-4.13+compile\sync\engine\source\runtime\projects\private\projectmanager.cpp:53]
UE4Editor!FEngineLoop::LoadStartupModules() [d:\build\++ue4+release-4.13+compile\sync\engine\source\runtime\launch\private\launchengineloop.cpp:2218]
UE4Editor!FEngineLoop::PreInit() [d:\build\++ue4+release-4.13+compile\sync\engine\source\runtime\launch\private\launchengineloop.cpp:1653]
UE4Editor!GuardedMain() [d:\build\++ue4+release-4.13+compile\sync\engine\source\runtime\launch\private\launch.cpp:117]
UE4Editor!GuardedMainWrapper() [d:\build\++ue4+release-4.13+compile\sync\engine\source\runtime\launch\private\windows\launchwindows.cpp:126]
UE4Editor!WinMain() [d:\build\++ue4+release-4.13+compile\sync\engine\source\runtime\launch\private\windows\launchwindows.cpp:202]
UE4Editor!__scrt_common_main_seh() [f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:264]
kernel32
ntdll

A while ago I worked my way through the Steam multiplayer tutorial and I keep a basic multiplayer project to use as a template. I merged content from another project into it, but I get mysterious errors now that I don’t understand.

Hey BlackRang666,

It looks like you are trying to create a abstract class, causing the assertion. I am unable to do much unless you post the code.

Thanks.

Do you know of anything that would cause it to think its creating an abstract class? It works properly in New Editor Play Window.

It could be a lot of things. In your case, no, I can’t give you an exact reason why its happening.

Can you give me any more information on your project or what you might think it would be?

I tracked it down.

Stand Alone does not like this line in the c++ constructor of my inventory item base class.

Mesh = ObjectInitializer.CreateDefaultSubobject(this, AInventoryItem::MeshName());

Do you know why it would have a problem with that?

It seems fine, as long as AInventoryItem::MeshName( ) is actually accessible in the constructor. You are also using the old way of creating a default subobject. The format now is:

Mesh = CreateDefaultSubobject<UStaticMeshComponent>( TEXT("Mesh") );

Its still throwing an error on

Mesh = CreateDefaultSubobject<UMeshComponent>(MeshName());

It is unusual that it works fine in the other editor modes.

What is the error?

UE4Editor_AdvMovProject!AInventoryItem::AInventoryItem()
[c:\users\fang\desktop\networking_1.0\networking\source\advmovproject\private\inventoryitem.cpp:13]

That is the relevant line from the list above.

Can you post the whole call stack? The idea here is to give me all the information you have on the crash. It’s difficult to understand whats going on with one line at a time.

Thanks.

I edited it into the first post because the character limits on comments is too small

Can you try:

Mesh = CreateDefaultSubobject<UMeshComponent>(TEXT("Mesh"));

Mesh = CreateDefaultSubobject(TEXT(“Mesh”));

works, but

Mesh = CreateDefaultSubobject<UMeshComponent>(TEXT("RootMesh"));

gives the same error as before.

FName AInventoryItem::MeshName()
{
	return FName("RootMesh");
}

That is the method I was using to set the name.

I changed both to “Mesh” and got the crash again.

I removed the refferences to that function entirely by changing my chlid class’s constructor from

ASkeletalMeshItem::ASkeletalMeshItem(const FObjectInitializer& ObjectInitializer)
	: Super(ObjectInitializer.SetDefaultSubobjectClass<USkeletalMeshComponent>(AInventoryItem::MeshName()))
{
	SkeletalMesh = Cast<USkeletalMeshComponent>(Mesh);
}

to

ASkeletalMeshItem::ASkeletalMeshItem(const FObjectInitializer& ObjectInitializer)
	: Super(ObjectInitializer.SetDefaultSubobjectClass<USkeletalMeshComponent>("Mesh"))
{
	SkeletalMesh = Cast<USkeletalMeshComponent>(Mesh);
}

and still get the crash.

My guess is that TEXT(“RootMesh”) is already used at some level, giving you an error.

Secondly,

Is “Mesh” a SkeletalMesh?

In:

SkeletalMesh = Cast<USkeletalMeshComponent>(Mesh);

As I stated, I changed all instances of “RootMesh” to “Mesh” and it did not resolve the issue.

How would I cast text into a component?

I mis-read, updated the comment to reflect my mistake.

Mesh was a UMeshComponent

I resolved the issue by removing Mesh completely and replacing references to it with GetRootComponent();