Setting Up the Game


While you can use any computer to host a RoboRuckus game server, this guide describes how to setup a dedicated game server on a Raspberry Pi with its own Wi-Fi network. A Raspberry Pi with ARMv7 or better is required by ASP.Net. The Raspberry Pi 2 is recommended as the Raspberry Pi 3 has not yet been tested. This guide also assumes you already have some basic familiarity with the Linux command line. If you’re unfamiliar with the command line, these two guides are a good introduction, and more general information can be found at the official Raspberry Pi documentation.

Materials

Setting Up Raspbian

Following these instructions, download and install Raspbian onto the SD card, and insert the card into your Raspberry Pi. You can either hook your Raspberry Pi up to a keyboard and monitor (via HDMI) to do the set up, or connect to your Raspberry Pi via SSH. Either way, an Internet connection is required for setup.

To connect via SSH (“headless” mode), connect your Pi to your router via an Ethernet cable then use this Raspberry Pi finder to locate your Pi and note its IP address. Click on the Terminal button to connect via SSH and open a command line. Use raspi-config to expand the file system and optionally set up the internationalization options and change the user password.

Setting Up the Access Point

After rebooting and reconnecting to your Pi, plug in the Wi-Fi adapter and configure it to be an access point. Follow this guide, making the following changes in the Install Software section:

Setting up DHCP server

Change these lines:

To this:

Set up wlan0 for static IP

Change:

To this:

Lastly, after completing the rest of this section run sudo ifconfig wlan0 192.168.3.1.

Configure Access Point

Change these lines:

To this:

This will create a Wi-Fi access point called RoboRuckus with no password. You can setup a secure network if you want by using the following configuration and changing the passphrase to whatever you want:

You will also need to update the BotCode.ino to use WPA by changing:

To this:

The sections titled Configure Network Address Translation and Update hostapd should be skipped.

Follow the rest of the guide as written. After completing the above steps and rebooting your Pi, you should now see a new Wi-Fi network called RoboRuckus, which you should be able to connect to, but it won’t provide any Internet access.

Setting Up DNS

You can set it up so devices connected to your Raspberry Pi can access the game server by visiting the address roboruckus.com. To start, you’ll need to set up dnsmasq by running the following command:

Edit the dnsmasq configuration file by running:

And add the following lines to the bottom of the file:

Press ctrl-x and y to close and save the file.

Next run:

And add the following line to the bottom of the file, then close and save it:

The next step is to install nginx and configure it as a reverse proxy. Run the following commands:

Then create a new nginx site called roboruckus:

Add the below to the contents of the file:

Save your file and restart your Pi to get dnsmasq and nginx working.

Hardware RNG

While the RoboRuckus game already uses the RNGCryptoServiceProvider class to provide high quality random numbers for dealing cards, you can further improve the entropy pool on the Raspberry Pi by enabling its hardware RNG. The following is based on these instructions, this only works on a Pi 2 or earlier, if you have a Raspberry Pi 3, that link has other instructions that should work.

First, install the RNG-Tools:

Next run:

And add the below line to the bottom of the file:

Close and save the file, then run:

And set the contents of that file to:

Close and save the file, then reboot to activate the RNG. Whether this makes any real difference remains to be determined, but it can’t hurt.

Setting Up .Net

ASP.Net Core does not currently have official support for Mono. However, the wonderful ASP.Net community has created some work-arounds which are detailed here.

Installing Mono

Getting Mono working is, unfortunately, not as trivial as it should be, but it can be done by entering the following commands in order (hat-tip to Lyle for providing the Mono and libuv solutions):

Installing libuv

Next, libuv needs to be downloaded, compiled, and installed using the following commands:

Installing .Net Core

Setting up .Net Core is based on these instructions. Enter the following commands:

Setting Up ASP.Net

The hackiest part of all this is getting ASP.Net to run on ARM, with major thanks to techcap for detailing this solution. Some of these steps may be unnecessary by now, but they don’t seem to hurt. Enter the following commands on the Pi, ignore any errors about things already existing:

Setting Up RoboRuckus

Now that the environment is set up, download the RoboRuckus Git repository, saving the file to your computer. Using SFTP, connect to your Raspberry Pi. Extract or open the zip file and copy the folder RoboRuckus from RoboRuckus-master/PiReady/ to your Raspberry Pi home directory. Then run the following commands:

Server Running

A successfully started RoboRuckus game server.

To stop the game server press ctrl-c. If the server starts and exits without problems, congratulations, your game is good to go!

You can also run the game in a “botless” mode, for playing the game without physical bots. This will add six “virtual” bots to the game so you can test and play just with a computer, phone, or tablet, but no physical bots needed. You cannot mix the botless mode with physical bots. To launch the game in botless mode, use the same instructions as above, except for the second command use: