Cashgen - (kinda) Infinite Procedural World Generator

UUFNNoiseGenerator is a base class for all the noise modules (FastNoise, Blend, Select etc.). You should be able to create a UFastNoise instance with NewObject.

Not sure what the problem is with the includes, I’ll have to have a look but I’m probably not going to get a until next week.

Update pushed, I was missing the module API specifier, should build properly now.

Everytime I run the new branch i get



MachineId:62E812094BDFFF9033924D87FA06223C
EpicAccountId:


Assertion failed: ThreadID == FPlatformTLS::GetCurrentThreadId() [File:D:\Build\++UE4+Release-4.12+Compile\Sync\Engine\Source\Runtime\Core\Private\HAL\ThreadingBase.cpp] [Line: 359] 


UE4Editor_Core!FDebug::AssertFailed() [d:\build\++ue4+release-4.12+compile\sync\engine\source\runtime\core\private\misc\outputdevice.cpp:440]
UE4Editor_Core!FRunnableThread::FreeTls() [d:\build\++ue4+release-4.12+compile\sync\engine\source\runtime\core\private\hal	hreadingbase.cpp:360]
UE4Editor_Core!FRunnableThreadWin::Run() [d:\build\++ue4+release-4.12+compile\sync\engine\source\runtime\core\private\windows\windowsrunnablethread.cpp:87]

Do your procedural meshes have LOD-levels?

And can they be used with large dynamic NavMeshes that allow movement over great distances (without taking half an hour to generate them)?

I do have a LOD system, you just specify the range for LOD 1 and 2 and it reduces the vertex count by LOD/2^2.

Haven’t tried using nav meshes on it yet.

Thanks for replying. I can imagine that large NavMeshes are virtually impossible to create in a decent amount of time at runtime. Unless maybe if there were some kind of optimizations specifically for landscapes, since they are basically just 2D plains. :frowning:

Hi,
I’m just curious how large area is needed to be covered by navmesh, and do you really need a navmesh, or another pathfinder is also okay, and how much time you want to allow for the pathfinder data generation?

Nice work. I need to do some serious digging into this. Having a procedural terrain system like this is just way beyond what I would have ever come up with.

Hi, sorry for the late reply. Actually, I think I just need NavMeshes for relatively small areas of my maps. Most of it is open terrain. The only static obstacles there would be rocks, trees, water and steep slopes - basically a 2D plane folded in 3D space.

But then there are areas with walls, buildings etc. For those I will probably need a NavMesh. I have thought about ways to combine NavMesh areas with something simpler, but haven’t really come up with anything. And I also don’t want to spend too much time on something, if I don’t have to. There’s plenty of other things to do.

I guess my setting is very much like Mount & Blade. Not entirely unlike a TW game either, but definitely not as big. I think 200 individual units on a battle field will be the limit.

Treat each navmesh as a “cell.”
Build a “road network” of waypoints and/or splines between the cells.
When wanting to go from A to B, then figure out:

If A and B are in the same navmesh, then use navmesh only.
If A and B are in different navmeshes, then solve the “road network” using simple search (this can even be pre-calculated.) Then use navmesh A to get to road, use road to get to B, use navmesh B to get to destination.
If A or B are outside a navmesh, you need to find the nearest road or road node, and use that as the destination.

This is a very simple example of “multi-level pathfinding,” which is a rich topic in and of itself :slight_smile:

I think in the Kite demo Epic used a dynamically created navmesh for the actual surrounding area, maybe it is accessible somehow, I don’t know… But 200 characters might be a heavy load (at least on my pc it is slow with a simple behaviour tree).

I asked you because I’m working on a pathfinder basically for RTS games (using areas and tiles), support for procedural maps is going to be ready soon, but also interested in other special requirements to consider, cause I really like this area, despite is a very time consuming area of game development. But buildings and walls, and especially doors and gates are not easy to be handled in a harmonized way by the AI decision making, pathfinder, and movement systems…

That way-point road combined version is a good idea to connect battle areas, maybe I will use it one day, thanks!

Hey MaxPower42,

Have you tried nav invokers? I have not used them yet personally, but from what i understand, you basic set up a nave mesh to cover all of your landscape, but there is a checkbox somewhere in the project settings that only allows the nave mesh to be generated around nav invokers. Then you set up any AI characters that you need to move around to have nav invokers, which basic generates a small navmesh area around the pawn. This area can be adjusted based on the radius, and then it only generates the nave mesh for the radius of each character, not the whole level.

If you already know all of this, please feel free to ignore this post.

just thought it might help if you were new to it.

Merged in pull request (sorry don’t have your forum name!) adding spline support, spline demo level.

Great to see you continue to work on this and considering your ‘enhancments’.

I’ve been following this for some time for my game to generate sea-floors that follow real-world OpenStreetMaps-coastlines data by using the osm-coastline data and then generating depth gradients based on distance from shore.

Can’t wait to get involved in the code when the time comes, working on above surface still!

I’m working on something much better, using poisson disk+voronoi and putting gameplay info into the voronoi graph, which can then be used to blend the same way as the pure noise functions. I’m also using curves a lot to bias the noise, like having a falloff outside a particular range so that you have an achipelago or set of continents and then open water, or just a very slight elevation bias towards the center of the map so that the playable area is more central. Still a ways off, but there’s an early version here that solves a specific task. I have procedural levels along the lines of diablo that are accessed by visiting locations on this map, and I’m going to see if I can use the same approach there. I might be able to put that into cashgen if I refactor it a bit, since it’s a bit less specialised than the world map, though I’m pulling in


boost::polygon::voronoi

which is a bit of an ugly dependency (my implementation was awful and slow).

Nearly finished with the big cleanup refactor. Just working out the last of the bugs with the new mesh data allocator and threading code.

There will be a huge reduction in memory footprint and general performance should be smoother with the new worker thread system. Code in general is much cleaner with better separation of responsibility between the components.

hey mid_gen, what do you think, would it be possible to run the same mesh generation on clients as on server if a multiplayer game is planned? (of course server version should be the true one) sorry if it has been asked/answered before…

I’ve only recently started working with the multiplayer side of UE4 so it’s not something I’ve looked into. In principle it will work but I’ll have to have a proper think about how to do it.

My refactoring exercise is nearly finished. It is a MASSIVE performance improvement. I’ve been running it on my cruddy laptop with 256x256 zones and the frametime isn’t even registering a blip while flying around. Previously even 32x32 was a bit dodgy.

I’ve built a simple central pooled allocator for the MeshData structures so you have control over the memory usage now. Should be down over 90% on the previous version.

I’m ditching the zone/tile based foliage spawning system for now too.

Where did you get the grass assets in the latest demo from?