Is this a sensible way to do it?

Jump to navigation Jump to search
Revision as of 11 October 2011 at 14:00.
The highlighted comment was edited in this revision. [diff]

Is this a sensible way to do it?

My AdvancedRobot, Thor, is currently using a static boolean "scanning" to determine whether to turn the radar or not.

This should provide a degree of locking by setting "scanning" to false when we scan a robot, setting it to "true" after we execute, and turning if it's true.

I know it's a naive approach and doesn't lock very well, but it doesn't appear to lock -at all- currently.

Is it my methodology that's flawed, or should I hunt for a bug in the code? (No point debugging if I'm going about it the wrong way from the start).

    Cbrowne14:20, 11 October 2011

    I think the way most of us do it is to simply scan towards the last known location of the enemy every single tick, making sure we overshoot by a little bit in case they move. I've never put too much effort into radar myself (at least 1v1 radar), because extremely simple solutions tend to work perfectly...

      Skilgannon14:47, 11 October 2011
       

      You need to turn it every tick, it's just a question of clockwise or counter-clockwise. The area covered by the sweep of the radar from last tick to this tick is the area that is scanned. So once you scan, you want to reverse the direction you turn the radar, not stop turning it.

      Edit: Also, there's an option in Robocode to display the radar arcs, which would help you see exactly what's going on.

        Voidious14:59, 11 October 2011