Needed Amount To Kill

Jump to navigation Jump to search
Revision as of 28 August 2017 at 02:43.
The highlighted comment was created in this revision.

Needed Amount To Kill

As I see from your version history you don't calculate needed amount to kill the robot precisely. I use this code:

            double robotEnergy = a.getEnergy();
            double neededAmountToKill;
            if (battleInfo.energy <= 4) {
                neededAmountToKill = battleInfo.energy / 4;
            } else {
                neededAmountToKill = (battleInfo.energy + 2) / 6;
            }

This may help you to improve SimpleBot.

    Dsekercioglu (talk)21:32, 27 August 2017

    Thanks for your code! I don't calculate it precisely because 1. It may gain some energy after I fire, which is unpredictable. 2. Some bullet power is better than another, for example, 2.95 is better than 3.00 as it exploits bugs in BasicSurfer. Therefore my algorithm is doing this: If and only if my current bullet power is enough to kill him, I lower my bullet power to some "Good" power which is still enough to kill him ;) Yes doing so waste a lot of energy to overkill him, meanwhile, I won't risk hitting him and leave 0.03 energy only because he hit me one more time. Anyway, I should test BOTH algorithm to see the real effect ;)

      Xor (talk)04:43, 28 August 2017