Welcome back.
Now we're going to keep adding some geometry to our level.
And in the last video, we saw the texture streaming pool over budget warning at the top.
We're probably going to see that again.
And in this video, we'll talk about a solution to that.
So first of all, I'd like some geometry to block the way as that's a complication we haven't encountered
yet.
So I'm going to go into my content assets dungeon folder and just get something like a three by two
by two.
Or perhaps even three by three.
By three.
Something like that.
And these are some nice geometry we can use to block our path.
Now, I don't have my snapping on, so I'm actually going to go ahead and delete those and bring them
back in with snapping on so we snap to a particular increment.
That way it'll look like I have actual precision here and I'm going to go ahead and bring these up.
And just make some geometry that I can use to block my path.
So bringing in some more geometry here.
Let's make some obstacles.
Let's go ahead and time lapse this.
All right.
And I think what I'm going to do is add a staircase right here.
So some stairs.
That'll give me some change in elevation here.
And I'm going to replace this with a smaller one.
A lazy way to reduce the size is just to bring it down into the floor like this.
But I think I have something that's a little bit more suited for it.
And I'm going to turn snapping off just to position this a little bit better here.
Okay.
And after saving, I'm going to press play.
There's that texture streaming pool over budget.
It is back, but let's just make sure we can run.
Now, one last thing I think I need is some rails.
I'm just going to use this corner railing here and just bring it down and in.
So we have something blocking the way, like so.
And now we have this little area here that we can place something up there, maybe a potion, whatever
we want.
And if I edit this railing and show simple collision.
I see that it's going to block the way.
So I have to go to this remove collision and just add a box.
That's not what I wanted.
I'm going to remove that.
I'm going to add a box simplified collision and just have a couple of little bits of geometry here that
can block the way.
So two blocks should do it.
So I'll just move those into place like so.
And we should be good there.
Okay.
Things are looking good.
We're blocked by the geometry.
And if I click to move, I was using Wasd there.
But if I click to move.
Let's see if we can manage to move.
Okay.
Now notice if I click here, we have an issue, right?
We want our pillar to ignore that visibility channel, but also block our projectiles.
Right?
So if I fire a projectile.
It's ignoring the projectile.
But if I click, I can't move either.
So we do need to make sure that our meshes are configured correctly.
So with my pillar and my stairs selected, in fact, all of these.
Let's just make sure that these are set correctly.
We're going to go to collision.
Collision Presets can be custom.
We're going to block the projectile and ignore visibility and we're going to make sure generate overlap.
Events is checked.
Now we get those collisions.
And of course my floor tiles are not allowing me to auto run.
So just to make sure I understand what's going on, I'm going to select this piece here, go to Collision
Presets and set it to custom.
I do want to block the projectile and let's just remind ourselves how our click to move works.
We can go into private player or a player controller and we need to look at our cursor trace.
We're tracing against the visibility channel and inability input tag released.
We're getting a NAV path, so if we want that auto run, let's drag in a nav mesh bounds volume.
I accidentally put in a second player start.
That's not what I wanted.
I want to go to volumes.
NAV mesh bounds volume and want to make sure that this volume encompasses the whole play area.
Pressing play now click to move works.
And things are working okay.
Now, one interesting thing is my stairs are not quite working right.
I'm just going to edit those stairs.
I'm going to show this simple collision and it looks like we have simple collision, even a ramp here.
So that's good.
And for the stairs collision settings, it's set to ignore visibility.
Now, this is a kind of complication that we haven't run into yet.
The thing is, we want to be able to click on the stairs and run to them.
So we want to block visibility for that reason, but we don't want these balusters to block visibility
because then we get those complications.
When we click on those Balusters we don't get a valid location.
But if we click somewhere like on the stairs themselves, well then we're going to run to that location.
And it'll work.
Notice I did actually run under the stairs and that's probably because of our nav mesh going under there.
Sure enough, it does.
So we do want our stairs actually blocking the nav mesh underneath.
So that's something we'll want some collision volumes for.
Basically we'll just say collision add box, simplified collision and we'll have a box that we put down
below.
We're going to go ahead and just make that box a little bit more narrow, bring it down and probably
forward a bit like so.
So that's going to ensure that we don't have the ability to run under it.
And sure enough, it's now blocking that volume.
Now we also have a hole up here.
Now this is something we could adjust our nav mesh settings project wide for.
Also, though, we're going to want our geometry itself looking pretty good.
And again, our NAV mesh bounds volume itself also needs to encompass enough room to cover all the surfaces.
So it was also not quite tall enough.
So that's looking pretty good.
If I click up here, I can run up here.
That's looking good.
Now we do have that complication of not knowing where to run if we click on the balusters themselves.
Although if we click somewhere that's not really a valid place to run, no harm done, we can just click
and hold to run to where we need to run.
But if you really wanted your stairs to allow click to move on the stairs part and then ignore the visibility
channel for the balusters, you could just remove the collision for the balusters.
These collision hulls here and then just create a basically static mesh actor that has box collisions
on those balusters and those can block the things you want to block and ignore the things you want to
ignore.
What you'd probably want to block is at least the collision channel for the projectile.
Okay, So these two pillars here, I'm going to generate overlap events for them and that way they can
block.
My fireballs as well.
And that's looking good.
Okay.
So now let's talk about this texture streaming pool over budget problem.
This is a problem.
I'm going to press P to get rid of that green there.
This is a problem when we have too many textures that are too large all on the screen at once and the
textures in this project, much of them are quite large.
And what we're going to want to do is compress them.
For example, if I click on the tile here and by the way, these other static meshes, I can move into
my dungeon folder as well.
So just really quickly moving these static meshes into the Dungeon meshes folder.
But again, if I click on the tile and I browse to the asset or really I could just right click and
edit that asset, here's its material and if I browse to it.
It's using these textures.
And if I double click on one, we can see in the details panel that this is a 4K texture.
Now that's great.
That's really high quality.
But for a top down game, it's probably overkill.
We probably don't need a 4K texture when we're playing top down like this.
If we're going to press play and we're seeing the texture from this far away, you know, 4K is overkill.
So we can compress that texture.
So here in the texture asset, we can take a look at the compression section, we can expand the advanced
settings and we can set our maximum texture size to the desired resolution.
For example, if we wanted half of 4K, which would be 2048, we can put that there.
If it's a nonzero value, it's going to compress to that.
Now, two K is also probably overkill.
In fact, we could probably get away with one K that's ten, 24 or even half k 512 So we can see what
that looks like by putting 512 in here.
Notice that the texture is smaller if we save that.
We're now using a half K texture instead of 4k.
Now, going through each individual texture is going to be a pain, but there's a faster way.
Well, we can do is we can select multiple textures at a time and we can bulk edit via property matrix.
We go to asset actions.
Bulk edit via property matrix.
Now there's more textures in the project than just these three.
So if we really wanted to do this on a massive scale, we could go up to the all folder and we can click
on the dropdown here to filter by texture.
Now we're seeing all the textures in the entire project.
And we can cut those textures all down.
Now, we don't have to cut them all down.
Some of these are used for UI, some of them are the character.
This one isn't.
This is just a picture of aura.
But a lot of these are used for environment and the environment.
We don't really need high res 4K or eight K textures.
So what we can do is search for certain things.
If I search for tile now, I see all the textures for my tile assets.
Now I can compress all of these.
Now there's a couple things in here that are not used by my tiles, like these noise textures.
I'm not too concerned about those, but I will compress all the rest of these.
So with all of them selected, I can right click on them.
I can go to asset actions, bulk edit via property matrix.
And we have quite a lot of textures that we're editing here, right?
We can go into our compression section, we can go to our maximum texture size.
It says multiple values, but we can enter five, 12, enter.
Now give it a second because we're changing quite a few textures here.
In fact, we're changing 77 total once it's done.
We now have compressed all of those tile textures.
For instance, if I select, say, this other tile here and I click on edit and browse to its folder
with its material and open up those textures, we can see maximum texture.
Size is 512 for it.
Now that's just the tiles.
There are other assets as well.
So what I'm going to do is close out of some of these tabs as I'm done with them and little by little
we can get the other assets.
Now, if I press play, notice that things are looking quite blurry now, but our texture streaming
pool isn't so high over budget anymore.
Now this blurriness can go away if I restart the engine.
So what I can do is I can go ahead and we can save those changes.
We've made close the engine and we can relaunch.
Okay, So relaunching, I see that I'm back into this level that I'm not too fond of.
So before continuing, I'm going to go to project settings into maps and modes and change the editor
startup map to Dungeon and the game default map to dungeon for now.
And then we'll move over to the dungeon.
And notice that our textures do look better.
So they still look pretty good at 0.5 K.
We can zoom in close and see this is really what they look like up close, but for a top down five K
is probably okay, right?
We probably don't need 4k, so we've got our tiles taken care of.
Those are nice and compressed down quite a bit.
You can of course compress them less, you can use one k, two k or leave them at 4k.
Just depends on your game and its needs.
But we can do this same thing for some of the other textures.
So let's just really quickly do it again.
I'm going to set the filter to texture here.
And we have other types of assets.
Now, what I'm most interested in are these dungeon assets.
For example, the stairs.
If I right click on the stairs and I just click edit, I see that we have these materials.
This has multiple materials, they all have stairs in them.
So we can compress those stairs materials by searching here we can click on all.
We still have texture filtered and we can search for stair.
So I had to uncheck texture and recheck texture.
And I accidentally checked something else here that I'd like to uncheck.
Now I have all my stair textures.
I can bulk edit those via property matrix.
Go to compression, maximum texture size, we can set that to 512.
Now, this is 12 textures.
It won't take that long.
And there we go.
Same thing for these corners.
We have tile set corner and I think anything with tile in the name has already been compressed.
Let's just see.
Yeah, those are all compressed.
And, you know, if we get any issues moving forward, we can always compress more.
Now, that's one way to fix that texture streaming over budget.
Sometimes we'll still be over budget.
Another way, which is a little more drastic, but you can do it, is we can change that budget limit.
And if you have a higher end PC and you're planning on releasing your game to higher end PCs, then
you can increase this texture budget.
We're going to close the engine for this.
We're going to open up our config folder and we're going to go into default engine Ini.
If you don't have one, you can always create one.
And here in default engine Ini, we're going to go into script engine render settings.
So if we search for render settings, if it's not there, then we need to add that section so we can
add that really anywhere in here.
We'll go down to the bottom.
So we need square brackets, forward slash capital script, forward slash engine dot and its render
settings.
Now that we have this section, we can set the streaming pool budget.
We can say r dot texture streaming equals true.
So we first have to do that and then R dot streaming dot pool size and we can set that here.
We're going to set it to a thousand.
So quite a lot more than what it was before.
What was it before?
Let's find out.
Let's copy this line.
R dot streaming dot pool size without the equals 100 and we'll open writer or your ID and we'll do a
project wide search for R dot streaming pool size.
And notice we have something here in base scalability.
And I if we click on that, you'll see that there are different streaming pool sizes based on context
here.
But we're going to set it for our project to a thousand.
And if you're asking me why a thousand?
Well, that number depends on your project and your needs.
We're just going to use 1000 for this project.
Now we can restart the editor.
So we're back in the editor.
And things are still looking good.
I'm okay with half k textures, but you may feel like that's not quite enough for you.
If you zoom in on certain things, they may look a little blurry.
So feel free to change things if you really want to go back to say, one K or two K for your stairs,
you know, maybe your tiles aren't that important.
They're everywhere, but stairs are more rare.
You can go back to all I have texture filtered.
I can search for stair and maybe I want these back to one k.
I can go to asset actions bulk edit via property matrix, go to compression and change this from 512
to perhaps 1024.
We'll go to one k hit enter, give it a second and perhaps that looks better for you and say stairs
are rare enough in your game that you're okay with 2048, right?
Two k textures.
You can just change them there if you like that.
And you can see that they're even more detailed.
So that's how you can set the texture compression settings.
And keep in mind, when you're looking up close, yes, things will look pretty bad when you're compressing
them a lot.
Don't go by, you know, looking at things from a foot away, unless that's how close you'll be in the
game for a top down, you never really will be that close to something.
So, you know, be realistic about it.
You don't have to go over your budget if you don't have to.
So that is how to handle the texture streaming over budget.
That's how to handle the compression settings for your textures.
And this is a really good way to optimize your game and really improve on your performance.
Excellent job and I'll see you in the next video.