Snarkpit Articles



Player Clips


Why Should I Care About Player Clips?

Player clips are hands-down the best way to keep your player in check. All it is is an invisible wall that only affects the player and nothing else! You can shoot through it, you can throw stuff though it, even NPCs can walk through it, but not the player; nope, the player is the one thing this texture tool does not like and absolutely refuses to be nice to. The beauty of player clips is that they need not be used as invisible walls at all. They have a myriad of uses, if you are willing to get a little creative.



A Few Things You Should Know About the Source Engine

In Source (specifically HL2 and related versions), the player is represented as a 32x36x72 (inch) 'block'. (1 unit in Hammer = 1 inch) (Source). As such, regardless of which direction you are facing, you're likely to get 'trapped' or 'caught-up' by some geometry (a.k.a. any shape with a collision hull) as you move through a level. Since game engines like Source are meant to be dynamic, there are no stipulations about which surface is the 'floor'. The floor could be one face of a brush, or the top of a pile of dead body models, or a moving brush. Any way you look at it, the floor is whatever surface you happen to be standing on. Because of this freedom of definition, Source relies on its robust Havok physics simulation system to calculate how you should be standing on each of these varied surfaces. The same is true for walls and ceilings. There are no Source definitions to indicate to the player model that "hey, this is a wall, make sure I act this way when approaching it!" No, it's simply a surface that is vertical. It's easy for the player 'block' to move around on smooth non-moving surfaces, and 'glide' against a smooth flat vertical surface, but what happens when it encounters some non-flat floors and non-flat walls? There are some tips to be had here!

How Can I Help the Player?

Best way to show you is by presenting some examples. Let's look below:



Here above, you can see the physical player 'block' as represented in Hammer. When players in Source encounter a vertical edge that is 18 units or less, the engine will automatically step them up to the top of the edge. So, when constructing stairs be sure to stay true to this dimension as it serves not only a visual aspect, but functional as well. Well, as a player continues up a flight of steps, the steps will undoubtedly be jarring the players view as the engine automatically steps-up the player each time they encounter the next step. This isn't such a big deal, in terms of level-design, but can be 'smoothed-over' with the use of player clips. What's more important is that a player who tries to jump up some steps while moving across them, will find themselves halted in their progress because there was a vertical step they didn't reach and the engine must first 'land' them when they reach the next flat surface so that they do not bounce. And the last reason, why we should fix this, is because in HL2 and related games, the player has a speed boost mechanism that allows them to move more quickly along a surface. Sprinting down a flight of steps will send the player flying rather than hurriedly stepping his way down the flight.

The fix is quite easy.



As you can see above, by coating a brush in the player clip texture, it allows the player block to 'glide' up along an invisible ramp without all the jarring sensations from stepped brushes. And It eliminates a player from flying off the flight, if they decided to 'sprint' down the steps. Moving on...


Below you can see an easy fix for short objects and doors in the way of travel. By creating simple ramps turned on their sides coated by the player clip texture, you have a nice easy, flat, & most importantly: Invisible surface for the player 'block' to glide along. Here are some examples below:



Using this method anywhere you feel a player might get hung up at, or be moving really fast through, will only help you to be a better mapper. I don't think there is a situation where doing this will cause bad reviews to come about. This is one of those methods that the professionals use, but never tell you about smiley. As a level designer, it is your duty to the player never to allow them to get lost or 'hung-up' in your world. If they never notice they're playing a game, then you've done your job right.


>Now for some layout techniques!




Post ReplyView Topic
Discussion
0 starsPosted by Gwil on Fri Jan 1st 2010 at 2:12pm

Great tutorial Riven - picks up on a finer nuance of gameplay that people might otherwise miss when finishing up a map.
5 starsPosted by G4MER on Thu Dec 31st 2009 at 2:59pm

Great Tutorial Riven. I learned a few new things from it. I cant do the player clip tut now.. but that is ok, I think you did a much better job of explaining than I ever could. smiley

I like how you laid the tut out as well on several pages. Made the content easy to follow and read.
Post ReplyView Topic