Uba - UbaSource
if (getDistanceRemaining() == 0) {FORWARD =-FORWARD; setAhead(185 * Math.random() * FORWARD);} setTurnRightRadians(e.getBearingRadians() +Math.PI/2-0.5236*FORWARD *(e.getDistance()>200?1:-1));It is almost the same as MicroAspid's, except I put in the randominizing.
Martin posted some code for this purpose under Ugluk/Persistence. --wcsv
I get an error every melee battle I do with Uba. Could someone find out what is wrong? My source code is at UbaSource. --Bayen
Could you copy/paste the error message from the console? That would make it a lot easier to diagnose. -- Voidious
It's okay, I fixed the error. It was from not deleting the custom event! --Bayen
20060217: This will be a quite irritating mini in OneOnOne, because it fights close. In melee it has no chance, because it will lock the radar and forget all other enemies. You are using both radians and degrees, better is to use one of them and stick to it. -- GrubbmGait
The bot really isn't for melee, I just threw in the melee options in case my little brother throws my bot into a melee battle on his computer ;) However, I am having problems with my VG array! It always shoots with the GuessFactor gun and never with the Linear gun, even when the LT gun is better. For example, I know that the LT gun hits Walls more often than the GF gun, but Uba continues to use the GF. WHY!?!?!?!
This looks like a problem:
if(type == "gf" && getOthers() == 1) t.gfhit++; if(type == "lt" && getOthers() == 1) t.lthit++;You should use type.equals("gf") instead, because what you have there doesn't work the way you want it to. (The "==" operator in Java actually tests that two object references are pointing to the exact same object; only numbers (and maybe characters?) work with "==" for the actual equality of values.) -- Voidious
Small remark: when you fire with LT, you printout GF ;-) -- GrubbmGait
if(getOthers() == 1 && t.gfhit >= t.lthit){ setTurnGunRightRadians(Utils.normalRelativeAngle( enemyAbsoluteBearing - getGunHeadingRadians() + wave.wBearingDirection * (mostVisited - MIDDLE_FACTOR))); ===> fire GF out.println("GF"); } if(getOthers() > 1 || t.gfhit < t.lthit){ setTurnGunRightRadians(Utils.normalRelativeAngle(theta - getGunHeadingRadians())); ===> fire LT out.println("GF"); }
I know, I just can't figure out why!! Also: I tried your idea, Voidious, but it didn't help. --Bayen
Well, no matter what else you did, your hit counts would never increment if you didn't make the change I mentioned =) -- Voidious