ExternalProtocol

From Wiki in Space
(Redirected from Arduino Controllers)
Jump to: navigation, search

Objects in space was made with the intention that it could be playable with just buttons.

You can also get almost all the information from the in-game UI sent back to your Arduino or other external microcontroller that can speak Serial.

There are 193 Commands Serial Commands, 164 Boolean Requests, and 24 Numeric Requests for a total of 381 commands and requests (source Zebra)

Protocol Details

The protocol is outlined on the offical web site, however as of version 1.0.2 the implementation in-game deviates a little from the version 1 protocol docs.

Line Endings

Contrary to the documentation, the newline character is LF (Dec: 10, Hex 0x0A), not CR (Dec: 13, Hex 0x0D). Note that LF is usually encoded as \n, so the samples provided are correct, just the description on the page is wrong.

All lines sent by the game are terminated with a \n, except for the handshaking phase.

Handshaking

To initiate a connection to the game, the client should send 451\n, not SYN=1. The game will respond with 452\r\n (Note the response here contains a newline and a carriage return).

Synchronisation

All commands from the client are the reverse to what's described in the documentation - the first parameter should be the text command, and the second the numerical channel. The correct forms of the examples given should be:

  • CMD=BURN_MAIN_ENGINE,4
  • NIB=MAIN_ENGINE_BURNING,1
  • NIN=POWER_LEVEL,2
  • NIF=CURRENT_SPEED,2

Sources