Jump to content

Gravity


LonesomeCoyote

Recommended Posts

Would someone please kindly explain to me how Gravity and Impact work for Projectiles in the CK. I am currently creating a mod I would like to release to the community but unfortunately I don't know the equation to calculate these value in comparison to real life values. Many thanks!

EDIT: Also, correct me if I'm wrong Projectile Speed = Units per second. 21 Units = 1 ft.

Edited by LonesomeCoyote
Link to comment
Share on other sites

  • Replies 162
  • Created
  • Last Reply

Top Posters In This Topic

Have you looked here?

https://geckwiki.com/index.php/Projectile

 

It just determines how fast the projectile travels along the Z axis towards the ground, independent of its X and Y speeds. A value of 0 will never hit the ground if it's aimed straight ahead. I would look at the values of projectiles you're already familiar with for a good idea of what values do what, and of course do some testing. If you're asking for precise values so that you can do precise calculations for a multitude of projectiles based on some scale, I'm afraid I can't help you there.

Link to comment
Share on other sites

I already know the real life mathematics behind it, I just need to know what the CK value for the projectile drop effect on the Z axis correspond to g (gravitational pull) in real life. Since there is no drag, resistance or wind force in Fallout (so technically there is no Z axis for projectile movement aside from the model rotation, just X and Y horizontal and vertical,) I just need to figure out Gravity to calculate a relatively accurate drop value. Such as my question above is, is Gravity also a value similar to Units/second like Speed? Or is just 1 Gravity = 1 Real Life Gravity and I don't have to do any calculation. This is my question. What is the conversion?

Edited by LonesomeCoyote
Link to comment
Share on other sites

If you don't find the information you need within these mods' description pages, you may want to try opening them up in the GECK or FNVedit to have a more in-depth look:

Lead - Realistic: https://www.nexusmods.com/newvegas/mods/64480

Lead - Original: https://www.nexusmods.com/newvegas/mods/64430

Realistic Bullet Speed: https://www.nexusmods.com/newvegas/mods/47841

 

Edit: And yes, units per second is the way to measure velocity (the literal calculation being distance divided by time, but that's only for the average velocity; the velocity at a given instant is much more complex, though it shouldn't differ too much from the average in the end). In real life, there is all manner of external factors, like wind, friction, and the initial force that pushed the bullet out of the gun, not to mention the shape of that barrel and the spin on the bullet, but I'm almost certain none of that was included in New Vegas, despite having wind speed a measurable thing in the game.

 

And the standard acceleration for gravity on average on this planet is 9.81 metres per second squared. Not sure you can easily facilitate gravity's acceleration here (maybe it's automatic), but that's probably good to know if you really want to get realistic.

 

Of course, everything would drop at the same rate if there were no friction (as in, simultaneously dropping a bowling ball and a feather in a vacuum would yield a simultaneous landing), so these values in the GECK are really indirectly attempting to simulate air resistance's effect on gravity, not gravity itself.

Edited by EPDGaffney
Link to comment
Share on other sites

Correct, so if 1 CK Gravity = 9.80665 m/s2 all ballistics would drop at trajectory would be determined by velocity just like in real life.

There is measurable wind speed in game!? Interesting, I did not know this.

 

I read on the Lead mod "The round weights 7.5 grams so I make the gravity value 7.5. The gravity value does not perfectly mirror the drag coefficient."

 

The thing is, the drag coeffecient has nothing to do with gravity. Drag has to do with surface area/shape of an object and fluid dynamics and loss of velocity.

Gravity (and subsequently Ballistic Drop) is a much simpler equation a determined from different integers.

Regardless, according to "Lead's" equation, CK gravity is allegedly calculated by the Mass of the object. I'm not certain if this is correct however.

I'll crack open that second mod today to take a look. Still, my question stands.

Link to comment
Share on other sites

Thinking about this at work right now. Just to correct myself, I believe what "Lead's" author was trying to say was that they couldn't calculate the drag coefficient into CK gravity value.

 

This is likely because there is no value to slow down a projectile over time.

Edited by LonesomeCoyote
Link to comment
Share on other sites

In theory, the mass should not be related to gravity, but it practise, greater mass is often in a direct relationship with taking up more space, which if all the items in question are designed for aerodynamics and are made of the same materials (like bullets) is likely to be a decent approximation of somewhat consistently accurate air resistance (which is friction from the air, which if you want to get crazy, is of course calculable).

 

If you want to get serious here, to approach it the way I would, this is what you'll need:

https://geckwiki.com/index.php/SetOnFireWeaponEventHandler

https://geckwiki.com/index.php/GetWindSpeed

https://geckwiki.com/index.php/Category:Projectile_Functions_(JIP)

 

I'm not sure it's worth the effort, but that's one way to get pretty close to realistic.

Link to comment
Share on other sites

Awesome, I don't think I need to go that far but if I decide to, it's bookmarked. Perhaps it would be a good learning experiment at some point since I am not well versed in scripting.

That aside, I was thinking more today at work about how to work with this. Yes, I understand that mass and horizontal speed have nothing to do with gravitation pull. That's basics for like...500 years now. Regardless, I can calculate trajectory in a generic environment (e.g. air pressure, humidity, temperature, etc I could even pinpoint it to the Mojave averages,) and then calculate it again removing external forces and focus on just the pull of gravity and velocity. The difference in distance between the two I could use to factor in those effects without having to deal with complexities in the CK. It would give me a relatively accurate way to figure those numbers and apply it in the CK as if they existed. I already have the programs written in my TI-84 from long ago, I just may have to copy and alter them slightly.

However, it still leads me to the problem of converting CK Gravity to something tangible. This is becoming my recent White Whale it seems...

I asked the mod author of Realistic Lead how they came to the conclusion they did about CK Gravity = Mass in grams but no response yet. It would be SO EASY if that's the true case. Going to keep digging around in the mean time and check out that other mod you referenced yesterday.

Link to comment
Share on other sites

Well, no offence to that mod author, especially if I'm wrong, but I wouldn't be surprised if they don't actually know and simply made some approximations based on some testing. There's no way to do this realistically with such a simple system, unless you do start some serious scripting. If you did that, it would be great but it would take you ages. However, I'd be on board to give you some help scripting. I always say I'm not an expert, but I have literally not given up yet on anything I've had to script in this engine, so we'd get there. In fact, even if I'm not exactly invested in that sort of change in my game (nor am I invested in keeping it this way; I just kind of think it won't make the biggest difference), I'm really interested in trying to script it, so let me know if you go that way.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...