Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
uber²

Looking for rocket launcher knockback values

Recommended Posts

Hello! I'm new here, I've lurked these forums for some time but decided to create an account to ask for some information, hope someone could help me out.
 

I've been looking for some info on rocket jumping (not 100% accurate here considering it's the doom engine though :p), and so far there's not much I've found about doom's rocket launcher. How would the explosion knockback work? I assume it does something like adding some speed to whatever thing is inside its blast radius, with the amount decreasing (linearly) the further away from the center it is. In that case, is there some way I could find what those values are?

Thanks!

Edit: I was messing around with a speedometer mod and tried shooting a rocket at a wall next to me with invulnerability, my speed increased to around 15.08mu/s at the moment of impact. Would that value be correct?

Edited by uber²

Share this post


Link to post

Any attack (except the chainsaw) causes knockback to the target proportional to the damage dealt. In function P_DamageMobJ:

 

thrust = damage*(FRACUNIT>>3)*100/target->info->mass;

FRACUNIT is one map unit, so FRACUNIT>>3 is 1/8th of a map unit. The player's mass is 100, so the last bit of the formula reduces to just 1. Therefore, the thrust applied is 1/8th of a map unit per point of damage taken.

 

Now, the rocket launcher deals between 0 and 128 damage, based on the distance to the center of the explosion (actually, explosions are square in Doom, so it works out a little differently). If the player fires at a wall at point blank, they will take the full 128 damage. Plugging 128 into the formula gives:

 

thrust = 128 * 1/8 mu = 16 mu

 

However, every gametic, if the player is touching the ground, the player's speed is reduced by 90.625% (friction). So if the player starts off standing still, they are moving at 0 mu/tic. The player then shoots a rocket at a wall at point blank range and their speed is immedeately increased to 16 mu. However, in the same tic friction is applied, so the actual speed ends up being 16 mu/tic * 0.90625≈14.5 mu/tic.

Share this post


Link to post

Nice analysis! And it seems like both your numbers jive:

Emperical: 15.08

Calculated: 14.5

 

< 5% difference

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×