Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

212 Neutral

About me22

  • Rank
  1. me22

    Throwing a Winning Pass

    Yes, I definitely meant "P_t^0".  Apparently I only fixed one when I noticed it :|   Good point on the possibly-infinite (in floating-point) t_max.  I suppose another possible parameter would be D_b, the range of the bullets, which would bound the B part of t_max by D_b/S_b.  In 2D I suppose that D_b is the diagonal of the screen, but if you have gravity, then (without air friction) D_b = (S_b)^2 / g.  Or of course it can be an arbitrary choice to get the weapon feelings right (no pistol sniping).   Have you compared convergence of the binary-search method with other options?  Once you're allowed iterative methods, there are some unsophisticated options.  For example, figure out how long it would take for a bullet to get where he is.  Since you're pretending he's not moving, this is trivial.  Then figure out where he'd be then, and repeat until you're close enough either in time or in space.   I'd be curious how the costs in iterations and complexity compared.  One advantage of the above approach is that it works best when the target is stationary (only one iteration), whereas a divide-and-conquer approach takes the most iterations at the edges of the range.
  2. me22

    Throwing a Winning Pass

    There's a simple way to get t_min and t_max usefully bounded: think in 1D.   t_R is easy to bound, since it's between 0 and the time it takes to turn 180 degrees.   t_B is smallest if they're moving straight at you, and largest if they're moving away   So that means the following sound like good starting values: t_min = |P_s - P_t^1| / (S_b + |v_T|) t_max = pi/w_r + |P_s - P_t^0| / |(S_b - |v_T|)|
  • 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!