PR physics questions.

General discussion of the Project Reality: BF2 modification.
Post Reply
40mmrain
Posts: 1271
Joined: 2011-08-17 05:23

PR physics questions.

Post by 40mmrain »

Question for those who are knowledgeable with PR's engine.

1. What is the acceleration due to gravity of a projectile in PR, using in game meters.
2. Does a bomb dropped from a plane have the same same initial velocity as the plane itself?

When you drop a bomb in PR, it goes down, I need to know the specifics of it's down-ness. Trying to do to simple kinematics calculations for dumb bomb dropping. I'm assuming it's not the same as our planet's, the bombs behave kind of strangely sometimes.

edit: it appears no one has an answer for this. Ill do some manual experimenting for this, I guess.
Last edited by 40mmrain on 2012-04-15 06:51, edited 1 time in total.
PricelineNegotiator
Posts: 1382
Joined: 2009-08-30 04:32

Re: PR physics questions.

Post by PricelineNegotiator »

40mmrain wrote:Question for those who are knowledgeable with PR's engine.

1. What is the acceleration due to gravity of a projectile in PR, using in game meters.
2. Does a bomb dropped from a plane have the same same initial velocity as the plane itself?

When you drop a bomb in PR, it goes down, I need to know the specifics of it's down-ness. Trying to do to simple kinematics calculations for dumb bomb dropping. I'm assuming it's not the same as our planet's, the bombs behave kind of strangely sometimes.

edit: it appears no one has an answer for this. Ill do some manual experimenting for this, I guess.
Should be the same as Earth's gravitational constant. The bomb does have the same initial velocity of the plane when dropped.
40mmrain
Posts: 1271
Joined: 2011-08-17 05:23

Re: PR physics questions.

Post by 40mmrain »

15m/s^2 you say?

Ill use these numbers, and run some tests, but for an example calculation in perfectly level flight, with exact bearing towards target, moving at 1200km/h (I assume this is the units of the speedometer on jets), and your altitude is 422 meters, if you drop a bomb it will land exactly 2500 meters away.

So, in practice, we should be able to put an attack mark on a target, fly way out of the map, line up the jet with the compass, adjust speed and altitude, then open up the map and look at the range until youre 3000 meters away, wait 1-2 seconds, then release the payload. Given that a 500lber has a blast radius exceeding 50m, even if youre a little off it should have good effect. Also, considering how the A10, A1, A4 and GR9 are pretty slow, we should be able to make good use of this on kashan, ia drang, and eventually the falklands.

Moving at slower speeds, higher alt or closer bombing should be possible. Once I run some tests, and confirm that 15m/s^2 is the actual number ill make a chart that people can use to dumb bomb effectively. Of course, bombs might have some weird coefficient like rifle projectiles.
40mmrain
Posts: 1271
Joined: 2011-08-17 05:23

Re: PR physics questions.

Post by 40mmrain »

I see. The speedometer has it's own arbitrary units that dont use in game meters, but they ARE constant, so this is workable. what I mean is that 1000 in a jet is exactly one half the speed 2000 is, right?

Thanks exiled youve been really insightful, once I find out bomb gravity, then it shouldnt be too hard to workout what the speedometer is actually saying.
Killer2354
Posts: 407
Joined: 2008-11-19 02:48

Re: PR physics questions.

Post by Killer2354 »

Sadly I can't help with this in form on math or programing, but I do know how to dumb bomb actually quite accurately using the bomb HUD, especially in the A10a.
slappymcnutface
Posts: 25
Joined: 2011-08-07 17:52

Re: PR physics questions.

Post by slappymcnutface »

I know some projectiles have different velocities all together as well. e.g. AP rounds travel ~twice as fast as HEAT, some bullets travel faster than others etc. This has to do more with the projectile than the weapon I suppose.

So maybe some bombs will travel with different speeds than others, who knows.
jax
Posts: 355
Joined: 2011-08-07 02:47

Re: PR physics questions.

Post by jax »

Physics class is useful somewhere, I just did all these calculations based off your findings, quite cool actually. :D

Off we fuck.
40mmrain
Posts: 1271
Joined: 2011-08-17 05:23

Re: PR physics questions.

Post by 40mmrain »

Killer2354 wrote:Sadly I can't help with this in form on math or programing, but I do know how to dumb bomb actually quite accurately using the bomb HUD, especially in the A10a.
I see, never actually tried this myself. That's great stuff for IVR bombing, but if we're able to bomb stuff 2500m from the target, then we pretty much have total immunity from AA, while still accurately attacking the enemy.

Takes a bit of skill to do this, however.
jax
Posts: 355
Joined: 2011-08-07 02:47

Re: PR physics questions.

Post by jax »

If you make this work, are you just going to roll with a calculator next to you while you fly?

Off we fuck.
Sniperdog
Retired PR Developer
Posts: 1177
Joined: 2009-02-27 00:06

Re: PR physics questions.

Post by Sniperdog »

1. -14.73 m/s/s;
2. If the object is traveling faster then its maxSpeed it will be reduced to that but otherwise the speed will be the same as will the direction of travel, unless the weapon held a lock when the projectile was spawned in which case it will be pointed at the target. (Which you will see with planes who have lock in BF2 even if they are flying horizontal with a target beneath them, the bomb will come out pointed straight down.)

This should help too:

ObjectTemplate.drag is a value that affects drag according to the equations:

x = mvcos?/k(1 - e^(-kt/m))
y = mvsin?/k(1 - e^(-kt/m)) - gm^2k^-2(e^(-kt/m) + kt/m -1)


x = mvcos(?)/0.064(1-e^(-0.064t/m))
y = mvsin(?)/0.064(1-e^(-0.064t/m))-gm^(2)0.064^(-2((e^(-0.064t/m))+(0.064t/m)-1))

where:
k ~ 0.064
m = objects mass (kg)
v = initial velocity (m/s)
g = acceleration due to gravity (m/s/s)
e ~ 2.718281828
? = angle above horizontal the thing was fired at
t = time since fired (s)

Split into horizontal/vertical vectors and particle has no acceleration (its not a rocket or powered vehicle). Is not applicable to anything on the ground.

Although gravity in bf2 is exactly -14.73 by default, but can be changed using physics.gravity, that value should then be multiplied by the object's gravityModifier to get the true gravity.

This one is parametric in time, and if drag is removed from the projectiles you get a simple parabolic trajectory governed by the SUVAT equations.

Bear in mind that if a projectile acquires lock it ignores gravity completely and it uses its follow component to determine its rate of change in direction of travel, and uses its acceleration and maxSpeed components to determine its change in speed.

Hope that helped, most of that info was found by [R-DEV]Mosquill and some guy who did testing a while before me.
Last edited by Sniperdog on 2012-04-17 05:34, edited 2 times in total.
Image

Image

Will Stahl aka "Merlin" in the Squad community
40mmrain
Posts: 1271
Joined: 2011-08-17 05:23

Re: PR physics questions.

Post by 40mmrain »

yeah Im hoping drag is negligible. ALso, vectors shouldn't be a problem, because it has to be simplified in practice by going exactly straight on towards the target in level flight.

Ideally I'm hoping for a parabola, which makes for easy calculations.

thanks, guys.
jax
Posts: 355
Joined: 2011-08-07 02:47

Re: PR physics questions.

Post by jax »

[R-DEV]Sniperdog wrote:ObjectTemplate.drag is a value that affects drag according to the equations....
Does this mean drag is neglible or not?

Off we fuck.
ytman
Posts: 634
Joined: 2010-04-22 17:32

Re: PR physics questions.

Post by ytman »

SniperDog, since your attention is had, how does all that affect mortars trajectory? Do mortars travel in a perfect arc (no drag/decrease in acceleration) or do they behave more like real mortars by nearly falling nearly straight down?
spirit03
Posts: 80
Joined: 2012-04-06 22:05

Re: PR physics questions.

Post by spirit03 »

Hello! One question considering physics. I've tried using deacceleration and adding negative value for acceleration. It doesn't work. Now, what I want to do is create an "effect" of a gravity drag and wind resistance.

As some of you know, I made a flare effect (posted in Community Modding forum), which now has a constant velocity (42). I'd like it to slow down so it looses velocity over time like this: 100% initial velocity -50% initial velocity-10% initial velocity, so that it kind of looses velocity and gets more dragged by gravity.

I'm a bit of a computer geek, and when I get my hands on some work, I complete it until it's perfect :D Now only thing I do when I can use computer is make these flares great :)

Cheers!
Post Reply

Return to “PR:BF2 General Discussion”