Board index DeFRaG How to DeFRaG

How the ground boost and teleporter jump works

Users helping users.

How the ground boost and teleporter jump works

Postby <hk> » Dec 5th, '10, 6:20 am

This is how I think the Groundboost works (didn't test this):
This is just how i pieced it together. I could be wrong here but I am at least very close. Please point out mistakes of any kind. I'll see to correct them.


Summary:
  • You walk on ground with no friction at all.
  • The more damage you take the longer you slide but only between 50 and 200 milliseconds(6 to 25 frames).
  • It should work with other players hitting you(teamtricking).


A player takes damage(by himself). The player is pushed away relative to the damage he takes if the weapon has a knockback.

g_combat.c in function G_Damage()
Code: Select all
  knockback = damage;
  if ( knockback > 200 ) {
    knockback = 200;
  }
  if ( targ->flags & FL_NO_KNOCKBACK ) {
    knockback = 0;
  }
  if ( dflags & DAMAGE_NO_KNOCKBACK ) {
    knockback = 0;
  }




A flag is set which defines the player as being pushed around. The delay until the flag is cleared is also related to the damage. At least 50 but tops 200 milliseconds (this will be your slidetime).

g_combat.c in function G_Damage()
Code: Select all
      t = knockback * 2;
      if ( t < 50 ) {
        t = 50;
      }
      if ( t > 200 ) {
        t = 200;
      }
      targ->client->ps.pm_time = t;
      targ->client->ps.pm_flags |= PMF_TIME_KNOCKBACK;




Usually, when you are hit, you can't move very well because the knockback pushes you off the ground into the air. But you never left the ground so PM_WalkMove() applies instead of PM_AirMove().
You can walk on the ground with typical air acceleration.
I guess that they removed the PMF_TIME_KNOCKBACK from this if() statement in CPM which would make the effect 10 times stronger than in VQ3. Feels right when I do so.

bg_pmove.c line 39
Code: Select all
float pm_accelerate = 10.0f;
float pm_airaccelerate = 1.0f;


bg_pmove.c in function PM_WalkMove()
Code: Select all
  // when a player gets hit, they temporarily lose
  // full control, which allows them to be moved a bit
  if ( ( pml.groundTrace.surfaceFlags & SURF_SLICK ) || pm->ps->pm_flags & PMF_TIME_KNOCKBACK ) {
    accelerate = pm_airaccelerate;
  } else {
    accelerate = pm_accelerate;
  }


It's the same for Teleporterjumping. Here is the code snipped that set's the KNOCKBACK flag. Which eventually leads to a lack of ground friction.
g_misc.c in function TeleportPlayer()
Code: Select all
  // spit the player out
  AngleVectors( angles, player->client->ps.velocity, NULL, NULL );
  VectorScale( player->client->ps.velocity, 400, player->client->ps.velocity );
  player->client->ps.pm_time = 160;   // hold time
  player->client->ps.pm_flags |= PMF_TIME_KNOCKBACK;



Here is the part where the PMF_TIME_KNOCKBACK leads to no friction at all. That's why you can accelerate like being on slicky ground.

bg_pmove.c in function PM_Friction()
Code: Select all
  // apply ground friction
  if ( pm->waterlevel <= 1 ) {
    if ( pml.walking && !(pml.groundTrace.surfaceFlags & SURF_SLICK) ) {
      // if getting knocked back, no friction
      if ( ! (pm->ps->pm_flags & PMF_TIME_KNOCKBACK) ) {
        control = speed < pm_stopspeed ? pm_stopspeed : speed;
        drop += control*pm_friction*pml.frametime;
      }
    }
  }
User avatar
<hk>
Menstruating 24/7
 
Posts: 1040
Joined: May 2nd, '09, 12:06 am
Location: Ingolstadt Germany

Re: How the ground boost works

Postby <hk> » Dec 9th, '10, 6:52 pm

No objections.
I am either right or nobody cares at all.
User avatar
<hk>
Menstruating 24/7
 
Posts: 1040
Joined: May 2nd, '09, 12:06 am
Location: Ingolstadt Germany

Re: How the ground boost works

Postby AL!EN » Dec 10th, '10, 12:06 am

Those thing can be user full for me 6 years ago. How many people from Defrag community know QuakeC ? I can learn it in a month but what for :?: My strafes won't improve from reading quake 3 engine code. Everything was already discover in Q3 engine, all bugs, all cheats ... damm hard night :ASDSAD
"strafe is the most important 'weapon' in defrag" - <hk>
User avatar
AL!EN
 
Posts: 282
Joined: May 2nd, '09, 8:26 am
Location: Poland

Re: How the ground boost works

Postby $$-albion » Dec 10th, '10, 12:50 am

<hk> wrote:No objections.
I am either right or nobody cares at all.


Or most of the ppl(people) don't know what's going on... like me :D

But still, I don't really care about the code for it, I'm not saying it's not impressive you know all that shit, it's just... just assume gb's are magnets and fucking magnets, how do they work? Fucking miracles... yeah that's right, deal with it 8-)
User avatar
$$-albion
 
Posts: 291
Joined: May 6th, '09, 9:15 pm
Location: Bruges, Belgium

Re: How the ground boost works

Postby <hk> » Dec 10th, '10, 1:38 am

eS-AL|EN wrote:Those thing can be user full for me 6 years ago.

What?



eS-AL|EN wrote:How many people from Defrag community know QuakeC ?

Me certainly not. What is QuakeC?



eS-AL|EN wrote:My strafes won't improve from reading quake 3 engine code.

True. But this is not about improving anything. It's about curiosity.



eS-AL|EN wrote:Everything was already discover in Q3 engine

Most of it. Nobody knows what's still out there. To my knowledge the last bug was discovered just a few month ago.
User avatar
<hk>
Menstruating 24/7
 
Posts: 1040
Joined: May 2nd, '09, 12:06 am
Location: Ingolstadt Germany

Re: How the ground boost works

Postby $$-albion » Dec 10th, '10, 12:27 pm

<hk> wrote:
eS-AL|EN wrote:Those thing can be user full for me 6 years ago.

What?


Read: Those things could've been useful to me 6 years ago.

Completely ignored my post :( forever alone :'(
User avatar
$$-albion
 
Posts: 291
Joined: May 6th, '09, 9:15 pm
Location: Bruges, Belgium

Re: How the ground boost works

Postby <hk> » Dec 10th, '10, 1:24 pm

For a moment I thought I was right with this theory. Well, you grounded me.
User avatar
<hk>
Menstruating 24/7
 
Posts: 1040
Joined: May 2nd, '09, 12:06 am
Location: Ingolstadt Germany

Re: How the ground boost works

Postby MidiMightyMoe » Dec 10th, '10, 6:18 pm

It's actually quite interesting, and imporant to have it writed down somewhere. It's jus that I had nothing to say about it :D .
MidiMightyMoe
 
Posts: 68
Joined: Jan 3rd, '10, 2:05 pm

Re: How the ground boost works

Postby Po0dle » Dec 16th, '10, 10:35 am

That's quite interesting to read still, I love to hear more about Quake bug theories :) I'm actually a really big fan of this move even though I learnt it only just recently.
Would it be possible to use plasma to make a slick road?
Po0dle
 
Posts: 11
Joined: Oct 15th, '09, 7:31 pm

Re: How the ground boost works

Postby esc?nebuLa » Dec 31st, '10, 7:00 pm

How about some creative demos showcasing ground boost? Not only just defrag runs, but cpm freestyle tricks :D

I'll start out with a simple one on dm17
You do not have the required permissions to view the files attached to this post.
https://www.facebook.com/TeamEventHorizon
#tricking_eh on irc.quakenet.org
User avatar
esc?nebuLa
 
Posts: 338
Joined: Nov 15th, '09, 2:02 pm
Location: USA

Next

cron