Is it possible to decrease player's width? Created 1 year ago2023-09-22 15:05:36 UTC by GoldSrc M.A.R.S. GoldSrc M.A.R.S.

Created 1 year ago2023-09-22 15:05:36 UTC by GoldSrc M.A.R.S. GoldSrc M.A.R.S.

Posted 1 year ago2023-09-22 15:05:36 UTC Post #347868
So, is it possible to change player's width (GoldSrc) so one can pass through more narrow doors and such? Is there an editable file somewhere where player's width can be changed or is this hard-coded?
Posted 1 year ago2023-09-22 15:23:25 UTC Post #347869
When it comes to interacting with the world, the player doesn't really have a width or height. It's just a point.
Instead it's the collision models (clip hulls) of the world that are expanded outwards by half the player's height and width. In other words, the invisible cliphulls of the game world are expanded so they meet this point in the center of the player.
User posted image
These cliphulls are baked into the maps themselves during compilation, so it is kind of hard-coded into the compiler. The latest VHLT (available here) does come with the source so you could change the compilers themselves to generate cliphulls according to your new player size, though an even easier way would be using info_hullshape which is a VHLT map entity that can define a new shape (including size) for the player.
Posted 1 year ago2023-09-22 16:13:40 UTC Post #347870
Oh almost forgot! There's also player-entity collisions, I think those used bounding boxes. That should be in game code somewhere.
Posted 1 year ago2023-09-22 16:16:12 UTC Post #347871
Thanks for the answer. Good to know there is an easier way to do this. I have some doors that are narrower and unpassable and widening them decreases their visual appeal. So instead I'd like to decrease the player's clip hull a bit, make it a bit more realistic.
Posted 1 year ago2023-09-22 16:27:04 UTC Post #347872
If the walls around the doors aren't used for sealing the map, they could be made into func_detail and use zhlt_hull1 and zhlt_hull3 pointing to narrower info_hullshapes (for standing and crouching respectively, with the defaulthulls key set to 0). That way it's only those specific doorways that will behave as if there was a narrower player, and not mess with any other cliphulls (and probably save some clipnodes too, relative to using global info_hullshape).
Posted 1 year ago2023-09-22 17:13:54 UTC Post #347873
I see, ok. There won't be map sealing walls around these doors.
Posted 1 year ago2023-09-29 21:56:32 UTC Post #347893
Lol, but then you'll have to recompile both DLLs to accomodate hull changes. There are plenty of places with those constants.
Posted 1 year ago2023-09-30 18:10:49 UTC Post #347896
That's bounding boxes that you're thinking of, not hulls.
Posted 1 year ago2023-09-30 19:11:18 UTC Post #347897
Even then, the player hull is kinda hardcoded in the engine's physics code.
Admer456 Admer456If it ain't broken, don't fox it!
You must be logged in to post a response.