Remove Bunny Hop From Single Player RTCW


(wolfETplayer) #1

I want to remove bunny hop(jump acceleration) from single player RTCW. I know there is some restriction on bunny hop and strafe jumping in RTCW MP. I’m working with source code, however i couldn’t find the way Nerve did that.

All that i found is PM_Checkjump in bg_pmove.c:

=============
PM_CheckJump

*/
static qboolean PM_CheckJump( void ) {
// JPW NERVE – jumping in multiplayer uses and requires sprint juice (to prevent turbo skating, sprint + jumps)
// don’t allow jump accel
// if (pm->cmd.serverTime - pm->ps->jumpTime < 850)

if ( pm->cmd.serverTime - pm->ps->jumpTime < 500 ) { // (SA) trying shorter time. I find this effect annoying :wink:
return qfalse;
}

if ( pm->ps->pm_flags & PMF_RESPAWNED ) {
return qfalse; // don’t allow jump until all buttons are up
}

if ( pm->cmd.upmove < 10 ) {
// not holding jump
return qfalse;
}

// must wait for jump to be released
if ( pm->ps->pm_flags & PMF_JUMP_HELD ) {
// clear upmove so cmdscale doesn’t lower running speed
pm->cmd.upmove = 0;
return qfalse;
}

pml.groundPlane = qfalse; // jumping away
pml.walking = qfalse;
pm->ps->pm_flags |= PMF_JUMP_HELD;

pm->ps->groundEntityNum = ENTITYNUM_NONE;
pm->ps->velocity[2] = JUMP_VELOCITY;
PM_AddEvent( EV_JUMP );

if ( pm->cmd.forwardmove >= 0 ) {
BG_AnimScriptEvent( pm->ps, ANIM_ET_JUMP, qfalse, qtrue );
pm->ps->pm_flags &= ~PMF_BACKWARDS_JUMP;
} else {
BG_AnimScriptEvent( pm->ps, ANIM_ET_JUMPBK, qfalse, qtrue );
pm->ps->pm_flags |= PMF_BACKWARDS_JUMP;
}

return qtrue;
}

I think this is the right thing. However I can’t find a way to make this work in single player. Maybe someone on this forums can help me out with this?


(ronboy) #2

Hello, WolfETPlayer. Why would you want to remove the iconic “bunny hopping” feature from Rtcw SP? Quite a few players use this feature, and it makes Rtcw unique, since most games don’t have this.

I can’t help you out though, because I know nothing regarding editing the source code. :frowning:


(Nail) #3

id Software left it in because removing the engine glitch was too difficult, good luck with your efforts


(wolfETplayer) #4

Well, somehow Nerve Software managed to restrict bunny hop in RTCW multiplayer. I hope to do the same in single player.


(wolfETplayer) #5

Thanks to Eugeny I figured it out. You just need to change this:

if ( pm->cmd.serverTime - pm->ps->jumpTime < 500 )

to this

if ( pm->cmd.serverTime - pm->ps->jumpTime < 850 )


(ronboy) #6

Eugeny is highly skilled with the Rtcw source code. We are lucky to have him, and congratulations on solving your problem WolfETPlayer. :slight_smile: