Inside3D!
     

"Proper" way to do crouching in DP

 
Post new topic   Reply to topic    Inside3d Forums Forum Index -> QuakeC Programming
View previous topic :: View next topic  
Author Message
c0burn



Joined: 05 Nov 2004
Posts: 158
Location: Liverpool, England

PostPosted: Tue Mar 30, 2010 7:45 pm    Post subject: "Proper" way to do crouching in DP Reply with quote

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
View user's profile Send private message Visit poster's website AIM Address MSN Messenger
Sajt



Joined: 16 Oct 2004
Posts: 1026

PostPosted: Tue Mar 30, 2010 8:12 pm    Post subject: Reply with quote

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
View user's profile Send private message
c0burn



Joined: 05 Nov 2004
Posts: 158
Location: Liverpool, England

PostPosted: Tue Mar 30, 2010 9:09 pm    Post subject: Reply with quote

Well that was quick. Thanks Supa, that's pretty much everything I needed to know.
Back to top
View user's profile Send private message Visit poster's website AIM Address MSN Messenger
leileilol



Joined: 15 Oct 2004
Posts: 1321

PostPosted: Tue Mar 30, 2010 9:15 pm    Post subject: Reply with quote

Supa didn't say anything.
_________________
Back to top
View user's profile Send private message
c0burn



Joined: 05 Nov 2004
Posts: 158
Location: Liverpool, England

PostPosted: Tue Mar 30, 2010 10:25 pm    Post subject: Reply with quote

Woops. Thanks Sajt.
Back to top
View user's profile Send private message Visit poster's website AIM Address MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Inside3d Forums Forum Index -> QuakeC Programming All times are GMT
Page 1 of 1

 
Jump to:  
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