Skip to content

Information about the state of the Avatars (2 Player)

rdgain edited this page May 12, 2016 · 1 revision

Some functions can be used to retrieve information of the current state of the avatars. StateObservationMulti provides information about all avatars in the game (position, resources, speed orientation). Note that they all require the ID of the player queried. See here the most important functions:

State Observation functions Description
ArrayList<Types.ACTIONS> getAvailableActions(int playerID) Returns the actions that are available in this game for the avatar corresponding to playerID.
Vector2d getAvatarPosition(int playerID) Returns the position of the avatar corresponding to playerID. If the game is finished, this returns Types.NIL.
double getAvatarSpeed(int playerID) Returns the speed of the avatar corresponding to playerID. If the game is finished, this returns 0.
Vector2d getAvatarOrientation(int playerID) Returns the orientation of the avatar corresponding to playerID. If the game is finished, this returns Types.NIL.
HashMap<Integer, Integer> getAvatarResources(int playerID) Returns the resources in the possession of the avatar corresponding to playerID. As there can be resources of different nature, each entry is a key-value pair where the key is the resource ID, and the value is the amount of that resource type owned. It should be assumed that there might be other resources available in the game, but the avatar could have none of them. If the avatar has no resources, an empty HashMap is returned.

Table of Contents:

Clone this wiki locally