ARES is a web service to calculate the elevation, heading, and fire mode needed to precisely hit desired targets in Bohemia Interactive's Arma 3. When loading the web app, you get to choose between the classic artillery computer for the 2S9 Sochor and M4 Scorcher, or, you are finally able to opt for the redneck artillery version designed for the MAAWS Mk4 Mod 0 – Be the real King of the Hill!
It is as simple as cloning this repository and double-clicking the .html
file. However, there is yet a more convenient way: Head straight to the live version of this artillery calculator found HERE – Free of charge and no nasty trackers nor advertisements!
When you open the web app, you'll be prompted to choose between two artillery calculators: one for the 2S9 Sochor and M4 Scorcher, and another for the MAAWS Mk4 Mod 0 (redneck artillery version).
Add an Artillery Unit: Right-click on the map to place your artillery unit.
Set a Target: Right-click again anywhere on the map to place a target.
Move Markers: Hold the left mouse button and drag to reposition existing markers.
Delete a Marker: Right-click on any marker to remove it.
For more guidance, check out the tutorial video by Testiboule. Thanks, Testiboule! <3
On mobile, a left-click is equivalent to a single tap, and a right-click is equivalent to a long press.
ARES has more to offer than what you notice at a first glance.
Altitude API
I have created an API to get the height data of a given coordinate on Altis. It's effortless to use: Transmit a 'x' and 'y' coordinate to the API, and it will return the altitude above sea level in JSON format at this specified point.
Let's go for an example: If you would like to know the altitude at 10'000, 10'000 on Altis, make a call to the API like this: https://api.openlink.bot/ares.php?x=10000&y=10000
Download Map Data
Unfortunately, the map tiles exceed the GitHub upload limit. You can get them HERE. Unzip map.zip
and drag-and-drop the map folder into the root project folder
The following documentation is split in two sections. The first section deals with the flight path of artillery shells shot by self-propelled artillery like the 2S9 Sochor and M4 Scorcher. Fortunately, in Arma 3, artillery shells are the only projectiles not affected by external force such as wind or air friction.
In the much more difficult second section, we will go over the projectile motion of the MAAWS Mk4 Mod 0 rocket, which, in contrast to artillery shells, is affected by air resistance, making the calculations much more exhausting.
Self-Propelled Artillery
Will be added on a later date. I know you want the juicy MAAWS rocket science. 🤣
MAAWS Mk4 Mod 0 (Redneck Artillery)
The Arma 3 wiki states that the only properties that influence trajectory are initSpeed (CfgMagazines), airFriction (CfgAmmo) and coefGravity (CfgAmmo). Such projectiles travel based on their muzzle velocity (initSpeed) and aerodynamic drag (airFriction), along with gravity-induced vertical drop.
Fortunately, there is another post on the Arma 3 wiki giving us an insight into the formula used to calculate projectile motion with air resistance. However, it is badly written and formatted to the point of almost no recognition. After further inspection and some guesswork, I decoded the formula to be:
While reading through the Projectile Motion on Wikipedia, I have found a somewhat matching formula. However, the variable names are different, and a differential equation is now being introduced because we want to compute the current state instead of the rate of change.
Armed with this knowledge, we rearrange the above equation and split it into
To actually get the current state instead of the rate of change, we need to solve the ordinary differential equations depicted by
The Wikipedia article further states that the equations of motion can not be easily solved analytically. Through the sheer amount of research I had done, I came across a YouTube video using the Euler method to approximate the projectile path.
Now, I have never been a good student in mathematics, so the explanation might be a bit lacking. What we do with the Euler method is essentially approximating the analytical solution by computing the same equation over and over again while taking the before calculated result into account. The smaller the step size (in our case, time)
Enough talking, here are the above equations while using the Euler method. Notice that the equation did not change, except I have added the step size multiplication (
You would now loop over these equations, each time pushing the new variable (e.g.
We next need to find a way to incorporate the shooting angle into the equation. As luck would have it, we forgot to define a before state of these variables:
Because each component is being calculated separately, we only need to split the rocket's absolute velocity into its x and y components once at the start of the calculation. The Euler method will take care of the rest. We will take 5° gun elevation as an example.
You now might ask; how do we actually find the angle required to fire a MAAWS rocket, let's say, precisely 2000m. The painfully simple answer is: guessing and testing. What my application will do is calculate a specific gun elevation and adjust its error through eliminating the worse chosen angle. Let us walk you through an example:
In this case, the script starts at gun elevation 5° and 10° and will calculate where the rockets impacts. For this angle, it will calculate around 1827m (for 5°) and 3142m (for 10°). 1827m is 173m away from our goal, 2000 m, which translates to 5° being roughly 0.65° away from our unknown goal angle.
My program would then replace 10° with 5.65° and would try again. This time it results in 1827m (for 5°) and 2018m (for 5.65°). 2018m is still 18m away from our goal, 2000m, which now translates to 5.65° being roughly 0.06° away from our unknown goal angle.
My program would then replace 5° with 5.588° and would try again. This time it results in 1999m (for 5.58°) and 2018m (for 5.65°).
As you can see, we are arriving at our unknown goal angle pretty fast. The only thing you would need to specify further is when the precision is enough to stop the recursive execution of this code and print the found angle onto the map.
You can use my Excel file to play around with the now newly acquired knowledge. You can safely ignore Stokes Drag.