Cashgen - (kinda) Infinite Procedural World Generator

Hey Guys,

I have two problems.

  1. When i leave first tile editor crashes.
  2. In packaged game theres’s no Collision with the Terrain. Everything is falling through Terrain. My Collisions are enabled. In PIE everything is working fine. Can’t find the reason. Tried to spawn from Level Blueprint and still not working. Tried to launch in editor through Launch-button same problem.

Please help.

Yes,you can

  1. I haven’t tried navigation on the generated terrain…I’ll put it on my todo list
  2. There are some instructions on the github page. The video tutorial on my youtube is out of date and needs updating
  3. Yes

I’ve been too busy to work on this for a while (flying out on another work trip today!) but hopefully after this week I can get back to it again.

  1. You’ll need to post details of the crash
  2. What engine version are you using?
  1. Link for Log File
  2. I’m using 4.17.2

Crash Report:
Assertion failed: (Index >= 0) & (Index < ArrayNum) [File:D:\Programme\Epic Games\UE_4.17\Engine\Source\Runtime\Core\Public\Containers/Array.h] [Line: 596] Array index out of bounds: 0 from an array of size 0

UE4Editor_Core!FDebug::AssertFailed() [d:\build++ue4+release-4.17+compile\sync\engine\source\runtime\core\private\misc\assertionmacros.cpp:349]
UE4Editor_CashGen!ACGTerrainManager::ProcessTilesForActor() [f:\unreal projects\pnw\plugins\cashgen\source\cashgen\private\cgterrainmanager.cpp:329]
UE4Editor_CashGen!ACGTerrainManager::Tick() [f:\unreal projects\pnw\plugins\cashgen\source\cashgen\private\cgterrainmanager.cpp:133]
UE4Editor_Engine!AActor::TickActor() [d:\build++ue4+release-4.17+compile\sync\engine\source\runtime\engine\private\actor.cpp:878]
UE4Editor_Engine!FActorTickFunction::ExecuteTick() [d:\build++ue4+release-4.17+compile\sync\engine\source\runtime\engine\private\actor.cpp:130]
UE4Editor_Engine!FTickFunctionTask::DoTask() [d:\build++ue4+release-4.17+compile\sync\engine\source\runtime\engine\private icktaskmanager.cpp:269]
UE4Editor_Engine!TGraphTask<FTickFunctionTask>::ExecuteTask() [d:\build++ue4+release-4.17+compile\sync\engine\source\runtime\core\public\async askgraphinterfaces.h:784]
UE4Editor_Core!FNamedTaskThread::ProcessTasksNamedThread() [d:\build++ue4+release-4.17+compile\sync\engine\source\runtime\core\private\async askgraph.cpp:650]
UE4Editor_Core!FNamedTaskThread::ProcessTasksUntilQuit() [d:\build++ue4+release-4.17+compile\sync\engine\source\runtime\core\private\async askgraph.cpp:559]
UE4Editor_Core!FTaskGraphImplementation::WaitUntilTasksComplete() [d:\build++ue4+release-4.17+compile\sync\engine\source\runtime\core\private\async askgraph.cpp:1327]
UE4Editor_Engine!FTickTaskSequencer::ReleaseTickGroup() [d:\build++ue4+release-4.17+compile\sync\engine\source\runtime\engine\private icktaskmanager.cpp:538]
UE4Editor_Engine!FTickTaskManager::RunTickGroup() [d:\build++ue4+release-4.17+compile\sync\engine\source\runtime\engine\private icktaskmanager.cpp:1450]
UE4Editor_Engine!UWorld::RunTickGroup() [d:\build++ue4+release-4.17+compile\sync\engine\source\runtime\engine\private\leveltick.cpp:758]
UE4Editor_Engine!UWorld::Tick() [d:\build++ue4+release-4.17+compile\sync\engine\source\runtime\engine\private\leveltick.cpp:1383]
UE4Editor_UnrealEd!UEditorEngine::Tick() [d:\build++ue4+release-4.17+compile\sync\engine\source\editor\unrealed\private\editorengine.cpp:1650]
UE4Editor_UnrealEd!UUnrealEdEngine::Tick() [d:\build++ue4+release-4.17+compile\sync\engine\source\editor\unrealed\private\unrealedengine.cpp:402]
UE4Editor!FEngineLoop::Tick() [d:\build++ue4+release-4.17+compile\sync\engine\source\runtime\launch\private\launchengineloop.cpp:3215]
UE4Editor!GuardedMain() [d:\build++ue4+release-4.17+compile\sync\engine\source\runtime\launch\private\launch.cpp:166]
UE4Editor!GuardedMainWrapper() [d:\build++ue4+release-4.17+compile\sync\engine\source\runtime\launch\private\windows\launchwindows.cpp:134]
UE4Editor!WinMain() [d:\build++ue4+release-4.17+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

Hi mid_gen,

Awesome work and thanks a lot for sharing.

I have a problem when using this plugin to explore a large map :(:(:frowning:

I add a CGTerrainTrackerComponent to the default player (ThirdPersonCharacter), the tile the player stands on is always empty and will be filled until the player leaves it.
While if I add a CGTerrainTrackerComponent to the default gamemode, it will be empty all the time.

Could you tell me how to fix this? Any suggestion is appreciated :slight_smile:

file:///C:%5CUsers%5CADMINI~1%5CAppData%5CLocal%5CTemp%5Crichole%5Ctemp_4880_1.png

Thanks for that, I’ll take a look. Unfortunately I’m just about to get on a flight and won’t be able to look into it until Friday at the earliest :S

I could solve first problem by setting Sector Distance to 5 in make CGLODConfig. In every CGLODConfig it must be Sector Distance 5 else editor crashes.

Im sorry one more question… can you spawn blueprints on the terrain like enemy AI. And will you do a tutorial about grass and foliage? Thanks for answering my questions I am new to the forums(thats why I asked the islands thing twice

What did you have it set to before?

I need to do a cleaning up pass and name some things better and add comments to the struct members.

Before i had Sector Distance 2 in first one and in second one 10

You can Spawn what ever you want. You have to use Tracers to get HitLocations on Terrain. I made my own Blueprint to spawn Grass an Foliage on Terrain, but mid_gen is planning to implement foliage system later.

updated for 4.18. Note that I’m finding an intermittent crash in multiplayer at the moment. Single player is fine. Fixed a couple of other issues.

I’ve moved the samples to a new repo :

Multiplayer sorted…properly handle tracked actors being despawned/spawned due to network relevancy.

Changed to IWYN, tested packaging on 4.18…all good.

Started work on the Biome branch

Finally added Async Collision Cooking support from the RMC (sorry for the delay).

You can crank the tile size right up now. 128x128 tiles with collision are fine running at 120fps without hitches on my machine :slight_smile:

Can you share info about your machine? If it’s not a problem of course.

I’m running on an i7 5820k with 32GB DDR4 and a GTX 970.

The demo repo project is now very much GPU throttled with 128x128 tile size terrain on my machine with async collision coooking enabled…so as a gameplay programmer I consider it job done :stuck_out_tongue:

Working on some prop scattering now.

No no, don’t get me wrong. I do agree that from the programming standpoint it is an achievement.
Besides a lot of performance comes from models, materials, and a lot of different things that are made directly by the developer. Yet it’s nice to hear that the tool itself is very nicely optimized, some of the assets in the marketplace look very nice but are incredibly performance heavy which makes it difficult to even use them in the project in the long run.

It is fairly well optimised now…I could probably improve it but I’d need a proper test case to benchmark…I am trying to build out the demo project more, hence the scattering system. It’s difficult to find assets that I can include in an open repository unfortunately.

CPU wise, all the heavy stuff (noise generation, collision cooking) is done off the game thread. All the mesh geometry data is handled in a statically allocated pool. The tiles themselves are not statically allocated but they are pooled, so it should fairly quickly settle down and not result in any excess fragmentation.