[ENHANCEMENT] Flare ammotype or have missiles follow incendiary ammo
boot2big opened this issue ยท 9 comments
IMO maybe flares shouldn't cool down unless such a rate is definable, but it's definitely a good point that missiles should possibly have a seek cone...
That being said I don't think we'd need to look for flares beyond a distance of say, four to six chunks infront of the missile, since flares behind the missile shouldn't matter much (unless that missile would end up rebounding on the firing jet/oppressor/etc) and if the flare is too far, the missile wouldn't reasonably seek it (nor would the flare probably stay in the air long enough to be seen)
If you can get me the distance to the flare to see, and figure out what you want to do about cone angles, I'll flag this as a possibility.
Correction, cone angle only effect the gimble limit of the missile, it doesn't mean the whole cone angle will be able to detect missile. The seek cone of a missile should be relatively small (about 5 degrees) to be able to resist again countermeasures.
My idea of flare is fairly simple, it is kid stuff compared to dcs mechanic. But it might work for minecraft.
So, my idea here is to give flare entity a large AABB, then when the missile is locked-on, it constantly raytrace the vehicle, when the flare's AABB hit the ray, the missile will calculate whether it should trace the flare or the aircraft based on the "Attractive index" i have mentioned earlier based on distance and heat (Sorry that i can't think of a way to get seek cone to work, and i don't know how it work either).
About gimble limit, it's as simple as get angle between raytrace vector and missile heading vector (the O(1) complexity algorithm available on internet i think)
Well, for IV, what one can do is request all bullets currently in the world. Look though those bullets and check if any are flares. If so, check if the flare is close enough to the missile to be seen. If so, get the heading vector of the missile and the vector from the missile to the flare, and get the angle between the two vectors. If the angle is within bounds, start tracking the flare. After the flare dies, have the missile resume normal logic. Because if the missile sees a flare far away, and it tracks it, it should still be able to hit something else if it's pretty much dead ahead of it.
Option B is as you say, make the flare have a larger bounding box and just raytrace the path to the flare. As long as @boot2big doesn't mind flares having to be somewhat in the path of the missile, this should work just fine and should avoid all angular maths since we're just doing distance and raytrace calculations.
I think this should be do-able. Though questions do arise as to when the flare is effective. Of course, if the flare is dropped directly in front of the missile it will chase it. But if it's off-center? Or behind the missile? There's obviously going to be an effective range here that needs defining.
I would assume due to the speed of some missiles as well as possible flare or missile trajectories that it'd have to be a 180 degree radius from the front of the missile outwards, though I don't have many missiles (or players) to test with yet. (Barring a new weapon type for convention vehicles)
Resent from correct account, apologies for any email spam
I think we can make the flare work by calculating an "Attractive index" include of how close the flare is to where the seeker head is pointing to and how hot it is, so if the flare is too far from the seeker head, or it has cooled down, the aircraft can still get hit
About effectiveness, each missile has its own seek cone, some can get to 60 degrees, some only get to 30, so leave that be a variable may be a good approach
Closing this ticket as a wontdo, because I don't see it being something I will ever personally do. If someone can implement it or convince someone else to do so, I'll gladly take a PR. But IV isn't big in the weapons department, and I don't want to posit into that given how the old Flansmod folks come and leave, and the gun folks are few and far between and on other gun platforms.