I got a crash with a packaged version of my game.
When playing directly in the editor, there is no problem. So it is very difficult for me to debug it.
Please someone help me. ^^
Here are the log for the error.
[2025.05.07-19.27.05:014][170]LogWindows: Error: === Critical error: ===
[2025.05.07-19.27.05:014][170]LogWindows: Error:
[2025.05.07-19.27.05:014][170]LogWindows: Error: Assertion failed: Count > 0 [File:D:\build++UE5\Sync\Engine\Source\Runtime\Engine\Private\Rendering\ColorVertexBuffer.cpp] [Line: 350]
[2025.05.07-19.27.05:014][170]LogWindows: Error:
[2025.05.07-19.27.05:014][170]LogWindows: Error:
[2025.05.07-19.27.05:014][170]LogWindows: Error:
[2025.05.07-19.27.05:014][170]LogWindows: Error: [Callstack] 0x00007ff77ec7f125 Orc.exe!FColorVertexBuffer::InitFromColorArray()
[2025.05.07-19.27.05:014][170]LogWindows: Error: [Callstack] 0x00007ff77e0b1402 Orc.exe!USkinnedMeshComponent::SetVertexColorOverride()
[2025.05.07-19.27.05:014][170]LogWindows: Error: [Callstack] 0x00007ff77e0b1706 Orc.exe!USkinnedMeshComponent::SetVertexColorOverride_LinearColor()
[2025.05.07-19.27.05:014][170]LogWindows: Error: [Callstack] 0x00007ff780ac30a7 Orc.exe!UGoreComponent::InitializeVertexColors() [D:\build\U5M-Marketplace\Sync\LocalBuilds\PluginTemp\HostProject\Plugins\DismembermentSystem\Source\DismembermentSystem\Private\Gore\GoreComponent.cpp:81]
[2025.05.07-19.27.05:014][170]LogWindows: Error: [Callstack] 0x00007ff780abc723 Orc.exe!TBaseUObjectMethodDelegateInstance<0,UGoreComponent,void __cdecl(void),FNotThreadSafeNotCheckedDelegateUserPolicy>::Execute() [D:\RocketSync\5.4.0-33043543+++UE5+Release-5.4\Working\Engine\Source\Runtime\Core\Public\Delegates\DelegateInstancesImpl.h:650]
[2025.05.07-19.27.05:014][170]LogWindows: Error: [Callstack] 0x00007ff77f171061 Orc.exe!FTimerUnifiedDelegate::Execute()
[2025.05.07-19.27.05:014][170]LogWindows: Error: [Callstack] 0x00007ff77f1f9922 Orc.exe!FTimerManager::Tick()
[2025.05.07-19.27.05:014][170]LogWindows: Error: [Callstack] 0x00007ff77e6200a0 Orc.exe!UWorld::Tick()
[2025.05.07-19.27.05:014][170]LogWindows: Error: [Callstack] 0x00007ff77e372499 Orc.exe!UGameEngine::Tick()
[2025.05.07-19.27.05:014][170]LogWindows: Error: [Callstack] 0x00007ff77f9d30ba Orc.exe!FEngineLoop::Tick()
[2025.05.07-19.27.05:014][170]LogWindows: Error: [Callstack] 0x00007ff77f9eb40c Orc.exe!GuardedMain()
[2025.05.07-19.27.05:014][170]LogWindows: Error: [Callstack] 0x00007ff77f9eb4da Orc.exe!GuardedMainWrapper()
[2025.05.07-19.27.05:014][170]LogWindows: Error: [Callstack] 0x00007ff77f9ee0a5 Orc.exe!LaunchWindowsStartup()
[2025.05.07-19.27.05:014][170]LogWindows: Error: [Callstack] 0x00007ff77f9fe384 Orc.exe!WinMain()
[2025.05.07-19.27.05:014][170]LogWindows: Error: [Callstack] 0x00007ff784264d3a Orc.exe!__scrt_common_main_seh() [D:\a_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288]
[2025.05.07-19.27.05:014][170]LogWindows: Error: [Callstack] 0x00007ffe63b1e8d7 KERNEL32.DLL!UnknownFunction
[2025.05.07-19.27.05:014][170]LogWindows: Error:
[2025.05.07-19.27.05:017][170]LogExit: Executing StaticShutdownAfterError
[2025.05.07-19.27.05:018][170]LogWindows: FPlatformMisc::RequestExit(1, LaunchWindowsStartup.ExceptionHandler)
[2025.05.07-19.27.05:018][170]LogWindows: FPlatformMisc::RequestExitWithStatus(1, 3, LaunchWindowsStartup.ExceptionHandler)
[2025.05.07-19.27.05:018][170]LogCore: Engine exit requested (reason: Win RequestExit)
So it is an error coming from an special actor component on my enemies characters.
Here is the code :
void UGoreComponent::InitializeVertexColors()
{
if(IsRunningDedicatedServer()) return;
for (USkeletalMeshComponent* Mesh : GetAllMeshes())
{
if(!IsValid(Mesh)) continue;
for (int32 i = 0; i < Mesh->GetNumLODs(); i++)
{
TArray<FLinearColor> Colors = GetCurrentVertexColors(Mesh, i);
SetLinearColorChannel(Colors, 0.f, BloodVertexChannel);
Mesh->SetVertexColorOverride_LinearColor(i, Colors);
}
}
}
Then inside Mesh->SetVertexColorOverride_LinearColor (Mesh being a SkinnedMeshComponent)
void USkinnedMeshComponent::SetVertexColorOverride_LinearColor(int32 LODIndex, const TArray<FLinearColor>& VertexColors)
{
TArray<FColor> Colors;
if (VertexColors.Num() > 0)
{
Colors.SetNum(VertexColors.Num());
for (int32 ColorIdx = 0; ColorIdx < VertexColors.Num(); ColorIdx++)
{
Colors[ColorIdx] = VertexColors[ColorIdx].ToFColor(false);
}
}
SetVertexColorOverride(LODIndex, Colors);
}
Then
void USkinnedMeshComponent::SetVertexColorOverride(int32 LODIndex, const TArray<FColor>& VertexColors)
{
LLM_SCOPE_BYNAME(TEXT("SkeletalMesh/VertexColorOverride"));
InitLODInfos();
FSkeletalMeshRenderData* SkelMeshRenderData = GetSkeletalMeshRenderData();
// If we have a render resource, and the requested LODIndex is valid (for both component and mesh, though these should be the same)
if (SkelMeshRenderData != nullptr && LODInfo.IsValidIndex(LODIndex) && SkelMeshRenderData->LODRenderData.IsValidIndex(LODIndex))
{
ensure(LODInfo.Num() == SkelMeshRenderData->LODRenderData.Num());
FSkelMeshComponentLODInfo& Info = LODInfo[LODIndex];
if (Info.OverrideVertexColors != nullptr)
{
Info.ReleaseOverrideVertexColorsAndBlock();
}
const TArray<FColor>* UseColors;
TArray<FColor> ResizedColors;
FSkeletalMeshLODRenderData& LODData = SkelMeshRenderData->LODRenderData[LODIndex];
const int32 ExpectedNumVerts = LODData.StaticVertexBuffers.PositionVertexBuffer.GetNumVertices();
// If colors passed in are correct size, just use them
if (VertexColors.Num() == ExpectedNumVerts)
{
UseColors = &VertexColors;
}
// If not the correct size, resize to correct size
else
{
// presize array
ResizedColors.AddUninitialized(ExpectedNumVerts);
// Copy while input and output are valid
int32 VertCount = 0;
while (VertCount < ExpectedNumVerts)
{
if (VertCount < VertexColors.Num())
{
ResizedColors[VertCount] = VertexColors[VertCount];
}
else
{
ResizedColors[VertCount] = FColor::White;
}
VertCount++;
}
UseColors = &ResizedColors;
}
Info.OverrideVertexColors = new FColorVertexBuffer;
Info.OverrideVertexColors->InitFromColorArray(*UseColors);
BeginInitResource(Info.OverrideVertexColors, &UE::RenderCommandPipe::SkeletalMesh);
MarkRenderStateDirty();
}
}
void FColorVertexBuffer::InitFromColorArray( const FColor *InColors, const uint32 Count, const uint32 InStride, bool bNeedsCPUAccess)
{
check( Count > 0 );
NumVertices = Count;
NeedsCPUAccess = bNeedsCPUAccess;
// Allocate the vertex data storage type.
AllocateData(bNeedsCPUAccess);
// Copy the colors
{
VertexData->ResizeBuffer(Count);
const uint8 *Src = (const uint8 *)InColors;
FColor *Dst = (FColor *)VertexData->GetDataPointer();
for( uint32 i = 0; i < Count; ++i)
{
*Dst++ = *(const FColor*)Src;
Src += InStride;
}
}
// Make a copy of the vertex data pointer.
Data = VertexData->GetDataPointer();
}
Since the component is a from a plugin from the marketplace, should I do something about it when packaging the game ?