Scoring Issues

Hi I’m doing some unit tests and the score calculation is giving me some issues. Here is an example state

Player A Health=100, Energy=31, Score=188
Player B Health=100, Energy=31, Score=188
[0E0][1A0][2 0][3 0][3d0][2 >][1 0][0E0]
[0E1][1 1][2 1][3 1][3 1][2 1][1 1][0E1]
[0E2][1A2][2 2][3d>][3D2][2a2][1 2][0E2]
[0E3][1 3][2 3][3 3][3 3][2 3][1 3][0E3]

Both players built buildings on the next turn on (2,2) and (1,2) respectively
They should get the following points (as I understand it)

Energy points:     17    17
Building points:    1     1
Damage points:      5     0
Destroyed building: 0     0

However the following turn has another 5 points for player B, and I don’t understand where it’s coming from.

Player A Health=100, Energy=18, Score=211
Player B Health=100, Energy=18, Score=211
[0E0][1A0][2 >][3 0][3D0][2 0][1 >][0E0]
[0E1][1 1][2 1][3 1][3 1][2 1][1 1][0E1]
[0E2][1A2][2a2][3d2][<D2][2A2][1a2][0E2]
[0E3][1 3][2 3][3 3][3 3][2 3][1 3][0E3]

Then the following round no player builds anything So

Energy points:     17    14
Building points:    0     0
Damage points:      5     0
Destroyed building: 1     0

And again player B gets 5 points that I can’t place.

Player A Health=100, Energy=35, Score=234
Player B Health=100, Energy=32, Score=230
[0E0][1A0][2 0][3 >][3D0][2 0][1 0][0 0]
[0E1][1 1][2 1][3 1][3 1][2 1][1 1][0E1]
[0E2][1A2][2A2][<d>][3D2][<A2][1A2][0E2]
[0E3][1 3][2 3][3 3][3 3][2 3][1 3][0E3]

Please help

I think I found the problem and it’s 2 things.

  1. Damage points is given on all missiles that hit a building for example if a building has hp of 5 and 2 missiles hit it at the same time the player gets 10 points but only one missile hits the building, the other continues and will possible get the player 5 more points.
  2. Damage points is given to a player for missiles hitting his own building, these missiles don’t do any damage to the building though

With those 2 assumptions my unit tests are all passing.

We will take a good look at the code and see what would cause such results

You can track the progress here

This topic was automatically closed after 30 hours. New replies are no longer allowed.