Re: [Code] Deployable Mortar (M252 81mm)
Posted: 2010-05-24 14:49
Man, can't wait till this is in game 
AquaticPenguin wrote:+1 for this idea- mobile mortars would be EPIC for insurgents

The problem is for some reason the equations don't correlate precisely with the in game results. The eqation to use should beJonny wrote:If drag is removed from the projectiles you get a simple parabolic trajectory governed by the SUVAT equations.

I have a feeling its the engine being **** because I'm doing the testing on a perfectly flat test trackJonny wrote:Have you tried accounting for the vertical height difference between point of firing and point of impact? If that doesn't remove most of the error, it might help locate where the actual error is located. It might just be the engine being ****, it doesn't like ballistics.
You are going to have a really hard time accounting for height differences anyway, even if turns out that it is the cause of the error you are getting. People are often going to have try and just walk the rounds in I expect.
Sadly there is no way to do calculations in a bf2 hud so I have to do everything graphically. Making a height correction graphic would be impossible because height correction varies with the range of your shot, and a height correction dial would be extremely confusing to the user.Jonny wrote: Unless you make a ballistics calculator of some kind to be added to the HUD (and give people some extra information to tell the gunners so they know what height the target is at), there isn't much that can change that.
Basically the conclusion I came toJonny wrote: Along with the deviation you will be told to add by the MAs & the limited number of possible angles to fire at, it might turn out that you dont really need to be all that accurate.
That is exactly the equation I used and which produced the values above. I found g to be 14.7 (I found it to 6 sigfigs but am not on the computer I did the calculations on atm) by finding 90 (a vertical shot) then making the lower extent of the barrel exactly 45, measuring the distance of the 45 shot, and finding g using the velocity, angle and distance. I then scaled it down to 9.8 in the projectiles code. The projectile definitely has no drag on it.Jonny wrote: Before you go trying to measure any variables, make sure you are use a non-dimentional form of the equation, it will probably make everything much easier. Use sin(2θ= Rg/v^2, and all the points you get should collapse to a single line if its the right equation (in this case, the line y=x). An accurate value of the actual acceleration of gravity can then be found from a point close to the line of best fit.
The problem could actually be the tracer problem because it does have a tracer effect on it. I'm assuming that if I take it off it will mess things up a lot but I will definitely look into itJonny wrote: If you notice anything weird going on, make sure you check the projectile's code, tracers are fired at about 75% of the velocity you type in and there may be some stray drag thats messing stuff up.
The values you posted look suspiciously like there is still a little drag involved in your projectile code, thats exactly the sort of error I would expect from it.
Jonny wrote:You should really have used a bigger data set to find g. You cant check for measuring errors using only 2 points, you should have at least 4, preferably 8+. You should plot a graph of sin(2θ= R/v^2, then measure the maximum and minimum possible gradients you could have while being within the bounds of the error bars, and that will give you both g and what range it could be in (rather than just a fairly accurate value of g that you can get from the dimentionless graph).
What is your error margin on g, I really dought you got it to 6 SF from just 2 readings?
If you suspect that the tracer bug affects g, too, then you need to take several more measurements: You need to know how long the projectile is in the air for so that you can get the true velocity from R = Utcosθ. You can then get an accurate value for g by reading off the corrected sin(2θ= R/v^2 graph, and can check more accurately for the presence of the tracer bug as will show up directly in the velocity values that you have calculated.
As for a ballistic calculator HUD, I was thinking of some python script to be run when you input some values, and then would display the angle you need to fire at via a message directed at the player on the mortar.
I really dought its worth doing any of that, though. This doesn't require anything close to the accuracy we needed for zeroing rifles. You are probably best off making HUDs assuming it follows a parabolic trajectory exactly, and that you are on level ground, and then concentrate on fixing up the sound effects, projectile damage, adding some extra ammo types, etc. So long as the rounds impact somewhere close (+/- 100m) to the intended target it's fine, it should be walked in by a spotter anyway.
Well it can be done without using python, but I don't know if it's even worth the effort, because it's probably not much of a problem anyway.Sniper_dog14 wrote: As far as the python goes you cant use python to generate to generate a custom hud text string based on user inputs afaik, but if you know any examples of this being done please let me know.
seems like a reasonable idea to meChizNizzle wrote:This is really good! It could fall under the same class as the TOW, so you have to choose wich one to deploy.
Only problem is that does player manned artillery sound reasonable/plausible on a 4km^2 map?[R-COM]Glimmerman wrote:Nice work indeed, now that mortars are doable, arty can be done also i guess![]()
yes it is. it will be like an alt layer, instead of jets/choppers/tank you will get Mobile or stationary artillery.ZephyrDark wrote:Only problem is that does player manned artillery sound reasonable/plausible on a 4km^2 map?
How does that affect the fact that with real life artillery ranges don't really make sense on a map where the furthest two points on it are about 5.6km(one corner of the map to the opposite). ZThe Iron Dreamer wrote:yes it is. it will be like an alt layer, instead of jets/choppers/tank you will get Mobile or stationary artillery.
M777 Lightweight 155mm howitzer (LW155)
...
Range: 30-40 km (assisted), 22.5-30 km (unassisted)
...
Minimum Range: 3.7-2.7 km high angle
http://www.globalsecurity.org/military/ ... -specs.htmPERFORMANCE SPECIFICATION
Major Item............................................... Model M119A1
.............
Maximum Range........................11,500 m w/Chg 7
..................................................14,000 m w/Chg 8
..................................................19,000 m w/M913 RAP