Skip to content

Commit 443c71e

Browse files
author
Builder
committed
Merge branch 'doc-sdk-score-criteria-score' into 'master'
doc(sdk): Add clarity to the differences between SOLOs and OPTI's scoring systems See merge request codingame/game-engine!168
2 parents 1e5d985 + 3fa41d1 commit 443c71e

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

playground/core-concepts/core-3-game-manager.md

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -187,16 +187,17 @@ gameManager.loseGame();
187187

188188
### Score calculation
189189

190-
Once the game is online, players will be able to submit their code and a score will be calculated to determine their rank in the leaderboard.
191-
192-
This score corresponds to **the sum of all the scores obtained when running validators**. Validators are specific kinds of test cases. Make sure you [configure them correctly](core-4-configuration.md#test-case-file).
190+
Once the game is published, players can submit their code to acquire a **score**. This **score** is the percentage of validators that the player has successfully passed.
191+
Validators are a specific kind of test case. Make sure you [configure them correctly](core-4-configuration.md#test-case-file).
193192

194193

195194
## Optimization Game Features <a name="optimization-game-features"></a>
196195

197-
An Optimization game is a Solo game with a score. The only differences comes in the [configuration](core-4-configuration.md#optimization-game-configuration) and the metadata you need to send.
196+
An Optimization game is a Solo game with a criteria score, such as `Points`, or `Fuel` as well as the normal validator score.
197+
198+
To configure the optimization criteria, you'll need to track in yourself in the game's code and send it as metadata with the `GameRunner`'s `putMetadata()` method. [More information here](core-4-configuration.md#optimization-game-configuration) on the configuration of an optimization game.
198199

199-
Once your game is correctly configured, you need to send your player's score. We advise you set it at the end of the game as below:
200+
Once your game is correctly configured, we advise you set the criteria score at the end of the game as below:
200201
```java
201202
@Override
202203
public void onEnd() {
@@ -205,3 +206,12 @@ public void onEnd() {
205206
}
206207
```
207208

209+
### Rank calculation
210+
211+
When a player submits code in an optimization game, they are assigned:
212+
- An ordinary **score**: the percentage of validators successfully passed.
213+
- A total **critera score**: the sum of the **criteria scores** from each validator.
214+
215+
The player's rank is determiend firstly by their **score**, then by their **total criteria score**. This means a very optimized solution that fails a single validator will rank lower than a poorly optimized solution that achieves 100%.
216+
217+
In case of a draw in both score and total criteria score, the ranking is arbitrary.

0 commit comments

Comments
 (0)