# Playing Celeste on a Raspberry Pi 2B/3B [![](https://i.imgur.com/LkxhI9l.png)](https://youtu.be/iTBUNb6IKHo) Many thanks to Sebastian for writing [this article](https://magazine.odroid.com/article/playing-modern-fna-games-on-the-odroid-platform/) which inspired me to do this project. And many thanks to [Ethan Lee](https://twitter.com/flibitijibibo) for creating [FNA](https://fna-xna.github.io/) and ported Celeste to it! Check out [this video](https://youtu.be/iTBUNb6IKHo) for a gameplay demo! I did a stream where I followed this guide and installed Celeste on a RPi 2B, check it out [here](https://www.twitch.tv/videos/446954756)! Performance is worse than on a RPi 3B though ;) Good luck! ## Before you start ![](https://i.imgur.com/cY2rFoi.jpg =500x) This guide assumes you have experience with Linux and the command line. * A Raspberry Pi 2B or better, running Raspbian (I use Raspbian Buster with desktop) with a microSD card that's at least 8 GB. I have tested 2B and 3B and confirm that they work. * You need to get [Celeste from itch.io](https://mattmakesgames.itch.io/celeste). The Steam version requires SteamWorks and won't work on ARM. * A monitor (HDMI, composite (untested) or the official Raspberry Pi Touch Screen) * An input device (keyboard or controller) * A network connection (everything can be done over SSH) * Pi booted to desktop (X11 needs to be running) * An account at FMOD to access the API libraries. A hobby/non-commercial license is enough. FMOD is the audio library used by the game. Install the following packages with apt: `mono-runtime libsdl2-image-2.0-0 mercurial cmake re2c nim` ## Step 1. Download and extract the game Buy the game from [itch.io](https://mattmakesgames.itch.io/celeste) and download the Linux version. Transfer the zip to the pi using your file manager or using scp/rsync. Extract the game to `/home/pi/Celeste`: ```bash unzip /path/to/celeste-linux.zip -d ~/Celeste ``` ## Step 2. Enable the v3d OpenGL driver, increase gpu memory allocation, increase swap size, set resolution Open `/boot/config.txt` and add the following to the `[all]` section like this: ```toml [all] # set this low so the CMA can be set high gpu_mem=16 # the kms driver doesn't seem to work, fake kms it is dtoverlay=vc4-fkms-v3d ``` Open `/boot/cmdline.txt` and append the following after `rootwait`: ``` cma=730M ``` 732 MB is the highest I could manage it to allocate, so go with 730 MB. Let's increase the swap. Open `/etc/dphys-swapfile` and set `CONF_SWAPSIZE` to to 700 or higher. This will allocate 700 MB of swap space on the microSD card on next boot. This is needed because we allocate much of the RAM to the GPU, and should improve stability. Make sure you have enough free space on the card before doing this. Disable the desktop wallpaper if you want. Change the desktop resolution to 1280x720 or lower. The game will run smoother and more stable on lower resolutions. The RPi touch screen is 800x480 which works very well. Now let's reboot! `sudo reboot` ## Step 3. Download and install libraries Log in to your FMOD account and go to [the FMOD Studio API download page](https://www.fmod.com/download#fmodstudio). Choose version 1.10.15 in the second dropdown and click Download on the row with the Linux logo. Run this to extract the armhf FMOD libraries: ```bash cd ~/Celeste mkdir -p librpi tar xvf /path/to/fmodstudioapi11015linux.tar.gz -C librpi fmodstudioapi11015linux/api/studio/lib/armhf fmodstudioapi11015linux/api/lowlevel/lib/armhf --strip=5 ``` Let's download and build [mojoshader](https://hg.icculus.org/icculus/mojoshader). ```bash cd ~/Celeste hg clone https://hg.icculus.org/icculus/mojoshader cd mojoshader mkdir -p build cd build cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_SHARED=ON -DDEPTH_CLIPPING=ON -DFLIP_VIEWPORT=ON .. make -j4 cp libmojoshader.so ~/Celeste/librpi/ ``` <!-- Remove some unneeded dlls. ```bash cd ~/Celeste rm -vf mscorlib.dll System.*dll rm Mono.*.dll ``` --> ## Step 4. Create a launch script and try the game Create the file `/home/pi/Celeste/Celeste.sh`: ```bash #!/usr/bin/env bash cd "${0%/*}" rm -f mono_crash.*.json export DISPLAY=${DISPLAY:-:0} LD_LIBRARY_PATH=librpi exec mono Celeste.exe ``` Make it executable: `chmod +x ~/Celeste/Celeste.sh` Now let's see if the game starts! ```bash ~/Celeste/Celeste.sh ``` To enable an fps counter/graph overlay, use the environment flag `GALLIUM_HUD=fps` After a while you should see a fullscreen window. Hit C or Enter some times and you should get to the menu eventually. It will look quite bad since we need to fix the textures. If using SSH, press Ctrl+C to exit the game or Alt+F4 if using the Pi directly. At the end of this guide I'll show you how to create a launcher for the menu/desktop so you don't have to start it from the terminal. ## Step 5. Fixing the texture atlases ![](https://i.imgur.com/EEnKjwa.jpg =400x) Time to fix those textures! The problem with them is that they are too big for the Raspberry Pi 3 to handle. It can only handle up to 2048x2048 pixels, while the Celeste texture atlases are 4096x4096. This will not fix every texture in the game. There are other artwork textures that are simply too big to be shrinked by repackaging. They would need scaling down, and I'm not sure if that's possible. They appear when you complete a chapter in Celeste, so you'll see mostly black. I don't own a Raspberry Pi 4 yet, but hopefully it supports higher resolution textures, and would make this step unnecessary. Download and compile my [Celeste Texture Atlas Shrinker](https://github.com/daniel-j/celeste-textureshrinker) tool: ```bash cd ~/Celeste git clone --recursive https://github.com/daniel-j/celeste-textureshrinker.git cd celeste-textureshrinker ./build.sh ``` Now, move the texture atlases to the input directory and convert them! ```bash mv ~/Celeste/Content/Graphics/Atlases/{Gui,Journal,Checkpoints,Gameplay}* input/ ./celestetextureshrinker ``` This creates the output directory. Let's move the new ones back to the game directory: `mv output/* ~/Celeste/Content/Graphics/Atlases/` You should be good to go now! ## Step 6. It's showtime! You're all set now, launch the game! ``` ~/Celeste/Celeste.sh ``` If you see a big mountain and text in the menu, grab a controller, some raspberries/strawberries and enjoy Celeste! 🍓 ## Step 7. (Optional) Add a shortcut in the menu/on the desktop If you like using the Raspberry Pi as a desktop computer, you might want to be able to launch the game without having to use the terminal. Here's how: Create a new file with the following content: ```ini [Desktop Entry] Version=1.0 Name=Celeste Categories=Game; Exec=/home/pi/Celeste/Celeste.sh Icon=/home/pi/Celeste/Celeste.png Terminal=false Type=Application ``` Save it as `~/.local/share/applications/celeste.desktop` and make it executable: `chmod +x ~/.local/share/applications/celeste.desktop` If you want to have a desktop launcher: `cp ~/.local/share/applications/celeste.desktop ~/Desktop/celeste.desktop` ## Known issues * Some textures don't get rendered, because limited hardware capabilities. Here is an example (click to see how it should look): [![](https://i.imgur.com/cWCIuFi.png =300x)](http://www.celestegame.com/images/completes/complete-1.png) * Something in the chapter Reflections, start of section Lake tanks the performance, it's probably something shader-heavy like the water or lighting. * I have noticed the game to occationally hang or stutter, but it goes away after a short moment. * The feather sequence has bad performance. * The skybox doesn't render behind the 3D mountain. If you find any issues with this guide, or the game using these settings, feel free to contact me below and I'll update it! *-- djazz* &nbsp; You can reach me at: Discord: djazz#0147 Twitter: [@daniel_hede](https://twitter.com/daniel_hede) Twitch: [daniel_hede](https://www.twitch.tv/daniel_hede/)