Firewalls targetting

Hi I have made my algo to play against itself and it should have ended like draw or win because of one would take less time, but the red one actually win normally, so I started to investigate what happend and on frame 458 even thought everything is as mirror, the emps choose different target and I wonder why? Red attacks [12, 13] and blue attacks [11, 14], which is equivalent to [16, 13] for red. I would actually expect red to attack [16, 13] as it is closer to edge as rules say:

  1. Choose the target closest to an edge

Does anyone any idea? Or do I understand the last rule of targeting wrong?

There is a replay of the game 11-3-2018-16-1-5.replay (4.9 MB)

1 Like

Thanks, i’ll look into this

1 Like

This has been fixed and will be deployed tommorow or later today.

When we say ‘closest to an edge’ we mean ‘farthest to the left or right’, which is equivalent to ‘distance from the center’. We were calculating this distance from the center, with abs(xPosition - boardCenter).

Our problem is that boardCenter was set to boardsize / 2. Our board is 28 by 28, so this is 14. Our center point should be 13.5, but was shifted half a tile to the right. This means that targeting was preferring targets towards the left when there was a tie.

Edit: This fix should be deployed


Does this affect the functionality of the starter pack’s getTarget() or has that been working correctly?

I’ll double check this.


unit_x_distance = abs(self.HALF_ARENA - 0.5 - unit.x)

This is the logical equivalent of the line that was messed up on engine, it looks good to me. Let us know if you notice anything wrong of course.

1 Like