View Full Version : Artillery Range Question for Modders or Tweakers
What is the absolute maximum range that works for artillery (cannon)?
I think the Monster something goes up to 650 IIRC. Has anybody got their artillery to shoot any further?
Are there any tweaks to make artillery more accurate? Other than experience?
The max range of a projectile depends on the velocity for it, so i believe you could mod artillery to fire across the map.
As for accuracy modders might be getting some files exposed in the coming 1.2 patch that deal with that.
Descr_Projectile does it actually. It's all in their for velocity and accurracy.
Also, a Weapon won't fire at a range greater than it's listed EDU entry, but it won't fire to 600 if the velocity isn't high enough n matter what you do with the EDU.
I did some testing with musketeers and changed the range to 300. I didn't change anything else. I noticed some weird behavior. On open ground, the muskets had the greater range and what seemed like the same kill power. During a siege battle, the muskets seemed to be able to shoot over the walls and rain cold steel down on the enemy. The projectiles did kill the enemy so I am not sure how the velocity figures into the max length that a bullet goes or if relates into how straight it goes. At first, I thought the bullets were going through the walls but then I noticed that it was coming at a downward angle.
I guess my question is, what does changing the velocity do? Will bullets go through multiple enemy soldiers instead of just into one? I thought artillery\muskets needed line of sight to shoot. Apparently, I found that to be wrong. Would enough change in velocity cause bullets or even cannon to rip a hole right through a whole city and exit out the other end (that would be pretty cool to see)?
I am not trying to create some kind of ultimate soldier or anything. Just trying to fiddle with some things and find out what they do. I am no modder nor do I pretend to be. I just recently had to do a complete OS reinstall because MTW2 would keep crashing so I am more hesitant to make any serious changes but I get so easily bored. :laugh4:
Basically changing the velocity alters the flight path of the projectile. It's really more about physics than anything else. What you've mentioned about the walls, though, ought to not be allowed by the engine. The main problem isn't that you could shoot a bullet into the air and have it come down somewhere not far from you - you could, though it would be horribly inaccurate. The problem is that no one would actually do this, and so the gunpowder units should not be allowed to fire on very steep angles.
As for unit ranges... rather than take a lot of time to explain the physics of determining a unit's range, just suffice it to say that physics dictates that a 45 degree shot is always the best for range.
Luckily for us, there's a very useful tool I found to do all the necessary work relating velocities to range: http://www.ajdesigner.com/phpprojectilemotion/range_equation.php
All you have to do is put in 9.8 m/s^2 for gravity, the angle (45 degrees if the unit can shoot at that, otherwise as close to it in either direction as it is allowed to shoot), and the initial velocity the unit shoots at (from the projectile file), and out pops the maximum range the shot can go. Note that the result only holds for a shot that begins and ends at the same height. Firing uphill shortens the range, while firing downhill lengthens it. Uphill would include towers and walls which are somewhat elevated from the ground, and esp in the case of firing on towers could significantly reduce the unit's range.
The only thing the page doesn't do is backwards calculate the correct velocity to hit a given max range, but we can easily figure that out. R = ((v^2)/g)sin(2*theta) looks like the full equation it uses. Solving for v gives R/sin(2*theta)=((v^2)/g), then Rg/sin(2*theta)=v^2, then sqrt(R(g)/sin(2*theta)) = v. At 45 degrees sin(2*theta) is 1 since sin(90), so at the simplest level we can easily determine the right velocity to make a unit have max range R by finding the square root of R*(9.8 m/s^2), provided that the unit is capable of a 45 degree shot. For units that can't shoot at 45 degrees you'd have to keep and figure out the correct sin(2*theta) term, but even that is not too much work.
FactionHeir
03-09-2007, 20:15
Hmm out of curiosity, where would you go about changing accuracy for arrows and bolts? The projectile file only has these listed for the siege weapons but omits them for arrows and bolts.
Also, say I were to give longbows a new max range of 180 or 200 (up from 160 base), would I need to change the velocities in the projectile file at all? (base velocity for arrows there is 20 48)
I'm asking this because I increased the max range for longbows and noticed that they'd be able to shoot at targets far away (especially when on a steep slope) but would not actually fire. Could be related to the slope though I guess. Same for muskets (although I didn't change their range)
Hmm out of curiosity, where would you go about changing accuracy for arrows and bolts? The projectile file only has these listed for the siege weapons but omits them for arrows and bolts.
you'd have to copy the fixed accurracy line out of one of the seige weapons projectiles and paste it in in the right place for arrows/bolts.
Also, say I were to give longbows a new max range of 180 or 200 (up from 160 base), would I need to change the velocities in the projectile file at all? (base velocity for arrows there is 20 48)
I'm asking this because I increased the max range for longbows and noticed that they'd be able to shoot at targets far away (especially when on a steep slope) but would not actually fire. Could be related to the slope though I guess. Same for muskets (although I didn't change their range)
They'll do 180- without velocity improvments, but you need more for 200+.
FactionHeir
03-09-2007, 20:49
Thanks,
I'm guessing I only need to increase the second velocity count in that case? (i.e. say 20 48 to 20 60)
Is the accuracy a decimal percentage in the projectile file? Ballistae have 0.05 against units, so that would mean something like 5% accuracy? It seemed they almost always hit, so I just want to clarify.
Really just want to change it because I get annoyed at how say 3 merc xbows can shoot at a unit of archer militia and the last one or two can get hit multiple times and not die.
Is the accuracy a decimal percentage in the projectile file? Ballistae have 0.05 against units, so that would mean something like 5% accuracy? It seemed they almost always hit, so I just want to clarify.
The value listed is how often they'll miss. so that 95% hits in your example.
FactionHeir
03-09-2007, 21:01
Great, thanks for the help.
One more question though:
What is the actual value for arrows and bolts by default? And if I set it to a fixed value as the siege engines have, will increasing amounts of chevrons increase accuracy at all or will it stay at the set value? If I'm not mistaken, currently arrows have a higher accuracy at higher experience
Edit:
Hmm I just noticed for catapults the value is 0.0625. That would mean it is 6.25% inaccurate or 93.75% accurate but a catapult misses way more often than that. Is it in per thousand instead of per hundred?
What is the actual value for arrows and bolts by default? And if I set it to a fixed value as the siege engines have, will increasing amounts of chevrons increase accuracy at all or will it stay at the set value? If I'm not mistaken, currently arrows have a higher accuracy at higher experience
The defualt value for arows and bolts variees with range and unit size somewhat. Expiriance helps artiallry so in theory should help fixed value arrrows/bolts too.
FactionHeir
03-09-2007, 21:49
Ok, any idea on the accuracy value meaning then? (as in my post above?)
Edit:
Hmm I just noticed for catapults the value is 0.0625. That would mean it is 6.25% inaccurate or 93.75% accurate but a catapult misses way more often than that. Is it in per thousand instead of per hundred?
Regardless of the actual accurracy all artiallry drifts a bit for some reason, not sure why. if you set it to 100% it will hit every time. My best guess is that the accurracy determines drift, with arrows it's 0 drift if the random number genorator exceeds the miss percentage. With catapults it appears to be a bit diffrent. Not sure how or why.
Basically changing the velocity alters the flight path of the projectile. It's really more about physics than anything else. What you've mentioned about the walls, though, ought to not be allowed by the engine. The main problem isn't that you could shoot a bullet into the air and have it come down somewhere not far from you - you could, though it would be horribly inaccurate. The problem is that no one would actually do this, and so the gunpowder units should not be allowed to fire on very steep angles.
As for unit ranges... rather than take a lot of time to explain the physics of determining a unit's range, just suffice it to say that physics dictates that a 45 degree shot is always the best for range.
Luckily for us, there's a very useful tool I found to do all the necessary work relating velocities to range: http://www.ajdesigner.com/phpprojectilemotion/range_equation.php
All you have to do is put in 9.8 m/s^2 for gravity, the angle (45 degrees if the unit can shoot at that, otherwise as close to it in either direction as it is allowed to shoot), and the initial velocity the unit shoots at (from the projectile file), and out pops the maximum range the shot can go. Note that the result only holds for a shot that begins and ends at the same height. Firing uphill shortens the range, while firing downhill lengthens it. Uphill would include towers and walls which are somewhat elevated from the ground, and esp in the case of firing on towers could significantly reduce the unit's range.
The only thing the page doesn't do is backwards calculate the correct velocity to hit a given max range, but we can easily figure that out. R = ((v^2)/g)sin(2*theta) looks like the full equation it uses. Solving for v gives R/sin(2*theta)=((v^2)/g), then Rg/sin(2*theta)=v^2, then sqrt(R(g)/sin(2*theta)) = v. At 45 degrees sin(2*theta) is 1 since sin(90), so at the simplest level we can easily determine the right velocity to make a unit have max range R by finding the square root of R*(9.8 m/s^2), provided that the unit is capable of a 45 degree shot. For units that can't shoot at 45 degrees you'd have to keep and figure out the correct sin(2*theta) term, but even that is not too much work.
Reading your reply is too much work! :laugh4: Gotta whip out the old high school math books. I guess I will mess with some of those settings to see if I can create a sniper. ----one shot, one kill----
Hmm out of curiosity, where would you go about changing accuracy for arrows and bolts? The projectile file only has these listed for the siege weapons but omits them for arrows and bolts.
Also, say I were to give longbows a new max range of 180 or 200 (up from 160 base), would I need to change the velocities in the projectile file at all? (base velocity for arrows there is 20 48)
I'm asking this because I increased the max range for longbows and noticed that they'd be able to shoot at targets far away (especially when on a steep slope) but would not actually fire. Could be related to the slope though I guess. Same for muskets (although I didn't change their range)
The easy thing to do would be plug numbers into the equation I just gave you :book:
Try: v = sqrt(R * 9.8) = sqrt(200 * 9.8) = sqrt(1960) = 44.27
Since 44.27 < 48, their listed max velocity, they should already be able to hit 200 meters. A 48 m/s shot should be able to go about 235m horizontally, so all you're really doing is allowing the unit to take some further away shots that ballistics already allowed for. You could end up in situations due to elevated targets where you are deemed in range but can't hit them, though. The default ratio of maximum flight to allowed range is very nearly 3:2, so in general I'd recommend trying to keep that if you want the archers to perform functionally similar to vanilla. In this case allowed range 200 makes possible range R = 300. Plug it in:
v = sqrt(R * 9.8) = sqrt(300 * 9.8) = sqrt(2940) = 54.22
So it looks like you're advised to use 55 as the max velocity for your modified bows. I'm guessing it'll make the behavior you've mentioned go away, though perhaps not - depends how the system is implemented.
Regardless of the actual accurracy all artiallry drifts a bit for some reason, not sure why. if you set it to 100% it will hit every time. My best guess is that the accurracy determines drift, with arrows it's 0 drift if the random number genorator exceeds the miss percentage. With catapults it appears to be a bit diffrent. Not sure how or why.
Without looking at the code, it's hard to say what the accuracy # means. It could be percentage or some other variable in any equation. However, I've been messing around with the numbers and from my observations, it seems the closer it is to zero the more accurate the projectile, as you may already know. The ballista is a nice unit to see how the accuracy # affects , well accuracy, as its projectile usually hits one or one column of units. From changing the acc #, I've noticed that when you increase the acc value, the projectiles will paint a larger circle around the unit flag. As you decrease the value it will paint a smaller circle around the unit flag. If you change the acc# to .0001 it will nail the flag bearer each and everytime. Since that number is so small and the projectiles always seem to circle the flag, I've thought that it might be the radius - that the projectile will fall within that value. but I could be wrong, does anyone know for certain? or does it matter as long as you know how to mod the accuracy?
That is my impression too, holycow: drift from the center of the target unit. Perhaps, instead of being circular, though, the effect is 3 dimensional. This would account for units like ribaults not only missing left-right and front-back, but also the vertical misses that seem to happen: the ribault shots often end up much more in front of or behind the target unit than they stray left or right, which would seem to indicate the presence of a 3rd dimension of possible drift. Upward and downward drift would cause the shots to fall much shorter and longer than front-back drift alone. So to me it looks like the shots are allowed to stray from center in all 3 dimensions. If we assume that's the case, then the question becomes whether the accuracy number is the max drift possible in any component direction (which would define a cubic drift area), or if it's the maximum total drift in a straight line from center (i.e. the radius of a sphere). Either way the process would likely consist of rolling randoms between 0 and 1 and using them to modify the drift components or drift length, as the case may be. A cubic area would simply require a RN (random number) for each of the 3 drift component directions x, y, and z, while a cubic one would likely use an RN to determine x-y orientation (a percentage of 360 degrees), one for the z angle (a 180 degree arc from straight down to straight up) and one to determine the actual amount of the drift in the given direction (a percentage of the accuracy value we've assumed to be max allowable drift).
In either case, the resulting point would have the projectile shot plotted through it. Of course it could be the more simple 2-D application of this idea, but from what I've been seeing I don't think a flat circle can account completely for how the artillery shots seem to fall.
ideas
The 3D suggestion makes sense to me, with one caveat. There does seem to be a "maximum range" for that "miss box" centered on the target in which a missing projectile will land. I propose that this proposed "maximum miss range" might be a function of the range of the unit in question. So in theory you have your 2/3D based "miss box" whose size is dependant on the range of the firing arty unit, and each shot has a percentage chance to hit for each fired projectile.
The 3D suggestion makes sense to me, with one caveat. There does seem to be a "maximum range" for that "miss box" centered on the target in which a missing projectile will land. I propose that this proposed "maximum miss range" might be a function of the range of the unit in question. So in theory you have your 2/3D based "miss box" whose size is dependant on the range of the firing arty unit, and each shot has a percentage chance to hit for each fired projectile.
Certainly possible. What I was getting at wasn't concerning miss chances though... more that the accuracy seems to determine how far the miss could (at most) be from center, and then a random roll gives a percentage of that maximum miss as the miss for any given shot (since clearly all shots seem to fall inside a given range, but at various distances between that range and center). Thus, instead of unit range defining the box, the accuracy for the projectile does so. So it would basically be that hits are uniformly distributed in the 2-D/3-D space of the miss box, using random numbers to drive that. It's also likely that the box is altered by the range the shot is at (which might be what you were getting at). The most obvious way would be be for the given accuracy to define the box at maximum range, and for the box to shrink along with range. Something like accuracy = base accuracy * (range/max range). So the box would shrink from full size to 0 as the range to the target shrinks from max range to 0. I've noticed with ribaults and other ranged units that they definitely do miss by more when far away than when close, which seems like clear evidence that the misses shrink somehow based on the range.
Certainly possible. What I was getting at wasn't concerning miss chances though... more that the accuracy seems to determine how far the miss could (at most) be from center, and then a random roll gives a percentage of that maximum miss as the miss for any given shot (since clearly all shots seem to fall inside a given range, but at various distances between that range and center). Thus, instead of unit range defining the box, the accuracy for the projectile does so. So it would basically be that hits are uniformly distributed in the 2-D/3-D space of the miss box, using random numbers to drive that. It's also likely that the box is altered by the range the shot is at (which might be what you were getting at). The most obvious way would be be for the given accuracy to define the box at maximum range, and for the box to shrink along with range. Something like accuracy = base accuracy * (range/max range). So the box would shrink from full size to 0 as the range to the target shrinks from max range to 0. I've noticed with ribaults and other ranged units that they definitely do miss by more when far away than when close, which seems like clear evidence that the misses shrink somehow based on the range.
Or we might both be right, and it's a combination of the two. I haven't seen enough arty in action in M2TW to say with confidence that I've noticed that. In RTW/BI I have, where the "miss box" seems to shrink with range. If you do end up trying something with the accuracy modifier I'd be curious to see your results.
vBulletin® v3.7.1, Copyright ©2000-2025, Jelsoft Enterprises Ltd.