Easy Question?

Jump to navigation Jump to search
Revision as of 13 December 2012 at 02:15.
The highlighted comment was edited in this revision. [diff]

Easy Question?

Hi mates.

How to detect inactivity?

It sounded like an easy problem to solve but now i struggle with it for quite a while and i guess i ask a little around now.

My solution so far is - counting all energy drops of my bot and if the energy difference has a value of 0.1 the inactivity timer has kicked in. Well, it works not very well and is quite a lot of code to just detect inactivity. Wall hits and inactivity is something that does not work very well for now. Has anyone solved this problem or might have a simpler solution? Any ideas would be gladly appreciated.

If you ask - why does he bother with inactivity? - well, i have no answer that doesn't sounds nitpicking.

    Wompi15:52, 12 December 2012

    How about if they dropped 0.1 and you drop 0.1 in the same tick? That should cancel out most cases, except maybe extreme endgame. If they drop 0.1 several ticks in a row then you can be sure that they weren't just firing.

      Skilgannon20:44, 12 December 2012
       

      Well that is similar to what I do in Nene. I just check if the power was 0.1 and the last time I detected them firing was 1 turn ago. Since I don't count my own bullets damaging them as 'them firing', this works out very well in a normal rumble.

      I also remove the last wave if I added one. This is 'safe' because if they fired there isn't going to be an inactivity counter kicking in the turn after they fired. But just to be safe, I only assign the 'lastWave' and 'lastWaveFireTime' variables if the power is equal to 0.1 (or rather within 0.001 of 0.1), specifically for the anti-activity counter.

        Chase03:09, 13 December 2012