[Home]History of DiveProtection

Robo Home | Changes | Preferences | AllPages


Revision 22 . . August 19, 2007 19:30 EST by Voidious [bot width precisions]
Revision 21 . . August 19, 2007 11:14 EST by Chase-san [comment]
  

Difference (from prior major revision) (no other diffs)

Changed: 39c39,40
*** Yes I know i'm not Voidious, but pixel perfect would be quite a bit less accurate then what most do. BotWidth?, really depends on the angle the enemy is at, and the distance. Your take it your using the bot width to generally reduce the number of bins you use the closer a bot is to you (like some bots do, such as CassiusClay IIRC). Generally speaking BotWidth? if its an angle is normally done as atan(40/distance). However if you wanna get an exact width, its something like 40 / max(abs(sin(AbsoluteRobotHeading?)),abs(cos(AbsoluteRobotHeading?))), then just divide that by the distance and atan it to get the angle. I wouldn't trust my memory, but thats just how I do it if I wanna be picky. --Chase-san
*** Yes I know i'm not Voidious, but pixel perfect would be quite a bit less accurate then what most do. BotWidth?, really depends on the angle the enemy is at, and the distance. Your take it your using the bot width to generally reduce the number of bins you use the closer a bot is to you (like some bots do, such as CassiusClay IIRC). Generally speaking BotWidth? if its an angle is normally done as atan(40/distance). However if you wanna get an exact width, its something like 40 / max(abs(sin(AbsoluteRobotHeading?)),abs(cos(AbsoluteRobotHeading?))), then just divide that by the distance and atan it to get the angle. I wouldn't trust my memory, but thats just how I do it if I wanna be picky. --Chase-san
*** Like Chase said, there are some trig based ways to get more exact BotWidth? calculations, but I think the great majority of people just use 36 or 40. A couple pixels probably don't matter much (if at all), but not using BotWidth? at all does matter, I think. In my gun, I just use 36 as BotWidth? when waiting for my gun to be aimed before shooting and don't use BotWidth? in any of the stats. I used to use one of the trig-based, more exact methods in my surfing, but re-reading Dooki's source code now (since the full rewrite), I'm just using 36 there, too. PEZ always told me it probably didn't matter to get that exact - he's often right about such things =) -- Voidious

Robo Home | Changes | Preferences | AllPages
Search: