Advanced Seeking Missiles
Filed under: Game Maker
Another bit of deliciousness from my GM folder. I made it after watching Battlestar Galactica. I learned a lot about homing missiles, like the fact that the tracking system isn’t as important as target selection. Anyway, it’s all there. With not much help or comments as usual
.
Clicking the mouse will launch a few missiles in concert. Their super cool advanced AI will have each pick a target which can be hit in the least amount of time, and avoid designating more than one missile per target unless there are more missiles launched than targets to pick from. After that a tracking algo kicks in which simulates a limited amount of fuel which is used up by turning. The tracking algo is deadly efficient and predicts where the target is going to be. If the missile runs out of fuel before hitting, it’ll just keep flying in a straight line. If its target is destroyed by another missile, it’ll intelligently try to pick another target which its most likley to be able to hit. Not only is this a good demo to learn from, it’s also good for actually putting ideas to a test. With a bit of work you can make a much larger room and spawn a lot more enemies and have it launch missiles automatically. What you’ll end up with is an equilibirum of targets being spawned and shot down. As you tweak the AI the number of targets onscreen at any time will go down if you made a good change or up if it was a bad one.
Oh and if you haven’t realized, the ribbon trails here are the same ones as you’ll find in my ribbon trail sample. Only, that one is nice and commented and stuff.
Fire Ze Missiles!
Compiled EXE by popular demand.
Tags: ai, development, effects
