HamSandwich is a collection of working source code for several of Hamumu Software's titles. Running HamSandwich requires assets from official versions of the games, available for free from https://hamumu.itch.io/.
The original code releases on which this project is based are available on hamumu.com.
Saves and profiles from the retail versions of the games are fully compatible with HamSandwich saves, except that controls will need to be reconfigured.
The recommended way to compile the games is MinGW on Windows. The following platforms also have various levels of support:
Platform | Toolchain | Status | Notes |
---|---|---|---|
Windows | MinGW | Primary | CI: Appveyor |
Linux | GCC | Primary | CI: Appveyor |
Browser | Emscripten | Secondary | Play now |
Windows | MSVC | Secondary | CI: Appveyor |
Windows | Clang | Tertiary | No app icons |
Linux | Clang | Tertiary | |
Android | NDK | Tertiary | Incomplete |
First-time setup:
- Install MSYS2, an environment for compiling C++ code.
- Visit https://www.msys2.org/ and download and run the latest "msys2-x86_64" installer.
- Choose a relatively short path with no spaces (say,
C:\msys64
orD:\tools\msys2
). - After installation finishes, run
pacman -Syu
in the console that opens. - When asked to do so, close the console and reopen it from the Start Menu (MSYS2 64bit > MSYS2 MinGW 32-bit).
- Run
pacman -Syu
again.
- Use
cd
to select the directory where HamSandwich will go.- For example, if you want the code to go in
C:\projects\HamSandwich
, runcd C:\projects
.
- For example, if you want the code to go in
- Run
pacman -S git
to install git, a tool used for source code collaboration. - Run
git clone https://github.com/SpaceManiac/HamSandwich
to download the code. - Run
cd HamSandwich
to enter the directory.
Compiling and running:
- Run
./run
to see a list of games in the project, and use./run <project>
to compile and play.- For example, to run Supreme With Cheese, write
./run supreme
. - To compile without running, write
make
ormake <project>
. - The first time you try to run a game, you will be prompted to download its installer from https://hamumu.itch.io/; follow the instructions shown.
- For example, to run Supreme With Cheese, write
- Run
git pull
to fetch changes which have been published here.
- Double-click
tools/msvc/Generate VS2019 Solution.bat
, or:- Download dependencies by running
powershell tools/msvc/install-dependencies.ps1
. - Run
build/premake5.exe vs2019
(or appropriate VS version) to generate the solution files.
- Download dependencies by running
- Open and compile
build/msc-v142/HamSandwich.sln
in Visual Studio.- For command-line builds, run
msbuild build/HamSandwich.sln /p:Configuration=debug /p:Platform=Win32
.
- For command-line builds, run
- Use installers from https://hamumu.itch.io/ to extract game assets to
build/game/<project>
. - Debug from within Visual Studio to launch a game.
- Install dependencies (handled automatically on Ubuntu, Arch):
- premake-5.0.0-alpha16-linux.tar.gz from https://github.com/premake/premake-core/releases/tag/v5.0.0-alpha16.
- 32-bit G++ (or Clang) toolchain.
- 32-bit SDL2, SDL2_mixer, and SDL2_image development packages.
- 7-Zip and Innoextract to extract game assets.
- Use
make
and./run
as described above to build and run the games.
- If on Windows, install and use MSYS2 according to the instructions above.
- The Emscripten SDK will be installed automatically, or you can do so
manually:
cd
to a convenient directory.git clone https://github.com/emscripten-core/emsdk.git
cd emsdk
./emsdk install latest-upstream
./emsdk activate latest-upstream
source ./emsdk_env.sh
- Return to the HamSandwich directory.
- Run
./run <project> --web
to run the build and open the result in your browser.
Bundling assets (worlds, music, graphics, etc.):
- Commit your assets to a subfolder in the repository of your choosing.
- In the appropriate project's section in
premake5.lua
, add a line pointing to your assets:assetdirs "your_asset_folder"
Publishing on GitHub Pages:
- Edit
.github/workflows/publish-pages.yml
file and change thedistribute-web.sh
line to include only the project or projects you wish to publish. - Push your changes to GitHub and wait for the build to be prepared.
- In your GitHub repository's Settings > Options tab, GitHub Pages section, change the "Source" from "None" to "gh-pages" and click "Save".
- Your site will be published at
https://yourusername.github.io/HamSandwich
- Future pushes will automatically update your site.
Publishing manually:
- Run
tools/build/distribute-web.sh <project>
.- You can supply multiple projects to build them together, or leave off
- You can leave off the project identifier
- Upload the contents of
build/webroot/
.
- If on Windows, install and use MSYS2 according to the instructions above.
- Install Gradle and the Android SDK and set
ANDROID_HOME
.- Example shell command:
export ANDROID_HOME='C:\Wherever you installed the Android SDK\'
- Example shell command:
- Run
./android <project>
to compile APKs.- For example, to build Supreme With Cheese, write
./android supreme
- For example, to build Supreme With Cheese, write
- Run
./android --install <project>
to install to a connected Android device. - To view logs, run
./android --logcat