Calculating where a projectile under the influence of gravity and drag will land...

Firstly, apologies if this has been placed in the wrong section, I have considered putting this in the scripting forum, but strictly, code isn’t involved yet, I feel this is more a design feature…

I am firing a projectile into the air. Each ‘fire’ will have a different 3D velocity… I need to estimate where the projectile will land…

My thoughts on a possible way to do this…

  1. upon ‘fire’, a function will return a vector 3 representing the point at which the projectile will land…

  2. To do this, it will register the Vector3 at which it is fired and store it…

  3. The next frame, we will again measure the Vector3 of the projectile… and calculate how much it has moved by means of the difference… Using this ‘Difference Vector3’ we can estimate where it will land…

  4. We will need a formula to place this ‘Difference Vector3’ into…

Thoughts? It might be better to use a bigger time-gap for the difference?

Anyone had any success with this sort of thing? Or know a good resource to learn about it?

Thanks all :smile:

Nope. That’s a scripting question, not a design question.

Related design questions would be things like:

  • How does firing a projectile into the air impact the game play?
  • Should I show players where the projectile is going to land while they are aiming?
  • Would the game be more/less fun if you had to fire two projectiles at once?
  • Should my projectile-firing game be turn-based or real-time?
  • What design lessons can we learn from great projectile-firing games of the past?

But as soon as you’ve decided what you want to do, and you’re wondering how to do it, that’s no longer a design question.

Had you posted in the Scripting forum, I would point out that what you’re describing is classic Euler integration, and that you might want to start with this article about it. But since this is the Design forum, I won’t. :slight_smile:

4 Likes

Hey! Thanks for the reply and advice, I shall know better for future posts…

And also, thanks for not giving me help with my problem! :wink:

So it boils down to knowing the initial velocity and angle of the projection… from there on in it’s A level physics :smile:

1 Like

If we helped every single person who didn’t post in the correct section, many would never post in the correct section. :wink:

1 Like

We also wouldn’t give them jellybeans. Like these jellybeans. They were pooped by the Easter Bunny.

TL;DR - Every time a newbie posts a question in the wrong place and you help them, you’re feeding them jellybeans pooped by the Easter Bunny. Don’t feed newbies jellybeans pooped by the Easter Bunny!

1 Like

Well, that’s not really fair!!! Now I am drooling for that delicious looking candy!

Oh!!! - Or you could just say “this is in the wrong section, things that belong in this section are…” you know, if it really grinds you that much :wink:

Thanks

Peace

1 Like

Eh, no biggie. Now you know! Good luck.

1 Like

This belongs in a different section.

There is a description in the stickies about what is appropriate for this thread.

  • but -

Cummon guys, the comments are bordering on proto-trolling.

Let’s be polite.

1 Like