View previous topic :: View next topic |
Author |
Message |
c0burn
Joined: 05 Nov 2004 Posts: 158 Location: Liverpool, England
|
Posted: Tue Mar 30, 2010 7:45 pm Post subject: "Proper" way to do crouching in DP |
|
|
What's the non hacky way to do crouching in DP?
Does it need Q3BSP due to needing another hull size?
What about setsize, what should be called? |
|
Back to top |
|
 |
Sajt
Joined: 16 Oct 2004 Posts: 1026
|
Posted: Tue Mar 30, 2010 8:12 pm Post subject: |
|
|
First decide whether crouching should involve moving the top of the bbox down (probably the first thing that comes to mind), or tucking in the bottom of the bbox. From what it feels like, (or what I remember it feeling like last time I played it,) Half-Life does something like the latter, which allows you to jump, tuck your legs in and land on a higher ledge. (If you are standing on the ground when this happens, though, you should move the player down too, or he will tuck his legs in then fall.)
Quake3's (and probably Quake2's) specific behaviour requires +jump to be merged with +moveup, and +crouch (or what have you) with +movedown. In SV_PlayerPhysics, check movement_z to determine whether to jump or crouch. Therefore, jump and crouch can cancel each other out, so while crouching, you can hold jump to briefly stand up.
When you uncrouch, do a walkmove or (in DP) an in-place tracebox, to make sure that there is room to uncrouch, before setsizeing back to normal.
Then you have to lerp view_ofs_z, historically done in QC but CSQC would be better.
You will need to use a non-Q1BSP map format, yes, if you want crouching to be of any practical use. Q2BSP and Q3BSP don't use hulls at all, HLBSP (and possibly Hexen2's BSP format?) add an extra hull for crouching. Years ago I was working on an extended Q1BSP format for DarkPlaces which allowed up to 16 user-defined hulls (among other features) but never finished it. So Q3BSP and HLBSP are your two best bets. _________________ F. A. Špork, an enlightened nobleman and a great patron of art, had a stately Baroque spa complex built on the banks of the River Labe.
Last edited by Sajt on Tue Mar 30, 2010 11:35 pm; edited 3 times in total |
|
Back to top |
|
 |
c0burn
Joined: 05 Nov 2004 Posts: 158 Location: Liverpool, England
|
Posted: Tue Mar 30, 2010 9:09 pm Post subject: |
|
|
Well that was quick. Thanks Supa, that's pretty much everything I needed to know. |
|
Back to top |
|
 |
leileilol

Joined: 15 Oct 2004 Posts: 1321
|
Posted: Tue Mar 30, 2010 9:15 pm Post subject: |
|
|
Supa didn't say anything. _________________
 |
|
Back to top |
|
 |
c0burn
Joined: 05 Nov 2004 Posts: 158 Location: Liverpool, England
|
Posted: Tue Mar 30, 2010 10:25 pm Post subject: |
|
|
Woops. Thanks Sajt. |
|
Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2004 phpBB Group
|