Skip to main content

ZAPPY - AI Protocol

📖 Overview

This document describes the client/server communication protocol used in the Zappy Artificial Inteligence (AI). It includes the name of the commands, their formats, and explanations of the effects of each command.

⚠️ Every command must end with a newline character (\n).


🧭 Client → Server Commands

ActionCommandTime limitResponse
move up one tileForward7/fok
turn 90° rightRight7/fok
turn 90° leftLeft7/fok
look aroundLook7/f[tile1, tile2,...]
inventoryInventory1/f[linemate n, sibur n, ...]
broadcast textBroadcast text7/fok
number of team unused slotsConnect_nbr-value
fork a playerFork42/fok
eject players from this tileEject7/fok/ko
take objectTake object7/fok/ko
set object downSet object7/fok/ko
start incantationIncantation300/fElevation underway

In case of a bad/unknown command, the server answer “ko”.

✨ Special Commands

👋 WELCOME command

The welcome command is sent by the server to the client when it connects. The AI must reply with the team name to authenticate itself.

After the team name is sent, the server will send the map size and the number of slots available for the team.

It should look like this, where -> is the server and <- is the client:

-> WELCOME
<- {team_name}
-> {map_x} {map_y}
-> {slots_available}

☠️ DEAD command

The dead command is sent by the server to the client when the AI dies. The AI does not need to send any command to get this information, and it also does not need to reply to it.