# AvihooI

Robo Home | Changes | Preferences | AllPages

Difference (from prior major revision) (no other diffs)

 Here's some suggestions I've made in the past: BotBuilding/Tips2 -- Martin

Name: Avihoo Ilan

Sex: male

Age: 16 (2006)

Location: Israel

Interests: Programming, Basketball and other stuff.

First time I saw Robocode was in 2004 if I recall correctly, however, my trigonometry knowledge, programming skills and generally my ability to come up with ideas inhaled to zero, so I thought I might give it another try since the below exponentially improved (I have mastered OOP (in .NET) knowledge, and also feel very comfortable with Java). That is to say, I am not yet a strong Robocoder, my best robot so far is a test of wave surfing which sort of had a chance against common micro/mini robots such as Sparrow, Cigaret (something like 3/10 win margin).

Favorite Robot: Shadow (a lot because of its victory dance, also because it gives you the feel that it knows what it's doing)

My goal: Create a strong MegaBot.

My sub-goals:

1. Implement WaveSurfing properly.

2. Implement VirtualBullet? and GuessFactor targetting properly.

3. Use pattern matching.

4. Implement data-saving (Robot Learning) properly.

The above are too general, but I am currently looking for a good tip on how WaveSurfing can be optimized, specifically, I am trying to figure how to predict the targetting technique of the enemy.

I learned how GuessFactorTargetting works first, because once that is implemented, WaveSurfing is basically assuming that the opponent is using that targetting technique so you try to keep the same statistics that the opponent is keeping. Welcome to the wiki, by the way. -- Alcatraz

I believe one technique for determining targeting techniques is to inflate your visit counts to 'guess factors' that you've actually been hit at. 0.0 would indicate dead-on firing. 1.0 for linear targeting. Somewhere shy of 1.0 for circular. I don't know that it is important to know the gun, since they may have multiple guns anyway. I don't do this myself but it sounds valid. -- Martin

As far as learning how WaveSurfing works, I would check the WaveSurfing page, all of its sub-pages, and possibly CassiusClay's Butterfly page. It is basically the inverse of GuessFactorTargeting, but instead of incrementing the score of "where enemy is when wave hits", you increment the score of "where I was when I was hit" by an EnemyWave. Beyond the general theory of it, the next best thing to do is examine any OpenSource bots (that page is a list) that implement WaveSurfing. (CassiusClay's code is quite neat, Dookious is less neat but probably not too bad, Chalk and Cyanide are both pretty easy to understand too, I think.) And just remember, they don't call it WaveSuffering for nothing =) -- Voidious

Then again, it's also worth nothing that neither Chalk nor your favorite bot, Shadow, use GuessFactors in their WaveSurfing; but the great majority of WaveSurfers do. -- Voidious

Welcome, Avihoo, and good luck. I'm working on WaveSurfing myself at the moment - the MovementChallenge2K6 is a good place to test your movement, and you could ask PEZ how to use his gun (since it's one of the best in the rumble) to measure your movement against his.

Remember that: 1. You first need to make sure that you're correctly registering the angle (or GuessFactor, if you are using them) when you get hit by a bullet. 2. You need to make sure your prediction of your movement is correct (if you predict your movement, which is usually required for WaveSurfing.) FuturePosition is a good example of how to do this. 3. You should make sure that you are correctly seeing when the enemy fires and dodging accordingly.

RobocodeSG or RobocodeGL can help you with all of this by letting you see what your robot is thinking. -- Greywhind

Just to clarify, RobocodeGL works with Robocode 1.7 under Windows XP platform? - AvihooI

It does, but you may need to find some libraries that aren't very easy to find. I managed to get it running after a lot of Googling, but it seems most people are preferring RobocodeSG these days. I think that's a lot easier to setup, and it uses normal Java graphics (Swing) functionality instead of the custom graphics stuff of RobocodeGL. -- Voidious

So I decided to write my tools first (libraries, etc...), I am not that fluent with swing graphics, so debugging might be a problem. I've seen PowerHouse drawing the waves nicely (forgot to turn debugging off?). -- AvihooI

There's good info. on the Java 1.4.2 or 1.5 API websites (whichever you're using) about Swing classes, and if you want example code for my debugging I can post some - the important thing to remember is that all coordinates must be translated from Robocode's by (x,y) -> (x, 600 - y) when drawing (not sure why, that's the way it's made...) -- Greywhind

So I improved my programming skill by implementing Sieve of Eratosthenes under C++, this algorithm is about finding all primes from 2 (since it's the first prime, duh :P) to N. It's not Robocode related, but I thought you guys might be interested, it's a good practice, you can find a bit of information about this simple yet challenging algorithm here: http://en.wikipedia.org/wiki/Sieve_of_Eratosthenes I am certain that this practice leveled me up and I urge everyone to try to implement it in their language of choice (I chose C++ because I like going down when it comes to those type of algorithms), by the way, my algorithm can currently find all primes from 2 to 2^16 in about .7 milliseconds, which is not remarkable, but I am proud of it - AvihooI p.s. I'd like you to take your time and tell me how you go about designing a new robot (MegaBot specifically).

Here's some suggestions I've made in the past: BotBuilding/Tips2 -- Martin

Robo Home | Changes | Preferences | AllPages