Talk:Maximum Escape Angle/Precise

From Robowiki
< Talk:Maximum Escape Angle
Revision as of 19:24, 18 September 2009 by Voidious (talk | contribs) (→‎Calculating: How I do it)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Calculating

There was some discussion of this recently and I just read some more on User talk:Rednaxela/SaphireEdge, so I thought I'd post how it's done in Dookious and Diamond. Of course, trust your own findings on how valuable this is, but I have personally found precise MEA to be a good thing, both in TC and the rumble. All of these steps use Precise Prediction, just like in Wave Surfing.

  1. Simulate the enemy turning perpendicular to the wave's absolute bearing and accelerating to full speed. This is what Math.asin(8.0 / bulletSpeed) approximates, but that of course ignores current speed and heading. Predict until the wave passes the enemy and calculate the resulting MEA. If the enemy didn't hit a wall, just use this, otherwise continue to the remaining steps.
  2. Simulate the enemy moving perpendicular to the wave's abs bearing, but with Wall Smoothing. I use a wall stick of 80 and ignore wall hits (ie, use the wall to calculate how he will move, but let him move through walls).
  3. Repeat step 2 a second and third time, but instead of moving perpendicular, have the enemy move directly towards the point at which they ended the previous simulation. If the enemy will end at that spot, he can further increase his MEA by just heading straight toward that spot to begin with.
  4. The precise MEA returned is the maximum MEA from any of the above calculations.

This is all in Dookious/utils/Wave.java and Diamond/utils/DiaWave.java. In Diamond, I don't use this for GFs, but I use (precise MEA / traditional MEA) as the wall distance attribute, since I think wall distance is meant to tell you how much the wall is impacting the enemy's movement.

--Voidious 17:24, 18 September 2009 (UTC)