Code Monkey home page Code Monkey logo

jay2645 / unreal-polygonal-map-gen Goto Github PK

View Code? Open in Web Editor NEW
356.0 32.0 77.0 2.84 MB

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/

License: Apache License 2.0

C# 1.45% C++ 98.09% C 0.46%
ue4 unreal-engine delaunay-triangulation polygon voronoi voronoi-diagram map-generation unrealengine unreal-engine-4 game

unreal-polygonal-map-gen's Introduction

Polygonal Map Generator

PRs Welcome Maintenance

For legal reasons I'm not allowed to work on this currently. However, I'm still able to review and OK pull requests if need be in the future. This should also work for Unreal 4.21 and (probably) 4.22.

Created for Unreal Engine 4.21

highresscreenshot00005

This is a port of the JavaScript code of Red Blob Games' Polygonal Map Generation for Games.

This port is written in C++ and designed to work in Unreal Engine 4 using the Unreal Engine 4 "Plugin" system. This port works fully with games written in C++ as well as games that use Unreal Engine 4's "Blueprint" system.

It supports Unreal Engine version 4.21.x; you can probably use it for earlier/later versions of the Unreal Engine, but you may have to make slight modifications.

highresscreenshot00000

highresscreenshot00001

highresscreenshot00003

This version is designed to be a fairly barebones port; if you need extra features, I've created a downstream fork which supports things like procedural river names.

Installation

Access through Blueprint only:

If you only want to access everything through Blueprint, you can just clone this project into your <Project Root>/Plugins folder, where <Project Root> is where the .uplugin file is kept. You may have to create the Plugins folder if you haven't made it already. From there, you should be able to drag the pre-made Blueprints into your scene, create new custom Blueprints, or do whatever else you need.

Access through C++ and Blueprints:

  1. Make a Plugins folder at your project root (where the .uproject file is), if you haven't already. Then, clone this project into a subfolder in your Plugins directory. After that, open up your project's .uproject file in Notepad (or a similar text editor), and change the "AdditionalDependencies" and "Plugins" sections to look like this:
	"Modules": [
		{
			"Name": "YourProjectName",
			"Type": "Runtime",
			"LoadingPhase": "Default",
			"AdditionalDependencies": [
				<OTHER DEPENDENCIES GO HERE>
				"PolygonalMapGenerator"
			]
		}
	],
	"Plugins": [
		<OTHER PLUGINS GO HERE>
		{
			"Name": "PolygonalMapGenerator",
			"Enabled": true
		}
	]

If you don't have a "Modules" section, then that usually means that your project isn't set up for C++ yet. First, set your project up to handle C++ code, then you should see the "Modules" section. It's okay if you don't see a "Plugins" section, however -- just add one in there.

In the past, I have gotten linker errors by not listing this in the .uproject file when trying to package a project. People have said you don't need to do it nowadays, so you might be able to skip this step -- even so, I'm listing it here in case any problems arise.

  1. Go into your source code folder, and you'll see a `.build.cs file. Open it up. Under either "PrivateDependencyModuleNames" or "PublicDependencyModuleNames" add a new entry called "PolygonalMapGenerator".

This lets Unreal's Blueprint reflection system "see" your plugin and know to compile it before it compiles the rest of your code, so that you don't get weird linker errors when using things from the plugin.

  1. Open up your project in Unreal. If you get a prompt asking for an Unreal Engine version, you probably missed a comma somewhere in your .uproject file -- make sure all the commas and syntax are correct and try again. If Unreal does start to load, you might be told that your project is out of date, and the editor will ask if you want to rebuild your project. Go ahead and say yes so the plugin can be installed properly (keeping in mind that it might take a while to rebuild).

  2. Open up the Plugins menu, scroll down to the bottom, and ensure that the "PolygonalMapGenerator" plugin is enabled.


Once you have the project set up, you should be able to see it in the sidebar of the Content Browser; simply scroll down to "Polygonal Map Generator." You'll see 2 folders -- "Content" and "C++ Classes." If you don't see it in the Unreal Engine editor, make sure to turn on "Show Plugin Content" in the view options in the bottom-right corner.

  • The "C++ Classes" folder contains, well, the C++ classes. You can right-click on them to create a new Blueprint or C++ class from the classes listed in that folder, or you can just do it the old-fashioned way, like you would inherit from Unreal's Actor class.

  • The "Content" folder contains a bunch of content that can help you when making your own version of the plugin. If you wanted to, you could delete these files, but they give examples on how to set up a map generator and what the different classes in the plugin actually do.

Use

There's a couple "main" classes which make everything tick:

  • The IslandMap class, which (as its name implies) generates islands. It uses a number of Unreal Engine data assets to drive the parameters for island creation; you can drag-and-drop in custom data assets with different parameters if you wanted to create something different.

  • The IslandMapMesh class, which (again, like the name implies), generates islands and then creates a procedural mesh. This mesh is more of a proof-of-concept and quick example than anything robust and ready for gameplay; the class is basically there to show off how to use the data structures "in action," as it were.

  • Various data assets, which actually generate the island. Things like IslandMoisture handles moisture distribution, IslandElevation handles elevation distribution, etc. For the most part, these match the files listed in the source repo.

The main exception to IslandWater, which gives various examples on how to create islands of different shapes and sizes -- IslandSquareWater makes a square island (probably not very useful), IslandRadialWater makes a (mostly) circular island using overlapping Sine waves, and IslandNoiseWater uses simplex noise to create the shape of islands. Of these, I think IslandNoiseWater looks the best -- you can see pictures of the islands it generates at the top of this README file.

There is also an additional file that's not in the source repo, under the "Mesh" folder -- IslandMeshBuilder. There's a couple subclasses IslandSquareMeshBuilder and IslandPoissonMeshBuilder. These lay out the actual vertices used in island creation; in the source repo, the mesh gets passed down with the points already added. These classes govern different ways to lay out the points -- IslandSquareMeshBuilder will do it in a uniform grid, whereas IslandPoissonMeshBuilder uses a poisson distribution to pseudo-randomly lay out all the points.

Advanced

You can mess around with the data assets, creating new subclasses and overriding base methods. Unlike "normal" data assets, these assets should work with Blueprint, if needed.

If you wanted to implement custom water generation, a good way to do so would be to create a new C++ class that inherits from the IslandWaters class and then override whichever method you want to change. Inside Unreal, right-click inside a content folder, then navigate to Miscellaneous -> Data Asset and create a new instance of your custom IslandWaters data asset. Go back to the IslandMap and update the water data asset to point to the one you just made, and it should "just work."

There's also a number of places to "hook" into the island generation code if you wanted to modify the existing logic of a certain step or add your own implementations.

As I mentioned, I tried to keep this port pretty close to the original. I've added a couple things for convenience, such as actual mesh generation as well as a data structure to keep track of rivers (URiver). However, while the rivers are placed, they do not get rendered and the underlying mesh is still the same -- you'll have to either roll your own option or look at that downstream fork I mentioned earlier.

Speaking of mesh generation; it's not perfect -- it does its best to match each triangle to an individual biome for the purposes of assigning materials, but it comes out a bit jagged.

Credits

  • The original code was released under the Apache 2.0 license; this C++ port of the code is also released under the Apache 2.0 license. Again, this was based on the mapgen2 repository.

  • Also included in this code is a port of the DualMesh library; DualMesh is also licensed under Apache 2.0.

  • Poisson Disc Sampling is created using code from the Random Distribution Plugin and used under the Apache 2.0 license.

  • Delaunay Triangulation is created using the MIT-licensed Delaunator and made accessible through a number of Unreal helper functions. Something that's fairly annoying: Delaunay Triangulation is built into the engine, but is only accessible from the Unreal Editor. The data structures aren't exposed to other modules or Blueprint, so you can't use it without linker errors when shipping your game. The Unreal Engine code has a different license, so a third-party library has to be used.

Miscellaneous

Why mapgen2? Why not mapgen4?

Short answer:

Because mapgen4 wasn't open-source yet when I started refactoring all the code from mapgen1 to mapgen2 (as far as I can tell, there is no mapgen3).

Longer answer:

I'm not the biggest fan of mapgen4. In the future, I may borrow some concepts regarding river representation, and I do enjoy how the rivers get laid out. I'm also unhappy with the current way of determining elevation (it's just distance from the nearest coastline), and I like the idea of having moisture determined by rainfall.

However, I don't like how mapgen4 looks. It's a different approach to things -- it goes for a "handcrafted map" look, but that means there's a very distinct change division between hills and mountains, that's not very realistic. It's also designed in a way to let the user paint it; again, this is a cool idea, and one I might try to implement someday, but it's not the goal I was going for with this project. Ultimately, while there are some cool aspects to it (linked above), I prefer the way that mapgen2 feels (for the most part).

unreal-polygonal-map-gen's People

Contributors

jay2645 avatar thejimster82 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

unreal-polygonal-map-gen's Issues

Calling UBiomeManager::DetermineBiome() from another thread SOMETIMES results in a crash

This appears to be an issue with Unreal itself, particularly the use of BlueprintNativeEvent to build the Biome code. I don't want to get rid of the BlueprintNativeEvent tag for DetermineBiome for Blueprint-only users, but at the same time I don't know of a good fix.

In the meantime, the multithreaded heightmap maker uses a polygon-based system and takes biomes directly from the polygon. So far, this has resulted in somewhat better results overall anyway, but the older per-pixel approach still has some merit.

UE4 editor crashes every time runs the Example Project

Working with UE4.16, the UE4 editor crashes and closes every time when I run the Example Project.
I can't fix it :-(
Any help is appreciated.

This is part of the output log.

[2017.07.26-08.53.08:998][421]LogWorldGen: Created a total of 1500 Centers, 2977 Corners, and 8928 Edges.
[2017.07.26-08.53.08:999][421]LogWorldGen: Created graph in 0.512500 seconds.
[2017.07.26-08.53.09:081][422]LogWorldGen: Elevations assigned in 0.594419 seconds.
[2017.07.26-08.53.53:468][423]LogWindows:Warning: CreateProc failed (2) ../../../Engine/Binaries/Win64/CrashReportClient.exe "F:/myTerrainTest/UnrealPolygonalMapGenExample-master/Saved/Crashes/UE4CC-Windows-B9ECDBDF4FEE66820964738B60FB8673_0001" -AppName=UE4-PolygonalMapExample -CrashGUID=UE4CC-Windows-B9ECDBDF4FEE66820964738B60FB8673_0001 -DebugSymbols=......\Engine\Intermediate\Symbols
[2017.07.26-08.53.53:468][423]LogWindows: Could not start CrashReportClient.exe
[2017.07.26-08.53.53:468][423]LogMemory: Platform Memory Stats for Windows
[2017.07.26-08.53.53:468][423]LogMemory: Process Physical Memory: 1719.66 MB used, 1882.98 MB peak
[2017.07.26-08.53.53:468][423]LogMemory: Process Virtual Memory: 2108.33 MB used, 2179.91 MB peak
[2017.07.26-08.53.53:468][423]LogMemory: Physical Memory: 15617.14 MB used, 17067.18 MB free, 32684.32 MB total
[2017.07.26-08.53.53:468][423]LogMemory: Virtual Memory: 3046.39 MB used, 17067.18 MB free, 8388608.00 MB total
[2017.07.26-08.53.53:468][423]LogCrashTracker:

[2017.07.26-08.53.53:468][423]LogCrashTracker:

[2017.07.26-08.53.53:468][423]LogWindows:Error: === Critical error: ===
[2017.07.26-08.53.53:468][423]LogWindows:Error:
[2017.07.26-08.53.53:468][423]LogWindows:Error: Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0x00000068
[2017.07.26-08.53.53:468][423]LogWindows:Error:
[2017.07.26-08.53.53:468][423]LogWindows:Error: UE4Editor-Engine.dll!TMapBase<FName,unsigned char * __ptr64,FDefaultSetAllocator,TDefaultMapHashableKeyFuncs<FName,unsigned char * __ptr64,0> >::GetKeys() [e:\tigerknightorbis\unrealengine\engine\source\runtime\core\public\containers\map.h:266]
[2017.07.26-08.53.53:468][423]LogWindows:Error: UE4Editor-Engine.dll!UDataTable::GetRowNames() [e:\tigerknightorbis\unrealengine\engine\source\runtime\engine\private\datatable.cpp:635]
[2017.07.26-08.53.53:468][423]LogWindows:Error: UE4Editor-PolygonalMapGenerator.dll!URiver::InitializeRiver() [f:\myterraintest\unrealpolygonalmapgenexample-master\plugins\polygonalmapgenerator\source\polygonalmapgenerator\private\maps\moisture\river.cpp:76]
[2017.07.26-08.53.53:468][423]LogWindows:Error: UE4Editor-PolygonalMapGenerator.dll!UMoistureDistributor::CreateRivers() [f:\myterraintest\unrealpolygonalmapgenexample-master\plugins\polygonalmapgenerator\source\polygonalmapgenerator\private\maps\moisture\moisturedistributor.cpp:615]
[2017.07.26-08.53.53:468][423]LogWindows:Error: UE4Editor-PolygonalMapGenerator.dll!AIslandMapGenerator::AssignMoisture() [f:\myterraintest\unrealpolygonalmapgenexample-master\plugins\polygonalmapgenerator\source\polygonalmapgenerator\private\maps\islandmapgenerator.cpp:339]
[2017.07.26-08.53.53:468][423]LogWindows:Error: UE4Editor-CoreUObject.dll!UFunction::Invoke() [e:\tigerknightorbis\unrealengine\engine\source\runtime\coreuobject\private\uobject\class.cpp:4461]
[2017.07.26-08.53.53:468][423]LogWindows:Error: UE4Editor-CoreUObject.dll!UObject::ProcessEvent() [e:\tigerknightorbis\unrealengine\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:1313]
[2017.07.26-08.53.53:468][423]LogWindows:Error: UE4Editor-Engine.dll!AActor::ProcessEvent() [e:\tigerknightorbis\unrealengine\engine\source\runtime\engine\private\actor.cpp:695]
[2017.07.26-08.53.53:468][423]LogWindows:Error: UE4Editor-PolygonalMapGenerator.dll!AIslandMapGenerator::ExecuteNextMapStep() [f:\myterraintest\unrealpolygonalmapgenexample-master\plugins\polygonalmapgenerator\source\polygonalmapgenerator\private\maps\islandmapgenerator.cpp:120]
[2017.07.26-08.53.53:468][423]LogWindows:Error: UE4Editor-Engine.dll!AActor::TickActor() [e:\tigerknightorbis\unrealengine\engine\source\runtime\engine\private\actor.cpp:874]
[2017.07.26-08.53.53:468][423]LogWindows:Error: UE4Editor-Engine.dll!FActorTickFunction::ExecuteTick() [e:\tigerknightorbis\unrealengine\engine\source\runtime\engine\private\actor.cpp:126]
[2017.07.26-08.53.53:468][423]LogWindows:Error: UE4Editor-Engine.dll!FTickFunctionTask::DoTask() [e:\tigerknightorbis\unrealengine\engine\source\runtime\engine\private\ticktaskmanager.cpp:269]
[2017.07.26-08.53.53:468][423]LogWindows:Error: UE4Editor-Engine.dll!TGraphTask::ExecuteTask() [e:\tigerknightorbis\unrealengine\engine\source\runtime\core\public\async\taskgraphinterfaces.h:883]
[2017.07.26-08.53.53:468][423]LogWindows:Error: UE4Editor-Core.dll!FNamedTaskThread::ProcessTasksNamedThread() [e:\tigerknightorbis\unrealengine\engine\source\runtime\core\private\async\taskgraph.cpp:954]
[2017.07.26-08.53.53:468][423]LogWindows:Error: UE4Editor-Core.dll!FNamedTaskThread::ProcessTasksUntilQuit() [e:\tigerknightorbis\unrealengine\engine\source\runtime\core\private\async\taskgraph.cpp:701]
[2017.07.26-08.53.53:468][423]LogWindows:Error: UE4Editor-Core.dll!FTaskGraphImplementation::WaitUntilTasksComplete() [e:\tigerknightorbis\unrealengine\engine\source\runtime\core\private\async\taskgraph.cpp:1809]
[2017.07.26-08.53.53:468][423]LogWindows:Error: UE4Editor-Engine.dll!FTickTaskSequencer::ReleaseTickGroup() [e:\tigerknightorbis\unrealengine\engine\source\runtime\engine\private\ticktaskmanager.cpp:538]
[2017.07.26-08.53.53:468][423]LogWindows:Error: UE4Editor-Engine.dll!FTickTaskManager::RunTickGroup() [e:\tigerknightorbis\unrealengine\engine\source\runtime\engine\private\ticktaskmanager.cpp:1450]
[2017.07.26-08.53.53:468][423]LogWindows:Error: UE4Editor-Engine.dll!UWorld::RunTickGroup() [e:\tigerknightorbis\unrealengine\engine\source\runtime\engine\private\leveltick.cpp:758]
[2017.07.26-08.53.53:468][423]LogWindows:Error: UE4Editor-Engine.dll!UWorld::Tick() [e:\tigerknightorbis\unrealengine\engine\source\runtime\engine\private\leveltick.cpp:1373]
[2017.07.26-08.53.53:468][423]LogWindows:Error: UE4Editor-UnrealEd.dll!UEditorEngine::Tick() [e:\tigerknightorbis\unrealengine\engine\source\editor\unrealed\private\editorengine.cpp:1633]
[2017.07.26-08.53.53:468][423]LogWindows:Error: UE4Editor-UnrealEd.dll!UUnrealEdEngine::Tick() [e:\tigerknightorbis\unrealengine\engine\source\editor\unrealed\private\unrealedengine.cpp:386]
[2017.07.26-08.53.53:468][423]LogWindows:Error: UE4Editor.exe!FEngineLoop::Tick() [e:\tigerknightorbis\unrealengine\engine\source\runtime\launch\private\launchengineloop.cpp:3119]
[2017.07.26-08.53.53:468][423]LogWindows:Error: UE4Editor.exe!GuardedMain() [e:\tigerknightorbis\unrealengine\engine\source\runtime\launch\private\launch.cpp:166]
[2017.07.26-08.53.53:468][423]LogWindows:Error: UE4Editor.exe!GuardedMainWrapper() [e:\tigerknightorbis\unrealengine\engine\source\runtime\launch\private\windows\launchwindows.cpp:134]
[2017.07.26-08.53.53:468][423]LogWindows:Error: UE4Editor.exe!WinMain() [e:\tigerknightorbis\unrealengine\engine\source\runtime\launch\private\windows\launchwindows.cpp:210]
[2017.07.26-08.53.53:468][423]LogWindows:Error: UE4Editor.exe!__scrt_common_main_seh() [f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:253]
[2017.07.26-08.53.53:468][423]LogWindows:Error: kernel32.dll!0x0000000077A159CD
[2017.07.26-08.53.53:468][423]LogWindows:Error: ntdll.dll!0x0000000077C8A561
[2017.07.26-08.53.53:468][423]LogWindows:Error: ntdll.dll!0x0000000077C8A561
[2017.07.26-08.53.53:468][423]LogWindows:Error:
[2017.07.26-08.53.53:477][423]LogExit: Executing StaticShutdownAfterError
[2017.07.26-08.53.53:480][423]LogWindows: FPlatformMisc::RequestExit(1)
[2017.07.26-08.53.53:480][423]Log file closed, 07/26/17 16:53:53

CreateHeightmap() crashes

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.

Crash on create heightmap in background

Hello, thanks for the last fix!!

Now i try the new version, this is my blueprint to create heightmap.
byhz-qn0qdqeukuecebvyq
But when you change the heightmap generation options to background, it crash with this unknow message:
a3yns1frt4kub1mgm5jcow

This is heightmap that plugin produce:
ydvnfxtirqemz-49mxikba
I see in your PolygonalMapHeightmap, you select a method to create each point (EPointSelectionMode). You can't change mode from blueprint, right? I decide to change method and change EPointSelectionMode::InterpolatedWithPolygonBiome to Interpolated and the result is the same the other.
interpolate
Is heightmap generation is good?

Thanks!

Crash on create heightmap in background

Hello,

I have the same crash after the fix. It always crash on background
fail

bp

I see this error too in foreground
`LoginId:6acadee4415135af9294438e9f2fcae6
EpicAccountId:3e6121d6dc0c4c6ab177110a2bbb6fa0

Access violation - code c0000005 (first/second chance not available)

UE4Editor_PolygonalMapGenerator!UPolygonalMapHeightmap::GetMapData() [d:\unreal projects\myproject\plugins\unreal-polygonal-map-gen-master\source\polygonalmapgenerator\private\maps\heightmap\polygonalmapheightmap.cpp:138]
UE4Editor_PolygonalMapGenerator!UMapTextureRenderer::SaveTextureFromHeightmap() [d:\unreal projects\myproject\plugins\unreal-polygonal-map-gen-master\source\polygonalmapgenerator\private\io\maptexturerenderer.cpp:13]
UE4Editor_PolygonalMapGenerator!UMapTextureRenderer::execSaveTextureFromHeightmap() [d:\unreal projects\myproject\plugins\unreal-polygonal-map-gen-master\source\polygonalmapgenerator\public\io\maptexturerenderer.h:17]
UE4Editor_CoreUObject!UFunction::Invoke() [d:\build++ue4+release-4.16+compile\sync\engine\source\runtime\coreuobject\private\uobject\class.cpp:4461]
UE4Editor_CoreUObject!UObject::CallFunction() [d:\build++ue4+release-4.16+compile\sync\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:721]
UE4Editor_CoreUObject!UObject::ProcessContextOpcode() [d:\build++ue4+release-4.16+compile\sync\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:2165]
UE4Editor_CoreUObject!UObject::execLetBool() [d:\build++ue4+release-4.16+compile\sync\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:2067]
UE4Editor_CoreUObject!UObject::ProcessInternal() [d:\build++ue4+release-4.16+compile\sync\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:943]
UE4Editor_CoreUObject!UObject::CallFunction() [d:\build++ue4+release-4.16+compile\sync\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:845]
UE4Editor_CoreUObject!UObject::ProcessInternal() [d:\build++ue4+release-4.16+compile\sync\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:943]
UE4Editor_CoreUObject!UFunction::Invoke() [d:\build++ue4+release-4.16+compile\sync\engine\source\runtime\coreuobject\private\uobject\class.cpp:4461]
UE4Editor_CoreUObject!UObject::ProcessEvent() [d:\build++ue4+release-4.16+compile\sync\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:1313]
UE4Editor_Engine!AActor::ProcessEvent() [d:\build++ue4+release-4.16+compile\sync\engine\source\runtime\engine\private\actor.cpp:695]
UE4Editor_PolygonalMapGenerator!AIslandMapGenerator::OnHeightmapFinished() [d:\unreal projects\myproject\plugins\unreal-polygonal-map-gen-master\source\polygonalmapgenerator\private\maps\islandmapgenerator.cpp:448]
UE4Editor_CoreUObject!UFunction::Invoke() [d:\build++ue4+release-4.16+compile\sync\engine\source\runtime\coreuobject\private\uobject\class.cpp:4461]
UE4Editor_CoreUObject!UObject::ProcessEvent() [d:\build++ue4+release-4.16+compile\sync\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:1313]
UE4Editor_Engine!AActor::ProcessEvent() [d:\build++ue4+release-4.16+compile\sync\engine\source\runtime\engine\private\actor.cpp:695]
UE4Editor_PolygonalMapGenerator!UPolygonalMapHeightmap::DoHeightmapPostProcess() [d:\unreal projects\myproject\plugins\unreal-polygonal-map-gen-master\source\polygonalmapgenerator\private\maps\heightmap\polygonalmapheightmap.cpp:126]
UE4Editor_PolygonalMapGenerator!UPolygonalMapHeightmap::CreateHeightmap() [d:\unreal projects\myproject\plugins\unreal-polygonal-map-gen-master\source\polygonalmapgenerator\private\maps\heightmap\polygonalmapheightmap.cpp:50]
UE4Editor_PolygonalMapGenerator!AIslandMapGenerator::CreateHeightmap() [d:\unreal projects\myproject\plugins\unreal-polygonal-map-gen-master\source\polygonalmapgenerator\private\maps\islandmapgenerator.cpp:440]
UE4Editor_PolygonalMapGenerator!AIslandMapGenerator::execCreateHeightmap() [d:\unreal projects\myproject\plugins\unreal-polygonal-map-gen-master\source\polygonalmapgenerator\public\maps\islandmapgenerator.h:96]
UE4Editor_CoreUObject!UFunction::Invoke() [d:\build++ue4+release-4.16+compile\sync\engine\source\runtime\coreuobject\private\uobject\class.cpp:4461]
UE4Editor_CoreUObject!UObject::CallFunction() [d:\build++ue4+release-4.16+compile\sync\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:721]
UE4Editor_CoreUObject!UObject::ProcessInternal() [d:\build++ue4+release-4.16+compile\sync\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:943]
UE4Editor_CoreUObject!UObject::CallFunction() [d:\build++ue4+release-4.16+compile\sync\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:845]
UE4Editor_CoreUObject!UObject::ProcessInternal() [d:\build++ue4+release-4.16+compile\sync\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:943]
UE4Editor_CoreUObject!UFunction::Invoke() [d:\build++ue4+release-4.16+compile\sync\engine\source\runtime\coreuobject\private\uobject\class.cpp:4461]
UE4Editor_CoreUObject!UObject::ProcessEvent() [d:\build++ue4+release-4.16+compile\sync\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:1313]
UE4Editor_Engine!AActor::ProcessEvent() [d:\build++ue4+release-4.16+compile\sync\engine\source\runtime\engine\private\actor.cpp:695]
UE4Editor_PolygonalMapGenerator!AIslandMapGenerator::ExecuteNextMapStep() [d:\unreal projects\myproject\plugins\unreal-polygonal-map-gen-master\source\polygonalmapgenerator\private\maps\islandmapgenerator.cpp:105]
UE4Editor_Engine!AActor::TickActor() [d:\build++ue4+release-4.16+compile\sync\engine\source\runtime\engine\private\actor.cpp:874]
UE4Editor_Engine!FActorTickFunction::ExecuteTick() [d:\build++ue4+release-4.16+compile\sync\engine\source\runtime\engine\private\actor.cpp:126]
UE4Editor_Engine!FTickFunctionTask::DoTask() [d:\build++ue4+release-4.16+compile\sync\engine\source\runtime\engine\private\ticktaskmanager.cpp:269]
UE4Editor_Engine!TGraphTask::ExecuteTask() [d:\build++ue4+release-4.16+compile\sync\engine\source\runtime\core\public\async\taskgraphinterfaces.h:883]
UE4Editor_Core!FNamedTaskThread::ProcessTasksNamedThread() [d:\build++ue4+release-4.16+compile\sync\engine\source\runtime\core\private\async\taskgraph.cpp:954]
UE4Editor_Core!FNamedTaskThread::ProcessTasksUntilQuit() [d:\build++ue4+release-4.16+compile\sync\engine\source\runtime\core\private\async\taskgraph.cpp:701]
UE4Editor_Core!FTaskGraphImplementation::WaitUntilTasksComplete() [d:\build++ue4+release-4.16+compile\sync\engine\source\runtime\core\private\async\taskgraph.cpp:1809]
UE4Editor_Engine!FTickTaskSequencer::ReleaseTickGroup() [d:\build++ue4+release-4.16+compile\sync\engine\source\runtime\engine\private\ticktaskmanager.cpp:538]
UE4Editor_Engine!FTickTaskManager::RunTickGroup() [d:\build++ue4+release-4.16+compile\sync\engine\source\runtime\engine\private\ticktaskmanager.cpp:1450]
UE4Editor_Engine!UWorld::RunTickGroup() [d:\build++ue4+release-4.16+compile\sync\engine\source\runtime\engine\private\leveltick.cpp:758]
UE4Editor_Engine!UWorld::Tick() [d:\build++ue4+release-4.16+compile\sync\engine\source\runtime\engine\private\leveltick.cpp:1373]
UE4Editor_UnrealEd!UEditorEngine::Tick() [d:\build++ue4+release-4.16+compile\sync\engine\source\editor\unrealed\private\editorengine.cpp:1633]
UE4Editor_UnrealEd!UUnrealEdEngine::Tick() [d:\build++ue4+release-4.16+compile\sync\engine\source\editor\unrealed\private\unrealedengine.cpp:386]
UE4Editor!FEngineLoop::Tick() [d:\build++ue4+release-4.16+compile\sync\engine\source\runtime\launch\private\launchengineloop.cpp:3119]
UE4Editor!GuardedMain() [d:\build++ue4+release-4.16+compile\sync\engine\source\runtime\launch\private\launch.cpp:166]
UE4Editor!GuardedMainWrapper() [d:\build++ue4+release-4.16+compile\sync\engine\source\runtime\launch\private\windows\launchwindows.cpp:134]
UE4Editor!WinMain() [d:\build++ue4+release-4.16+compile\sync\engine\source\runtime\launch\private\windows\launchwindows.cpp:210]
UE4Editor!__scrt_common_main_seh() [f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:253]
kernel32
ntdll`

"Another" bug with generate Heightmap

When i create heightmap with too "high" resolution size ->= 250 for me. I ve got an error and close the editor.

`Assertion failed: !AllocationFlags[Index] [File:D:\Epic Games\UE_4.16\Engine\Source\Runtime\Core\Public\Containers/SparseArray.h] [Line: 78]

KERNELBASE
UE4Editor_Core
UE4Editor_Core
UE4Editor_Core
UE4Editor_MyGame_2480!TSparseArray<TSetElement<TTuple<FVector2D,int> >,TSparseArrayAllocator<FDefaultAllocator,FDefaultBitArrayAllocator> >::AllocateIndex() [d:\epic games\ue_4.16\engine\source\runtime\core\public\containers\sparsearray.h:81]
UE4Editor_MyGame_2480!TSet<TTuple<FVector2D,int>,TDefaultMapHashableKeyFuncs<FVector2D,int,0>,FDefaultSetAllocator>::Emplace<TPairInitializer<FVector2D const & __ptr64,int const & __ptr64> >() [d:\epic games\ue_4.16\engine\source\runtime\core\public\containers\set.h:490]
UE4Editor_MyGame_2480!UPolygonMap::FindMapCenterForCoordinate() [d:\unreal projects\mygame\source\mygame\private\map\polygonmap.cpp:412]
UE4Editor_MyGame_2480!FHeightmapPointTask::MakeMapPoint() [d:\unreal projects\mygame\source\mygame\private\map\heightmap\heightmappointtask.cpp:245]
UE4Editor_MyGame_2480!FHeightmapPointTask::DoTask() [d:\unreal projects\mygame\source\mygame\private\map\heightmap\heightmappointtask.cpp:282]
UE4Editor_MyGame_2480!TGraphTask::ExecuteTask() [d:\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`

In low resolution, you could see that there is many many many many warning "LogWorldGen:Warning: Tried to fetch a pixel at 227, 123, but no pixel was found.", Don't know if it could help you. After a few execution, you could see that editor get a new error

Access violation - code c0000005 (first/second chance not available) VCRUNTIME140 UE4Editor_GameplayTags UE4Editor_GameplayTags UE4Editor_GameplayTags UE4Editor_MyGame_2480!TArray<FMapData,FDefaultAllocator>::CopyToEmpty<FMapData>() [d:\epic games\ue_4.16\engine\source\runtime\core\public\containers\array.h:2323] UE4Editor_MyGame_2480!UPolygonalMapHeightmap::CheckMapPointsDone() [d:\unreal projects\mygame\source\mygame\private\map\heightmap\polygonalmapheightmap.cpp:33] UE4Editor_CoreUObject UE4Editor_CoreUObject UE4Editor_MyGame_2480!UE4Function_Private::TFunctionRefCaller<<lambda_57bf9da02145909c0e8c545268c2f5d5>,void __cdecl(void)>::Call() [d:\epic games\ue_4.16\engine\source\runtime\core\public\templates\function.h:244] UE4Editor_Core UE4Editor_Core UE4Editor_Core UE4Editor_Engine UE4Editor UE4Editor UE4Editor UE4Editor UE4Editor kernel32 ntdll

Rebuild Project

Hey,

this is a really cool Plugin :D

But I have issues at the installation. When I'm trying to start it (after following your instructions) I get this Error: " could not be compiled. Try rebuilding from source manually. "

And when I'm doing this with Visual Studio I get following error message:
...\Plugins\UnrealPolygonalMapGenmaster\Source\PolygonalMapGenerator\Private\PolygonalMapGeneratorPrivatePCH.h" is included by most of the source files. The following source files are not including ...\Plugins\UnrealPolygonalMapGenmaster\Source\PolygonalMapGenerator\Private\PolygonalMapGeneratorPrivatePCH.h" as their first include:...\Intermediate\ProjectFiles\EXEC

I'm using Ue4 Version 4.18 and Visual Studio 17.

Any suggestions??

Map Heightmap Takes an absurd amount of time

UPolygonalMapHeightmap::CreateHeightmap takes a long time to complete (5 seconds for a 128x128 array), with the majority of the time caused by interpolating map points.
It would be a lot easier if the heightmap could only be created as needed, and when it is generated it should be done asynchronously if at all possible.
Additionally, the function should be optimized wherever it can be to work out what is causing such a giant bottleneck in performance.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.