/** * BlackPearl is derived from Jekyl in many ways. It also serves as a proving ground for new concepts * that may one day find thier way into Jekyl. It is a pretty complete robot. If you use any of the code * contained in this bot I only ask that you let me see what it is you changed to make it better. Seeing * your whole bot would be nice but is not a requirement. I would also appreciate it if you would help me * to learn from your experiences in return as well. If you use this please take the time to send me an * email at jim at j e k l . c o m. If you want you can also most likely reach me on AOL IM as screen name Sparafucil3. * I look forward to hearing from you......jim */ |
private static final double MAX_STAND_OFF_DISTANCE = 500D; private static final double MIN_STAND_OFF_DISTANCE = 400D; private static final double GUESS_FACTORS = 25D; |
private static final double MAX_STAND_OFF_DISTANCE = 600D; private static final double MIN_STAND_OFF_DISTANCE = 500D; private static final double GUESS_FACTORS = 23D; |
private static final double MAX_SHOT_POWER = 3D; private static final double FIRE_POWER_NUMERATOR = 1000D; |
private static boolean save; |
int lastLatVelIndex? = 0; |
save = (getOthers() == 1); //Only? save data if we are in a 1-v-1 engagement, otherwise the data will be polluted |
double accelDiff = Math.round(Math.abs(eVelocity) - Math.abs(eVelocity = e.getVelocity())); double latVel = (eVelocity) * Math.sin(eHeading = e.getHeadingRadians() - (eAbsBearing? = Utils.normalRelativeAngle(getHeadingRadians() + (e.getBearingRadians?())))); |
if (Math.abs(eVelocity) > Math.abs(eVelocity = e.getVelocity())) { ticksSinceReverse? = 0; } double latVel = (eVelocity) * Math.sin(eHeading = e.getHeadingRadians() - (eAbsBearing? = Utils.normalRelativeAngle(getHeadingRadians() + (e.getBearingRadians?())))); |
int accellIndex = (accelDiff == 0 ? 0 : (accelDiff > 0 ? 2 : 1)); int latVelIndex? = ((int)Math.abs(latVel) / 2); int distanceIndex = (int)(Math.min(11, Math.min(4, eDistance / 150D))); if (accelDiff < 0) { ticksSinceReverse? = 0; } |
int distanceIndex = (int)Math.min(4, eDistance / 180D); |
double firePower = Math.max(Math.min(Math.min(Math.min(getEnergy() * .2, eEnergy * .25), FIRE_POWER_NUMERATOR/eDistance), MAX_SHOT_POWER), .1); |
double firePower = (distanceIndex <=1 ? 3.0 : 1.9); //double firePower = (getEnergy() > 0 ? 3.0 : 0); |
//double distDelta = 0.02 + Math.PI/2 + (e.getDistance() > 400 ? -.1 : .5); //double theta = 0.5952*bulletV(eLastShot?)/eDistance; //if ( (Math.random() > Math.pow(theta, theta) && flatten)|| distDelta < Math.PI/4 || (distDelta < Math.PI/3 && eDistance < 400)){ double theta = .64 * bulletV(eLastShot?)/eDistance; if ((Math.random() > Math.pow(theta, theta) && flatten)) { |
double distDelta = 0.02 + Math.PI/2 + (e.getDistance() > 400 ? -.1 : .5); double theta = 0.5952*bulletV(eLastShot?)/eDistance; if ( (Math.random() > Math.pow(theta, theta) && flatten)|| distDelta < Math.PI/4 || (distDelta < Math.PI/3 && eDistance < 400)){ //double theta = .64 * bulletV(eLastShot?)/eDistance; //if ((Math.random() > Math.pow(theta, theta) && flatten)) { |
int stats[] = statBuffer[getOutIndex?()][accellIndex][latVelIndex?][Math.min(4, ++ticksSinceReverse?/5)][distanceIndex]; |
int stats[] = statBuffer[getOutIndex?()][lastLatVelIndex?][(lastLatVelIndex? = ((int)Math.abs(latVel) / 2))][Math.min(4, ++ticksSinceReverse?/10)][distanceIndex]; |
//If? the gun is cool, fire and shoot a Wave if (getGunHeat() == 0 && firePower > 0) { |
if (firePower > 0) { |
w.maxAnglePossible? = Math.asin(9.0 / w.bulletVel); |
w.maxAnglePossible? = Math.asin(8.0 / w.bulletVel); |
//lastLatVelIndex? = latVelIndex?; |
return (guessIndex - MIDDLE_FACTOR) / MIDDLE_FACTOR * Math.asin(9.0 / bulletV(firePower)) * eDirection; |
return (guessIndex - MIDDLE_FACTOR) / MIDDLE_FACTOR * Math.asin(8.0 / bulletV(firePower)) * eDirection; |
return new int[3][3][5][5][5][(int)GUESS_FACTORS]; |
//int stats[] = statBuffer[getOutIndex?()][lastLatVelIndex?][latVelIndex?][Math.min(4, ++ticksSinceReverse?/5)][distanceIndex]; return new int[5][5][5][5][5][(int)GUESS_FACTORS]; |
while (i < 20 && field.contains((eX + (Math.sin(eHeading)* (45.0 * i) * eDirection)), (eY + (Math.cos(eHeading) * (45.0 * i) * eDirection)))) { i+=10; } return (i/10); |
do { } while (++i < 4 && field.contains((eX + (Math.sin(eHeading)* (45.0 * i) * eDirection)), (eY + (Math.cos(eHeading) * (45.0 * i) * eDirection)))); return (i); |
</pre> |
</pre> |