Difference between revisions of "Play It Forward"
Line 13: | Line 13: | ||
== Fast Play it Forward == | == Fast Play it Forward == | ||
− | [[File:FastPIF0.png|thumb|right|252px| | + | [[File:FastPIF0.png|thumb|right|252px|Current locations and Recorded state.]] |
− | [[File:FastPIF1.png|thumb|right|252px| | + | [[File:FastPIF1.png|thumb|right|252px|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. | 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. | ||
Line 21: | Line 21: | ||
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. | 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 == | == See also == |
Revision as of 03:53, 1 August 2010
This article is a stub. You can help RoboWiki by expanding it. |
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
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.