Character collision hulls

I’m curious about the shape of player/NPC collision hulls. GMod and other Source 1 games used rectangular axis-aligned hulls, but this had the unfortunate side effect of not allowing characters to pass through thin passages (e.g. realistically sized doorways) that aren’t aligned to the world axes:

This still seems to be the case in HL:A, judging by the movement in non-VR mode (although the hull is much thinner, so it’s not as much of an issue). A cylinder or capsule shaped hull like in Unity/Unreal sounds like it would be an ideal solution, but I imagine it could be difficult to switch to that when it’s not used in Source 2 by default.

Have any plans or decisions been made about the shape and size of character hulls? It’d be nice to be able to rely on realistic measurements when mapping, especially if VR support is coming at some point.

I am pretty sure the stock character controller will utilize AABB as player physics object, not sure if it’ll be very easy to change the shape of the collider to something like a cylinder or capsule preserving the rest of the controller (how walking, jumping, etc. works).

You will probably be able to implement/use another player motion controller but don’t expect it to feel like the Source one, it’ll be something different.

I’m using AABB for the default movement code - because that’s what HL2 uses. You can trace sweep any shape though so I don’t see any reason why you wouldn’t be able to change the code to use a capsule or whatever.

5 Likes

Wouldn’t it be better to use a capsule so there’s no problem with off-grid doorways? Could be a problem for some mappers who can’t code and want to host servers with their maps to play.

It’s more of a situation where Garry wants to keep the default movement identical to source, collision hull included.

Hmm, but would it make any real difference to the feel of the movement other than allowing more accurate collision and no issues with angled doorways.

In an ideal world, someone will probably post an addon to the workshop that modifies the default hull shape of all players, so that it’s a simple fix for any server owners that need it.

I guess, the only thing that would really feel different is going up stairs, it’d be less jarring with a capsule.

I share your concern about player collision as well, and really wanted to implement a custom collider too.

I think that a cylinder(NOT a capsule) would be best for solving that really annoying corner issue while allowing players to enjoy certain platforming advantages of AABB’s flat bottom/top. It’s too fun to be able to accurately step on thin ledges and have it just work. Also capsules can feel like shit and have inherent collision bugs related to their top and bottom spheres, just try your average Unity game and see.

Source maps are designed with AABB in mind, so if you have very different collision then you could break so many maps that people love and will expect to play properly. Too controversial.

Source movement code has AABB collision so ingrained into it that it’s not simple to quickly switch it without serious bugs I assume. In my opinion you may as well implement custom movement yourself if you want these changes.

What I would like to see is a friendly way to override the player’s default movement collision methods when working through S&box, but I can’t say what any barriers/kinks might be without access.

1 Like