Skip to content

Running From Source

Noah-C-S edited this page Apr 2, 2021 · 7 revisions

Running SlippiMusic from the source code

The source code is more portable and more trustworthy than the executables that I've built for this program. While I can promise to you that I created the executables from the source code you see in this repo, this is pretty difficult to prove, so if for whatever reason you don't trust me (or if your antivirus flags it or something), then you can run the source code and know exactly what you're executing. Additionally, I only have builds for Windows and Linux, and for Linux I obviously haven't tested the executable on every distribution, so it's possible that there are distros such that the source code works and the executable doesn't. I also don't have a build for MacOS despite making sure that the source code works on the operating system, primarily because the process of releasing an executable on MacOS is much more complicated than on other systems; I believe I would need to make it into a .App and then I would need to sign it with a signature backed by a licensed certificate authority (or maybe not?), the latter of which doesn't seem very well documented online. I might figure it out on my own eventually, but if you know anything about releasing executables on MacOS, feel free to reach out to me. Until then, since this program is written in Python, it's actually very easy to run from the source code itself.

Prerequisites

First, you will need Python installed on your computer. I developed and tested this using Python 3.9, but other versions might work as well. If it doesn't work with an older or newer version, try using Python 3.9.
The next thing you should do is install the dependencies using pip, which comes with Python if you used the installer. The dependencies are pygame (this is the best way to play music with Python for some reason), pyenet, and for versions lower than 1.2, numpy. The actual versions should be even less important than the version of Python, but the ones I used are pygame 2.0.0, pyenet 1.3.14, and numpy 1.19.3.
I'm going to write these instructions mostly for MacOS, but it's basically the same for Windows and Linux. The main difference is with Windows where you run the console in "admin mode", and pip3 or python3 can be replaced by pip and py respectively.
First, open a terminal (command prompt in Windows) window. On Mac, this can usually be found in your /Applications/Utilities folder.
Next, run (just type it into the window and then press enter) the commands:
pip3 install pyenet
pip3 install pygame
You will also need to use pip to install numpy for versions older than 1.2. The first time you use sudo, it will ask for your password. It means "super user do" and essentially runs the command with elevated privileges. Pip is a very well-known and trusted program, so I wouldn't worry about running it with this kind of access.

Actually running the program

Once you've done all that, you should be able to run the program. Download the source code from one of the releases and extract it somewhere on your computer. First, set up all of the settings and music just like if you were using the executable version by filling in the fields in the melee/config.txt file. Next, in your terminal window, navigate to whichever folder you put it in by running cd absolute/path/to/folder/slippiMusic.py/is/located. You can also use relative paths. cd .. brings you to the parent directory (so moves one folder up in your file system) and ls (dir on Windows) will tell you which files and other folders are located in whatever folder you're in. Once your terminal is in the directory containing slippiMusic.py, just run python3 slippiMusic.py and it should work.
You can also run it from any directory by running python3 absolute/path/to/slippiMusic.py.

Setting up double-clicking to run SlippiMusic

It would be a pain to have to open up the terminal window every time you wanted to play Melee. However, running the source code from a desktop icon is easy as well. Just make a text file in the same directory as slippiMusic.py and type python3 slippiMusic.py into it. Then, change the file extension of the text file to .sh (.bat on Windows), so something like slippiMusic.sh, and then double click on that file and it should run slippiMusic. You should be able to make a desktop shortcut for that file as well.
Let me know if you can't figure something out here or if you get any errors that you can't fix.

Clone this wiki locally