Easy Question?

Jump to navigation Jump to search
Revision as of 13 December 2012 at 18:16.
The highlighted comment was created in this revision.

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
         

        @Skilgannon - this sounds like a good idea to recheck my energy drop against the enemy drop if i hit a wall. Because in all other cases i can detect inactivity 100% based on my energy profile and just adjust the enemy energy on that. Actually i came to think about inactivity because i observed that in melee end games it happens quite frequently that the inactivity timer kicks in (long range and bullets < 1.0). The main "concern" i have, is winning by inactivity makes you loose all bonuses (have to recheck if the bonus get lost for all opponents).

        @chase - i hade a quick peek at your code and it looks like you have the same "trouble" with your solution, as i had with my first try. Because an enemy can still shoot <1.0 bullets and the inactivity will not be canceled. This means basically that your waves on inactivity are of by 0.1 bullet power (0.3 pix per turn) . Probably not worth of thinking about it but if you add the uncertainty of wall damage that could become more "serious".

        Well, maybe i should explain a little more why i'm nitpicking on this. Based on observations i made on almost all high ranked wave surfer bots, i'm playing with a experimental trick movement for those bots, based on 'forced' wall hits and shooting the same turn i hit the wall. I guess theoretically it could work quite nice and just for the sake of curiosity.

          Wompi13:25, 13 December 2012
           

          In theory you are quite right. In practice it could be less satisfying than expected. I and probably some more take into account accelerating/decelerating bots, although it will never be 100% proof. Decelerating at the right moment could give you the opportunity to fire a specific bulletpower without detection.
          The discussion about inactivity timer got my attention though, I'll see if I can come up with something for my next release.

            GrubbmGait15:38, 13 December 2012
             

            just an update ... if the opponent dies by inactivity you get no score bonus for him. You also get no bonus if you die by inactivity for all alive opponents. It is still unclear what the conditions for inactivity in melee are. I tested 8 sitting ducks and 2 bots shooting 0.1 bullets and there was no inactivity trigger. Just 2 bots (0.1) and the inactivity kicks in around 450. I tested some other scenarios (3 bots, just shooting till everyone is below 40 energy) to, with very different inactivity behavior.

            @GrubbmGait - actually, imagine a bot who drives with speed 4 to the wall and before he hits set speed to 2 and shoots with 1.0. There is no way to detect if it is a bullet or the wall hit damage.

              Wompi17:31, 13 December 2012
               

              I thought you wanted to detect inactivity because it confuses wave detection and looks like a bunch of 0.1 power waves are being fired. Gun heat tracking can help distinguishing inactivity from 0.1 power bullets being fired.

              But trying to use wall hits to conceal a shot will make you bots movement quite predictable.

              Analysing the last example, a bot with speed 4 which sets speed to 2 and shoots with power 1.0 will be shown in the opponents radar as a bot which decelerated from speed 4 to 0 and decreased 1.6 energy. Combat would detect a 1.0 power wave being fired (it ignores 0.6 energy drop whenever someone decelerates more than 2 in a single tick). But if it hits the wall with constant speed 2, then the 1.6 energy drop would be ambiguous. It could mean a 1.6 power bullet was fired and the bot stopped, or a wall hit with a 1.0 power bullet being fired. Currently, Combat would guess it is a 1.0 power bullet and if it was a 1.6 power bullet, dodging would be sub-optimal, but it would still react to the firing.

              Another worse scenario: You hit the wall with constant speed 2. A false 0.6 power wave would be detected and gun heat tracking would kick in. Then, there would be a 12 tick window when a shot would go undetected. If it is a power 3.0 bullet, it would hit long after the 0.6 wave was dodged. Maybe I should disable gun heat tracking for 0.6 power bullets shot near walls.

                MN19:16, 13 December 2012