# Playing Celeste on a Raspberry Pi 2B/3B [![](https://i.imgur.com/LkxhI9l.png)](https://youtu.be/iTBUNb6IKHo) If you have a Raspberry Pi 4, [check out this guide instead.](https://hackmd.io/@djazz/Sysdqjva8) 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 with atleast 1GB RAM. I have tested 2B and 3B and confirm that they work. * Raspberry Pi OS on a microSD card that is at least 8 GB. * An Internet connection to the Raspberry Pi * You need to buy [Celeste on itch.io](https://mattmakesgames.itch.io/celeste). The Steam version won't work. ## Step 1. Increase gpu memory allocation, increase swap size, set resolution First we change the GPU memory allocation. The FKMS v3d driver should already be enabled by default, add the dtoverlay line if it isn't already there. 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 # add this line if it's not already here dtoverlay=vc4-fkms-v3d ``` Open `/boot/cmdline.txt` and append the following after `rootwait`: ``` cma=600M ``` 732 MB is the highest I could manage it to allocate, but it works with 600 MB. Let's increase the swap. Edit `/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. 1920x1080 is too high and the game will suffer in performance. The RPi touch screen is 800x480 which works very well. Now let's reboot! `sudo reboot` ## Step 2. Download and extract the game If you haven't already, buy the game from [itch.io](https://mattmakesgames.itch.io/celeste). Go to [your library](https://itch.io/my-collections) and download the Linux version. At the time of writing, Celeste's version number is 1.4.0.0 (Mar 29, 2021). Extract the game to `~/Celeste`: ```bash unzip ~/Downloads/celeste-linux.zip -d ~/Celeste ``` ## Step 3. Download and install libraries Run the following command to install the Mono runtime and SDL2. ```bash sudo apt install mono-runtime libsdl2-2.0-0 libsdl2-image-2.0-0 ``` Download the following file to your Downloads directory. This contains some native dependencies not available through the package manager, and a new launch script. https://github.com/daniel-j/fnalibs-celeste/releases/download/v211028.1/fnalibs-celeste-libarmhf.tar.gz *If you want to build it yourself, check out [the repository](https://github.com/daniel-j/fnalibs-celeste).* Extract it to `~/Celeste`: ```bash tar xvf ~/Downloads/fnalibs-celeste-libarmhf.tar.gz -C ~/Celeste ``` <!-- Remove some unneeded dlls. ```bash cd ~/Celeste rm -vf mscorlib.dll System.*dll rm Mono.*.dll ``` --> ## Step 4. Try the game Let's see if the game starts! ```bash ~/Celeste/Celeste.sh ``` 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 textures ![](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 2 or 3 to handle. It can only handle textures 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. The Raspberry Pi 4 does not have this issue, it supports higher resolution textures, and makes this step unnecessary. See the link at the top for the Pi 4 guide. Download and compile my [Celeste Texture Atlas Shrinker](https://github.com/daniel-j/celeste-textureshrinker) tool: ```bash sudo apt install mercurial cmake re2c nim 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 ../Content/Graphics/Atlases/{Gui,Journal,Gameplay}* input/ ./celestetextureshrinker ``` This takes a very long time. Now let's move the new texture atlases back to the game directory: `mv output/* ../Content/Graphics/Atlases/` Leave the texture shrinker directory: `cd ..` 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) YouTube: [djazz](https://www.youtube.com/channel/UCoak0PlSYIv9PA-iMqqqa1Q)