Jump to content
  • Advertisement

Gameplay algorithm for creating missile paths for a 2D game

Recommended Posts

Does anyone have any thoughts on how to create paths for missiles that make random curly-q type patterns before homing in on a target? 

Edited by Davicus

Share this post

Link to post
Share on other sites
2 hours ago, Davicus said:

...random curly-q type patterns before homing in on a target...

Do you mean random movement with curly-q's, and then start following the target? Or random curly-q movement while following the target?

I don't know how convenient this would be for you, but it could be helpful to see an image (drawing or whatever) showing what you have in mind exactly.

Share this post

Link to post
Share on other sites

Adding to Zakwayda's comment, designing "algorithms" for pretty curly flight paths is a mostly quantitative matter.

Assuming a physically sound dynamic model in which the missile accelerates and turns according to the wishes of the missile AI (as opposed to arbitrarily interpolating position along a path) you need to find a balance of obvious parameters and mechanisms that makes the missile chase the target, but not too well:

  • maximum velocity (as an objective: the missile needs to be faster than the target to hit, excessive speed leads to overshooting dodging targets, which is probably something you want in moderation, and to increased turning radius, which might become too large for the scale of the available space)
  • maximum acceleration and deceleration, which might be different
  • maximum torque, which influences turning radius
  • delay between launching the missile and beginning to steer it
  • choosing new values of acceleration and torque at intervals instead of every frame (ensuring nice curves are executed undistorted, and that aiming degrades)


Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!