SF's Hammer Tutorials - Optimization 2: Hint & Skip

Uploaded by Silwerfish on 22.04.2010

Hello and welcome to this tutorial where you will learn how to optimize your levels
using hint and skip.
This is the room that I have created for this tutorial, there's an oil drum, a chair and a
table, and there's a wall separating them.
So the first thing I'm going to do here is compile the map.
And then I'm going to press map.
And load portal file.
This is a feature that is only present in Orange Box engine games, so if you're using any
other engine,
then you will need to
check the leafs and portals inside of the game, and i'll show you how to do that
at the end of the tutorial.
But if you are using Orange Box, like I am, then you can use this handy tool to see
Portals and leafs without even starting the game.
As you can see here, these leafs and portals are not optimized at all, we would want a
portal there.
So that when we're in here, we can't see what's on the other side there.
But as the
Portals are set up right now,
it doesn't matter where in the map we are, we will always render the whole map.
So I'm going to browse for textures here,
first I'm going to get the hint texture.
You just filter for hint and get that
purple texture there.
And then you filter for skip and get the skip texture.
And I'm now going to use this to telll the engine where it should put the portals instead.
And we want the portals to be
right there.
So I'm just creating a brush here,
with the skip texture.
And then I select the face that I want the engine to use as a portal,
and give it the hint texture.
So, let's try to compile this again and see how it looks.
And then we load the portal file again.
Now you can see that
the portals here are much better!
Now if we're in here, we don't see what's in here.
And that's exactly what we want!
But this thing here.
There's a very
tall leaf here that enables you to see into that
leaf here.
And that is obviously something that we do not want.
So now you might ask yourself; "Silverfish,
why is that leaf there at all? There's no obvious reason for that leaf to be there.".
Well, my guess is that they have some kind of limitation in the engine to how
large a leaf can be.
So therefore they split
all maps into a maximum size for the the leafs.
And you can see that maximum size by looking at these colored lines you have in your
front, top and side viewports,
because those show where the portals will be created.
So how do we solve this?
Well, it's actually quite simple, we just do the same thing we did before.
But this time we do it
on the top
of the wall instead.
So I apply the hint texture to one side of this.
And then I compile it again.
I press map, and load portal file.
And now the leafs and portals are like they should.
So let's start up the game and and see how it works!
And here we have the map!
So these are the console commands you'll be using; mat_wireframe 1,
and mat_leafvis 1.
Wireframe enables you to see the world in wireframe to see through walls, and leafvis
will enable you to see
the leaf you're currently in with a red outline.
And that's it for this tutorial!
So don't forget to rate, favorite and subscribe. And if you have any tutorial requests, or
anything else you want to tell me,
just give me a comment below and I'll get back to you as soon as I can.
So thank you for watching and have an awesome day!