Difference between revisions of "ExternalProtocol"
(→Arduino Controllers) |
|||
(9 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
+ | 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 [[Serial Requests#Boolean Requests|Boolean Requests]], and 24 [[Serial Requests#Numeric Requests|Numeric Requests]] for a total of 381 commands and requests (source [http://forum.objectsgame.com:88/t/ois-arduino-code-during-beta/911/18?u=segwegler Zebra]) | |
− | |||
− | There are 193 Commands [[Serial Commands]], 164 Boolean Requests, and 24 Numeric Requests for a total of 381 | ||
− | == Protocol == | + | == Protocol Details == |
− | + | The protocol is outlined on the [http://objectsgame.com/the-controllers/ois-serial-data-protocol/ offical web site], however as of version 1.0.2 the implementation in-game deviates a little from the version 1 protocol docs. | |
− | To | + | |
+ | === 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 <code>\n</code>, so the samples provided are correct, just the description on the page is wrong. | ||
+ | |||
+ | All lines sent by the game are terminated with a <code>\n</code>, '''except for''' the handshaking phase. | ||
+ | |||
+ | === Handshaking === | ||
+ | |||
+ | To initiate a connection to the game, the client should send <code>451\n</code>, not <code>SYN=1</code>. The game will respond with <code>452\r\n</code> (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: | ||
+ | |||
+ | * <code>CMD=BURN_MAIN_ENGINE,4</code> | ||
+ | * <code>NIB=MAIN_ENGINE_BURNING,1</code> | ||
+ | * <code>NIN=POWER_LEVEL,2</code> | ||
+ | * <code>NIF=CURRENT_SPEED,2</code> | ||
+ | |||
+ | === Sources === | ||
+ | |||
+ | * [http://forum.objectsgame.com:88/t/ois-arduino-code-during-beta/911/13 Nocturnal] | ||
+ | * [https://bitbucket.org/pjhardy/arduinosinspace/src/87cf41381ac8cab9573cd5ed95976346e54991d8/protocol-notes.md?at=master&fileviewer=file-view-default stibbons] | ||
+ | |||
+ | [[Category:HardwareInterfacing]] |
Latest revision as of 13:05, 7 March 2019
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