Skip to content
RoboCup Humanoid League TC edited this page Mar 26, 2017 · 11 revisions

Welcome to the GameController wiki!

General Notes

This explains the GameController protocol. If there is an reference to a Java Class it is referenced as @package.ClassName which can be used to check the allowed values for this field.
You will find the byte values for the refered classes in the Appendix. The game controller send out packages on the GAMECONTROLLER_DATA_PORT=3838 and expects the response from players who are connected to the GameController on the GAMECONTROLLER_RETURN_PORT=3939.

You will need to interpret a package Game Control Data and respond with a package Game Control Return Data.

The rows are highlighted based on the following categorization.

    A single byte indicating a specific field
    A set of bytes but not a complex object yet
    Complex Objects consisting of a byte array themselves

Game Control Data

<style> .struct { background-color: lightblue; } .byte { background-color: lightgoldenrodyellow; } .bytes { background-color: palegoldenrod; } .java { font-weight: 700; font-style: italic; color: darkblue; } table tr td { text-align: center; } </style>
<tr class="bytes">
    <td>4</td>
    <td>Header</td>
    <td>A String that is considered the Header 'RGme'</td>
</tr>
<tr class="byte">
    <td>1</td>
    <td>Protocol Version</td>
    <td>Identifying the Version of the Protocol</td>
</tr>
<tr class="byte">
    <td>1</td>
    <td>packetNumber</td>
    <td>A counter for the package that is raised by the GameController</td>
</tr>
<tr class="byte">
    <td>1</td>
    <td>playersPerTeam</td>
    <td>The numbers of Players per Team</td>
</tr>
<tr class="byte">
    <td>1</td>
    <td>gameType</td>
    <td>
        The type of the game that is played.<br>
        See <span class="java">@data.values.GameTypes</span> for allowed values
    </td>
</tr>
<tr class="byte">
    <td>1</td>
    <td>state</td>
    <td>
        The state that the game is currently in.<br>
        See <span class="java">@data.values.GameStates</span> for allowed values
    </td>
</tr>
<tr class="byte">
    <td>1</td>
    <td>firstHalf</td>
    <td>Whether the game is in the first half (value=1) otherwise (value=0)</td>
</tr>
<tr class="byte">
    <td>1</td>
    <td>kickOffTeam</td>
    <td>The team number of the next team to kick off or DROPBALL</td>
</tr>
<tr class="byte">
    <td>1</td>
    <td>secondaryState</td>
    <td>
        The SecondaryState of the game.<br>
        See <span class="java">@data.values.SecondaryGameStates</span> for allowed values
    </td>
</tr>
<tr class="bytes">
    <td>4</td>
    <td>secondaryStateInfo</td>
    <td>The secondary state information giving information about the state.<br>
        See <a href="#secondary_state_info">below</a> or <span class="java">@data.states.SecondaryStateInfo</span> for allowed values.
    </td>
</tr>

<tr class="byte">
    <td>1</td>
    <td>dropInTeam</td>
    <td>number of team that caused last drop in</td>
</tr>

<tr class="byte">
    <td>1</td>
    <td>dropInTime</td>
    <td>number of seconds passed since the last drop in. -1 (0xffff) before first dropin</td>
</tr>

<tr class="byte">
    <td>1</td>
    <td>secsRemaining</td>
    <td>estimate of number of seconds remaining in the half</td>
</tr>

<tr class="byte">
    <td>1</td>
    <td>secondaryTime</td>
    <td>number of seconds shown as secondary time (remaining ready, until free ball, etc)</td>
</tr>
<tr class="struct">
    <td>2</td>
    <td>TeamInfo</td>
    <td>The information about both teams and their players</td>
</tr>
Number of Bytes/
Occurrences
Identifier Explanation

TeamInfo

The TeamInfo Struct describes how a team looks like.

<tr class="byte">
    <td>1</td>
    <td>team_number</td>
    <td>The unique team number</td>
</tr>

<tr class="byte">
    <td>1</td>
    <td>team_color</td>
    <td>The color of the team.<br>
        See <span class="java">@data.values.TeamColors</span> for allowed values
    </td>
</tr>


<tr class="byte">
    <td>1</td>
    <td>score</td>
    <td>The score of the team.</td>
</tr>

<tr class="byte">
    <td>1</td>
    <td>penaltyShot</td>
    <td>Number of penalty shots</td>
</tr>

<tr class="byte">
    <td>1</td>
    <td>singleShots</td>
    <td>Number of successful penalty shots</td>
</tr>

<tr class="byte">
    <td>1</td>
    <td>coachSequence</td>
    <td>The sequence number of the last coach message</td>
</tr>

<tr class="bytes">
    <td>253</td>
    <td>coachSequence</td>
    <td>The coach message
        See below or <span class="java">@data.spl.SPLCoachMessage</span> for more information.
    </td>
</tr>
<tr class="struct">
    <td>1</td>
    <td>PlayerInfo (coach)</td>
    <td>The PlayerInfo complex object which specifies the coach
    </td>
</tr>
<tr class="struct">
    <td>11</td>
    <td>PlayerInfo (players)</td>
    <td>The PlayerInfo complex object which specifies all the players</td>
</tr>
Number of Bytes/
Occurrences
Identifier Explanation

PlayerInfo

The TeamInfo Struct describes how a specific player looks like.

<tr class="byte">
    <td>1</td>
    <td>penalty</td>
    <td>
        The id of the penalty the robot currently has. No penalty is 0.<br>
        See <span class="java">@data.values.Penalties</span> for allowed values.
    </td>
</tr>

<tr class="byte">
    <td>1</td>
    <td>seconds_till_unpenalized</td>
    <td>
        The number of seconds until the robot is unpenalized again.
    </td>
</tr>
Number of Bytes/
Occurrences
Identifier Explanation

Secondary States

The concept of secondary states allows to move during a main state to a secondary state and with the detailed secondary state information convey additional information within that sub state.

You can look at @data.states.SecondaryGameStates for the implementation. The below table shows which is the meaning for the additional bytes. Only Secondary Game States and respective byte positions which convey information are listed. The others can be ignored.

</tr>
<tr class="byte">
    <td>PENALTY_KICK</td>
    <td>0</td>
    <td>Team Number of the team performing the penalty kick</td>
</tr>
Secondary Game State Byte Position Information
FREE_KICK 0 Team Number of the team performing the free kick

Game Control Return Data

This is the package that needs to be send by the robot to show up in the Game Controller.

<tr class="bytes">
    <td>4</td>
    <td>header</td>
    <td>The header flag for the package. In this case = 'RGrt'.</td>
</tr>

<tr class="byte">
    <td>1</td>
    <td>version</td>
    <td>The version of the return protocol. Currently version 2.
    </td>
</tr>
<tr class="byte">
    <td>1</td>
    <td>team</td>
    <td>The unique team number of the player</td>
</tr>

<tr class="byte">
    <td>1</td>
    <td>player</td>
    <td>The unique player number of the player</td>
</tr>
<tr class="byte">
    <td>1</td>
    <td>message</td>
    <td>What the player can say. <br>
        See <span class="java">@data.values.PlayerResponses</span> for allowed values.
    </td>
</tr>
Number of Bytes/
Occurrences
Identifier Explanation

Appendix

GameStates

Identifier Byte Value
IMPOSSIBLE -1
INITIAL 0
READY 1
SET 2
PLAYING 3
FINISHED 4

GameTypes

Identifier Byte Value
ROUNDROBIN 0
PLAYOFF 1
DROPIN 2

Penalties

Identifier Byte Value
UNKNOWN -1
NONE 0
SPL_ILLEGAL_BALL_CONTACT 1
SPL_PLAYER_PUSHING 2
SPL_ILLEGAL_MOTION_IN_SET 3
SPL_INACTIVE_PLAYER 4
SPL_ILLEGAL_DEFENDER 5
SPL_LEAVING_THE_FIELD 6
SPL_KICK_OFF_GOAL 7
SPL_REQUEST_FOR_PICKUP 8
SPL_COACH_MOTION 9
SUBSTITUTE 14
MANUAL 15
HL_BALL_MANIPULATION 30
HL_PHYSICAL_CONTACT 31
HL_ILLEGAL_ATTACK 32
HL_ILLEGAL_DEFENSE 33
HL_PICKUP_OR_INCAPABLE 34
HL_SERVICE 35

PlayerResponses

Identifier Byte Value
MAN_PENALISE 0
MAN_UNPENALISE 1
ALIVE 2
UNKNOWN -1

SecondaryGameStates

Identifier Byte Value
NORMAL 0
PENALTYSHOOT 1
OVERTIME 2
TIMEOUT 3
FREEKICK 4
PENALTYKICK 5

TeamColors

Identifier Byte Value
BLUE 0
RED 1
YELLOW 2
BLACK 3
WHITE 4
GREEN 5
ORANGE 6
PURPLE 7
BROWN 8
GRAY 9
Clone this wiki locally