replaced builder's manual file with links to the wiki in the README

This commit is contained in:
ohsqueezy 2023-05-17 16:02:41 -04:00
parent fdff973446
commit 39de5967d1
8 changed files with 19 additions and 614 deletions

View File

@ -12,18 +12,23 @@ Send us a donation through [Ko-fi](https://ko-fi.com/scrapeboard)!
[![Donate at Ko-fi](https://storage.ko-fi.com/cdn/kofi3.png?v=3)](https://ko-fi.com/Z8Z7FX41L)
Wiki
----
### *See [Scrapeboard Wiki](../../../wiki) for a manual on how to build Scrapeboard from scratch!*
Controller
----------
The standard controller is a custom platform combined with a modified skatedeck, seen in the above GIF. It can be built using the instructions in the [builder's manual][1]. Custom interfaces can also be created using an Arduino or Raspberry Pi. There is also keyboard support built-in. It is meant for testing, but the game can be played with it.
The standard controller is a custom platform combined with a modified skatedeck, seen in the above GIF. It can be built using the instructions in the [builder's manual](../../../wiki/Builders-manual) and attached to an Arduino. Custom interfaces can be created using an Arduino or Raspberry Pi.
The hardware requirement for [serial mode](#serial) is an [Arduino][] or Arduino-equivalent device that can run the [serial program][]. [Raspberry Pi][] mode is similar to serial mode, but it uses the Python GPIO library to get input directly from the Raspberry Pi pins. For [keyboard mode](#keys), no special hardware is required, although a gamepad or [Makey Makey][] could be used to create a custom controller that sends key presses.
See [Scrapeboard Builder's Manual][1] for detailed instructions on how to build a complete system from scratch using an Arduino or Raspberry Pi!
There is also keyboard support built-in. It is meant for testing, but the game can be played with it.
Software
--------
### *See the [software chapter](../../../wiki/Software) of the [Builder's Manual](../../../wiki/Builders-manual) for more detailed instructions*
The software requires Python, [Pygame][], and a custom Python game framework [PGFW][]. The Python version should be 3.9 or higher. The Pygame version should be 1.9.6 or higher. PGFW is a submodule of this repository, so it can be cloned simultaneously using the `--recursive` flag. Python and Pygame can be installed on any operating system, including Windows, OS X, and Linux.
Installing Python will usually install Python's package manager PIP as well. PIP can be used to install Pygame by running the following from your terminal (for example, PowerShell on Windows).
@ -32,23 +37,25 @@ Installing Python will usually install Python's package manager PIP as well. PIP
Once you have Python and Pygame installed, run the following to download Scrapeboard and PGFW
git clone --recursive https://git.nugget.fun/scrape/scrapeboard
git clone --recursive https://open.shampoo.ooo/scrape/scrapeboard
If you have an Arduino connected with the circuit and program prepared, run this to start the game. If the Arduino is not prepared yet, see below.
./OPEN-GAME
python OPEN-GAME
If you are using a Raspberry Pi, run this instead. The Pi should have a circuit installed to its GPIO pins. See below for details.
./OPEN-GAME --pi
python OPEN-GAME --pi
To run the game in keyboard mode anytime, use this
To run the game in keyboard mode anytime, use the following
./OPEN-GAME --no-serial
python OPEN-GAME --no-serial
Serial
------
### *See the [electronics chapter](../../../wiki/Electronics) of the [Builder's Manual](../../../wiki/Builders-manual) for more detailed instructions*
To run the game using the custom skateboard and metal pads, the Arduino attached to the pads must be plugged into USB, and the [pyserial][] package must be installed on the computer.
If you have Python Package Installer, you can run this to install pyserial:
@ -59,12 +66,10 @@ The Arduino must be loaded with the [serial program][] and connected to USB. The
If you don't have the board, pad and Arduino, you can test the game using keyboard-only mode.
Refer to [Scrapeboard Builder's Manual][2] for how to build the circuit.
Raspberry Pi
------------
Raspberry Pi GPIO input is also supported. Refer to [Scrapeboard Builder's Manual][2] for how to build the circuit. Once the circuit is in place, the game will be able to detect GPIO input. Run with the `--pi` flag to activate Raspberry Pi mode.
Raspberry Pi GPIO input is also supported. See the [Raspberry Pi chapter](../../../wiki/Raspberry-Pi) of the manual for how to install this on Raspberry Pi. Once the circuit is in place, the game will be able to detect GPIO input. Run with the `--pi` flag to activate Raspberry Pi mode.
./OPEN-GAME --pi
@ -100,7 +105,7 @@ Options
The full list of configurable values is in the [config file][]. There are also command line flags that can override config values. Use the help flag to see the possible values:
./OPEN-GAME -h
python OPEN-GAME -h
The `--minimize-load-time` flag can be useful when testing because it sacrifices some effects to load the game quickly.
@ -116,8 +121,6 @@ Contact
More information is available [at the website](https://scrape.nugget.fun). Email us at scrape (at) nugget (dot) fun.
[1]: doc/Scrapeboard_builder's_manual.md
[2]: doc/Scrapeboard_builder's_manual.md#electronics-1
[Pygame]: https://pygame.org
[Makey Makey]: https://makeymakey.com
[serial program]: serial/serial.ino

View File

@ -1,598 +0,0 @@
---
gitea: none
include_toc: true
---
Scrapeboard Builder's Manual
============================
![demo](https://scrape.nugget.fun/www/Scrapeboard_Gameplay_Demo_picture_in_picture.webp)
Scrapeboard is an arcade game that uses a skateboard deck and metal floor pads for input. In the game, the player is a lizard who is given a skatedeck by Tony Hawk and challenged to physical matches against a series of goons. The object of each match is to perform combinations of foot moves on a sliding board as quickly as possible as they are displayed on screen.
The game is available to play at select game conventions and festivals, but it is also a D.I.Y. project that is not difficult to reproduce. This manual covers how to build a full Scrapeboard system. It includes how to install and test the software, how to build the electronics, and how to fabricate a controller using a skateboard deck, metal pads, and plywood.
![Time lapse of build](img/Scrapeboard_platform_timelapse.webp)
Audience
--------
The manual is intended for a general audience. There are steps that involve beginner level electronics and wood working. The instructions assume some understanding about how to connect components when using the Arduino. There are steps that require the use of a drill.
There is a significant time investment to consider from reading the manual and sourcing the supplies to building the software, electronics, and hardware. Multiple days should be set aside if building a system from start to finish.
Purpose
-------
The builder's manual was created so players could build Scrapeboard on their own and challenge themselves and friends outside of events and host their own events. It is released with open licensing, so the finished system can be used personally, for example in a player's garage or basement, or commercially, like in an arcade or bar. It is also licensed to be modified, so the controller can be used for other games, including custom ones. With more Scrapeboard systems, there can be more access outside of occasional events.
License
-------
The code, electronics, and manual are released as open source, so the system is licensed to be modified and used for any purpose, including commercial. See [LICENSE.txt](LICENSE.txt) for details.
History
-------
Scrapeboard started in 2017 as a side project of the STORE 2 exhibition at [Babycastles](https://babycastles.com), which Frank, Blake, and Clement, worked on, along with curator Mushbuh and a team of volunteers. The team received a donation of a signed skatedeck from Tony Hawk to be added to the exhibition. After the exhibition, in preparation for [MAGFest](https://super.magfest.org) 2018, Frank and Blake created Scrapeboard so they could use the skatedeck as a game controller.
![Tony Hawk signed skatedeck](../www/clamp.jpg)
The original prototype was created using the signed skatedeck, cardboard, aluminum foil, copper tape, and a [Makey Makey](https://makeymakey.com). The skatedeck was turned into a conductive device by applying copper tape to the bottom of the deck and placing it on a platform made of cardboard and layered aluminum foil. In the center of the platform was a cross section of aluminum foil, separated by bare cardboard and painter's tape from four other sections of aluminum foil outside the cross section. The four outside sections and cross section were connected to the Makey Makey with alligator clips. This served as a proof of concept for the game and was even able to be used for a few events.
<img src="../resource/gif/Boarding_2.gif" />
The next version of Scrapeboard used four aluminum street signs, a rug, an aluminum sheet, and an Arduino. Four rectangles were cut into the rug to frame the aluminum signs, which were taped to the bottom of the rug with carpet tape. The aluminum sheet was drilled into the bottom of the signed skatedeck. The Arduino circuit was designed using pull-up resistors and a program loop which turned each input low and tested for a connection with the other inputs, so the circuit wouldn't require a ground connection anymore. This version was used for many events but required a lot of repair and maintenance before and after each event.
![The rug prototype](../www/open_graph_card.jpg)
A newer model was made in preparation for [GDC](https://gdconf.com) 2022, using wood, aluminum street signs, steel anchor rings, and the same Arduino circuit. The aluminum street signs were drilled into four pieces of wood which were bracketed together on the underside. The steel anchor rings were fastened to the underside of the skatedeck using machine screws. By the end of 2022, this version had been refined to last through multiple events without needing repair, a significant milestone for the project because it opened up the possibility of the game being able to run without constant supervision.
![Collage of scrapeboard action photos at GDC](https://scrape.nugget.fun/local/cover2.png)
Although there are still improvements being worked on, the 2022 model is what the manual is based on and what the instructions will create. Since that model has proven to be durable, the steps to reproduce it can be recommended as a simple method for Scrapeboard players to construct a system of their own. Further improvements are covered by optional steps and more will likely be added in the future.
Supplies
--------
### Electronics
* [Arduino][3] or [Raspberry Pi 4 (2GB or higher)][4]
* Desktop or laptop computer (not required if using Raspberry Pi)
* 4GB or larger micro SD card and reader (only needed for Raspberry Pi)
* USB keyboard (only needed for Raspberry Pi)
* Monitor or any HDMI capable display
* HDMI cable
* [Breadboard](https://www.amazon.com/dp/B07LFD4LT6)
* [Jumper wires](https://www.amazon.com/dp/B01EV70C78)
* 4 × [4.7k resistors](https://www.amazon.com/dp/B07QJB3LGN)
* 4 × [5mm screw terminals](https://www.amazon.com/dp/B088LSS14J)
### Hardware
* 4 × [plywood](https://www.homedepot.com/p/203504324) pre-cut to 15x21x3/4" each (oak or birch hardwood recommended, note: if the platform doesn't need to be portable, 1 big piece of plywood or any type of wood floor can be used)
* 4 × 1/8x12x18" metal sheets (for example, [aluminum composite sheet](https://www.homedepot.com/p/308670310) cut into 4 pieces or [street signs](https://www.ebay.com/itm/134245723578))
* 68 × [Flat-head sheet metal screws #12 7/8"](https://www.zoro.com/i/G9189975/)
* 4 × [#12 washers](https://www.zoro.com/i/G0585042/)
* 8 × [Flat metal brackets with 5/8" screws](https://www.amazon.com/dp/B07Z8YLFCN)
* 20' - 30' [16 AWG wire](https://www.ebay.com/itm/272488348389)
* [Skateboard deck](https://www.ebay.com/sch?_nkw=blank+skateboard+deck)
* 2 × [Surface-mounted anchor rings](https://www.harborfreight.com/4-piece-surface-mounted-rope-rings-97767.html)
* 6 × [#12-24 × 5/8" flat head machine screws](https://www.zoro.com/i/G1631332/) and [#12-24 nuts](https://www.zoro.com/i/G1271146/)
* 10 × [#8-1/2" sheet metal screws](https://www.amazon.com/dp/B09D952RV5)
* [Thin metal strip](https://www.amazon.com/dp/B00745VXN2)
* [Non-slip floor padding](https://www.amazon.com/dp/B09QS47P21) (recommended for keeping the platform from sliding)
* [Carpet tape](https://www.amazon.com/dp/B07H88SWCM) (recommended for keeping the platform from sliding)
* [WD-40](https://www.amazon.com/dp/B00IOX8M0A/) (recommended for drilling into metal)
### Tools
* Drill
* Hammer
* Straight edge
* Pencil
* Measuring tape
* Countersink bit (recommended)
* Wire strippers (recommended)
* Wrench and/or pliers (recommended)
* Screwdriver (recommended)
* Sandpaper (recommended)
* Router (optional, see notes below)
### Optional
If access to a router is available, a more compact version of the platform with a smooth, flush surface can be created. It will require creating insets for the metal panels, inner screws, brackets, and wires using the router. To create this version, make the following supply substitutions, and follow the steps marked optional in [Building a Scrapeboard and platform](#building-a-scrapeboard-and-platform).
* Replace plywood with smaller, square pieces: 4 × [plywood](https://www.homedepot.com/p/203504324) pre-cut to 14x14x3/4" each (oak or birch hardwood recommended)
* Replace metal sheets with [4 × 18-gauge, 12x12" metal sheets](https://www.amazon.com/dp/B09RZMTZBG)
* Replace the 68 × #12 7/8" sheet metal screws with
+ 68 × [#12-24 × 5/8" flat head machine screws](https://www.zoro.com/i/G1631332/)
+ 68 × [#12-24 nuts](https://www.zoro.com/i/G1271146/)
+ 68 × [#12 washers](https://www.zoro.com/i/G0585042/)
* Add [3/4" straight bit](https://www.amazon.com/dp/B07ZC974L1)
* Add [router edge guide](https://www.amazon.com/dp/B0771Y41W6) (recommended)
It is also possible to add latches to the back of the wood if the platform is expected to be taken apart and reassembled frequently. In that case, make the following substitution.
* Replace flat metal brackets with 8 [latches](https://www.amazon.com/dp/B07GKHD61X) and 32 [#4 × 1/4" round head screws](https://www.homedepot.com/p/204275185)
Preparing a computer
--------------------
Choosing the computer depends primarily on whether an Arduino or Raspberry Pi is being used for the electronics. This manual covers both of the following options.
* ordinary desktop or laptop with 2GB or more RAM, along with an Arduino for the electronics
* 2GB RAM or higher Raspberry Pi 4 to run both the game and electronics
### Non-Raspberry Pi
Computers other than Raspberry Pi don't need special preparation before installing the software. They can work as is with an Arduino connected. The OS can be anything that runs Pygame, like a desktop computer or laptop running Windows, OS X, or Linux. The computer can be used like any ordinary computer by downloading the game software and attaching an Arduino, which will connect to the Scrapeboard pad.
### Raspberry Pi
If using a Raspberry Pi, it must have 2GB or higher RAM, and only the Raspberry Pi version 4 has been tested. This manual covers how to install everything from scratch on an empty SD card using a Raspberry Pi OS Lite. A wi-fi or LAN connection for the Pi is necessary.
#### Instructions
##### Imager
![Pi imager home screen](img/pi_imager_home_screen.png)
1. Get the [Raspberry Pi imager](https://www.raspberrypi.com/software/) software and launch it (note: must be run as authorized user)
2. Choose `"Raspberry Pi OS (other)" -> "Raspberry Pi OS Lite (64-bit)"` under `"Operating System"`
3. Connect your SD card and choose it under `"Storage"`
##### Imager settings tab
![Pi imager settings](img/pi_imager_settings.png)
1. Click the gear button to open the settings
2. Check off "Set hostname" and change to "scrapeboard"
3. Check off "Enable SSH" with "Use password authentication"
4. Check off "Set username and password" and choose your own username and password
5. Check off "Configure wireless LAN" and set the SSID and password for your wi-fi network (if wi-fi is unavailable, you can use the Raspberry Pi's ethernet connection or transfer the Scrapeboard files onto the SD card manually later)
6. Check off "Set locale settings" and set to your time zone and keyboard layout
##### Begin installation
Click "WRITE" in the Imager window
#### Boot
1. Insert the SD card into the Raspberry Pi
2. Connect the Pi to an external HDMI display
3. Connect a keyboard
4. Power up the Pi (note: an [official power adapter](https://www.raspberrypi.com/products/type-c-power-supply/) is recommended)
5. Login with the username and password set during installation
6. Optional: run `sudo apt update && sudo apt upgrade` to update the operating system
7. The system is ready for installing the game software and other software requirements
Installing the software
-----------------------
These instructions depend on the operating system, so each section is divided into subsections by OS.
### Software requirements
* [Python 3.7+](https://python.org)
* [Pygame 2+](https://pygame.org)
* [Git](https://git-scm.com/)
* [Scrapeboard + PGFW code repository](https://git.nugget.fun/scrape/scrapeboard)
### Python 3
#### Linux / Raspberry Pi
Most likely Python 3 is already installed. If not, install it from the package manager. For example, on Raspberry Pi, run
sudo apt install python3
#### Windows, OSX, other
1. [Download the appropriate installer](https://www.python.org/downloads/) and follow the system-wide installation instructions.
2. If prompted, choose to install pip (the Python package installer) alongside Python.
### Git
Git is only used for getting the Scrapeboard and PGFW software. It is possible to skip installing Git and download each repository as a ZIP file instead, but that is not covered by these instructions.
#### Linux / Raspberry Pi
Install from the package manager
sudo apt install git
#### Windows, OSX, other
Download and install from <https://git-scm.com/downloads>.
### Pygame
#### Raspberry Pi OS Lite
Full desktop versions of Raspberry Pi OS will run Pygame normally, so this section only applies to Raspberry Pi OS Lite (no desktop).
Raspberry Pi OS Lite is still using Pygame 1 by default. Scrapeboard, however, is made to use Pygame 2, which uses SDL2. It is possible to run it on Pygame 1 with SDL1, but 2 is preferred. For Raspberry Pi OS Lite, there are two options. Either use Pygame 1, or compile a custom version of SDL2.
See the following links for more information on why this is necessary.
* <https://stackoverflow.com/questions/57672568/sdl2-on-raspberry-pi-without-x>
* <https://wiki.libsdl.org/FAQUsingSDL#how_do_i_choose_a_specific_video_driver>
* <https://forums.raspberrypi.com/viewtopic.php?t=248621>
* <https://github.com/sm64pc/sm64ex/issues/37>
* <https://forums.raspberrypi.com/viewtopic.php?t=234087#p1437451>
* <https://github.com/pygame/pygame/issues/3003>
##### Pygame 1.9.6 and SDL 1 workaround
Install Pygame using the package manager, and it will install Pygame 1.9.6 with SDL 1, since these are still considered the stable versions on Raspberry Pi OS.
sudo apt install python3-pygame
In `/boot/config.txt`
1. Comment out the line `dtoverlay=vc4-kms-v3d`
2. Set the framebuffer resolution by adding these lines to the file. The resolution of Scrapeboard is 800x450.
framebuffer_width=800
framebuffer_height=450
##### Pygame 2+ and SDL 2 custom installation
To set the resolution, edit `/boot/cmdline.txt` by adding a custom video definition to the end of the file
video=HDMI-A-1:800x450M@60
Install initial Pygame dependencies
sudo apt install libfreetype6-dev libportmidi-dev libjpeg-dev python3-setuptools python3-dev python3-numpy
Download [SDL2 source](https://github.com/libsdl-org/SDL/releases/). For example, this will download version 2.24.2.
wget https://github.com/libsdl-org/SDL/releases/download/release-2.24.2/SDL2-2.24.2.tar.gz
tar -xf SDL2-2.24.2.tar.gz
cd SDL2-2.24.2/
Enable `deb-src` repositories by uncommenting the `deb-src` lines in `/etc/apt/sources.list`.
Install everything necessary to build SDL2.
sudo apt update && sudo apt build-dep libsdl2
Configure, make, and install
./configure && make && sudo make install
Download and compile [SDL image][], [SDL ttf][], and [SDL mixer][]
wget https://github.com/libsdl-org/SDL_image/releases/download/release-2.6.2/SDL2_image-2.6.2.tar.gz
wget https://github.com/libsdl-org/SDL_ttf/releases/download/release-2.20.1/SDL2_ttf-2.20.1.tar.gz
wget https://github.com/libsdl-org/SDL_mixer/releases/download/release-2.6.2/SDL2_mixer-2.6.2.tar.gz
tar -xf SDL2_image-2.6.2.tar.gz
cd SDL2_image-2.6.2/
./configure && make && sudo make install
cd ..
tar -xf SDL2_ttf-2.20.1.tar.gz
cd SDL2_ttf-2.20.1/
./configure && make && sudo make install
cd ..
tar -xf SDL2_mixer-2.6.2.tar.gz
cd SDL2_mixer-2.6.2/
./configure && make && sudo make install
sudo ldconfig
Build Pygame
git clone https://github.com/pygame/pygame
cd pygame
python3 setup.py -config -auto
python3 setup.py install --user
It may be necessary to configure sound by replacing the contents of `~/.asoundrc` with
defaults.pcm.card 1
defaults.pcm.device 0
defaults.ctl.card 1
#### Linux / non-lite Raspberry Pi
Install pip from the package manager
sudo apt install python3-pip
Install pygame through pip
sudo pip install pygame
#### Windows, OS X, other
[Check if pip needs to be installed](https://pip.pypa.io/en/stable/getting-started/). Use that same link to get instructions on how to install it if necessary. After pip is installed, call it from the command line to install Pygame (using PowerShell or Terminal, for example) and the PIL library.
python -m pip install pygame pillow
### Scrapeboard and PGFW
Use Git clone with the `--recursive` flag to download both the game and framework from the command line (or PowerShell, Terminal, etc.). This can also be done from a Git GUI.
git clone --recursive https://open.shampoo.ooo/scrape/scrapeboard
cd scrapeboard/
### Launch
![Launch from command line](img/launch_from_command_line.png)
It should be possible to run in keyboard mode and test input with key presses now. The `--no-serial` flag is used to indicate keyboard mode.
#### Linux (except Raspberry Pi Lite OS), Windows, OS X
./OPEN-GAME --no-serial
#### Raspberry Pi Lite OS
The `--kms` (Kernel Mode Setting) flag is necessary for running on the lite OS because it doesn't have X-windows.
./OPEN-GAME --no-serial --kms
### Launch Scrapeboard automatically on Raspberry Pi (optional)
An optional, advanced step is to make the game launch at boot time on the Raspberry Pi. First, make the Raspberry Pi skip the login prompt. Use the `raspi-config` script and select `System Options -> Boot / Auto Login -> Console Autologin`.
To launch Scrapeboard at startup, create a file at `/etc/systemd/system/scrapeboard.service` with the following contents
[Unit]
Description=It is Scrapeboard you slime bag
After=multi-user.target
[Service]
ExecStart=/home/tony/scrapeboard/OPEN-GAME --go-to-dir --fb
Restart=always
RestartSec=5s
TimeoutStartSec=2min
[Install]
WantedBy=default.target
and enable it
sudo systemctl enable scrapeboard.service
Now Scrapeboard will launch at startup and will restart itself if it ever is closed or crashes, and it can be controlled through `systemd`
> sudo systemctl start scrapeboard
...
> sudo systemctl stop scrapeboard
Since it restarts automatically when quit with the usual quit button, there is also `SHIFT + q` to permanently quit and get back to the Raspberry Pi console.
Electronics
-----------
![Finished breadboard](img/circuit_finished_breadboard.jpg)
A simple circuit constructed with either an Arduino or Raspberry Pi is necessary to connect the input pads with the game. This image shows the finished circuit connected to a Raspberry Pi.
### Circuit
Four input pins on the microcontroller need to be connected to the game's four input pads, with a 4.7k resistor in each connection. With the program loaded onto the microcontroller, when a connection is made between two pads with any conductive material, they are registered as connected. During each loop of the program, each of the four pads is set to low output while the others are set to high input. The low output pulls down the high input if they are connected, so if an input set high is read as low, that means the two low pins are connected.
#### Arduino
1. Connect pins 2, 3, 4, and 5 to the breadboard using jumper wires
2. Extend each connection using a 4.7k ohm resistor
3. End each connection with a screw terminal
#### Raspberry Pi
1. Connect pins 37, 35, 33, and 31 to the breadboard using jumper wires (these pins are also referred to as GPIO 26, GPIO 19, GPIO 13, and GPIO 6).
2. Extend each connection using a 4.7k ohm resistor
3. End each connection with a screw terminal
### Loading the program
#### Arduino
![Arduino IDE upload](img/arduino_IDE_upload.png)
Download the [Arduino IDE](https://www.arduino.cc/en/software) and connect it to the Arduino. Make sure the Arduino is connected in `Tools -> Port`. Open [serial/serial.ino](serial/serial.ino) in the IDE. Load the program into the Arduino using `Sketch -> Upload`.
#### Raspberry Pi
The electronics program does not need to be loaded separately onto the Raspberry Pi because the code that reads the Raspberry Pi's GPIO pins is built into the game's Python code.
### Testing the circuit
If the game is running on Raspberry Pi Lite OS, the commands below must also have the `--kms` flag (even if using an Arduino with Raspberry Pi Lite).
#### Arduino
Launch the game without any flags to indicate Arduino (or serial) mode. Serial data being output by the Arduino will be read over USB.
./OPEN-GAME
Test the connection between any two screw terminals using a jumper wire, and the lizard should appear on screen.
#### Raspberry Pi
Launch the game with the `--pi` flag to indicate that input is coming through the Raspberry Pi's GPIO pins.
./OPEN-GAME --pi
Test the connection between any two screw terminals using a jumper wire, and the lizard should appear on screen.
Building a Scrapeboard and platform
-----------------------------------
The controller hardware has two main parts:
* a custom built platform
* the scrapeboard (a modified skatedeck)
![Board and platform assembled](img/scrapeboard_and_platform_assembled.jpg)
The platform consists of four metal plates, usually mounted to wood, that must be capable of supporting the weight of a person and should not move even under constant friction. The scrapeboard is a regular skatedeck with two round metal pads on the underside (near where the trucks are usually attached) connected together by a thin metal strip.
This manual describes how to use four pieces of plywood as the base for the metal plates. However, it is not necessary to use any specific base, as long as the metal plates are spaced correctly, don't move, and allow the round metal pads on the scrapeboard to scrape over them. The metal could be fastened directly to the floor or a single piece of plywood if the platform doesn't need to be portable.
An optional compact and flush version of the platform can be built with smaller metal plates by carving channels for the plates, brackets, inner screws, and wiring using a router. These channels can help with durability and portability and will make the surface smooth and flush, but they are not necessary for creating a working platform. Steps for doing this are included, but they are marked as optional.
![Underside routing](img/underside_routing.jpg)
The electronics are assumed to be installed in front of the platform, near where the screen is. If installing the electronics behind the platform, adjust wire lengths and wire channel orientations.
### Terminology
To avoid confusion between similar parts, the following terms are used:
* *Platform*: all four panels
* *Panel*: a single piece of the four panel platform, a piece of wood with a single metal plate attached
* *Plate*: the metal part of the panel by itself
* *Pad*: one of the two metal anchor rings on the underside of the scrapeboard
### Platform
![Finished platform](img/platform_finished.png)
The platform for a standard Scrapeboard build consists of four evenly spaced metal plates, spaced 4" apart. The metal plates can be mounted in any manner, as long as they are firmly attached. This manual describes how to mount the metal to four pre-cut pieces of plywood and bracket the pieces together. It also describes how to use a router to inset the metal parts and wiring, but those parts are optional.
#### Measuring
![Metal plate outline](img/metal_plate_outline.jpg)
<img src="img/platform_measuring_plate.gif" />
First, measure an outline for the metal, making sure to keep the correct amount of space between the metal plates, close enough together that diagonal moves will register but far enough apart that a single round metal pad on the scrapeboard won't be able to touch two plates simultaneously. Since the round metal pads for the scrapeboard are just under 4" in diameter, the metal plates should be around 4" apart. This can be adjusted if the round metal pads are slightly different in diameter.
1. For each of the panels, measure 2" inward from the two inner edges, going along each edge, marking off 2".
2. Draw a line parallel to the edge of the wood piece on each of the two inner edges. These lines mark where the metal plate should be attached.
#### Inset (optional)
![Insetting metal plate](img/platform_inset_plate.webp)
In order to get the metal plates flush with the platform, it is necessary to remove a thin layer of wood from where the metal will be attached. A router can be used to cut away a thin layer from all parts of the wood other than the cross section between the metal plates (everything other than the 2" previously measured on each piece).
1. Insert a 3/4" diameter straight bit into the router.
2. Adjust the router depth to match the thickness of the metal, so the surface of the metal will be flush with the wood. For example, if using 18-gauge metal plates, set the router depth to 1/16". This is done to ensure the edges of the metal won't get caught on the scrapeboard and pried from the wood.
3. On each panel, route two straight channels into the wood, one along each inside part of the lines previously drawn where the metal will be set. Use a router edge guide if possible to make a straight cut.
4. Use the router to remove the rest of the wood between the channels and the edge of the wood, leaving only the cross section. In the end, there should be a recess the metal plate can be placed into on each panel.
#### Machine screw routing (optional)
Using machine screws and nuts to fasten the metal to the wood has a few advantages over drilling the metal directly into the wood with wood or sheet metal screws. Since machine screws and nuts can be regularly tightened, there is a better chance of them keeping the metal firmly in place throughout the lifetime of the platform, even under heavy friction. Also, if the screws ever need to be removed and reinserted or the metal needs to be replaced, the machine screws can easily use the same holes, whereas regular sheet metal screws may have trouble with the holes stripping over time.
Using machine screws requires routing which will allow washers and nuts to be used on the underside of the platform to keep the machine screws tightened in place.
##### Inner screws (optional)
![Routing screw channels](img/platform_machine_screw_channels.webp)
For the inner two rows of machine screws (parallel to the cross section of wood), create two 3/4" channels on the underside of each panel.
1. Insert a 3/4" diameter straight bit into the router.
2. On each panel, using the lines already measured into the top of the panel, measure out 3/4" wide channels on the underside of the panel along the two inner edges under each metal plate. The channels should each start at the edge and come 3/4" inward. The line marking the outer edge of each channel can be started by drawing a line along the side edge of the panel, connecting the top of the panel with the bottom, indicating on the bottom where the metal edges are. Draw lines from the mark straight in along the bottom of the panel to indicate where to route.
3. Adjust the depth of the router to 5/16".
4. Use the router to carve two channels with the outside of each channel along the lines drawn.
##### Outer screws (optional)
For the screws along the edge of the platform, each screw will need its own routed inset on the underside of the panel. Each screw is routed individually to avoid routing full strips of wood off the edges of the underside, which would cause the wood to crack under the player's weight.
1. Measure and mark points where the screws will emerge. These points will correspond with points on the metal where the screws will be inserted. The marks should be 3/8" in from the edge of the wood and evenly spaced. Note that if the metal plates do not come up to the edge of the wood, the marks may need to be more than 3/8" in. The outermost corner screw should be spaced differently because it would be too close to the corner to route away the wood. For the corner screw, move the mark inward half the distance toward its neighboring screw along the edge corresponding to either the front or back of the platform.
2. Using the same router bit and depth from the previous step, route 3/4" channels in from the edge of the wood, one for each screw, each channel going in about 3/8" past the screw mark to give room to the washer and nut.
#### Wire preparation
![Stripped wire endings](img/stripped_wire_endings.jpg)
There will be four wires total, one for each metal plate. They should be cut long enough to reach the Arduino or Raspberry Pi. To have them all terminate at the same point, the back two panels should have longer wires than the front two.
1. Measure the distances between the Arduino or Raspberry Pi and each metal plate. This will vary depending on the setup, and it is a good idea to measure extra distance.
2. Cut wire at the measured distance for each plate.
3. For each wire, at one end use wire strippers to cut off the sheathing and expose 1/4" of wire. These ends will be inserted into the screw terminals.
4. For each wire, at the other end, use wire strippers to cut off the sheathing and expose 2" or more of wire. These ends will be attached to the metal plates.
#### Metal plates and wire connections
![Drilling in metal plate](img/platform_metal_plate.webp)
The metal plates must be screwed into the platform, leaving the measured cross section of bare wood between them. The wires must be attached to the metal plates. To fasten the metal plates to the wood, 16 screws are used per plate, all along the edges, 3/8" inward from the edge.
Each screw head should be flush with the metal, leaving the surface of the metal smooth even at the edges. To do this, a countersink must be made for each screw head. For 1/8" thick metal, the countersink can be directly in the metal. For 18-gauge metal, the countersink will be in the wood, and the metal will be pulled into the countersink when the screws are tightened.
1. On each panel, place the metal plate along the measured lines.
2. Each of the screws should be 3/8" away from the edge of the metal. Mark points for the screws so they are evenly spaced around the edge of the metal. With one mark at each corner, there should be two marks between the corners on the short edges, and four marks between the corners on the long edge.
3. *(if using machine screws)* If the optional machine screw routing steps were done earlier, the outermost corner screw mark should be brought inward along the edge corresponding to either the front and back of the platform, half the distance to its neighboring screw mark.
4. *(if using sheet metal screws)* Insert a 7/64" drill bit into the drill. Pre-drill a hole for each screw through the metal and into the wood at each mark. The hole should only go a bit into the wood.
4. *(if using machine screws)* Insert a __" drill bit into the wood. Drill a hole all the way through the wood and out the underside for each mark. Each hole should emerge in the center of its channel on the underside.
5. *(if using 1/8" thick metal)* Use either a countersink bit or a thick drill bit to drill a countersink the same circumference as the screw head slightly into the metal, just enough for the screw head to be inserted into the metal.
5. *(if using 18-gauge metal)* Use either a countersink bit or a thick drill bit to drill a counter sink slightly larger than the circumference of the screw head into the wood, just deep enough so that the metal will bend into the countersink after the screw is inserted and tightened from the underside.
6. Insert a screw into each hole and drill it in. If using sheet metal, include a washer at the corner screw, and carefully wrap the wire around the screw, under the washer before drilling.
7. *(if using machine screws)* Flip the panel over. The screws should be sticking out of the bottom of the panel. Place a washer over each screw and screw a hex nut onto the screw by hand. On the outermost corner, carefully wrap the wire around the screw before attaching the washer and nut. Holding the panel on its side, use pliers to hold each nut in place while using the drill on the top side to tighten the screw. The screw should push the metal into the wood countersink, leaving the metal surface flush.
#### Brackets
The brackets should be attached to the underside of the platform. They are necessary for holding the panels together. With 8 - 12 evenly spaced brackets, the panels will hold together firmly. The brackets may be inset into the wood using a router. If using the clasp style brackets, the insetting is necessary. Ordinary flat brackets can be either inset or not.
1. Flip the platform on its backside, with all four panels arranged in their proper orientations.
2. Along the cross section seam, place the brackets so they are evenly spaced, covering as much area as possible, without getting too close to the edge or the center.
3. *(if routing)* Trace around the bracket to mark where to route the wood. If using the clasp style brackets, leave some extra room in the outline.
4. *(if routing)* Use the router to carve a channel in the shape of the bracket. The router depth should be set to the thickness of the bracket. If using the clasp style latches from the supply list, the router depth will be 3/8". After routing, put the brackets back in place.
5. *(if using clasp style brackets)* In order to get a tight hold, the two sides of each bracket should be drilled so they are very slightly farther apart than the neutral state they come in, separated about 2mm farther. To do this, first draw pencil marks where the holes would be in the neutral position. Then, unclasp the bracket, and move each side back about 1mm.
6. Directly drill the brackets into the wood using the appropriate screws. For the clasp style brackets, these will be the #4 1/4" screws.
7. *(if using clasp style brackets)* Clasp the brackets and ensure they are able to close and hold tightly. If not, remove the screws, adjust their positions, and drill them in again until the brackets are tight.
#### Non-slip padding (optional)
The non-slip padding is necessary on many surfaces to keep the platform from slipping. If the platform is placed on a very non-slippery surface like carpet, it may not be necessary. The non-slip padding can be attached to the underside of the panels or it can be placed on the floor between the platform and floor.
1. On each panel's underside, measure areas for non-slip padding to attach. If there are channels from routing, either measure around the channels or include them in the measurement and cut off the non-slip padding over the channels after attaching it. Depending on how the padding is going to be applied and the size of the non-slip padding material, this may mean making multiple measurements or one big measurement. Either way, measure so the padding covers as much area as possible while allowing the panel to rest as flat as possible on the ground.
2. Cut the non-slip padding material into the shapes measured.
3. Apply carpet tape to the back side of each piece of non-slip material.
4. Firmly press each piece of non-slip material into its measured place on the underside of the panel.
#### Connecting
The platform is now finished. It can be connected to the Arduino or Raspberry Pi and tested before moving on to building the board.
1. Carefully flip the platform back over, taking care near the seams because the underside bracketing can make it susceptible to snapping.
2. For each wire, insert its far end into its appropriate screw terminal. Going clockwise from the top left plate, for Arduino, the wires connect to pins 2, 3, 4, and 5. For Raspberry Pi, the wires connect to pins 37, 35, 33, and 31 (also known as GPIO 26, GPIO 19, GPIO 13, GPIO 6).
3. Use any metal conductor to touch one metal plate to another. The lizard should appear on the screen.
### Scrapeboard
The standard scrapeboard is a skatedeck with two round metal pads drilled into either end of the bottom. The pads are connected by a flat metal strip, creating a conductive contact across the length of the underside of the board. The recommended metal pads to use are actually anchor rings, ordinarily used to hook cargo to a tow cable. They are used because their unique disk shape and slightly raised edges allow for the best motion with the board. The board is subject to a lot of friction and pressure, so it's recommended to follow this manual unless intending to build a heavily modified version of the controller.
#### Metal strip
The metal strip is used to connect the metal pads so the signal can be conducted from one to the other. The strip should be attached to the underside, in the middle, running from one metal pad to the other. The metal pads will then be drilled on top of it.
1. Measure and mark on the underside of the skatedeck where the center of the metal pads will be. They should each be about 1" in from the center of the truck holes.
2. Measure a length of metal strip so the strip will go from one center to the other.
3. Drill the wire strip directly into the underside of the board using the 1/2" sheet metal screws, distributing the screws evenly and covering as much area along the length of the strip as possible.
#### Metal pads
The metal pads are attached on the underside of the skatedeck, slightly closer together than the truck holes, and held in place by machine screws and nuts.
1. If using the recommended anchor rings, first remove the ring from the base. Pry up the center flap slightly with a screwdriver or other tool, and the ring should slide out.
2. Use a hammer on the center flap to flatten it as much as possible.
3. For each metal pad, place it directly in the center of the underside, with its center about 1" farther toward the center of the board than the truck holes. The center hole of the pad should be directly above the metal strip, ideally lined up with an existing hole in the strip. If the hammering of the center flap caused the hole to move off center, it is fine to leave the hole off center a bit.
4. Insert a 1/4" drill bit into the drill.
5. The center hole of the anchor can be used as a drill point. Drill a hole through the wood so that the #12-24 5/8" machine screw can fit snugly through. The hole should also pass through the metal strip.
6. Use a countersink bit or large drill bit to create countersinks for each screw on the top of the board. These will prevent the screw head from sticking out of the board. They will also allow the 5/8" machine screws to stick out on the underside just enough to attach a nut. Each countersink can go through the grip tape and slightly into the wood.
7. Insert the machine screw from the top of the deck through the underside. Attach a nut to the underside and tighten with a wrench or pliers and screwdriver. If the screw is not sticking out far enough, repeat step 6 with a deeper countersink.
8. Two more holes need to be drilled into the metal on either side of the center hole, through the wood, and out the other side of the deck. The holes should be on the opposite sides of the metal strip (not going through the strip). For each hole, spray some WD-40, then drill all the way through both the metal and wood.
9. Repeat step 7 for the new holes.
#### Connect
The board and entire build should now be complete. Try placing the board on two metal pads. The lizard should appear on the screen.
[SDL mixer]: https://github.com/libsdl-org/SDL_mixer/releases
[SDL ttf]: https://github.com/libsdl-org/SDL_ttf/releases
[SDL image]: https://github.com/libsdl-org/SDL_image/releases
[Erickson surface mount anchor ring #9100]: https://ericksonmfg.com/product/surface-mount-anchor-ring-3/
[1]: https://www.amazon.com/s?k=erickson+9110
[2]: https://www.ebay.com/sch?_nkw=erickson+9110
[3]: https://store-usa.arduino.cc/collections/boards/products/arduino-uno-rev3
[4]: https://www.raspberrypi.com/products/raspberry-pi-4-model-b/

BIN
doc/img/clasps.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 390 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 313 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 MiB

BIN
doc/img/outer_screw_routing.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 MiB

@ -1 +1 @@
Subproject commit 9c9926d9e04a15cf3612d0594a5e19e79682a619
Subproject commit 2bbdc9a7028dd86c8a2f06a74403ffc5a1fe6d44