Bug in Test Harnass - Shields

Hi guys,

I’ve noticed a couple of issues when deploying a shield in the test harnass and would like anybody else to confirm, please.

  1. When playing as player B, the shield is deployed one round too late.
    For example: I deploy a shield in round 35 and only in round 37 will a shot be blocked. I think player A’s shot is processed before the shield code is run in round 36. This doesn’t happen when playing as player A.

  2. When playing as player A, the shield is deployed correctly in the next round but the shield stays active for one round extra at the end. Strangely the ‘@’ is not shown on the map for that last extra round.

It would suck being player B in the tournament :wink:

Hi Fairwind,

You are right, it would suck to be player B,I will have a look and see what the issue is, thanks for the feedback

Seems like this is still happening, and the final tournament is very soon. Is there any chance of getting this fixed? Bit difficult to test a bot with a bug like this in the game engine!

Hi Malman,

I am busy investigating, it will be resolved soon

Hi Guys,

This issue has been resolved with the latest release, all shield commands will be processed before any other commands


Thanks a lot

Hi Foamy

Thanks for having a look at this. It seems that now, both players’ shields are deployed at the same time (and before their opponent’s shot fired in the same round).

But it seems like this still has the effect the shields last for one round longer than you’d expect - a shield that is deployed with a charge of 1, blocks 2 rounds of shots, a shield deployed with a charge of 3 blocks 4 rounds of shots, etc. I’m not sure if this is how it is supposed to work?

If the shield was only deployed after the opponent’s shot landed (the same fix, just the other way round), I think the effect would last the expected number of rounds.

hi , i checked on the downloaded zip’ped pre compiled game engine, to see if i can confirm for you , but on mine with tests i did not come across this , as player a and b , i did a 1 charge and 2 charge test .

the 1 charge i recieved round 8 (takes effect next round) so command was send round 14 to activate shield ,round 15 the shield activated , round 16 no charges was left , so it was active 1 round.

on the 2 charge as other player , i tested , round 18 the command was send , round 19 shield activated with 2 charges , round 20 1 charge was left , round 21 shield deactivated with 0 charges , so lasted 2 round for 2 charges .

Hi Guys,

Thanks for the feedback I will have a look and see if there is a miss understanding between the rules and the implementation, I will get back to you guys as soon as possible.

Thanks again Foamy.

wjb: I think if you look at the state files, you’ll see the behaviour you describe, but the difference is when you actually try to shoot at the shield. The difference between the state and what actually happens is partly why I think this is still a bug.

Here’s what happens with my two test bots, one which places a shield in Round 22 (as soon as charge and radius reach 3) and another which shoots at a point under the shield, starting in Round 22, until it registers a hit or a miss (not a shield hit):

Round 22: A places shield, B shoots at square in shield range. Result: SHIELD HIT
Round 23: B shoots at square again. Result: SHIELD HIT
Round 24: B shoots at square again. Result: SHIELD HIT
Round 25: B shoots at square again. Result: SHIELD HIT
Round 26: The @ symbol disappears from the map. B shoots at square again. Result: HIT

The behaviour at the end is what you’d expect: when the @ symbol disappears, you can target where it was, and the shield will be gone. But the shield is still lasting four rounds, rather than three, and it takes five times shooting at the same square to hit it, rather than four.

As we know, there are only two hard problems in Computer Science: cache invalidation, naming things, and off-by-one errors!

The only simple solution I can think of to this is to change the order of the previous fix, so that shields are applied after shots land. That way, my test bot would score a hit in round 22, or if it waited till round 23 to target that square, would hit the shield three times before hitting the ship underneath it.

@malman , okay i understand , i comfirmed by checking with bots ,on the round when the charge is deactivated , the attacking player’s shot is not registered as a hit although the shield should no longer be there accordingly to my understanding .

I see what you guys mean,

I believe a simple fix would be to make it that the round the shield is placed is considered an actual turn as well, that way if you have 1 charge and place it in round 22, it will only protect for round 22, and round 23 it will be deactivated

Hi guys,

I have deployed a new version of the game engine, which will resolve the issue of shields lasting a round longer than they should

Thanks again Foamy, really appreciate the quick fixing!

I really don’t want to sound like I’m continually complaining, but since a change has been made this late anyway, I don’t suppose it’s possible to request that all the shield actions be shifted one turn later? All this bug fixing seems to have made a couple of things not work as cleanly as they could:

  • The @ symbol now disappears the round AFTER the shield has cleared.
  • The shield appears with no possible warning, whereas if it appeared the round after the command was given, it would be possible to detect the possibility of the shield and conserve one’s expensive multi-shot weapons.

This is definitely no longer a bug report, just a request for something that I think will make for much more interesting bot developing. Either way, looking forward to the final round!

Hi Malman,

The purpose of having the shield is to favour the player using the shield.

eg. If you have a submarine left and it has 1 cell remaining, and you use the shield to allow you to use your seeker missile the next round it will prevent the opponent from destroying your ship for 1 round. The fact that there is no hit/miss symbols after that round should provide with some insight that the shield was used.

Hi I have just done a git pull & I have two very similar bots playing against each other (version 23 & 24 - both using shields) the bot who is player A will still always win between the two… if this can’t be fixed then maybe players should play twice against each other as player A and then again as B… (why this is happening will take some investigation which I don’t have too much time for… but I can only think it is still a shield problem…)

Hi Andre,

This is very strange as the logic is to always evaluate the shield commands first before any other commands, I will have a look and do some testing from my side to see why this is still happening.

Hi Andre,

After evaluation and running tests the order of which commands are processed are correct, the destruction of ships are evaluated after both players have made their moves. The reason for Player A being the winner could be pure chance. I can’t find anything that will favour player A over B

Is it possible that if A shoots at a square that B is activating a shield on, that A’s shot happens before B’s activation - A’s and B’s shields should be activated before any shots are calculated for the turn…

…To follow up…
Round 24:
B’s Ship is about to be destroyed at point 9,0
“A” shoots: 1,9,0 &
“B” shields: 8,9,0

Round 25:
“A” hits 9,0 destroying ship &
“B” throws down shield over destroyed ship at point 9,0

Now the Reverse:
Round 24:
A’s Ship is about to be destroyed at point 9,0
“A” shields: 8,9,0 &
“B” shoots: 1,9,0

Round 25:
“A” shields 9,0 protecting ship &
“B” shoots at point 9,0 hitting shield

ie. “A” shields on turn 25 before “B” can hit ship.

  • But reverse
    “B” shields after “A” hits (or destroys) ship.
    This handicaps player “B”…

Please let me always play as “A”…