Artillery hitting moving tank
First post in here since the crash?
Ive been thinkin about this for the last few days. How would you calculate the proper angles to hit the tank?
Lets say that the initial velocity of our projectile is constant, and the tank is moving at a constant and known speed. There are infinite solutions, so lets say the optimal solution is where hangtime of the projectile is smallest.
Lets say that we are on a flat plane with no obstructions, and Z is up.
Using basic physics equations and trig, its easy enough to find the range for a given angle up (inclination?), the angle needed to cover that distance, the time required for the projectile to cover that range, etc.
If the target is stationary, thats all we need to know. But the target is moving... how much do we have to lead to hit the target? What if its driving at a 45 degree angle relative to us?
We could find equations for the position of the projectile and the tank at a time t, and use those find the distance between the target and projectile at time t. Then find where the distance is 0, and thats our impact point.
But theres two angles we need to know. If we aim at a shallower angle, the projectile will cover the distance faster (but max range is less) and we need to lead less.
What is the best approach to find the right angles?
It seems like you could calculate to the range of the tank as a function of time which would form a parabola if it is moving in a straight line. Then you can calculate the inclination you would need for that range as a function of time. You can then calculate a flight time based upon the inclination. When the flight time equals the time to position then you have a firing solution. That position obviously determines the rotation of the gun. A little more complicated would be to add in angular velocities for rotating and raising/lowering the gun. Really to make it fair to the player I think you would have to do that.
Keys to success: Ability, ambition and opportunity.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement