It is very similar to using VirtualBullets but less memory-consuming. Basically, you store where you are and where the enemy is at a certain time, then you mark a desired time in the future for an observation of the enemy, usually the time it would take for a bullet to reach the enemy. What you get is an observation of the enemy's actual change in position relative to the straight aim.
Usually I have used this in a way similar to GuessFactorTargeting, select one of the observations at random and interpolate/extrapolate it to get a guess factor. Random selection among the observations should be as good as using the "most usual" observation and in addition, it solves the problem of what to do when several observations are equally usual. See also RandomTargeting.
LaserTargeting evolved from keeping a log of everything every turn and is well-suited to melee combat because you do not need to scan the enemy every turn.
In a way, LaserTargeting was partly responsible for starting off the [MiniBot Challenge]? because I realized that the ugly code I originally wrote for Neptune could be written much more compactly and beautifully.
How would you randomly select among the most usual obesrvations? I've been struggling with that for quite a while now and I can't think up an algorithm apart from just selectin one of the, say, three most common observations. But I would want it to work more like Random.nextGaussian(). Not a normal distribution of course but a distribution based on the size of each observation segment. -- PEZ
A way to select a random point based on the observed distribution is to create a kind of histogram, count the total number of observations, select a random number in the range and advance trought the histogram till you reach it. Another way is to put then in an array and select just one (because the most common repeat more frequently, the selection would be OK). -- Albert
Ah, yes, if you keep the histogram at a reasonable resolution that would work well. I will try that. -- PEZ
BTW. Marshmallow uses LaserTargeting for its statistical gun (though it's called "sector aim" in the code). The difference is that it checks every tick after a bullet is fired if it has either hit (see Marshmallow/CodeSnippets for that code) or missed and only then checks the "laser beams". This makes it more accurate since few enemy bots allow you to estimate a very accurate BulletTravelTime. -- PEZ
What's the difference between this and pattern matching? :-/ -- Tango
Ok, it seems i misread something somewhere... :-/ -- Tango
Well, [[?iley]] seems to be able to combine these two systems so the question is very relevant. -- PEZ
FloodHT (my work in progress) is currently attempting to use this for pattern analysis as well, which is a good idea, assuming your opponent is moving primarily relative to you (i.e. - excellent against my CircleBot, not as useful against SpinBot) -- Kawigi
Ok, I havent really understood the basis of this, it seems to be a combination of GuessFactorTargeting and some angular stuff. Is this just one of the descriptions of the early GF, or is it more? -- Jokester
Is it? I would say Marshmallow had the exact same idea as GuessFactorTargeting about what to do with them. It's definately less that GF targeting though. Technically both LaserTargeting and GF targeting could be implemented using Waves, VirtualBullets, a simple estimate of BulletTravelTime or some other thing.(Marshmallow used waves, that's clear to me now). Conceptually LaserTargeting is GF targeting without the brilliant insight that you should regard the relative (to current situation) angular/lateral movement of your enemy rather than the raw angle difference. This