Alright, so we got three separate asks for this, I'll take that as people wanting to know. :v
So to start, we'll have to go through what ladders in Source are. We'll start at the beginning, GoldSRC. In GoldSRC, ladders are a brush (re: world geometry), named func_ladder. They're always invisible, so you'd have the visible part of the ladder made and then in front of that you'd have this brush entity that actually did the laddering.
Movement on these is free-form, as long as you're in contact with the brush you stick to it. WASD moves you around on the ladder itself, you get off by either getting to the end of the brush or jumping. Simple stuff. This simple setup was carried over to Source almost unchanged. The only difference is in Source, the func_ladder doesn't have to be invisible.
It's also an internal entity, which means that it doesn't actually exist in the map itself, it's just used by the map compiler. That's important later.
Not every Source game has func_ladder, though. Half-Life 2 and its derivatives (the Episodes, Deathmatch, and mods based off of those) have func_useableladder, a point entity. Point entities aren't made of brushes. This is worth bringing up because "func" is usually reserved for brush entities, but Valve figured the naming conventions here weren't gonna be confusing enough.
func_useableladder defines two endpoints and draws a line between those. The player can only move linearly between these two points. Like the original GoldSRC ladder, these points are completely invisible, you have to make a visual ladder to go with this if you want people to know there's a ladder there.
There's also info_ladder_dismount, a sister entity to these, that are used to mark nice dismount spots for the ladder. If you push your Use key while close to and facing one of these, or push your move keys towards it when at the end of the ladder, you'll dismount directly onto it. (Fun fact, during the dismount process, you're put into noclip.)
Some games, like TF2 and Portal, have neither of these ladder types, which is why you don't see ladders (that aren't some flavor of incredible jank, instead of some flavor of moderate jank) in these games.
Then there's Left 4 Dead.
If you've played Left 4 Dead, you probably noticed the ladders in it feel sorta like the ones in HL2. However, they're brush ladders... sort of? Okay, like, they're made with brushes, and are actually still put down as func_ladder in Hammer. But, that then gets converted into func_simpleladder. I'm not really sure how they function under the hood, there's little documentation on them. The only really notable feature to them is that they list a normal that is typically pointing out from the intended "usable" face of the ladder.
I say typically, because sometimes the normal is broken and just points straight up. As far as I can tell, it isn't actually used, because those ladders with the broken normals don't seem negatively affected by them in L4D itself. I would think it'd be used for like, the angle of the player on the brush as they play their new fancy ladder climbing animations, but, that doesn't seem to be it? Because I don't recall seeing people lying on their backs climbing up any ladders in L4D. It also seems like the top bit isn't used at all even though there's nothing marking it as not ladder as far as Hammer is concerned, they tend to be entirely nodraw, or sometimes the front face is toolsinvisible, when it isn't the infected only climb texture...
Anyway, Garry's Mod. GMod has both func_ladder and func_useableladder support. Yay. It doesn't have func_simpleladder support. Less yay. However, maybe as a sort of artifact of them originally being func_ladder, maybe as something that's tied to how they're used in L4D, these ladders still have their brushes contained in the map, and they have the ladder contents flag. (I've mentioned that silly little concept before.) Remember how func_ladder is an internal entity? Well, apparently, this doesn't actually matter, because...
We can spawn the func_simpleladder/func_ladder brush model in as a generic brush entity and it'll work as a ladder. Return of the Yay. But... of course there's issues. Namely, players in GMod are 32 units thick. Most of the ladders in L4D are 28 units thick. This isn't a problem by itself, but Valve tends to put clip brush wedges around the grid-aligned ladders in L4D, presumably to help players not get caught on the edges, but it has an unfortunate side effect in GMod of actually blocking the player from getting on the ladder...
...At regular size. Shrinking the player down is an option, and I tried it, but not only is the process of doing it jank-city (that I've thankfully mostly ironed out on my shrink ray prototype), it also makes it really finicky to stay on those ladders. Like, if you were slimmed down to 26 units (already a significant reduction in area, and very noticeable in other spots in the game) you'd only have about one unit of leeway on either side while going up, because if you touched the edges here those clip brushes would pull you off.
We could make the ladders 1 unit wider/deeper... except we can't edit the brush models in any real way. It actually took me several days of trying things and testing to eventually realize this (alongside the clip brush issue mentioned previously), up until that point I thought I was maybe doing something with the stuff I was trying and that there was something inconsistent between the ladders that could be corrected. (Such as their content, their surface material, the vmt they were covered in, the previously mentioned normal, etc., etc.) I was wrong.
But, there's that normal direction we get from the map info. I actually previously used that to try to spawn HL2-styled ladders before I realized the brushes still worked as ladders. I got decently far into that, got most straight up and down ladders supported.


There was a lot of code to that, though, and it was still far from perfect, even ignoring that slanted ladders didn't get supported. So unfortunately, that was scrapped. But, having known that that normal was there, and (generally) working, I wound up using that as a direction to bump the grid-aligned ladders by one unit. This would put them past any clip wedges on the sides of them. And that was enough to get (most) L4D ladders working. As long as they either had a working normal or weren't clipped off, they should be fully usable.
Oh yeah, another important caveat. So, L4D uses player clip as survivor clip. Infected players can freely move through it. A ton of ladders in L4D are also only intended for the infected to use. There's not a real way to make ladders team-specific in GMod, and in the spirit of keeping things as movement friendly as possible, I left them all in. But, a lot of them lead to infected-only areas, that in GMod are just gonna be invisible walls.
So, sorry for all the ladders to nowhere. One actual upside of the original HL2-style system I had done was it would try to test for this and just kill the ladder if it seemed like it went nowhere like that, but, oh well. Even the current iteration feels like a lot of code for what's gonna be a very small percentage of maps people will be going on, especially considering that L4D2 format maps aren't even fully functional yet.
So yeah, tl;dr is ladders in Source are, indeed, spaghetti. And I don't wanna have to think about them again.



to this profile