Fortress Forever

Fortress Forever (https://forums.fortress-forever.com/index.php)
-   General Discussion (https://forums.fortress-forever.com/forumdisplay.php?f=10)
-   -   Conc push formula (https://forums.fortress-forever.com/showthread.php?t=14949)

hlstriker 03-05-2008 12:43 AM

Conc push formula
 
I'm working on a plugin that needs to emulate a conc grenade.

I was wondering if one of the developers or someone with access to the source can let me know what the formula is for the conc push.

I tried a basic formula of:
((distance + speed) * 2.35)

The above works but is not efficient enough.

pF 03-05-2008 12:58 AM

..for?

Circuitous 03-05-2008 01:00 AM

His plugin, obviously.

I don't have the formula you crave, nor access to it. We'll see if a dev steps up.

Tsukasa 03-05-2008 05:27 AM

Quote:

Originally Posted by hlstriker
I'm working on a plugin that needs to emulate a conc grenade.

I was wondering if one of the developers or someone with access to the source can let me know what the formula is for the conc push.

I tried a basic formula of:
((distance + speed) * 2.35)

The above works but is not efficient enough.

The formula is 7 * 6, yielding an answer of 42.

tml 03-05-2008 01:56 PM

first you have to derive the conc, finding the slope of the push. now take the push slope and multiply by the noob factor devided by pi

Dr.Satan 03-05-2008 07:10 PM

wow stfu guys...this guy is trying to ask a genuine question. why do you have to be jackasses about it?

at OP I'll pm a dev and see if I can't get them to stop by for ya man.

pF 03-05-2008 07:19 PM

Cui bono..

Jiggles 03-05-2008 09:49 PM

This is the conc code, simplified:

From CFFGrenadeConcussion::Explode():
Code:

Vector vecDisplacement = pPlayer->GetLegacyAbsOrigin() - GetAbsOrigin();
float flDistance = vecDisplacement.Length();
Vector vecResult;
                       
// HAND-HELD CONC
if ((pEntity == GetThrower() && m_fIsHandheld) || (flDistance < 16.0f))
{
        float fLateral = FFDEV_CONC_LATERAL_POWER;        // 2.74f
        float fVertical = FFDEV_CONC_VERTICAL_POWER;        // 4.10f

        Vector vecVelocity = pPlayer->GetAbsVelocity();
        Vector vecLatVelocity = vecVelocity * Vector(1.0f, 1.0f, 0.0f);
        float flHorizontalSpeed = vecLatVelocity.Length();

        vecResult = Vector(vecVelocity.x * fLateral, vecVelocity.y * fLateral, vecVelocity.z * fVertical);

}
// DROP CONC
else
{
        float verticalDistance = vecDisplacement.z;
                                       
        vecDisplacement.z = 0;
        float horizontalDistance = vecDisplacement.Length();

        // Normalise the lateral direction of this
        vecDisplacement /= horizontalDistance;

        vecDisplacement *= (horizontalDistance * (8.4f - 0.015f * flDistance));
        vecDisplacement.z = (verticalDistance * (12.6f - 0.0225f * flDistance));

        vecResult = vecDisplacement;
}

pPlayer->SetAbsVelocity(vecResult);


Dr.Satan 03-05-2008 09:57 PM

^ Jiggles is awesome!

hlstriker 03-05-2008 10:12 PM

Thanks a ton. Much appreciated :)


All times are GMT. The time now is 06:55 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2020, vBulletin Solutions, Inc.