Thread history
Time | User | Activity | Comment |
---|---|---|---|
No results |
- I've just calculated it. If it is correct moving away helps.
latVel = Math.sin(angle) * 8; advVel = -Math.cos(angle) * 8; timeToHit = distance / (bulletSpeed + advVel); mea = latVel / (distance - (timeToHit * advVel) / 2) * hitTime;
- This is the formula. It thinks that the bot is moving at full speed and with brute force search I got these results:
- Bullet Power 1:
- LatVel: 7.762365810207972 AdvVel: -1.9353751647973414
- Bullet Power 2:
- LatVel: 7.6504380477042835 AdvVel: -2.338973637781894
- Bullet Power 3:
- LatVel: 7.468643411977614 AdvVel: -2.8669435963624013
- Distance doesn't change anything if it isn't zero.
timeToHit is not taking in account that the bullet moves at some angle too, i.e. we need to use bulletSpeed*cos(MEA). In above we assume that 'a' is angle between line connecting bots and the velocity of the target.
The last line is not precisely correct as well. There should be no factor of 2, and you forgot the atan. It should be
mea = atan( latVel / (distance - (timeToHit * advVel)) * hitTime );
But the last thing could be simplified a bit if you notice that
latVel = bulletSpeed*sin(MEA)
Moving away is always bad idea from the MEA prospective within robocode physics.
Look at the values that he posted for latVel vs advVel, all with the same 8 speed. For a very small reduction in latVel you can get a big increase in advVel. Increased advVel means you get a longer time until the bullet hits, so in that extra time you can add more latVel components, giving you a higher MEA. This is offset somewhat by being further away, so your latVel/distance is slightly smaller so each latVel increases the MEA a bit less. But this is more than compensated by the extra time until the bullet hits.
Aren't we confusing increase time to hit with increase EA? Longer time to hit has an advantage to decrease bot shadow, but it is not nesesary results in increase of EA.
Continuing our discussion of border cases, if bullet and bot have the same speed. The best strategy is run away from the firing bot. The bullet will never catch up, but the EA is the smallest possible here, i.e. zero.
I run my simulations. You guys are correct asin(vBullet/vBot) is the correct formula.
Now back to the drawing board to see where the logic fails me.
It is not the correct one. It just has a higher value than the real MEA all the time so it works.