Fortress Forever

Go Back   Fortress Forever > Community > General Discussion

Reply
 
Thread Tools Display Modes
Old 03-05-2008, 12:43 AM   #1
hlstriker
QUAD ROCKET
Server Owner
Fortress Forever Staff
 
hlstriker's Avatar
 
Join Date: Jul 2007
Class/Position: Soldier
Gametype: Rocket Jumping
Affiliations: -g1 ]qS[ -eC- :e0: [ESAD]
Posts Rated Helpful 11 Times
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.
hlstriker is offline   Reply With Quote


Old 03-05-2008, 12:58 AM   #2
pF
no war but class war
Fortress Forever Staff
 
pF's Avatar
 
Join Date: Oct 2007
Location: big bad berlin
Class/Position: Soldier / Scout
Gametype: ctf
Affiliations: [w~k!]
Posts Rated Helpful 3 Times
..for?
__________________
Support FF:

Gay And Lesbian Fiction | Teen Books | Bath Products
pF is offline   Reply With Quote


Old 03-05-2008, 01:00 AM   #3
Circuitous
Useless
Retired FF Staff
 
Join Date: Jun 2005
Class/Position: D Soldier, O Scout
Gametype: AvD
Posts Rated Helpful 9 Times
Send a message via AIM to Circuitous Send a message via MSN to Circuitous Send a message via Yahoo to Circuitous Send a message via Skype™ to Circuitous
His plugin, obviously.

I don't have the formula you crave, nor access to it. We'll see if a dev steps up.
__________________
Look at all those dead links.
Circuitous is offline   Reply With Quote


Old 03-05-2008, 05:27 AM   #4
Tsukasa
 
Join Date: Sep 2007
Class/Position: O
Gametype: CTF
Affiliations: mimic-
Posts Rated Helpful 0 Times
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.
Tsukasa is offline   Reply With Quote


Old 03-05-2008, 01:56 PM   #5
tml
make it rain
 
tml's Avatar
 
Join Date: Dec 2007
Location: North Bay
Posts Rated Helpful 0 Times
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
tml is offline   Reply With Quote


Old 03-05-2008, 07:10 PM   #6
Dr.Satan
Wiki Team
Fortress Forever Staff
 
Dr.Satan's Avatar
 
Join Date: Sep 2007
Location: Greeley, CO
Class/Position: Med / Solly
Gametype: PAYLOAD
Affiliations: DET-
Posts Rated Helpful 19 Times
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.
__________________
(Released) conc_school | hellion_classic | ksour_PAYLOAD | mulch_faf
(Beta) alchimy_b1
(Lua) base_payload_2015
(Models) props_trainyard
Support FF:
Dr.Satan is offline   Reply With Quote


Old 03-05-2008, 07:19 PM   #7
pF
no war but class war
Fortress Forever Staff
 
pF's Avatar
 
Join Date: Oct 2007
Location: big bad berlin
Class/Position: Soldier / Scout
Gametype: ctf
Affiliations: [w~k!]
Posts Rated Helpful 3 Times
Cui bono..
__________________
Support FF:

Gay And Lesbian Fiction | Teen Books | Bath Products
pF is offline   Reply With Quote


Old 03-05-2008, 09:49 PM   #8
Jiggles
Retired FF Staff
 
Jiggles's Avatar
 
Join Date: Jan 2005
Location: CowTown
Posts Rated Helpful 0 Times
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);
Jiggles is offline   Reply With Quote


Old 03-05-2008, 09:57 PM   #9
Dr.Satan
Wiki Team
Fortress Forever Staff
 
Dr.Satan's Avatar
 
Join Date: Sep 2007
Location: Greeley, CO
Class/Position: Med / Solly
Gametype: PAYLOAD
Affiliations: DET-
Posts Rated Helpful 19 Times
^ Jiggles is awesome!
__________________
(Released) conc_school | hellion_classic | ksour_PAYLOAD | mulch_faf
(Beta) alchimy_b1
(Lua) base_payload_2015
(Models) props_trainyard
Support FF:
Dr.Satan is offline   Reply With Quote


Old 03-05-2008, 10:12 PM   #10
hlstriker
QUAD ROCKET
Server Owner
Fortress Forever Staff
 
hlstriker's Avatar
 
Join Date: Jul 2007
Class/Position: Soldier
Gametype: Rocket Jumping
Affiliations: -g1 ]qS[ -eC- :e0: [ESAD]
Posts Rated Helpful 11 Times
Thanks a ton. Much appreciated
hlstriker is offline   Reply With Quote


Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:07 PM.


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