Jay2645 / Unreal-Polygonal-Map-Gen

An Unreal Engine 4 implementation of the Polygonal Map Generator for generating islands found at http://www-cs-students.stanford.edu/~amitp/game-programming/polygon-map-generation/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CreateHeightmap() crashes

KammererTob opened this issue · comments

commented

First off: Great plugin.
I tried to use it to generate me a heightmap, but it seems to be crashing nearly everytime at different completion percentages.
I will try to provide as much information as possible.

  1. This is how my Level Blueprint is set up.
    image

  2. This is the trace of the error (happens most often):

Assertion failed: Index>=0 && Index<NumBits [File:F:\Programme\Epic Games\UE_4.16\Engine\Source\Runtime\Core\Public\Containers/BitArray.h] [Line: 575] 



KERNELBASE
UE4Editor_Core
UE4Editor_Core
UE4Editor_Core
UE4Editor_PolygonalMapGenerator!TSparseArray<TSetElement<TTuple<FVector2D,int> >,TSparseArrayAllocator<FDefaultAllocator,FDefaultBitArrayAllocator> >::AllocateIndex() [f:\programme\epic games\ue_4.16\engine\source\runtime\core\public\containers\sparsearray.h:78]
UE4Editor_PolygonalMapGenerator!TSet<TTuple<FVector2D,int>,TDefaultMapHashableKeyFuncs<FVector2D,int,0>,FDefaultSetAllocator>::Emplace<TPairInitializer<FVector2D const & __ptr64,int const & __ptr64> >() [f:\programme\epic games\ue_4.16\engine\source\runtime\core\public\containers\set.h:490]
UE4Editor_PolygonalMapGenerator!UPolygonMap::FindMapCenterForCoordinate() [f:\projekte\ue-projekte\terraintest\plugins\unreal-polygonal-map-gen\source\polygonalmapgenerator\private\maps\polygonmap.cpp:453]
UE4Editor_PolygonalMapGenerator!FHeightmapPointTask::MakeMapPoint() [f:\projekte\ue-projekte\terraintest\plugins\unreal-polygonal-map-gen\source\polygonalmapgenerator\private\maps\heightmap\heightmappointtask.cpp:244]
UE4Editor_PolygonalMapGenerator!FHeightmapPointTask::DoTask() [f:\projekte\ue-projekte\terraintest\plugins\unreal-polygonal-map-gen\source\polygonalmapgenerator\private\maps\heightmap\heightmappointtask.cpp:281]
UE4Editor_PolygonalMapGenerator!TGraphTask<FHeightmapPointTask>::ExecuteTask() [f:\programme\epic games\ue_4.16\engine\source\runtime\core\public\async\taskgraphinterfaces.h:883]
UE4Editor_Core
UE4Editor_Core
UE4Editor_Core
UE4Editor_Core
UE4Editor_Core
kernel32
ntdll

Please let me know if you need any more information/help. I tried to debug it myself, but it is quite hard without getting into the whole plugin first.

So CreateHeightmap is somewhat spaghetti code. If you look at it, you can see that it literally iterates over every single piece of MapData in the whole island, which can take 12 years. Because of that, I split it up into threads, but the threads tend to have stability issues when dealing with larger heightmaps.

I've been moving for the past month or so, and I only got access to stable internet again in the last week. I'll take a look at how to improve that function; I've moved away from CreateHeightmap internally in my own project, but it should be easy to optimize. Hopefully.

I think I've fixed the issue with commit 05f1ff5. I'm closing this for now. Feel free to reopen it if you're still having issues!