What’s the best way that is easiest on performance to procedurally spawn a lot of instances onto a landscape for example? I’m having a hard time getting a really large terrain densely vegetated without killing my computer…
For this setup I’m using a Surface Book with the Nvidia Maxwell GPU, so it might not be the best computer for this sort of thing… or perhaps I’m just doing something fundamentally wrong?
Below is a simple demonstration of what’s going on as of now:
On the left side you can see how many instances of each mesh are being created, there are
- 231617 Grass Instances
- 231584 Farn Instances
- 19299 Flower Instances
- 761 + 698 Tree Instances
- 753 Stone Instances
The major problem is that this now is actually not the terrain size I was going for! The actual size should be 6x larger!! It will slightly exceed the default world boundaries, I don’t want to go any further than that, I think that will be more than large enough. Still even now with a much much smaller terrain I’m having a fps of 11 or below!
So I don’t know what I’m doing wrong or if my expectations are just way beyond the stars. Can someone give me some insights as to how I do this procedural creation thing in UE4 correctly and visually appealing?
Hopefully someone can help me out,
thank a lot!
The Keyword you want to look into is level streaming. With this you break up your “world” into chunks which each have their own level Blueprint etc.
A common way of using this is to always load the current chunk and the chunks around it and as soon as you leave the current chunk, unload all chunks that are more than one chunk away and load all adjacent ones. Make sure to not do the common mistake of unloading the chunk the player comes from and reload it though, always create at least two checks to make sure you don’t take away terrain the player is backtracing on.
This tutorial is quite helpful to get started: Unreal Engine 4 - Introduction to Level Streaming - YouTube
Are you generating your trees and stuff with the new procedural foliage or with Instanced statics by the way?
Alright thanks for your answer! I didn’t know level streaming would work in this case as well. The entire world is procedurally generated with blueprint script system I made by myself using instanced static meshes, though I could look into the procedural foliage tool as well… I’m just not sure what would be the better way to do it since I want to sustain a lot of flexibility as to when the instances should be removed and when they should be added back to the scene again… that is if this is really necessary in terms of performance and such.
Would there possibly be any interest in blueprint scripts that let you generate procedural content (much more extensive than just terrain and vegetation) because then I wouldn’t do this just for my own purposes but for a possibly as marketplace content as well… I’m just not sure if its worth it or if I’m basically wasting my time for something that could be achieved much easier… I’m just not sure how to go about it - do you have more suggestions?
Sorry for the late reply. If your world is randomly generated in any regard you may want to have a look into seeds and store those seeds in an array to make the world look the same every time you reload a chunk.
I think that there is definitely a need for some advanced blueprint scripts for procedural content systems from basic terrain to animation and beyond. if you find cool and easy ways to achieve those things in Blueprint, why not put Tutorials on youtube too?
Cool, I’m very glad to hear that. In this case I will just continue to improve my script until I’m satisfied. Tutorials on how I created everything is definitely something I’m planning on doing as well… thanks again!
In addition to that you might want to work heavily with LODs since they will drastically reduce your load on the GPU
Yes using LOD’s was one of the first things I looked into but it doesn’t solve all problems when it comes to very large landscapes. I hope to have something presentable done by the end of the year or even earlier and then I can continue to make new additions to the system. Hope you guys will like it, I will try to make it as useful as possible for both artists and solo developers.