Post Reply 
 
Thread Rating:
  • 3 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Solved the projectile aiming calcs with drag
2017-02-23, 01:58 AM
Post: #1
Solved the projectile aiming calcs with drag
Finally sat down and spent an evening working through some other solutions and got a system of equations that will aim a projectile when there is drag.

Now I need to properly test it and optimise it.. but it's looking good so far.

This should allow a lot more fidelity in terms of projectile effective ranges, speeds, damage at different ranges, etc.

Will have a clearer view tomorrow evening whether it works or not

This is definitely something that could go back into FTD.

Reviewed FtD on steam yet? It's the #1 thing you can do to help FtD (and future games by Brilliant Skies!), so please take the time!
Visit this user's website Find all posts by this user
Quote this message in a reply
2017-02-23, 02:34 AM
Post: #2
RE: Solved the projectile aiming calcs with drag
Yes! Thanks Nick~

This is a cat
Is this a cat?
How is that a cat?
You are a cat?
Keep the cat!
An idiot cat...
Idiot cat
Busy cat
For that cat
40 cats
Seconds please -the cat

Now read the first words of each sentance
Find all posts by this user
Quote this message in a reply
2017-02-23, 02:57 AM
Post: #3
RE: Solved the projectile aiming calcs with drag
wow you did it!.
Im very qurious about the method you used. Especially if it was what I haven't known.
Find all posts by this user
Quote this message in a reply
2017-02-23, 03:24 PM
Post: #4
RE: Solved the projectile aiming calcs with drag
If you've written it up, I'd be interested to see the math.

I imagine this would have difficulty with air density changes with altitude in FtD. But making shells suffer constant drag at any positive altitude could resolve this. This could also replace the "effective flight time" mechanic of shells with this softer cap.
Find all posts by this user
Quote this message in a reply
2017-02-23, 03:29 PM
Post: #5
RE: Solved the projectile aiming calcs with drag
(2017-02-23 01:58 AM)Nick Smart Wrote:  Finally sat down and spent an evening working through some other solutions and got a system of equations that will aim a projectile when there is drag.

Now I need to properly test it and optimise it.. but it's looking good so far.

This should allow a lot more fidelity in terms of projectile effective ranges, speeds, damage at different ranges, etc.

Will have a clearer view tomorrow evening whether it works or not

This is definitely something that could go back into FTD.

That's a very good thing!

Will it also work when projectiles go underwater?
Find all posts by this user
Quote this message in a reply
2017-02-23, 04:13 PM
Post: #6
RE: Solved the projectile aiming calcs with drag
I think it might be different equatiin but coefficients are surely different
Find all posts by this user
Quote this message in a reply
2017-02-23, 05:23 PM
Post: #7
RE: Solved the projectile aiming calcs with drag
(2017-02-23 01:58 AM)Nick Smart Wrote:  Finally sat down and spent an evening working through some other solutions and got a system of equations that will aim a projectile when there is drag.

Now I need to properly test it and optimise it.. but it's looking good so far.

This should allow a lot more fidelity in terms of projectile effective ranges, speeds, damage at different ranges, etc.

Will have a clearer view tomorrow evening whether it works or not

This is definitely something that could go back into FTD.

I recently posted a (first version of a) script on the forums which can also handle trajectories that are partially underwater Smile. How does yours work?

On a related note, what will gravity be like in Forgotten Shores? Will it have the same (slightly odd) decreasing gravity as FtD or just constant gravity at all heights? Constant gravity would make mortars a lot easier. With more realistic vehicle propulsion they might even become useable!
Find all posts by this user
Quote this message in a reply
2017-02-23, 05:57 PM (This post was last modified: 2017-02-23 05:58 PM by HerpeDerp.)
Post: #8
RE: Solved the projectile aiming calcs with drag
(2017-02-23 03:29 PM)Gladyon Wrote:  That's a very good thing!

Will it also work when projectiles go underwater?

Aiming when the projectiles are only underwater is the exact same calculation as above water with drag, except for a single constant. However, when part of the trajectory is above water and part underwater it becomes exceptionally more difficult. One cause for this is that, if the drag is constant along the entire trajectory, it is possible to consider the horizontal movement of the shell separately from the vertical movement, since the horizontal forces on the shell do not depend on the altitude of the shell. If the trajectory is partially underwater and partially above water however, the horizontal drag depends on the altitude of the shell (above water vs underwater) so you can't consider horizontal and vertical movement separately anymore.
Find all posts by this user
Quote this message in a reply
2017-02-23, 08:53 PM
Post: #9
RE: Solved the projectile aiming calcs with drag
The difficult bit - and the bit I have solved - is getting code to tell you how to aim in order to hit when drag is present.

I have basically just got "linear drag equations" (quadratic drag equations do not exist) and a solver and am rotating the reference frame so that there is a "down range" axis, a "cross range" axis and an "up" axis. I then solve for the down range velocity that produces a down range impact time that allows the cross range to solve for a cross range velocity and the altitude to solve for an up/down velocity... it all solves to produce a firing solution where the magnitude of the solutions velocity equals the weapon muzzle velocity. 10k calls in 200miliseconds so should easily run fast enough. Will post code later.

Reviewed FtD on steam yet? It's the #1 thing you can do to help FtD (and future games by Brilliant Skies!), so please take the time!
Visit this user's website Find all posts by this user
Quote this message in a reply
2017-02-23, 09:05 PM
Post: #10
RE: Solved the projectile aiming calcs with drag
(2017-02-23 08:53 PM)Nick Smart Wrote:  10k calls in 200miliseconds so should easily run fast enough. Will post code later.

It will take about 240 guns firing at 1000rpm to eat 2ms per frame (assuming 40fps).
It should be OK in most cases.
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 2 Guest(s)