Skip to content

PlayerID

python
PlayerID = str
java
public class PlayerID {
    @Nullable
    public static PlayerID of(@Nullable String value)
    public @NotNull String stringValue()
}

The unique identifier of a player in the game.

Set to a short random-looking string value that is unique to each player during the game. Used to reference players in various scenarios, such as choosing a target for an attack or retrieving more information about someone who is attacking the bot.

null value for PlayerID

Initially, the map is covered with empty territory that does not belong to any player. This territory is represented by a PlayerID of null.

In other words, you can:

  • Check if there are empty territories around your borders by checking if your neighbors list contains null.
  • Attack the player null to claim empty territory for yourself.

Difference with PlayerSmallID

PlayerID should not be confused with PlayerSmallID, which is a different identifier, used mainly for communications between players.

Use the small_id_to_player_id function to convert a PlayerSmallID to a PlayerID when necessary.

INFO

We cannot provide an exact explanation as to why there are two different player identifiers. This comes directly from the game source code, and we did not notice any particular pattern in how they are used, except PlayerID is used more often in the game state, while PlayerSmallID is used more often in communications.

In any case, conversion functions should abstract this problem away.