-
Notifications
You must be signed in to change notification settings - Fork 20
Installation instructions for Windows 10
Before anything else, download "vulkan_test.exe" from https://github.com/skeeto/vulkan-test and run it. If it tells you that Vulkan won't work, it will be difficult to move forward because you may need to update your graphics card driver or even to get a new graphics card. If you are not in a position to do these things, it is not worth going through the rest of the build process when Hypermine won't even run in the end.
Before you can build Hypermine, you need to install a bunch of dependencies so the first build might take an hour+ including this set up time.
Most of the following software have installers that prompt you at some stage if you would like to set up your PATH. In every case indicate yes. some installers, additionally may ask if they need to be accessed via the command line. In such a case indicate yes.
-
Build tools for visual studio 2022 https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2022
- The installation wizard offers a bunch of components but we only need the C/C++ tools. These are needed to compile any Rust project.
-
Git. Download and run the git installer from https://git-scm.com/download/win. When setting it up, make sure to also install the Git LFS component, because the Hypermine repository uses LFS. The configuration options after that are not important here, and you can go with the defaults. This is used to download the Hypermine repository from Github.
-
Python (3.5+) from https://www.python.org/downloads/. This is used because Hypermine depends on shaderc, which is built from source in a customised way.
-
Cmake from https://cmake.org/download/. This is required because of shaderc.
-
Ninja https://github.com/ninja-build/ninja/releases. This is required because of shaderc.
- This is required only on windows-msvc. If you are unsure whether this applies for you, you can skip ahead to the step where you begin to install Rust using rustup. If rustup says that your "default host triple" has "windows-msvc" in the name, then you need Ninja. If you are still unsure, just go ahead with installing Ninja.
- Make a folder such as C:/Ninja and unzip the Ninja executable there. It's best to make the folder in a place where you won't accidentally move or delete it.
- Unlike the other programs, you need to manually add this folder to your PATH environment variable. do this by right clicking on My Computer and navigating the dialogue "Properties" > "Advanced" > "Environment Variables" > "Path" and adding a new line with C:/Ninja or wherever you put the executable. You can also access the environment variables by typing "Path" in the Start Menu search and clicking on the "Edit the system environment variables" control panel setting.
Don't worry if you don't see everything in the list of paths that you installed as part of these instructions that feels like it should be there. To verify that all of the installed programs can be accessed, open a new command prompt (or PowerShell window) and run the commands python --version
, cmake --version
, ninja --version
, and git --version
.
Each of these commands should print some text displaying the program's name and version.
- Finally, install Rust. Get rustup https://www.rust-lang.org/tools/install and follow all prompts. The default options will do.
In a command prompt, run the command rustc --version
. After doing so, output like the following is expected.
PS C:\Users\user> rustc --version
rustc 1.46.0 (04488afe3 2020-08-24)
This means that the Rust compiler is present and the PATH environment variable for Cargo, the package manager for Rust, is configured correctly. Now you have everything you need to build Hypermine (except the source code!).
Open a command prompt in the directory that you want to install Hypermine into and run:
git clone https://github.com/Ralith/hypermine.git
Then run:
cd .\hypermine\
Then run:
git lfs pull
The first command downloads the Hypermine repository to your computer, the second navigates to its directory, and the third downloads the graphics files in the "assets" subdirectory that are necessary for the game to run. Then Hypermine will be ready to build and run with the command:
cargo run --bin client --release
The initial compilation of Hypermine will take 20--30 minutes.
if you want to build Cedric's dev branches you will have to add his repo (run the following command only once)
git remote add ced https://github.com/cedric-h/hypermine
then do:
git fetch
git checkout branch-name-here
then you can recompile by running
cargo run --bin client --release
If you type a command in the command prompt and it says '[Name of command]' is not recognized as an internal or external command, operable program, or batch file.
. this probably means that one of the tools like git, git-lfs, or cargo did not get installed, or if they got installed, the folder that they are installed in was not added to the PATH environment variable.
An environment variable is a configuration setting whose value is set by the operating system rather than in the scope of a single program. The PATH environment variable is a record of which folders that tools such as the command prompt should look for programs in. It consists of a bunch of paths to various folders, separated by semicolons. Generally when modifying the PATH, you want to append new paths after the existing set of paths. You can type $PATH
in the command prompt and hit the enter key to see what the current value of the variable is, or you can view it inside the "Edit the system environment variables" control panel setting.
If after running cargo run --bin client --release
you see error messages similar to the following:
The following warnings were emitted during compilation:
warning: System installed library not found. Falling back to build from source
error: failed to run custom build command for `shaderc-sys v0.6.2`
Caused by:
process didn't exit successfully: `C:\git\hypermine\target\release\build\shaderc-sys-d13980cbefa44775\build-script-build` (exit code: 101)
--- stdout
cargo:warning=System installed library not found. Falling back to build from source
--- stderr
thread 'main' panicked at '
couldn't find required command: "cmake"
', C:\Users\user\.cargo\registry\src\github.com-1ecc6299db9ec823\shaderc-sys-0.6.2\build\cmd_finder.rs:50:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: build failed
This is caused by the required programs Cmake (or Python or Ninja) either not being installed or not being added to the PATH environment variable properly.
If after a successful build you see the application exit immediately after starting up and you get output like this in the command prompt window:
cargo run --bin client --release
Finished release [optimized] target(s) in 11.85s
Running `target\release\client.exe`
Sep 26 14:45:11.636 INFO C:\Users\user\AppData\Roaming\hypermine\config\client.toml not found, using defaults
Sep 26 14:45:11.674 INFO server: listening address=[::1]:65058
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: LoadingError(LoadLibraryW { source: Os { code: 126, kind: Other, message: "The specified module could not be found." } })', client\src\graphics\core.rs:40:34
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread 'tokio-runtime-worker' panicked at 'cannot access stdout during shutdown', src\libstd\io\stdio.rs:586:51
error: process didn't exit successfully: `target\release\client.exe` (exit code: 101)
Or like this:
PS C:\Users\((user))\Downloads\hypermine> .\client.exe
[2mOct 06 10:16:53.889[0m [32m INFO[0m C:\Users\((user))\AppData\Roaming\hypermine\config\client.toml not found, using defaults
[2mOct 06 10:16:53.931[0m [32m INFO[0m [1mserver[0m: listening address=[::1]:54958
[2mOct 06 10:16:54.188[0m [32m INFO[0m vulkan debugging unavailable
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: VkError(ERROR_INCOMPATIBLE_DRIVER)', client\src\graphics\core.rs:85:72
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread '
This occurs because drivers for the graphics card that support Vulkan are not installed.
It might be possible to get hypermine to work by updating your graphics card driver. However, before performing the update, make a system restore point in case anything goes wrong.
Go to the start menu and open "Device manager". Click on "Display adapters", double-click the name of the graphics card that shows up to view its properties, and go to the "Driver" tab. Try updating the driver using Windows' own tool for the job.
If that doesn't work, or if it reports that it is already up to date even when it isn't, then go to the website for the manufacturer of your graphics card and look for the most up-to-date driver for your graphics card. As an example, the website for an Intel card would be https://downloadcenter.intel.com/ and the driver can be updated by following the instructions on https://software.intel.com/content/www/us/en/develop/articles/how-to-install-vulkan-apis-for-ue4.html up to step 11.