Play It Forward

From Robowiki
(Redirected from PIF)
Jump to navigation Jump to search

A method of generating a firing angle from a past situation. Using a log of enemy movements, one can "Play It Forward", simulating future movements, to determine where a bullet would have intersected the target bot.

Commonly abbreviated "PIF".

Play it Forward

The most common technique for playing it forward, is to store states of heading difference and the velocity. Some older robots used velocity delta instead, but this has the problem of bounds checking and less accurate outcomes.

With this technique, you take the current enemy location, heading, and velocity. Then for every state you want to simulate apply the stored states to the last one. They build on top of one another to build a simulated set.

Fast Play it Forward

Current locations and Recorded state.
Current locations rotated and projected onto Recorded state.

A faster version of the play it forward. It is faster since it skips the inner loop trigonometry calls usually done in the usual method. This method makes use of the stored location and heading. It is only beneficial when finding the end point is important, otherwise it may well be slower than the usual version. This is generally more confusing and complex to implement the first time around.

It requires rotating the battlefield around the location of the robot you are predicting. Rotating it so that the current heading would match the recorded heading. Then translating the entire field so that the current position equals the recorded position. This is because any other points on the field (such as another robots location), are subject to the current heading and location, rather then the recorded ones. Then playing it forward till you reach the wanted point. As usual with a Play it forward, a close match to the current heading difference and velocity are very important.

Then doing the reverse to get the final point. An simple optimization if only the angle is needed is getting the angle delta to the projected absolute angle, and applying it to the current one.

See also