[Home]RelativeHeading

Robo Home | Changes | Preferences | AllPages

I'm ready to try it. If someone shows what it is. -- PEZ

It's the enemy's movement direction relative to you.

Quite simply:

angleToMe = Math.abs(BotUtils.normalizeBearing(enemyHeading - getHeading() - e.getBearing()));

Paul calls it "attack angle", iirc. I believe he also segments on it in his guns.

-- ABC

Coriantumr uses cos(enemyHeading-absBearing)*sign(enemyVelocity). I scale this by multiplying it by 1.4 (originally 1.5, but in very rare cases, I'd get an index out of bounds) and adding 1.5. This is basically segmenting on moving toward me, moving perpendicular to me (not usually confused by just moving slowly) and moving away from me. It could be considered an AdvancingVelocity segmentation, but it's more of an advancing direction segmentation. However, notice that it's just the cosine of ABC's calculation, so the difference is really a sort of curved scaling factor. -- Kawigi

In fact Locke looks at my bearing from the point of view of the enemy. But that should give the same result I think.

myBearing = BotUtils.normalizeBearing(Math.atan2(meX-enemyX, meY-enemyY) - enemyHeading);

ABC, why do you take the absolute value? I can't see how that would work, unless somewhere you compensate with sign(velocity) or something? -- Vic

My enemyHeading var is "e.getHeading() * sign(enemyLastMovingVelocity?)". I take the absolute value because I don't care if the enemy is going clockwise or counter-clockwise:

close to 0 = coming towards me
close to 90 = going perpendicular to me
close to 180 = going away from me

PS: your method is basically the same, your bearing from the point of view of the enemy is the enemy's bearing from your point of view * -1. I might have confused the sign of the normalized subtraction (wouldn't be the first time ;)), but since I take the absolute value it doesn't really matter.

-- ABC

Thanks guys. Maybe I can try this. It could be that it helps against some really low-ranked bots. -- PEZ


Robo Home | Changes | Preferences | AllPages
Edit text of this page | View other revisions
Last edited May 18, 2004 18:58 EST by PEZ (diff)
Search: