This is an old revision of the document!
With the rem0te package of r0ket software you can build a game or other installation that can be interacted with, using a r0ket.
The system consists of three elements: The game server, the bridge and the l0dable r_player.
The game server uses the bridge to announce the game, receive button presses and (in the future) send text to the display of a player.
The bridge is a r0ket running a special firmware. It is attached via USB to the computer running the game server. It can receive and send on any channel and with any address.
The l0dable runs on the r0kets of the players. It displays a list of available games and lets the player join a game. It can also transmit the nickname of the player to the game. In a future version it will be able to display text on the LCD.
To implement your own game server you can use our python library r0ketrem0te. It is located in the git at https://github.com/r0ket/r0ket/tree/master/tools/game .
It depends on the python library crcmod. You can use pypi to install it. With Ubuntu run:
sudo apt-get install python-stdeb sudo pypi-install crcmod
Now you can install the library:
cd tools/game sudo python setup.py install
The py-pong directory contains a sample implementation for a multi-player pong using the game server. Run it with:
cd tools/game/py-pong python main.py
The game will wait until two players have connected and transmitted their nick name. It will then start the game until one of the players shuts down the l0dable or gets out of reach.
You need to have pygame installed for py-pong.
The library is currently only tested with Linux.
The firmware for the bridge is located in the file firmware/applications/bridge.c
To build it you have to edit firmware/core/projectconfig.h and
cd firmware make APP=bridge
Now flash it using
A precompiled image can be found at https://brezn.muc.ccc.de/~schneider/bridge.bin
The l0dable is located at firmware/l0dables/r_player.c
To build it run:
cd firmware make APP=final make APP=final l0dables
Then copy l0dables/r_player.c0d to the r0ket. We will put up a pre compiled l0dable before 28C3. We are still actively developing for it.
If you have a game server running in the vicinity the l0dable will show you the games it found. Select the game you want to play and press right. The game can now request your nickname. The l0dable then transmits it to the game and starts to send the state of the button. You can now interact with the game. The l0dable transmits the state of the button on a regular basis. Currently about every 50ms.
Currently there is no way to exit the l0dable and there is no code to display text.
To write your own game server you can use the r0ketrem0te Python library. Have a look at the main.py and pypong/player.py for an example application. The r0ketrem0te.game.Game class implements most of the things that have to be taken care of.
In the constructor you have to specify the following parameters:
The Game class keeps track of active players. If a player does not send a packet for 10 seconds she is removed from the list of active players.
There are callbacks for