2017-02-05 23:33:40 -08:00
# OpenSpades [![Build status](https://travis-ci.org/yvt/openspades.svg?branch=master)](https://travis-ci.org/yvt/openspades) [![All releases downloads](https://img.shields.io/github/downloads/yvt/openspades/total.svg)](https://github.com/yvt/openspades/releases) [![Latest release](https://img.shields.io/github/release/yvt/openspades.svg)](https://github.com/yvt/openspades/releases) [![Crowdin](https://d322cqt584bo4o.cloudfront.net/openspades/localized.svg)](https://crowdin.com/project/openspades)
2017-01-08 07:25:19 -08:00
2014-03-11 00:56:20 -07:00
2017-02-18 02:15:28 -08:00
![OpenSpades banner ](https://openspadesmedia.yvt.jp/brand/OpenSpadesBanner.jpg )
2016-11-06 03:59:15 -08:00
2018-10-15 12:44:34 -07:00
[Official website ](https://openspades.yvt.jp ) — [Download ](https://github.com/yvt/openspades/releases ) — [Community ](https://buildandshoot.com ) — [Trello board ](https://trello.com/b/3rfpvODj/openspades-roadmap )
2016-11-06 04:15:53 -08:00
2016-11-22 11:20:27 -08:00
## What is it?
2013-09-03 19:21:12 -07:00
OpenSpades is a compatible client of Ace of Spades 0.75.
2013-08-18 00:55:06 -07:00
* Can connect to a vanilla/pyspades/pysnip server.
2016-11-06 03:59:15 -08:00
* Uses OpenGL/AL for better experience.
2013-08-18 00:55:06 -07:00
* Open source, and cross platform.
2016-11-22 11:20:27 -08:00
## How to Build/Install?
2016-11-22 11:31:07 -08:00
**Before you start:** In case you're having issues to build OpenSpades, it may be because this README file is outdated, if so:
1. See the [Building Guide ](https://github.com/yvt/openspades/wiki/Building ), which may be up to date
2. Or [open an issue ](https://github.com/yvt/openspades/issues ) if the problem persists
2013-08-18 00:55:06 -07:00
### On Linux
2019-04-13 21:17:51 -07:00
2017-05-03 12:30:53 -07:00
#### Snap package
On [snap enabled ](https://snapcraft.io/docs/core/install ) systems, the latest pre-built stable release of OpenSpades can be installed with:
2017-05-03 02:17:50 -07:00
2017-05-03 12:30:53 -07:00
```bash
2017-08-22 16:00:06 -07:00
sudo snap install openspades
2017-05-03 12:30:53 -07:00
```
2019-04-13 21:17:51 -07:00
Once installed, you'll be able to launch OpenSpades from inside the desktop menu or from your terminal with the `openspades`
2019-04-06 19:38:24 -07:00
#### Flatpak package
On [flatpak enabled ](https://flatpak.org/setup/ ) systems, OpenSpades can be installed with:
2017-05-03 02:17:50 -07:00
2019-04-06 19:38:24 -07:00
```bash
flatpak install flathub jp.yvt.OpenSpades
```
2019-04-13 21:17:51 -07:00
Once installed, you'll be able to launch OpenSpades from inside the desktop menu or from your terminal with `flatpak run jp.yvt.OpenSpades`
2017-05-03 02:17:50 -07:00
2022-08-11 08:27:05 -07:00
### On Unixes (from source)
2014-03-22 06:43:10 -07:00
2022-05-25 06:54:23 -07:00
#### Building
2014-03-03 01:27:28 -08:00
1. Install dependencies:
2018-02-14 09:27:32 -08:00
*On Debian-derived distributions* :
2016-11-06 03:59:15 -08:00
```
2022-05-02 16:20:05 -07:00
sudo apt-get install build-essential pkg-config libglew-dev libcurl3-openssl-dev libsdl2-dev \
2018-10-08 21:37:58 -07:00
libsdl2-image-dev libalut-dev xdg-utils libfreetype6-dev libopus-dev \
libopusfile-dev cmake imagemagick
2016-11-06 03:59:15 -08:00
```
(because of a bug in some distributions, you might also
have to install more packages by `sudo apt-get install libjpeg-dev libxinerama-dev libxft-dev` )
2021-09-01 15:54:26 -07:00
*On Fedora or other RHEL-derived distributions* :
```
2022-05-02 16:20:05 -07:00
sudo dnf install make automake gcc gcc-c++ kernel-devel pkgconf-pkg-config glew-devel \
openssl-devel libcurl-devel SDL2-devel SDL2_image-devel \
2021-09-01 15:54:26 -07:00
freealut-devel xdg-utils freetype-devel opus-devel opusfile-devel \
libjpeg-devel libXinerama-devel libXft-devel cmake ImageMagick
```
2022-08-11 08:27:05 -07:00
*On FreeBSD* :
```
sudo pkg install gmake automake pkgconf glew openssl curl sdl2 sdl2-image \
freealut xdg-utils freetype2 opus opusfile jpeg-turbo libXinerama libXft \
cmake ImageMagick7
```
2018-02-14 09:27:32 -08:00
*On other distributions* :
2014-03-03 01:27:28 -08:00
Install corresponding packages from your repository (or compile from source).
2022-05-02 16:20:05 -07:00
2022-05-25 06:54:23 -07:00
Building OpenSpades requires a C++ compiler, which is included in the dependencies above in case you don't have one installed yet.
2014-03-03 01:27:28 -08:00
2017-01-07 07:03:38 -08:00
2. Clone OpenSpades repository:
2014-03-06 07:58:43 -08:00
2016-11-06 03:59:15 -08:00
```bash
git clone https://github.com/yvt/openspades.git & & cd openspades
```
2014-03-06 07:58:43 -08:00
2017-01-07 07:03:38 -08:00
3. Create directory `openspades.mk` in cloned/downloaded openspades repo and compile:
2014-03-03 01:27:28 -08:00
2014-05-30 18:04:51 -07:00
```bash
mkdir openspades.mk
cd openspades.mk
2017-01-07 07:03:38 -08:00
cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo & & make
2014-05-30 18:04:51 -07:00
```
2014-03-03 01:27:28 -08:00
2022-05-08 12:02:12 -07:00
#### Installing and launching
2022-05-07 08:36:24 -07:00
2022-05-08 12:13:01 -07:00
To launch the built game without installing:
2022-05-08 12:02:12 -07:00
```
cd $REPO_DIRECTORY/openspades.mk; bin/openspades
```
2022-05-08 12:13:01 -07:00
To install the game to your system (recommended), take the following steps:
2022-05-25 06:54:23 -07:00
1. Execute the following command:
```
sudo make install
```
2022-05-08 12:02:12 -07:00
**note** : If you have a previous installation of OpenSpades, you have to uninstall it manually by `sudo rm -rf /usr/local/share/games/openspades` before installing a new one, or else it might load old resources.
2022-05-07 08:36:24 -07:00
2022-05-08 12:02:12 -07:00
2. Launch the game by typing `openspades` into command line, or search for it from start menu.
2022-05-07 08:36:24 -07:00
2022-05-08 12:13:01 -07:00
Alternatively, to install the game to a different directory, take the following steps:
2022-05-07 08:36:24 -07:00
2022-05-08 12:02:12 -07:00
1. Copy the Resources directory into bin (or else the game won't launch):
2014-03-03 01:27:28 -08:00
2022-05-25 06:54:23 -07:00
```
cp -r ./Resources ./bin/
```
2022-05-07 08:36:24 -07:00
**note** : If you plan on distributing it, remember to remove CMake files and folders from Resources.
2018-02-14 09:27:32 -08:00
2022-05-08 12:02:12 -07:00
2. Move the "/openspades.mk" folder somewhere else, for example `/home/user/Games` , or `/opt/games` and rename it to "/OpenSpades".
2014-03-03 01:27:28 -08:00
2022-05-08 12:02:12 -07:00
3. The game's launcher is located at `bin/openspades` . You can create a shortcut for it on the desktop or a `.desktop` file placed in `/usr/share/applications/` for it to appear in Start Menu. Make sure to set the `bin` directory as the shortcut's working directory, or else you will get an error about missing resources.
2014-03-03 01:27:28 -08:00
2022-05-08 12:02:12 -07:00
**note** : If you choose a directory outside of your `/home/user` , for example `/opt/games` , remember to *chmod* the game launcher's permissions to 755.
2013-08-18 00:55:06 -07:00
2022-05-25 06:54:23 -07:00
After successful installation, optionally you can remove the source code and build outputs to save disk space (~100MB).
2013-11-01 13:22:54 -07:00
2022-07-02 07:24:02 -07:00
#### On Linux (from source, by Nix Flakes)
To build and run OpenSpades from the latest source code:
```bash
nix shell github:yvt/openspades -c openspades
```
To build and run OpenSpades for development:
```bash
git clone https://github.com/yvt/openspades.git & & cd openspades
nix develop
# note: this will patch CMake files in the source tree
cmakeBuildType=RelWithDebInfo cmakeConfigurePhase
buildPhase
bin/openspades
```
**note**: Nix Flakes are an experimental feature of Nix and must be enabled manually. See [this wiki article ](https://nixos.wiki/wiki/Flakes ) for how to do that.
2016-11-15 07:20:14 -08:00
### On Windows (with Visual Studio)
2016-12-05 18:47:55 -08:00
1. Get the required software if you haven't already:
2016-11-24 15:26:59 -08:00
* CMake 2.8+
2016-12-05 11:13:50 -08:00
* PowerShell 5.0
* Integrated with Windows 10.
* Older versions are not tested, but might work
2020-12-17 05:44:27 -08:00
* *Visual Studio 2017* or later
2018-02-14 09:27:32 -08:00
* VS2015 is also supported, but VS2017 is more recommended
2016-12-03 02:55:35 -08:00
* VS2013 is no longer supported, but might work
2016-11-24 15:26:59 -08:00
2. Grab the source code:
2017-08-31 06:46:43 -07:00
* Stable version: https://github.com/yvt/openspades/releases
* Latest development version (0.1.x): https://github.com/yvt/openspades/archive/master.zip
2020-12-17 05:44:27 -08:00
3. Checkout the source
2016-11-24 15:26:59 -08:00
* All examples will assume `E:/Projects/openspades` , update paths in the examples to reflect yours
2020-12-17 05:44:27 -08:00
* Make sure to update all git submodules, e.g., by `git clone ... --recurse-submodules` ). Note that the GitHub website's ZIP download currently does not support submodules.
4. Build libraries using vcpkg:
```bat
cd E:/Projects/openspades
vcpkg/bootstrap-vcpkg.bat
vcpkg/vcpkg install @vcpkg_x86 -windows.txt
```
2016-12-05 18:47:55 -08:00
5. Run CMake:
* Source: `E:/Projects/openspades`
* Binaries: `E:/Projects/openspades/OpenSpades.msvc`
2018-02-14 09:27:32 -08:00
* Generator:
2020-12-17 05:44:27 -08:00
* For VS2019: `Visual Studio 16 (2019)`
* For VS2017: `Visual Studio 15 (2017)`
* For VS2015: `Visual Studio 14 (2015)`
* Platform: `Win32`
* Toolchain file: `E:/Projects/openspades/vcpkg/scripts/buildsystems/vcpkg.cmake`
2020-12-17 08:55:56 -08:00
* Add a new string entry `VCPKG_TARGET_TRIPLET=x86-windows-static`
2018-02-14 09:27:32 -08:00
2016-11-24 15:26:59 -08:00
6. Open `E:/Projects/openspades/OpenSpades.msvc/OpenSpades.sln` in Visual Studio.
2018-02-14 09:27:32 -08:00
7. Build the solution.
2016-12-05 18:47:55 -08:00
* The recommended build configuration is `MinSizeRel` or `Release` if you're not an developer
* The default build output directory is `E:/projects/OpenSpades/OpenSpades.msvc/bin/BUILD_TYPE/`
2020-12-17 05:44:27 -08:00
8. To get audio working, download a [Windows release of OpenSpades ](https://github.com/yvt/openspades/releases ), extract it, and copy the following dlls to the build output directory:
2018-02-14 09:27:32 -08:00
* For OpenAL audio: `openal32.dll`
2016-12-09 07:48:32 -08:00
* For YSR audio: `YSRSpades.dll` , `libgcc_s_dw2-1.dll` , `libstdc++-6.dll` , `pthreadGC2.dll`
2020-12-17 05:44:27 -08:00
9. Download the [Non-free pak ](https://github.com/yvt/openspades-paks/releases/download/r33/OpenSpadesDevPackage-r33.zip ), extract it, and copy `Nonfree/pak000-Nonfree.pak` to the `Resources` folder inside your build output directory, which is probably `E:/Projects/openspades/openspades.msvc/bin/BUILD_TYPE/Resources` . You can also copy the paks contained in `Official Mods/` folder of OpenSpades 0.0.12b to add more fonts and improve localization support of your build.
2016-11-22 13:28:42 -08:00
2020-12-13 04:46:13 -08:00
### On macOS (with Ninja)
2022-05-10 09:33:02 -07:00
#### Requirements
- Xcode Command Line Tools
- CMake
- pkg-config
2022-05-11 12:34:26 -07:00
- gcc 6 or newer (not clang!) — macOS 10.14 (Mojave) or earlier only
2022-05-10 09:33:02 -07:00
- ninja
#### Building
1. Install the Xcode Command Line Tools and other required build tools.
```bash
xcode-select --install
```
Using Homebrew:
```
brew install cmake pkg-config ninja
# If you are using macOS 10.14 (Mojave) or earlier:
brew install gcc
```
Using Nix:
2022-05-11 12:34:26 -07:00
- Add `$(nix-build '<nixpkgs>' -A pkg-config-unwrapped --no-out-link)/bin` to `PATH` .
2022-05-10 09:33:02 -07:00
2. Clone the Openspades repository:
```bash
git clone https://github.com/yvt/openspades.git --recurse-submodules & & cd openspades
```
3. Bootstrap `vcpkg` and install the required packages:
```bash
vcpkg/bootstrap-vcpkg.sh
vcpkg/vcpkg install @vcpkg_x86_64 -darwin.txt
```
2020-12-13 07:14:13 -08:00
4. Create directory `openspades.mk` in the cloned/downloaded openspades repo and compile:
2020-12-13 04:46:13 -08:00
```bash
mkdir openspades.mk
cd openspades.mk
cmake -G Ninja .. -D CMAKE_BUILD_TYPE=RelWithDebInfo -D CMAKE_OSX_ARCHITECTURES=x86_64 -D CMAKE_TOOLCHAIN_FILE=../vcpkg/scripts/buildsystems/vcpkg.cmake -D VCPKG_TARGET_TRIPLET=x64-osx
ninja
```
2022-05-11 12:34:26 -07:00
5. Launch:
2020-12-13 04:46:13 -08:00
```bash
2020-12-13 05:31:48 -08:00
open bin/OpenSpades.app
2020-12-13 04:46:13 -08:00
```
2020-12-13 05:31:48 -08:00
(Universal builds aren't supported yet.)
2014-04-06 09:04:56 -07:00
2020-12-13 07:31:57 -08:00
### Network usage during building
OpenSpades' build process automatically downloads prebuilt game assets and libraries as needed. Specifically:
2020-12-18 05:52:47 -08:00
- `pak000-Nonfree.pak` and `font-uniform.pak` from < https: // github . com / yvt / openspades-paks > . Can be disabled by passing `-D OPENSPADES_NONFREE_RESOURCES=NO` to CMake.
- The prebuilt binaries of YSRSpades (audio engine) from < https: // github . com / yvt / openspades-media > . Can be disabled by passing `-D OPENSPADES_YSR=NO` to CMake.
2020-12-13 07:31:57 -08:00
In addition, vcpkg (sort of package manager only used for Windows and macOS builds) [collects and sends telemetry data to Microsoft ](https://vcpkg.readthedocs.io/en/latest/about/privacy/ ). You can opt out of this behavior by passing `-disableMetrics` option when running `vcpkg/bootstrap-vcpkg.sh` command.
2016-11-15 07:20:14 -08:00
## Troubleshooting
For troubleshooting and common problems see [TROUBLESHOOTING ](TROUBLESHOOTING.md ).
2016-11-22 11:20:27 -08:00
## Licensing
2014-02-10 07:08:33 -08:00
Please see the file named LICENSE.