1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

Bullet speed

Discussion in 'Programming' started by Postal, Dec 31, 2001.

  1. Postal

    Postal I apear to have lost my pin.

    Joined:
    Nov 14, 1999
    Messages:
    1,388
    Likes Received:
    0
    Ok, I have code to simulate air friction, make bullets fall at the correct speed, and so forth.

    What I now need to know, what is realist speeds for bullets in uneal. I can easly look up the speed of ammunation, but what is the converson from fps to unreal units, what ever they are.

    So, let say, for 9x19 nato, Federal 124 grain Hydro-Shock round at 1120 fps, how do I use that in my projectile?
     
  2. +RIP+Botje

    +RIP+Botje New Member

    Joined:
    Dec 8, 2001
    Messages:
    19
    Likes Received:
    0
    all i know is that 128 uu ~= 1m
     
  3. Postal

    Postal I apear to have lost my pin.

    Joined:
    Nov 14, 1999
    Messages:
    1,388
    Likes Received:
    0
    Thats good enough, thanks
     
  4. mr.s-d

    mr.s-d CHiMERiC Moderator

    Joined:
    Aug 30, 2001
    Messages:
    65
    Likes Received:
    0
    Eh? 128UUs is ~1 metre? then that would make the players under a metre tall...
     
  5. eXoR

    eXoR Lead coder

    Joined:
    Oct 22, 2001
    Messages:
    36
    Likes Received:
    0
    As I recall it 48 UU = 1 meter.
     
  6. Silver_Ibex

    Silver_Ibex Member

    Joined:
    Feb 27, 2001
    Messages:
    654
    Likes Received:
    0
    Beppo already calculated out the conversions for airspeed and bullet drop, below are his comments from the infiltration bullet class.

     
  7. Postal

    Postal I apear to have lost my pin.

    Joined:
    Nov 14, 1999
    Messages:
    1,388
    Likes Received:
    0
    Hey, I have similar code, cool
     
  8. usaar33

    usaar33 Un1337

    Joined:
    Mar 25, 2000
    Messages:
    808
    Likes Received:
    0
    Since you are going for realism, probably the best scale is derive it from gravity.

    Default zonegravity is -950 unreal units/second^2 in UT (check the zoneinfo.uc class to verify if you wish).

    Yet it is only applied at 1/2 rate (It is in the C++ code... Mongo showed the code at #unrealscript.. I dunno why Epic wrote it this way, but that is how it works. Feel free to test this yourself).

    Thus -425 units = -9.8 meters

    Thus 1 meter ~ 43.33 units.

    1 foot = 13.21 units.


    BTW, this scale gives 180 cm (5'11") players (collisionheight of tournamentplayer is 39. That measurement is from location to top and bottom of cylinder.. thus total size is 78 un high) A very realistic number :)

    Beppo's scale results in 149 cm (4'10.5") players, rather on the short side.

    180 un to 1 meter? The default player would be less than a meter tall!
     
    Last edited: Jan 2, 2002
  9. Papapishu

    Papapishu 我是康

    Joined:
    Jun 18, 2001
    Messages:
    2,043
    Likes Received:
    0
    Aaah! :):)
    It's at times like this when you see the pure beauty of truth like looking into the sun, but it's sweet.
    It makes you believe that there's an inteligent lifeform that has set the rules.
    The programers have thought of everything, and it makes me feel like I'm in a safe haven :D

    hrrm, sorry, the mere beauty of the truth made me a bit dilerious and poetic :D
     
  10. Postal

    Postal I apear to have lost my pin.

    Joined:
    Nov 14, 1999
    Messages:
    1,388
    Likes Received:
    0
    For my mod, we plan to use simple, unrealistic traces in most of the guns, but of few of the maps we have planed will not have edges but portles(is make a small section of forrest seem endless) so I am going to make some special guns for that, where the bullets are projectetiles that fly with air ristance, and dropw ith gravity, and so forth
     
  11. EasyRaider

    EasyRaider Crazy coder

    Joined:
    Sep 21, 2001
    Messages:
    74
    Likes Received:
    0
    So Zonegravity is only applied at half rate. Nice to know. I've already estimated 1 m ~= 43.33 uu from the height of players, but I didn't think about comparing with gravity.

    Now acceleration isn't applied at half rate too, is it? I have a BallisticProj class, in which I add zonegravity to acceleration in an attempt to simulate gravity. Should I just multiply by 0.5?

    [edit]
    Hm, it seems that 48 may be the most accurate number anyway:
    950 / 2 = 475
    475 / 9.81 ~= 48.4

    That gives a player height of about 162 cm.

    I'm sorry to burst your bubble, papapishu :)
     
    Last edited: Jan 2, 2002
  12. usaar33

    usaar33 Un1337

    Joined:
    Mar 25, 2000
    Messages:
    808
    Likes Received:
    0
    Ya... that is how I work. Get good ideas... always make stupid calculation errors.

    I suppose that means players are simply short then :) 3 inches shorter than me.. and I consider myself small :p
     
  13. +RIP+Botje

    +RIP+Botje New Member

    Joined:
    Dec 8, 2001
    Messages:
    19
    Likes Received:
    0
    maybe they had their heads deflated so they get less headshots ;)
     
  14. butto

    butto Red Orchestra Coder

    Joined:
    Dec 2, 2001
    Messages:
    693
    Likes Received:
    0
    In my mod, I just changed the scale to 1uu = 1 inch by changing player height, gravity, etc. It makes it a lot easier than using a 13uu = 1 foot scale.

    Did you base your code on real ballistics formulas by any chance? I'm just curious, because as far as I know I'm the first to do it in a UT mod. It takes the ballistic coefficient into effect for air resistance, which is computed using the G1 or G7 drag functions. Also throws in gravity and wind.
     
  15. Hunz

    Hunz ...aka [A|K]Leviathan, mkay?

    Joined:
    Jan 7, 2002
    Messages:
    302
    Likes Received:
    0
    Realistic projectiles are falling, so i did the physics as falling, but they are falling too fast. Should i use the 'mass'-float or is it dead?
     
  16. Papapishu

    Papapishu 我是康

    Joined:
    Jun 18, 2001
    Messages:
    2,043
    Likes Received:
    0
    :mad:
    Well, it's in the future, who knows :D maybe the ppl shrink... ;)

    BTW, projectiles are the only one's flying through warpzones also...scanhit's don't...
    But if you made the bullets go the same speed as a rifle-bullet, it'd go 14400 units per second...Does this have anything to do with the "speed" var of the projectiles? like speed=6000 = 6000 units/second or something
    I don't think that projectiles can go that fast... can they?
     
  17. butto

    butto Red Orchestra Coder

    Joined:
    Dec 2, 2001
    Messages:
    693
    Likes Received:
    0
    Of course projectiles can travel at that speed. They can travel at any speed, provided that MaxSpeed is set greater than or equal to your speed value.

    Oh, and that thing about UT applying gravity at half the amount isn't true. The player JumpZ makes the player jump about twice as high as normal to try to make up for the twice as high gravity, but the player still has unrealistically low air time as a result.
     
  18. EasyRaider

    EasyRaider Crazy coder

    Joined:
    Sep 21, 2001
    Messages:
    74
    Likes Received:
    0
    What exactly do you mean? I too had a problem with PHYS_Falling. It seemed to limit the speed of the projectile to 2500 (same as terminalvelocity?). So I just set acceleration equal to zonegravity (plus some air resistance stuff).

    butto,

    G1 or G7 drag functions? Sounds a bit over my head, but you got me interested. Any chance of a link? :D

    (edit)
    As a little note, I finally decided to use a conversion ratio of 1:45 (m:uu)
     

Share This Page