endGameScoring state
Properties
- id
999
- name
endGameScoring
- type
game
- description
not set
- descriptionmyturn
not set
- action
- transitions
endGame
- possibleactions
not set
- args
not set
- updateGameProgression
false
- initialprivate
not set
Summary
State to compute the players scores at the end of the game. For now, only base game scores are taken into account:
Power track ranks
Player board points
Card points (including industrial Age special cards)
Detailed description
This is a detailed overview of how each score is computed:
- Power tracks scores:
For each power (population, prestige, army), the DB is queried for the order of the players on the track. Results are grouped by players’ position on the track, and the output might look like:
type
level
player_ids
Population
8
player3id;player1id
Population
5
player2id
Population
4
player4id
Prestige
7
player4id;player2id;player1id
Prestige
5
player3id
Army
9
player1id
Army
7
player4id;player3id
Army
5
player2id
Then score are compute according to the rules: should multiple players occupy the same space on the track, the average (rounded down) of the scores corresponding to the ranks occupied is distributed to each tied player. For the example given above, the following scores would be computed:
Player
Population
Prestige
Army
player1id
8 (average of 1st and 2nd)
7 (average of 1st, 2nd, and 3rd)
12
player2id
3
7 (average of 1st, 2nd, and 3rd)
1
player3id
8 (average of 1st and 2nd)
2
5 (average of 2nd and 3rd)
player4id
1
7 (average of 1st, 2nd, and 3rd)
5 (average of 2nd and 3rd)
- Player board points:
For each skill, the number of victory points given by the level is obtained from array defined in the
material.inc.php
, or files included therein. The sum is then computed and awarded to the corresponding player
- Card points:
Active cards are traversed and the sum of the points granted by the cards is awarded to the owning player. If the Industrial Age variant is enabled, if a negative number is encountered, then the corresponding number of points (number of cards of type (science, engineering or culture) divided by 5, rounded down) is added to the total instead of substracted.