Why does the assertion fail if I disconnect a tick exec line, hit play, then reconnect it?

I’ve been randomly running into this assert occasionally when hitting Play. For whatever reason if I disconnect a tick exec line, hit play, then reconnect it, the assert doesn’t seem to happen. Does anyone have any insight into this?

Assertion failed: ScreenSizeInTexels >= 0


Note: This assert doesn’t seem to happen when running in DebugGame Editor. And only when hitting Play (Simulation and Launch is fine).

Yea, got the same issue:)

Engine version 4.5 I was lucky because this was debugging session:)

Stack trace:

>	UE4Editor-Core-Win64-Debug.dll!StaticFailDebug(const wchar_t * Error, const char * File, int Line, const wchar_t * Description, bool bIsEnsure) Line 186	C++
 	UE4Editor-Core-Win64-Debug.dll!FDebug::AssertFailed(const char * Expr, const char * File, int Line, const wchar_t * Format, ...) Line 220	C++
 	UE4Editor-Engine-Win64-Debug.dll!FFloatMipLevel::FromScreenSizeInTexels(float ScreenSizeInTexels) Line 520	C++
 	UE4Editor-Engine-Win64-Debug.dll!FStreamingManagerTexture::CalcWantedMips(FStreamingTexture & StreamingTexture) Line 4028	C++
 	UE4Editor-Engine-Win64-Debug.dll!FAsyncTextureStreaming::DoWork() Line 1136	C++
 	UE4Editor-Engine-Win64-Debug.dll!FAsyncTask<FAsyncTextureStreaming>::DoWork() Line 296	C++
 	UE4Editor-Engine-Win64-Debug.dll!FAsyncTask<FAsyncTextureStreaming>::DoThreadedWork() Line 318	C++
 	UE4Editor-Core-Win64-Debug.dll!FQueuedThread::Run() Line 326	C++
 	UE4Editor-Core-Win64-Debug.dll!FRunnableThreadWin::Run() Line 71	C++
 	UE4Editor-Core-Win64-Debug.dll!FRunnableThreadWin::GuardedRun() Line 48	C++
 	UE4Editor-Core-Win64-Debug.dll!FRunnableThreadWin::_ThreadProc(void * pThis) Line 85	C++

The check(ScreenSizeInTexels >= 0); is hit because
ScreenSizeInTexels = -1.#IND0000


  • UTexture (Name=0x000000000df51168 “T_Default_Material_Grid_M”) UTexture

It seems the problem is somewhere near here contentstreaming.cpp:

const float ScreenSizeInTexels = TexelFactor * FMath::InvSqrtEst( DistSqMinusRadiusSq ) * ScreenSize;

Ok, I breakpoint:)

// Calculate distance of viewer to bounding sphere.
const float	DistSq					= FVector::DistSquared( ViewInfo.ViewOrigin, PrimitiveData.BoundingSphere.Center );
 const float	DistSqMinusRadiusSq		= ClampMeshToCameraDistanceSquared(DistSq - FMath::Square(PrimitiveData.BoundingSphere.W));
  bool bbb = FMath::IsNaN(DistSqMinusRadiusSq) || !FMath::IsFinite(DistSqMinusRadiusSq);
   if (bbb)
   	bbb = bbb;

ViewInfo.ViewOrigin = {X=6.60688586e+023 Y=0.000000000 Z=-1.99839716e+018 }

PrimitiveData.BoundingSphere.Center = {X=1645.00000 Y=-10932.0000 Z=108.000000 }

As you see ViewInfo.ViewOrigin has enormous values and the product of

FVector::DistSquared( ViewInfo.ViewOrigin, PrimitiveData.BoundingSphere.Center ); is

	DistSq	1.#INF0000	const float

Which gives ScreenSizeInTexels = -1.#IND0000 in sqrt

Still crashing in 4.6 preview.

Was testing from 4.5 to 4.6 this issue with my fix:

const float	DistSq = FVector::DistSquared( ViewInfo.ViewOrigin, PrimitiveData.BoundingSphere.Center );

changed to:

const float	DistSq = FMath::Min(BIG_NUMBER, FVector::DistSquared(ViewInfo.ViewOrigin, PrimitiveData.BoundingSphere.Center));

without crashing.

Was this ever solved?