Frequent Crash: Assertion failed: CellIndex < CellIndexMax

I think I’ve found a workaround that may be useful until it’s officially fixed.

From my understanding the crash occurs due to a limit being hit in the Nanite Scene Culling code, instead of each instance being culled individually the scene is parsed and grouped into cells so that less bounds checks need to be made. If more than 1048576 cells are created you get the crash.

Two ways you can avoid the crash are:

  1. Disable Nanite scene culling by setting r.SceneCulling 0 this will likely reduce performance so profile this yourself but it let me open my level without crashing to work on it. You can set this in DefaultEngine.ini with:
[ConsoleVariables]
r.SceneCulling=0
  1. Reduce the number of cells so they don’t hit the limit, I did this in my project by increasing the minimum cell size from the default of 4096cm to 16384cm with r.SceneCulling.MinCellSize, the command is read only so can’t be changed once the editor has launched. You can set this in DefaultEngine.ini with:
[ConsoleVariables]
r.SceneCulling.MinCellSize=16384

My level is large and mostly flying around at high altitudes so having less granular culling was pretty inconsequential for me.

You can use the command r.SceneCulling.DebugRenderMode 1 to view the cells and see how your meshes are being grouped and then increase or decrease r.SceneCulling.MinCellSize in the config restarting the editor each time until you find the best value that doesn’t crash and gives you enough culling granularity.

7 Likes