Skip to content

Commit

Permalink
docs: update readme (#1017)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pospelove authored Mar 15, 2022
1 parent b3de0a5 commit 10633b2
Show file tree
Hide file tree
Showing 5 changed files with 185 additions and 186 deletions.
157 changes: 157 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,163 @@ The only things we require is to test thoroughly, maintain code style and keepin

Also, accepting and agreeing to release any contribution under the same license.

## Building From Source

You can find instructions on setting up the project locally below. To get a local copy up and running follow these simple example steps. You need ~4 GB RAM, ~22 GB on your hard drive and some free time.

## Prerequisites

### Common

These tools required regardless of your system:

* 64-bit [NodeJS](https://nodejs.org/en/download/) 12.x/14.x/16.x
* [Yarn](https://yarnpkg.com/getting-started/install): `npm install --global yarn`
* [CMake 3.18.2](https://cmake.org/download/) or higher

### Windows

Before your start make sure that your system meets the conditions:

* Windows 7 or higher *([Windows 10](https://www.microsoft.com/en-us/software-download/windows10) is recommended)*
* [Visual Studio 2019](https://visualstudio.microsoft.com/downloads/)
* .NET Framework SDK at 4.6.0 or higher *(Visual Studio Installer -> .NET desktop development)*
* Python 3.9.x 64bit or 32bit *(Visual Studio Installer -> Idividual components -> search for python)*

### Linux

You can build and run server and unit-tests on Linux.
As Skyrim has no native Linux version, client can only be built using MSVC,
but then can be run with Proton (though some crashes can occur on SP startup
and it can be tricky to get Skyrim itself to work with non-ASCII text, for example).

* Ubuntu 18.04 or 20.04. Other distros are not tested or are expected to fail:
* Alpine Linux doesn't work
* Arch-based distros also [won't be able to run the server](https://github.com/chakra-core/ChakraCore/issues/6613)
* Clang 12 *(GCC is not supported)*: `sudo apt install clang-12`
* Python 2 (not 3.x! It is needed to build ChakraCore. Don't worry, it won't conflict with Python 3):
`sudo apt install python2`
* Make sure that your NodeJS and CMake are fresh enough:
* You can use [`nvm`](https://github.com/nvm-sh/nvm) or [Nodesource's apt repositories](https://github.com/nodesource/distributions) to install fresh Node
* The simpliest way to install fresh CMake is to download a `.tar.gz` from [CMake download page](https://cmake.org/download/),
unpack it to your home directory and add it to path:
```sh
echo 'export PATH="$HOME/apps/cmake-3.22.0-.../bin:$PATH"' >> ~/.bashrc
```

If you don't wish to build all the dependencies by yourself, or have an unsupported distro,
you can use [a Docker image with preinstalled dependencies](https://hub.docker.com/r/skymp/skymp-vcpkg-deps):
```sh
docker run -it --rm -v "$PWD:$PWD" -w "$PWD" -u "`id -u`:`id -g`" skymp/skymp-vcpkg-deps ./build.sh ...
# ... or go rootless!
podman run -it --rm -v "$PWD:$PWD" -w "$PWD" -e VCPKG_DEFAULT_BINARY_CACHE=/home/skymp/.cache/vcpkg/archives \
skymp/skymp-vcpkg-deps ./build.sh ...
```
## Configuring and Building
### Common
1. Clone the repo, including submodules
```sh
git clone https://github.com/skyrim-multiplayer/skymp.git
cd skymp
git submodule init
git submodule update
```
2. Do OS-specific steps (see below)
### Windows
1. Make a build directory (used for project files, cache, artifacts, etc)
```sh
mkdir build
```
2. Generate project files with CMake (replace path with your actual Skyrim SE folder)
```sh
cd build
cmake .. -DSKYRIM_DIR="C:/Program Files (x86)/Steam/steamapps/common/Skyrim Special Edition"
```
For users who don't have Skyrim SE installed:
```sh
cd build
cmake ..
```
* Some tests would be skipped
* The server would require manual installation of Skyrim.esm and other master files
* Papyrus scripts that require Bethesda's compiler would not be compiled, prebuilts would be used
3. Build with CMake:
```sh
cmake --build . --config Debug
```
On Windows you also can open `build/skymp.sln` with Visual Studio, then `Build -> Build Solution`.
All build artifacts would be placed into `build/dist`.
#### How to build only SkyrimPlatform
- For those users who want to build SP but not SkyMP there is `ONLY_SP` option:
```sh
cmake .. -DONLY_SP=ON
```
### Linux
On Linux, there might be some tricky dependency issues. To work around them,
we recommend you to use a wrapper script `build.sh`. It will create a temporary
directory and add some aliases to `PATH`.
1. Generate project files with CMake wrapper (replace path with your actual Skyrim SE folder)
```sh
./build.sh --configure -DCMAKE_BUILD_TYPE=Debug \
-DSKYRIM_DIR="$HOME/.steam/debian-installation/steamapps/common/Skyrim Special Edition"
```
For users who don't have Skyrim SE installed:
```sh
./build.sh --configure -DCMAKE_BUILD_TYPE=Debug
```
If you're building for a production machine, change build type to Release:
```sh
./build.sh --configure -DCMAKE_BUILD_TYPE=Release
```
2. Build with CMake wrapper:
```sh
cd build
../build.sh --build
```
Additional arguments after `--build` will be passed to CMake. E.g. you can specify the build target:
```sh
cd build
../build.sh --build --target=unit # only build unit-tests and their dependencies
# Will run cmake --build . --target=unit
```
### Optional steps after build
1. Run tests:
```sh
ctest -C Debug --verbose
```
Some tests ([ESPMTest](https://github.com/skyrim-multiplayer/skymp/blob/main/skymp5-server/cpp/unit/EspmTest.cpp)) require Skyrim SE data files and will be skipped if you didn't specify `-DSKYRIM_DIR`.

In order to avoid potential errors, make sure:
1. You have installed it using Steam and it's up to date (currently last update was on [Nov 20, 2019](https://steamdb.info/depot/489832/history/?changeid=M:8702665189575304780)). See SteamDB for [hashes](https://steamdb.info/depot/489832/?show_hashes) and [update history](https://steamdb.info/depot/489832/history/).
2. You did not modify `Skyrim.esm`, `Update.esm`, `Dawnguard.esm`, `HearthFires.esm` and `Dragonborn.esm`. (Ideally, you should have pure Vanilla version installed.)
2. Calculate test coverage (Windows-only):
Install [OpenCppCoverage](https://github.com/OpenCppCoverage/OpenCppCoverage/releases) and then:
```sh
cmake .. -DCPPCOV_PATH="C:\Program Files\OpenCppCoverage"
ctest -C Debug --verbose
```
These commands would re-generate project files with coverage enabled and run tests. Coverage report would be in `build/__coverage`.
## Pull Requests
- **Your branch must be buildable** - The project's build system must be able to build repo with your changes.
Expand Down
197 changes: 18 additions & 179 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,188 +1,27 @@
<!-- PROJECT LOGO -->
<br />
<p align="center">
<a href="https://skymp.io">
<img src="skymp.jpg" alt="Logo" width="200" height="200">
</a>
<h3 align="center">SkyMP</h3>
# SkyMP

<p align="center">
A general-purpose multiplayer mod for Skyrim SE.
<br>
<a href="https://github.com/skyrim-multiplayer/skymp/tree/main/docs">Explore Docs</a>
·
<a href="https://github.com/skyrim-multiplayer/skymp/issues">Report Bug</a>
·
<a href="https://github.com/skyrim-multiplayer/skymp/issues">Request Feature</a>
·
<a href="https://discord.gg/k39uQ9Yudt">Join Discord</a>
</p>
</p>
[![Discord Chat](https://img.shields.io/discord/699653182946803722?label=Discord&logo=Discord)](https://discord.gg/k39uQ9Yudt)
[![PR's Welcome](https://img.shields.io/badge/PRs%20-welcome-brightgreen.svg)](CONTRIBUTING.md)

## Building From Source
SkyMP is an open-source multiplayer mod for Skyrim ⚡

You can find instructions on setting up the project locally below. To get a local copy up and running follow these simple example steps. You need ~4 GB RAM, ~22 GB on your hard drive and some free time.
SkyMP is built on top of the [SkyrimPlatform](docs/docs_skyrim_platform.md) - a tool to create Skyrim mods with TypeScript and Chromium. 🚀

## Prerequisites
This repo hosts all sources to ease local setup and contributing. See [CONTRIBUTING](CONTRIBUTING.md) for build instructions.

### Common
![image](skymp.jpg)

These tools required regardless of your system:
### What's Synced

* 64-bit [NodeJS](https://nodejs.org/en/download/) 12.x/14.x/16.x
* [Yarn](https://yarnpkg.com/getting-started/install): `npm install --global yarn`
* [CMake 3.18.2](https://cmake.org/download/) or higher
- [x] Player movement and animation sync
- [x] PvP sync: melee damage, attributes, death
- [x] Inventory sync: equipment, containers, etc
- [x] Limited scripts sync (WIP) - we have our own Papyrus engine
- [ ] Who knows what comes next? We work on synchronizing all Skyrim game mechanics.

### Windows
### Multiplayer Features

Before your start make sure that your system meets the conditions:

* Windows 7 or higher *([Windows 10](https://www.microsoft.com/en-us/software-download/windows10) is recommended)*
* [Visual Studio 2019](https://visualstudio.microsoft.com/downloads/)
* .NET Framework SDK at 4.6.0 or higher *(Visual Studio Installer -> .NET desktop development)*
* Python 3.9.x 64bit or 32bit *(Visual Studio Installer -> Idividual components -> search for python)*

### Linux

You can build and run server and unit-tests on Linux.
As Skyrim has no native Linux version, client can only be built using MSVC,
but then can be run with Proton (though some crashes can occur on SP startup
and it can be tricky to get Skyrim itself to work with non-ASCII text, for example).

* Ubuntu 18.04 or 20.04. Other distros are not tested or are expected to fail:
* Alpine Linux doesn't work
* Arch-based distros also [won't be able to run the server](https://github.com/chakra-core/ChakraCore/issues/6613)
* Clang 12 *(GCC is not supported)*: `sudo apt install clang-12`
* Python 2 (not 3.x! It is needed to build ChakraCore. Don't worry, it won't conflict with Python 3):
`sudo apt install python2`
* Make sure that your NodeJS and CMake are fresh enough:
* You can use [`nvm`](https://github.com/nvm-sh/nvm) or [Nodesource's apt repositories](https://github.com/nodesource/distributions) to install fresh Node
* The simpliest way to install fresh CMake is to download a `.tar.gz` from [CMake download page](https://cmake.org/download/),
unpack it to your home directory and add it to path:
```sh
echo 'export PATH="$HOME/apps/cmake-3.22.0-.../bin:$PATH"' >> ~/.bashrc
```

If you don't wish to build all the dependencies by yourself, or have an unsupported distro,
you can use [a Docker image with preinstalled dependencies](https://hub.docker.com/r/skymp/skymp-vcpkg-deps):
```sh
docker run -it --rm -v "$PWD:$PWD" -w "$PWD" -u "`id -u`:`id -g`" skymp/skymp-vcpkg-deps ./build.sh ...
# ... or go rootless!
podman run -it --rm -v "$PWD:$PWD" -w "$PWD" -e VCPKG_DEFAULT_BINARY_CACHE=/home/skymp/.cache/vcpkg/archives \
skymp/skymp-vcpkg-deps ./build.sh ...
```
## Configuring and Building
### Common
1. Clone the repo, including submodules
```sh
git clone https://github.com/skyrim-multiplayer/skymp.git
cd skymp
git submodule init
git submodule update
```
2. Do OS-specific steps (see below)
### Windows
1. Make a build directory (used for project files, cache, artifacts, etc)
```sh
mkdir build
```
2. Generate project files with CMake (replace path with your actual Skyrim SE folder)
```sh
cd build
cmake .. -DSKYRIM_DIR="C:/Program Files (x86)/Steam/steamapps/common/Skyrim Special Edition"
```
For users who don't have Skyrim SE installed:
```sh
cd build
cmake ..
```
* Some tests would be skipped
* The server would require manual installation of Skyrim.esm and other master files
* Papyrus scripts that require Bethesda's compiler would not be compiled, prebuilts would be used
3. Build with CMake:
```sh
cmake --build . --config Debug
```
On Windows you also can open `build/skymp.sln` with Visual Studio, then `Build -> Build Solution`.
All build artifacts would be placed into `build/dist`.
#### How to build only SkyrimPlatform
- For those users who want to build SP but not SkyMP there is `ONLY_SP` option:
```sh
cmake .. -DONLY_SP=ON
```
### Linux
On Linux, there might be some tricky dependency issues. To work around them,
we recommend you to use a wrapper script `build.sh`. It will create a temporary
directory and add some aliases to `PATH`.
1. Generate project files with CMake wrapper (replace path with your actual Skyrim SE folder)
```sh
./build.sh --configure -DCMAKE_BUILD_TYPE=Debug \
-DSKYRIM_DIR="$HOME/.steam/debian-installation/steamapps/common/Skyrim Special Edition"
```
For users who don't have Skyrim SE installed:
```sh
./build.sh --configure -DCMAKE_BUILD_TYPE=Debug
```
If you're building for a production machine, change build type to Release:
```sh
./build.sh --configure -DCMAKE_BUILD_TYPE=Release
```
2. Build with CMake wrapper:
```sh
cd build
../build.sh --build
```
Additional arguments after `--build` will be passed to CMake. E.g. you can specify the build target:
```sh
cd build
../build.sh --build --target=unit # only build unit-tests and their dependencies
# Will run cmake --build . --target=unit
```
### Optional steps after build
1. Run tests:
```sh
ctest -C Debug --verbose
```
Some tests ([ESPMTest](https://github.com/skyrim-multiplayer/skymp/blob/main/skymp5-server/cpp/unit/EspmTest.cpp)) require Skyrim SE data files and will be skipped if you didn't specify `-DSKYRIM_DIR`.

In order to avoid potential errors, make sure:
1. You have installed it using Steam and it's up to date (currently last update was on [Nov 20, 2019](https://steamdb.info/depot/489832/history/?changeid=M:8702665189575304780)). See SteamDB for [hashes](https://steamdb.info/depot/489832/?show_hashes) and [update history](https://steamdb.info/depot/489832/history/).
2. You did not modify `Skyrim.esm`, `Update.esm`, `Dawnguard.esm`, `HearthFires.esm` and `Dragonborn.esm`. (Ideally, you should have pure Vanilla version installed.)
2. Calculate test coverage (Windows-only):
Install [OpenCppCoverage](https://github.com/OpenCppCoverage/OpenCppCoverage/releases) and then:
```sh
cmake .. -DCPPCOV_PATH="C:\Program Files\OpenCppCoverage"
ctest -C Debug --verbose
```
These commands would re-generate project files with coverage enabled and run tests. Coverage report would be in `build/__coverage`.
## License
Use of this source code is subject to GPLv3. (See `LICENSE` for more information)
<!-- CONTACT -->
## Contact
Leonid Pospelov - Pospelov#3228 - [email protected]
Project Link: [https://github.com/skyrim-multiplayer/skymp](https://github.com/skyrim-multiplayer/skymp)
- Mostly server-controlled game state - you can't cheat everything
- Store your world in plain files or MongoDB
- Customize your server with TypeScript or Papyrus scripting
- Use esp/esm mods, just ensure both client and server load order are the same
1 change: 1 addition & 0 deletions ROADMAP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

16 changes: 9 additions & 7 deletions docs/docs_skyrim_platform.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,7 @@ Here you will find documentaiton aimed for you to create your own mods using Sky

The documentation is versioned up-to-date with SkyrimPlatform itself. If you read this page on GitHub, it's probably docs on latest SP revision. We release SkyrimPlatform updates from time to time. See [here](https://github.com/skyrim-multiplayer/skymp/tree/main/docs/release/dev) what is included in the upcoming SP update.

## Versioning

SP follows [Semantic Versioning](https://semver.org/) for JavaScript, but not for TypeScript.

It means that non-major updates won't break compiled TypeScript plugins or plugins written in JavaScript. If they do, treat it as an SP bug then.

On the other hand, updating `skyrimPlatform.ts` may break the compilation of your TypeScript plugins. You likely will be able to easily fix these problems, or ask for help in our Discord server, or just use `skyrimPlatform.ts` from one of the previous versions.
You can get Skyrim Platform from Nexus: https://www.nexusmods.com/skyrimspecialedition/mods/54909

## Table of contents

Expand Down Expand Up @@ -46,3 +40,11 @@ On the other hand, updating `skyrimPlatform.ts` may break the compilation of you
[Papyrus]: skyrim_platform/papyrus.md
[Texts]: skyrim_platform/texts.md
[Win32]: skyrim_platform/win32.md

## Versioning Notes

SP follows [Semantic Versioning](https://semver.org/) for JavaScript, but not for TypeScript.

It means that non-major updates won't break compiled TypeScript plugins or plugins written in JavaScript. If they do, treat it as an SP bug then.

On the other hand, updating `skyrimPlatform.ts` may break the compilation of your TypeScript plugins. You likely will be able to easily fix these problems, or ask for help in our Discord server, or just use `skyrimPlatform.ts` from one of the previous versions.
Binary file modified skymp.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 10633b2

Please sign in to comment.