TeamHypersomnia / Hypersomnia

Multiplayer top-down shooter made from scratch in C++. Play in your Browser! https://hypersomnia.io Made in 🇵🇱
https://hypersomnia.io/
GNU Affero General Public License v3.0
1.17k stars 52 forks source link
2d-game 2d-shooter browser-game cpp editor free-software game game-development gamedev indie-game multiplayer multiplayer-game pixel-art pixelart pixelart-game shooter shooter-game top-down-game top-down-shooter topdown-shooter

![image](https://github.com/TeamHypersomnia/Hypersomnia/assets/3588717/8ccf0d22-317d-459d-8c19-3b4830968545) # [Play in the Browser!](https://hypersomnia.io/) [![Appveyor Build Status](https://ci.appveyor.com/api/projects/status/5aatwxv8hceaop56?svg=true)](https://ci.appveyor.com/project/geneotech/Hypersomnia) [![Build Status](https://github.com/TeamHypersomnia/Hypersomnia/workflows/Linux%20build/badge.svg)](https://github.com/TeamHypersomnia/Hypersomnia/actions) [![Build MacOS binary](https://github.com/TeamHypersomnia/Hypersomnia/workflows/MacOS%20build/badge.svg)](https://github.com/TeamHypersomnia/Hypersomnia/actions) [![License: AGPL v3](https://img.shields.io/badge/License-AGPL%20v3-blue.svg)](https://www.gnu.org/licenses/agpl-3.0) Online shooter with relentless dynamics. Challenge your friend to an intense duel, or gather two clans to fight a spectacular war. Written in modern C++, **without a game engine!** Forever free and open-source :heart: *Comes with an [in-game map Editor!](https://hypersomnia.io/editor/official)* ### Join us:

Official Telegram channel (RU)

# Get it on Steam! # Download the game
Only 29 MB! The game will start with an **interactive Tutorial!** Download Headless Dedicated Server *All archives are [digitally signed.](https://github.com/TeamHypersomnia/Hypersomnia/blob/master/src/signing_keys.h) You can [verify signatures.](https://hypersomnia.xyz/builds/latest/)*
# Press

Liam @ GamingOnLinux

GitHub Blog GitHub Blog

Issue 275, page 89 **[Open Source Friend](https://t.me/open_source_friend/2483)** (200 votes, 20k views) # [📰 Are you a journalist? Click here!](https://github.com/TeamHypersomnia/PressKit/blob/main/README.md#intro) # Watch gameplay [![IMAGE ALT TEXT](https://img.youtube.com/vi/L4zSA34fD_E/0.jpg)](https://www.youtube.com/watch?v=L4zSA34fD_E "Video Title") [![IMAGE ALT TEXT](https://img.youtube.com/vi/CHLPzZqANlM/0.jpg)](https://www.youtube.com/watch?v=CHLPzZqANlM "Video Title") # Learn to make maps! [![IMAGE ALT TEXT](https://img.youtube.com/vi/q1rfIy06_xo/0.jpg)](https://www.youtube.com/watch?v=q1rfIy06_xo "Video Title") ## Latest developer journals [![IMAGE ALT TEXT](https://img.youtube.com/vi/Nlh_dyd_V7w/0.jpg)](https://www.youtube.com/watch?v=Nlh_dyd_V7w "Video Title") [![IMAGE ALT TEXT](https://img.youtube.com/vi/URWjNtUArDo/0.jpg)](https://www.youtube.com/watch?v=URWjNtUArDo "Video Title")

Table of contents

Introduction

Hypersomnia_discordthread

Hypersomnia is a competitive arena released as free software.

The game has been online and playable since 2017. It brings together:

Hypersomnia aims to be the ultimate open-source 2D shooter - a grand community project extensible without limit.

Declare allegiance to one of the three factions whose apple of discord is a disparity between prevailing notions of moral excellence:

Metropolis. Atlantis. Resistance.

Will you take revenge for the unethical simulation of an inferior universe? Will you support the cruel experiments to win total control over metempsychosis? Or will you join the underground civilization that awaits the end of war in this dangerous afterlife reality?

Features

Tech highlights

Background

Hypersomnia has been in development since 2013 (as seen in the commit history).

It didn't take 10 years of uninterrupted coding, though - in the meantime, I worked commercially to cover my costs of living. I saved money to be able to work less and focus on Hypersomnia. My financial decisions now let me develop the game full-time.

I use a lot of 3rdparty libraries like Box2D (physics) or yojimbo (transport layer) - everything not on this list, however, is written pretty much from scratch, in pure C++.

Many believe that writing games without an engine is no more than reinventing the wheel, or put more bluntly, a complete waste of time.

I hope this project serves as a great testament to the opposite.

Had I never embarked on this journey, I would have never made some of the interesting discoveries detailed in Tech highlights section. Video game internals are just so vast and interdisciplinary that they have limitless potential for creative breakthroughs, and it is a waste to never even entertain the idea that some widely used solutions can be replaced by something absolutely ingenious.

Quick gameplay instructions

From: https://hypersomnia.xyz/guide

You can reconfigure all bindings by going to Settings->Controls tab.

How to build

Currently, Hypersomnia is only buildable using clang. Your operating system must be 64-bit.

Irrespectively of the OS, you will need the following software in order to build Hypersomnia:

Once dependencies are installed, go to the directory where you wish to have your Hypersomnia project downloaded, open git bash and paste:

git clone --recurse-submodules https://github.com/TeamHypersomnia/Hypersomnia

The --recurse-submodules is necessary to clone the submodules as well.

Wait for the download to complete. Next steps depend on the platform you are on.

On all platforms, you can choose among three building configurations:

Windows instructions

Refer to appveyor.yml file for up-to-date building procedure. A short overview of the process now follows.

Prerequisites:

Open up the standard Windows cmd prompt (it won't work with PowerShell or others). Setup the environment:

call "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" x64

(If the file cannot be found, it means you are not using Visual Studio 2022 Community. You will have to look for a corresponding vcvarsall.bat location on your own.)

Next, run these commands:

cd Hypersomnia
mkdir build
cd build
set CONFIGURATION=RelWithDebInfo
cmake -G Ninja -DCMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl -DCMAKE_LINKER=lld-link -DARCHITECTURE="x64" -DCMAKE_BUILD_TYPE=%CONFIGURATION% -DGENERATE_DEBUG_INFORMATION=0 -DOPENSSL_ROOT_DIR=C:\OpenSSL-Win64 ..
ninja

This will build a non-Steam client by default. To build a Steam client, add a -DLINK_STEAM_INTEGRATION=1 flag to the cmake command.

Note: your computer might start lagging heavily for the duration of the build as ninja will use all available cores for compilation.

If you intend to develop the game, it is best to use "Debug" configuration for the fastest builds.

If you want to somehow customize your build, e.g. disable certain game features, refer to the beginning of CMakeLists.txt to see which options you can pass to the cmake command.

If the game builds successfully, run this command to launch it:

ninja run

If you built with -DLINK_STEAM_INTEGRATION=1, don't forget to create a hypersomnia/steam_appid.txt file with 2660970 in it. Otherwise the game will try to restart itself through Steam.

If, for some reason, some step fails, refer to the latest working Appveyor build and the relevant appveyor.yml file.

Linux instructions

Refer to Linux_build.yml file for up-to-date building procedure - it is constantly in flux. A short overview of the process now follows.

Current platforms are actively tested and supported:

Distribution-specific dependencies

Arch Linux:

Ubuntu:

sudo apt-get install cmake ninja-build libxcb-keysyms1 libxcb-keysyms1-dev libxi6 libxi-dev alsa-oss osspd-alsa osspd libasound2 libasound2-dev p7zip p7zip-full libgl1-mesa-dev libxcb-glx0-dev libx11-xcb-dev

One-shot launch

Once the dependencies are all set, this is the complete script for building and launching the game from scratch, with RelWithDebInfo configuration:

git clone --depth 1 --recurse-submodules https://github.com/TeamHypersomnia/Hypersomnia
cd Hypersomnia
export CXX=clang++; export CC=clang;
cmake/build.sh RelWithDebInfo x64
ninja run -C build/current

Detailed instructions

Use your favorite shell to enter the repository's directory. Then run:

cmake/build.sh [Debug|Release|RelWithDebInfo] [x86|x64] ["ADDITIONAL CMAKE FLAGS"]

For example:

export CXX=clang++; export CC=clang;
cmake/build.sh Debug x64

After which, the resultant build.ninja should appear in the build/Debug-x64-clang directory.

Example for gcc:

export CXX=g++; export CC=gcc;
cmake/build.sh Debug x64

After which, the resultant build.ninja should appear in the build/Debug-x64-gcc directory.

Invoking ninja

There are several additional ninja targets defined:

ninja run

Launches the game normally.

ninja tests

Launches unit tests only and exits cleanly.

The above targets set the working directory automatically to ${PROJECT_SOURCE_DIR}/hypersomnia.

If, for some reason, some step fails, refer to the latest working Linux_build.yml file.

If the game fails to launch, it should automatically open a log file with the relevant message using $VISUAL executable.

File dialogs integration

You might want to follow some additional configuration to make the experience better on Linux.

Opening and revealing files

The Hypersomnia editor can reveal files in explorer. Also, the game may prompt you to select a file, e.g. to choose the avatar. On Windows, this is accomplished through an IFileDialog.
Needless to say, such a class does not exist on Linux.
Hypersomnia provides shell scripts for common file managers in hypersomnia/detail/unix/managers.
You'll need one for choosing a file to open and one for revealing files in explorer.
cd to hypersomnia/detail/unix and, assuming you want to use ranger as your file manager, create symlinks as such:

ln -s managers/reveal_file_ranger.zsh reveal_file.local 
ln -s managers/open_file_ranger.zsh open_file.local

None of the symlinks will be tracked by git.

Currently, the following file managers are supported:

MacOS instructions

Refer to MacOS_build.yml file for up-to-date instructions.

Contributing

Pull requests are welcomed, should they even be typo fixes or missing const guarantees. If you plan to add a completely new feature, create a relevant issue so that everybody knows about it, because the project is continuously in a very, very active development and may undergo a revolution when it is the least expected.

A WIP documentation can be found at wiki.

Make sure to check out TeamHypersomnia for other repositories that are useful when setting up your own custom servers.

If you have questions or you fail to build Hypersomnia, reach out on Discord. Or if you just can't wait to utter some brilliant ideas with regard to the game, please do so, too!