Probably dumb question, but how do I know which player in the game state I am?
When your bot receives the register callback from the engine, it is assigned a UUID.
This UUID can then be referenced in the playerObjects array in the game state.
How do I get the UUID value. If I print registration token I get a different value to every playerID.
So the registration token you send to the game engine and the UUID you receive back from the game engine are two different values.
There is a callback called Registered
which when connected and registered successfully will return your bot UUID
You can also check the GameComplete json file to check what PlayerID value your bot received, for your bot’s nickname.
For example:
{
"Placement": 2,
"Seed": 10211,
"Score": 14,
"Id": "ecce2667-32eb-4893-bee5-136c39672460",
"Nickname": "RefNickName",
"MatchPoints": 6
}
Where my bot’s nickname here was RefNickName
, I can now search the logs for ecce2667-32eb-4893-bee5-136c39672460
to find all references to my bot.
You can also use this file to identify where your bot finished.
If you grab the latest starter pay, you’ll notice a visualiser, which will also help you see this!