[Home]History of Komarious/Code

Robo Home | Changes | Preferences | AllPages


Revision 19 . . (edit) January 10, 2007 6:55 EST by Voidious [Komarious 1.712 code]
Revision 18 . . October 24, 2006 15:00 EST by Voidious [Komarious 1.705 source]
Revision 17 . . (edit) September 28, 2006 18:14 EST by Voidious [Komarious 1.59 source code]
  

Difference (from prior major revision) (minor diff, author diff)

Changed: 1c1
This is the code to Komarious 1.59. Code size is 1359 when compiled with Jikes (no colors).
This is the code to Komarious 1.712. Code size is 1492 when compiled with Jikes (3 colors = 13 bytes).

Added: 11a12
import java.awt.Color;

Added: 30a32
private static double _nextSurfSegment?[];

Changed: 44c46



Changed: 47c49



Changed: 66c68,69
static double[][][][][] _gunStats = new double[5][3][4][3][GF_ONE+1];
static double[][][][][][] _gunStats = new double[6][4][4][2][3][GF_ONE+1];
static final double LOG_BASE_E_TO_2_CONVERSION_CONSTANT = 1.4427;

Changed: 71c74
// setColors(Color.black, null, Color.white);
setColors(Color.black, Color.black, Color.white);

Changed: 94c97
w.waveGuessFactors = _surfStats[(int)(Math.min((_lastDistance+50)/200, 3))][(int)((Math.abs(_lastLatVel?)+1)/2)];
w.waveGuessFactors = _nextSurfSegment?;

Added: 96a100
_nextSurfSegment? = _surfStats[(int)(Math.min((_lastDistance+50)/200, 3))][(int)((Math.abs(_lastLatVel?)+1)/2)];

Changed: 140c144,145
_lastGunOrientation? = w.orientation = sign((e.getVelocity())*Math.sin(e.getHeadingRadians() - _enemyAbsoluteBearing?));
double enemyLatVel?;
_lastGunOrientation? = w.orientation = sign(enemyLatVel? = (e.getVelocity())*Math.sin(e.getHeadingRadians() - _enemyAbsoluteBearing?));

Changed: 142,143c147,148
int bestGF = Math.min(2, (int)(Math.sqrt(153D*lastVChangeTime?++/_lastDistance)));
// int bestGF = Math.min(2, (int)(Math.sqrt(120D*lastVChangeTime?++/_lastDistance))); // TC
int bestGF = Math.min(3, (int)(Math.pow(280*lastVChangeTime?++/_lastDistance, .7)));
// int bestGF = Math.min(3, (int)(Math.sqrt(220D*lastVChangeTime?++/_lastDistance))); // TC

Changed: 145c150
if (enemyVelocity != (newVelocity = (int)(Math.abs(e.getVelocity())))) {
if (enemyVelocity != (newVelocity = (int)(enemyLatVel? = Math.abs(enemyLatVel?)))) {

Changed: 147c152
bestGF = 3;
bestGF = 4;

Changed: 149c154
bestGF = 4;
bestGF = 5;

Added: 151a157,158
enemyVelocity = newVelocity;


Removed: 153,157d159
w.bulletVelocity = 14D;
w.distance = -21;
// w.bulletVelocity = 11D; // TC
// w.distance = -16.5;


Changed: 160,161c162,163
w.waveGuessFactors = _gunStats[bestGF][(int)((enemyVelocity = newVelocity)/3)][gunWallDistance(0.15206139473) ? (gunWallDistance(0.30412278946) ? (gunWallDistance(0.45618418419) ? 3 : 2) : 1) : 0][(int)Math.min(2, _lastDistance/200)];
// w.waveGuessFactors = _gunStats[bestGF][(int)((enemyVelocity = newVelocity)/3)][gunWallDistance(.20358498553) ? (gunWallDistance(0.40716997107) ? (gunWallDistance(0.61075495659) ? 3 : 2) : 1) : 0][(int)Math.min(2, _lastDistance/200)]; // TC
w.waveGuessFactors = _gunStats[bestGF][(int)(LOG_BASE_E_TO_2_CONVERSION_CONSTANT * Math.log(enemyLatVel? + 1.5))][gunWallDistance(0.18247367367) ? (gunWallDistance(0.36494734735) ? (gunWallDistance(0.63865785787) ? 3 : 2) : 1) : 0][gunWallDistance(-0.36494734735) ? 0 : 1][(int)limit(0, (_lastDistance-75)/200, 2)];
// w.waveGuessFactors = _gunStats[bestGF][(int)(LOG_BASE_E_TO_2_CONVERSION_CONSTANT * Math.log(enemyLatVel? + 1.5))][gunWallDistance(0.24430198263) ? (gunWallDistance(0.48860396528) ? (gunWallDistance(0.85505693924) ? 3 : 2) : 1) : 0][gunWallDistance(-0.48860396528) ? 0 : 1][(int)limit(0, (_lastDistance-75)/200, 2)]; // TC

Changed: 169c171,175
setTurnGunRightRadians?(Utils.normalRelativeAngle(_enemyAbsoluteBearing? - getGunHeadingRadians?() + ((_lastGunOrientation?*.02644545995)*(bestGF-GF_ZERO)) ));
double power = 2 - Math.max(0, (30 - getEnergy()) / 16);
// double power = 3; // TC
w.distance = -1.5 * (w.bulletVelocity = (20 - 3*power));

setTurnGunRightRadians?(Utils.normalRelativeAngle(_enemyAbsoluteBearing? - getGunHeadingRadians?() + ((_lastGunOrientation?*(Math.asin(8/w.bulletVelocity)/GF_ZERO))*(bestGF-GF_ZERO)) ));

Changed: 172c178
if (getEnergy() > 2 && Math.abs(getGunTurnRemaining?()) < 3 && setFireBullet(2 + (_ramCounter / (3*getRoundNum?()+1))) != null) {
if (Math.abs(getGunTurnRemaining?()) < 3 && setFireBullet(power + (_ramCounter / (3*getRoundNum?()+1))) != null) {

Added: 184a191
_oppEnergy += e.getBullet().getPower() * 3;

Added: 192a200,205

public void onBulletHit?(BulletHitEvent? e) {
double bulletPower;
_oppEnergy -= (bulletPower = e.getBullet().getPower()) * 4 +
(Math.max(0, bulletPower - 1) * 2);
}

Removed: 342d354


Robo Home | Changes | Preferences | AllPages
Search: