Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411592 Posts in 69386 Topics- by 58444 Members - Latest Member: FightingFoxGame

May 07, 2024, 06:53:58 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsCommunityTownhallForum IssuesArchived subforums (read only)TutorialsHow to lead a moving target.
Pages: [1]
Print
Author Topic: How to lead a moving target.  (Read 2579 times)
slembcke
Level 3
***



View Profile WWW
« on: May 11, 2010, 02:21:46 PM »

Not to be spammy, (Andy already posted about this in our Solaro DevLog) but I figured this would be more visible under tutorials as well.

Quote
Just about everybody who’s played a shooting game knows about leading the target. For instance, in Halo, rockets move pretty slow compared to bullets. To get good at the game, you have to learn how far ahead of your target to fire the rockets so they will run into the rocket’s path just as it gets to them.

This isn’t an easy skill to learn as a player, so how do you implement it so that AI players can do it too? It’s easiest to think of this problem in relative positions and velocities. This puts the firing point at the origin and the relative motion of the target is a line. This is of course assuming that the target isn’t changing direction or accelerating.

...

Read the rest (including example code) on our blog!
« Last Edit: May 12, 2010, 12:18:58 PM by slembcke » Logged

Scott - Howling Moon Software Chipmunk Physics Library - A fast and lightweight 2D physics engine.
MrGando
Level 0
***



View Profile WWW
« Reply #1 on: May 12, 2010, 01:42:02 PM »

Very nice article! , thanks for sharing it here!  Smiley
Logged

Lead Programmer
Gando Games
Twitter
Indievelopper
Guest
« Reply #2 on: May 27, 2010, 12:43:22 PM »

Hum, i'm sorry but, this formula here is not really easier than mine...
I didn't use any function tho, pure and simple(relatively) geometry.

edit : sorry wrong post, http://forums.tigsource.com/index.php?topic=12652.msg386511#msg386511
« Last Edit: May 27, 2010, 12:55:19 PM by Indievelopper » Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic