Difference between revisions of "Wave Suffering"

From Robowiki
Jump to navigation Jump to search
m
(Trying to flesh this out as I tackle it myself (add code examples when possible, try and make them general))
Line 3: Line 3:
 
In developing a wave surfing robot, many people go through that which is called Wave Suffering. This is usually caused by all the minuscule details that need to be gotten right for it to score well. This term was coined by [[User:Axe|Axe]].
 
In developing a wave surfing robot, many people go through that which is called Wave Suffering. This is usually caused by all the minuscule details that need to be gotten right for it to score well. This term was coined by [[User:Axe|Axe]].
  
Common mistakes include:
+
==Common Pitfalls==
* Incorrect wave information.
+
 
** Waves should have the enemy position from last turn, and the fire time should be last turn.
+
=== Energy Drop ===
** Waves should use the absolute bearing and direction from 2 turns ago. That is the turn before last.
+
Energy Adjustment due to robot hit and hit by robot
 +
 
 +
'''Wrong'''
 +
<blockquote><syntaxhighlight>
 +
public void onBulletHit(BulletHitEvent e) {
 +
lastEnemyEnergy = e.getEnergy();
 +
}
 +
</syntaxhighlight></blockquote>
 +
:*Caveat of this is if they fired a bullet at the same time ours hit them, it may not be detected, so even though it returns the energy after our bullet hits them, we should do the math.
 +
'''Correct'''
 +
<blockquote><syntaxhighlight>
 +
//When our bullet hits them, they lose energy
 +
public void onBulletHit(BulletHitEvent e) {
 +
double bulletPower = e.getBullet().getPower();
 +
lastEnemyEnergy -= Rules.getBulletDamage(bulletPower);
 +
}
 +
//When we get hit by the enemies bullet, they gain energy
 +
public void onHitByBullet(HitByBulletEvent e) {
 +
lastEnemyEnergy += Rules.getBulletHitBonus(e.getPower());
 +
}
 +
</syntaxhighlight></blockquote>
 +
 
 +
=== Wave Creation ===
 +
* Waves should have the enemy position from last turn, and the fire time should be last turn.
 +
* Waves should use the absolute bearing and direction from 2 turns ago. That is the turn before last.
 +
 
 +
=== Prediction ===
 
* Incorrect/inaccurate precise prediction. For this there are a number of [[Precise Prediction|open source precise predictors]].
 
* Incorrect/inaccurate precise prediction. For this there are a number of [[Precise Prediction|open source precise predictors]].
 
* Not including the distancer or other heading/velocity information in the precise prediction. That is to say the robot does things differently in actuality then what it does in the precise prediction.
 
* Not including the distancer or other heading/velocity information in the precise prediction. That is to say the robot does things differently in actuality then what it does in the precise prediction.
 +
 +
=== Driving ===
 
* Bad set back as front or goto implementation.
 
* Bad set back as front or goto implementation.
 
* Problematic [[Wall Smoothing]] that either is too harsh or not harsh enough.
 
* Problematic [[Wall Smoothing]] that either is too harsh or not harsh enough.
 
* Poor distancing that either causes it to go too close or too far in some situations.
 
* Poor distancing that either causes it to go too close or too far in some situations.

Revision as of 01:40, 20 July 2011

This article is a stub. You can help RoboWiki by expanding it.

In developing a wave surfing robot, many people go through that which is called Wave Suffering. This is usually caused by all the minuscule details that need to be gotten right for it to score well. This term was coined by Axe.

Common Pitfalls

Energy Drop

Energy Adjustment due to robot hit and hit by robot

Wrong

public void onBulletHit(BulletHitEvent e) {
	lastEnemyEnergy = e.getEnergy();
}
  • Caveat of this is if they fired a bullet at the same time ours hit them, it may not be detected, so even though it returns the energy after our bullet hits them, we should do the math.

Correct

//When our bullet hits them, they lose energy
public void onBulletHit(BulletHitEvent e) {
	double bulletPower = e.getBullet().getPower();
	lastEnemyEnergy -= Rules.getBulletDamage(bulletPower);
}
//When we get hit by the enemies bullet, they gain energy
public void onHitByBullet(HitByBulletEvent e) {
	lastEnemyEnergy += Rules.getBulletHitBonus(e.getPower());
}

Wave Creation

  • Waves should have the enemy position from last turn, and the fire time should be last turn.
  • Waves should use the absolute bearing and direction from 2 turns ago. That is the turn before last.

Prediction

  • Incorrect/inaccurate precise prediction. For this there are a number of open source precise predictors.
  • Not including the distancer or other heading/velocity information in the precise prediction. That is to say the robot does things differently in actuality then what it does in the precise prediction.

Driving

  • Bad set back as front or goto implementation.
  • Problematic Wall Smoothing that either is too harsh or not harsh enough.
  • Poor distancing that either causes it to go too close or too far in some situations.