Skip to content

Commit

Permalink
[ci skip] meta file fixups, merge build instructions with wiki
Browse files Browse the repository at this point in the history
  • Loading branch information
rollerozxa committed Apr 25, 2024
1 parent 251fa84 commit f769daf
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 167 deletions.
13 changes: 6 additions & 7 deletions AUTHORS.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
Original Authors of Principia
===========================
=============================

Emil Romanus
**Emil Romanus**<br>
Original creator, programming, game design, 3D modeling, graphics

Rasmus Karlsson
**Rasmus Karlsson**<br>
Game programming, server development, and more

Mikael Romanus
**Mikael Romanus**<br>
3D Modeling, code twiddling

Contributors
-------------
------------

Anders Schanche
**Anders Schanche**<br>
3D Models (Tesla Gun, Rocket Launcher, and more), testing

139 changes: 5 additions & 134 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ Principia runs on anything with a recent enough version of Windows, Linux or And
* Discord server: https://principia-web.se/discord

## Binary builds
Every now and then new beta builds for 1.5.2 are made whenever things are stable enough on the `master` branch. These are available for download on the [principia-web downloads page](https://principia-web.se/download).
Binary builds of Principia for Windows, Android and Linux are available on the [downloads page](https://principia-web.se/download).

There are also nightly build artifacts for Windows and Android that get automatically built by GitHub CI on each commit, see [Actions](https://github.com/Bithack/principia/actions). Keep in mind these may be broken at times during development, and you are recommended to use the beta builds instead.
There are also nightly build artifacts for Windows, Android and Linux that get automatically built by GitHub CI on each commit, see [Actions](https://github.com/Bithack/principia/actions). Keep in mind these may be broken at times during development, and you are recommended to use the release builds instead.

## Getting involved
Feel free to fork this project and send in your pull requests. This is a community project and the community decides how the project evolves.
Expand All @@ -30,139 +30,10 @@ Most of our discussion and development happens in the `#development` channel of

Also be sure to follow [@principia](https://fosstodon.org/@principia) on Fosstodon for more updates about the project.

## Building and running
Below are instructions to build Principia on Windows, Linux and Android from source. See also [this Wiki page](https://principia-web.se/wiki/Compiling_Principia) for notes on running Principia on particular platforms. (e.g. Chrome OS, Raspberry Pi or Haiku OS)
## Building from source
See [Compiling Principia](https://principia-web.se/wiki/Compiling_Principia) on the Principia Wiki.

If you have issues building Principia, then please ask in the `#development` channel on Discord.

### Windows
The game engine behind Principia (TMS) is written in the C99 standard of C. Unfortunately, the Visual Studio C compiler does not support the C99 standard. Principia must therefore be compiled using MinGW-w64 toolchain.

The following build Windows instructions use MSYS2 which is a development environment for Windows including MinGW and other tools. Please download and install the latest version of the MSYS2 installer here: https://www.msys2.org/

After installation, a terminal opens. Run the following command to update the environment:

```bash
pacman -Syu
```

The terminal will then ask you to shut down the MSYS2 runtime to the finish the update. Proceed with doing so, and then go to the start menu and start the "MSYS2 UCRT64" environment (icon with gold background) again. Run the following command to install the necessary dependencies:

```bash
pacman -S git mingw-w64-ucrt-x86_64-{gcc,cmake,ninja,curl-winssl,gtk3,glew,libpng,libjpeg-turbo,freetype,SDL2}
```

Navigate somewhere you want to clone the Principia source code to, such as on your desktop:

```bash
cd /c/Users/$USER/Desktop/
git clone https://github.com/Bithack/principia
cd principia
```

Then generate the build files using CMake and start the compilation:

```bash
mkdir build; cd build
cmake .. -G Ninja
ninja
```

When finished there will be a `principia.exe` file in the build folder. Keep in mind that the built executable can only be run inside of the MSYS2 terminal, to make a release build see below to build the installer:

#### Windows installer
The Windows installer uses NSIS, which must be installed first before building:

```bash
pacman -S mingw-w64-ucrt-x86_64-nsis
```

For making Windows release builds you would run the `packaging/windows_release.sh` script, which will bundle necessary DLLs and other files to make the game run, and builds the installer.

### Linux
*If you just want to play Principia on Linux, there is an AppImage build available as well as packages for various Linux distributions. See the [principia-web downloads page](https://principia-web.se/download) for more info.*

Install dependencies.

**Debian-based distros:**

```bash
sudo apt install --no-install-recommends cmake ninja-build libgtk-3-dev libgl-dev libglew-dev libcurl4-openssl-dev libpng-dev libjpeg-dev libfreetype6-dev libsdl2-dev
```

**For Arch-based distros:**

```bash
sudo pacman -S --needed cmake ninja glew gtk3 curl freetype2 libpng libjpeg sdl2
```

**For Fedora:**

```bash
sudo dnf install @development-tools cmake ninja gcc-c++ freetype-devel libcurl-devel libpng-devel libjpeg-turbo-devel gtk3-devel SDL2-devel libXxf86vm-devel glew-devel mesa-libGLU-devel alsa-lib-devel systemd-devel
```

**For Alpine:**

```bash
doas apk add build-base cmake ninja mesa-dev glew-dev gtk+3.0-dev libpng-dev jpeg-dev curl-dev freetype-dev zlib-dev sdl2-dev
```

Generate the build files using CMake and start compilation:

```bash
mkdir build; cd build
cmake .. -G Ninja
ninja
```

When finished a `principia` executable will be produced, which can then be run.

While the game works fine when being run from out of the source tree, additional setup is required for the URL handler to work in order to play community levels. See [this page on the Wiki](https://principia-web.se/wiki/Principia_Protocol#linux) for more details.

#### Packaging for Linux
On Linux Principia will attempt to load data from the following directories:

1. `./` (data directories are next to the executable)
2. `../` (data directories are one directory up relative to the executable)
3. `./share/principia/` (for an installed build)

When doing `ninja install`, the data folders will be installed to `share/principia`. For packaging, you would want to pass `-DCMAKE_INSTALL_PREFIX=/usr` to CMake which when installed will put data where it can get loaded from.

### Building for Android
These instructions assume a Linux system but can likely be easily adapted to build for Android on any platform.

Download Android Studio from here: https://developer.android.com/studio

Untar the archive and run studio.sh:

```bash
tar xzf android-studio-*-linux.tar.gz
cd bin; ./studio.sh
```

Choose Custom in the Installer, click Next a bunch of times. Android Studio will download components for a while. Once finished, in the "Welcome to Android Studio" dialog, choose "Customize" in the left menu and then click "All Settings..." at the bottom center. Open Appearance -> System Settings -> Android SDK. Click the SDK Tools tab and check the following items:

- NDK (Side by side)
- Android SDK Command-line tools

Click Apply and wait for the components to download. Close Android Studio **forever**.

Open a terminal and run the build scripts:

```bash
cd build-android
export ANDROID_HOME=/home/EXAMPLE/Android/Sdk
./gradlew build
```

ANDROID_HOME should be set to the location where Android Studio installed the SDK (which you chose during setup). You might want to put that export line in your .bashrc file.

Finally, to install the game on your device:

```bash
./gradew install
```
(You can also view the plaintext Markdown document [here](https://raw.githubusercontent.com/principia-game/wiki/master/pages/Compiling_Principia.md))

## License
See [LICENSE.md](LICENSE.md)
52 changes: 26 additions & 26 deletions THANKS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,32 @@ Thanks

We would like to send a special thanks to some of the most dedicated Apparatus and Principia players who have supported development and helped the community.

Alfajim
Axohmega
BobMonkeypimp
Cheddah
Cralant
Ctjet
Demon666
Doughnuts108
Golden
JOELwindows7
Nighthawk
Ridget
Rubicon
Sasha from Russia
TechZ
Tetsu
The_Blacksmith_
abrackers
incrazyboyy
mrsimb
mznznlt
sjoerd1999
wokstation
woodnut
yo man
zardOz (RIP)
- Alfajim
- Axohmega
- BobMonkeypimp
- Cheddah
- Cralant
- Ctjet
- Demon666
- Doughnuts108
- Golden
- JOELwindows7
- Nighthawk
- Ridget
- Rubicon
- Sasha from Russia
- TechZ
- Tetsu
- The_Blacksmith_
- abrackers
- incrazyboyy
- mrsimb
- mznznlt
- sjoerd1999
- wokstation
- woodnut
- yo man
- zardOz (RIP)

And everyone else in the Principia and Apparatus communities.

Expand Down

0 comments on commit f769daf

Please sign in to comment.