# Slalom Surfing

Robo Home | Changes | Preferences | AllPages

As in Dookious' WaveSurfing method, Slalom Surfing involves looking at more than just the next wave.

This method weights and adds up the probability curves for each wave, resulting in a single probability curve. The effective risk of all potential positions is calculated as follows:

P = P1 + P2 / 2^w + P3 / 3^w + P4 / 4^w + ... + Pn / n^w, where n is the total number of waves, and w is the weighting (higher w gives less importance to the risk of farther-off waves).

Usually there are only two, or at most three waves present at any one time. So this method has very little effect in general. However, it does make a noticible difference in weaving, and avoiding "trap shots."

• Weaving between bullets is usually something to avoid, but by looking ahead, you can evaluate the risk associated with weaving. Occasionally this is a better idea than staying to the same side. This results in a greater use of the full range of [Guess Factor]?s (most WaveSurfing algorithms are much more focused on the positive side).
• "trap shots" are low-powered bullets fired immediately after high-powered bullets. Some robots will do this when they run out of energy, while others could do this intentionally to trick wave surfers. By looking ahead, the robot will stay on the opposite side of the slow shot from the fast shot, avoiding both, instead of just the first.

I'm still tweaking the weighting and probability calculations, but once I have something concrete I'll post scores and source code.

Hope this is at least an interesting idea.

-- Speal

Hi, this sounds like WaveSurfing/TrueSurf, you should get a look at it and at RaikoMX which implements it. -- Florent

I think most surfers do something like this. In fact I think Dookious is somewhat unique in only considering the two closest waves. CassiusClay/Butterfly weights the danger according to the time to impact and and bullet power (Bullets arriving sooner are more dangerous as are bullets with high power.) -- PEZ

This idea reminds me of WaveSurfing/PathFinding. I should add that Dookious does something a little different than most, he actually uses PrecisePrediction on the evaluation of the second wave; so he actually takes the minimum of three 2nd-wave positions for each one of the movement options. That's part of the reason he only considers two - the other being that it seems a tad pointless to me to consider more. It just doesn't seem right to me (speaking in terms of CassiusClay's style surfing algorithm) to consider the same spot for the first and second waves, since you will definitely have time to move from there before wave 2 hits. And since most use a formula like (1/distance_squared), the third wave's relative influence would be pretty close to zero.

But, in the end, it turns out it's a lot more important to get everything bug-free, no matter what surfing algorithm you use. (You know, I actually think Dooki's weird algorithm might have an unintended side effect that helps against high level guns, but it's just a hunch. If the second level considers every spot in its whole range and takes the lowest, it decreases performance, even though it seems correct to me!)

-- Voidious

• Hey, this is rather interesting since i've been experimenting in this direction. When deciding which direction to go, the bot selects one, predicts the position for the next tick (if it would really go in this direction), looks at the range of guess factors that can be reached from that position and uses the lowest danger value for evaluation of that decision. The same procedure is used to look at the second bullet. The dangers are added up (weighted depending on bullet distance). I thought that this approach would produce better estimations for the risk of going in a certain direction, because this way really all the reachable guess factors are considered and not only the one the bot will be at if it continuously moves into the selected direction until the bullet arrives. Sadly i did not get this to work properly yet, and i suspected some bugs to be responsible for that. Did i understand you correctly that you already tried this approach, and it just did worse? --mue
• Well, Dookious evaluates forward, stop, and reverse movement options. For each of those predicted spots/times, it evaluates forward/stop/reverse for the second wave, and adds the lowest danger to that movement option's danger. What worked worse was evaluating every GF between forward and reverse on the second wave, even though that seems "right" to me, since you could get to any of them from that movement option. I don't know why, really. And turning off the 2nd-wave prediction, so it just uses the coordinates for both waves' dangers, always seems to decrease performance; but that could just be due to being tuned the other way. -- Voidious
• Ah i see, thats actually very similar to what the current Ascendant version in the rumble does. It looks like it does not work for me as good, as it does for you. And its somehow like pretending, that the bot will decide only once per bullet about the direction and stick to that decision until the bullet arrives. I think i'll pursue that experiment some more then, maybe there is a bug responsible for the bad results after all. --mue

Of course! You mean I only predict the closest wave and then check that GF on all the others? I haven't given that a thought even so you're probably right. I'll start working on this ASAP. Thanks! -- PEZ

Well, the same (x,y) spot is a different GF on each wave, but I meant that you have plenty of time to move the spot itself before wave 2 hits, also. -- Voidious

I don't know about CC, but I have always used PrecisePrediction until the last wave hits. And I would say most wavesurfers do the same. -- ABC

In X2 I'm surfing the first for 3 different decisions (reverse, stop, ahead), then I surf the second one with the 3 different decisions from each of 3 positions I got from the first wave. And so on for all the bullets in the air, that's partly why X2 is slow. I have 3 positions for the first wave, 9 for the 2nd, 81 for the 3rd ... -- Florent

Holy cow, Florent! That's cool. Do you have any weighting for the waves that are further away, or do you just try and choose the best path overall? Even with PrecisePrediction over multiple waves, I've still found it very advantageous to weight the first wave more, but I'm interested to hear what you've found. -- Voidious

I believe Jamougha tried something like that with one of RaikoMX's versions. -- ABC

I guess I should have been more clear about my algorithm. I'm not just adding up the probabilities for the same position on every wave, I add the minimum reachable probability for future waves using modified prediction code from the WaveSurfing tutorial. --Speal

I also use the minimum danger path and each wave is weighted according to its time to arrival. -- Florent

I´m doing the same in Krabby2 like Florent does, but only for two waves and only reverse and ahead (6 positions). I wonder how CC could be that good with that simple implementation :) --Krabb

Well, that tells you something about what's most important in doing WaveSurfing, doesn't it? =) -- Voidious

Robo Home | Changes | Preferences | AllPages