You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: playground/core-concepts/core-3-game-manager.md
+15-5Lines changed: 15 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -187,16 +187,17 @@ gameManager.loseGame();
187
187
188
188
### Score calculation
189
189
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).
193
192
194
193
195
194
## Optimization Game Features <aname="optimization-game-features"></a>
196
195
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.
198
199
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:
200
201
```java
201
202
@Override
202
203
publicvoid onEnd() {
@@ -205,3 +206,12 @@ public void onEnd() {
205
206
}
206
207
```
207
208
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