Difference between revisions of "Thread:Talk:Main Page/Virtual bullet doesn't line up with real bullets/reply (11)"

From Robowiki
Jump to navigation Jump to search
 
(<pre> not <code>)
 
Line 1: Line 1:
 
He means something like:
 
He means something like:
<code>
+
<pre>
 
Point2D.Double myNextLocation = project(myLocation,getVelocity(),getHeadingRadians());
 
Point2D.Double myNextLocation = project(myLocation,getVelocity(),getHeadingRadians());
 
Point2D.Double enemyNextLocation = project(enemyLocation,e.getVelocity(),e.getHeadingRadians());
 
Point2D.Double enemyNextLocation = project(enemyLocation,e.getVelocity(),e.getHeadingRadians());
 
double nextAbsBearing = absoluteBearing(myNextLocation,enemyNextLocation);
 
double nextAbsBearing = absoluteBearing(myNextLocation,enemyNextLocation);
</code>
+
</pre>
  
 
I've tried this, and using it  to predict the enemy location didn't help me, although it did help for my own location. I think it depends on the way you define wave hits and starting locations in your gun. In DrussGT I wait until my gun-turn remaining at the beginning of the tick is 0, then fire. I put my bullet on the wave from last tick. As long as you make the same assumptions everywhere it should be ok.
 
I've tried this, and using it  to predict the enemy location didn't help me, although it did help for my own location. I think it depends on the way you define wave hits and starting locations in your gun. In DrussGT I wait until my gun-turn remaining at the beginning of the tick is 0, then fire. I put my bullet on the wave from last tick. As long as you make the same assumptions everywhere it should be ok.

Latest revision as of 07:26, 5 October 2011

He means something like:

Point2D.Double myNextLocation = project(myLocation,getVelocity(),getHeadingRadians());
Point2D.Double enemyNextLocation = project(enemyLocation,e.getVelocity(),e.getHeadingRadians());
double nextAbsBearing = absoluteBearing(myNextLocation,enemyNextLocation);

I've tried this, and using it to predict the enemy location didn't help me, although it did help for my own location. I think it depends on the way you define wave hits and starting locations in your gun. In DrussGT I wait until my gun-turn remaining at the beginning of the tick is 0, then fire. I put my bullet on the wave from last tick. As long as you make the same assumptions everywhere it should be ok.