SwarmAgent problems UE (trying to invert a NIL matrix)

Hi I’m trying to port our project from 4.7 to 4.8, I have fixed some c++ errors and now it compiles and I can play the game.

The problem is that all previously generated lightmaps seems to be broken, so I decided to recompile lights.

The swarm agent starts but in the “Lightmass Starting” process this error appears in the log:

[link text][1]

After this, the build process ends but there is no crash.

What can I do to solve this?

EDIT:

I have launched the engine in DebugGame configuration and this breakpoint is reached in the gathering scene geometry process:

I think that this is a problem with some foliage mesh, becouse I don´t use any instanced static meshes directly in my project.

I have tried to compile in an empty map with some foliage meshes and it works.

I will keep investigating but It would be nice some help please.

At the end I achieved to fix this issue by changing this lines in UnrealMatrix.h:

UE_LOG(LogUnrealMath, Error, TEXT("FMatrix::InverseFast(), trying to invert a NIL matrix, this results in NaNs! Use Inverse() instead."));
ensureMsg(false, TEXT("FMatrix::InverseFast(), trying to invert a NIL matrix, this results in NaNs! Use Inverse() instead."));

To this:

UE_LOG(LogUnrealMath, Error, TEXT("FMatrix::InverseFast(), trying to invert a NIL matrix, returning identity matrix [RG CODE]."));
return FMatrix::Identity;

This is what the Inverse() functions does inside, after this I recompiled the editor and the unreal Lightmasss and it worked fine.

This error usually comes from a null scaled static object that can be identified using the Map Check tool, it would display an error looking like this :

Error Cylinder6 Cylinder6 : Invalid DrawScale/DrawScale3D

1 Like