Here is a quick demo I threw together to demonstrate Proportional Navigation missiles in 2D. Generally speaking you don't want to put your players against this type of missile unless you want missiles to be very threatening (e.g. Highfleet) or you are going for something more sim-like.
Feel free to reference or use my code. I did my best to make it readable.
Nice demo! The defensive tactic that works for me (and one that often works in sims as well) is to make a tight turn when the missile is nearby, using the player's smaller turn radius to out-turn the missile. If you want to tone down the difficulty for a game, making the missile's path "stiffer" would be an easy way to do it.
It would be interesting to play with this with keyboard controls instead of mouse, and perhaps in a larger play field. I suspect those would make it easier to control the player's vehicle and perform evasive maneuvers.
(It would also be interesting to model inertia/fuel to see how much benefit mixed guidance gives over raw proportional guidance -- though if you're not building a sim, that might be a level of detail that's not relevant! Fun to read your comments on it, though.)
@freds72 Your game was actually the inspiration for me to make this experiment! Those torpedoes were extremely fun to use.
@cmounce I doubled the player's turn speed in this demo so that it was physically possible to dodge the missile. With the players stats equal to the missile's stats it is impossible to dodge (i think).
Sim-lites usually allow the player to have a higher g-limit than the missile so that evasion can be reliably done, but in true Simulators the player is reliant on making the missile run out of fuel/speed before it reaches them.
The mixed guidance doesn't do anything in this demo, but you are right about its intended purpose. If there is a maneuvering target, the mixed guidance should prevent the missile from using all its fuel trying to match every little motion the target does. This comes at the cost of flight time. The missile follows a longer path and gives the target more time to react.
It is possible to dodge the 'pure pursuit' and 'mixed guidiance' missiles I think, I could be wrong but I tried a technique of dodging the missiles by first drawing a 'q' like shape using the missle and it worked! Even though, it is very close, the missile will just despawn.
[Please log in to post a comment]