Implement more realistic seekers for missiles
gyrohero opened this issue ยท 2 comments
In real life, missiles don't lock onto targets that are 90 degrees offset from them. The seeker in the front of the missile has to be able to physically gimbal and look at the target before it can lock on.
The implementation would be to check that an entity you're trying to lock onto is within the JSON-defined maxSeekerAngle from the direction the missile is pointing. Additionally, if another trackable entity (or particle like flares) passes between the target and the missile, the missile should have a chance of locking onto the new entity or particle instead. This will allow working countermeasures like chaff and flares.
Some missiles can lock onto a target after they're launched. For these, there should still be a capability for flying toward a certain block position until they track something (using a sort-of inertial guidance unit), but some random error should be added so that this method is less accurate than a locked-on missile.
And to make the lock-on status clear to users, there should be a variable to indicate whether the missile has a target locked on. Down the road, this may even indicate the relative yaw and pitch to the locked on target, so that moving HUD instruments can render a symbol around the target.
Closing as I likely won't re-visit targeting missiles in any capacity ever again. If someone else wants to do this, they are welcome to. But I have enough issues with guns as-is, and I don't want more by messing with them even more.