Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update compilation instructions #142

Merged
merged 2 commits into from
Dec 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 20 additions & 13 deletions src/content/docs/en-US/developer/start/compiling.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,37 @@
title: Compiling
---

The first step before making changes to the source code is getting it to compile. Intersect relies on dozens of external libraries and tools (ie MonoGame, Newtonsoft Json.Net, etc) and our project is designed to fetch those dependencies automatically from Nuget.
The first step before making changes to the source code is getting it to compile. Intersect relies on dozens of external libraries and tools and our project is designed to fetch those dependencies automatically from Nuget **or** in the case of several libraries like LiteNetLib, these are "linked" in the repository via git submodules.

In order to get started open the Intersect.sln file in the Intersect-Engine folder. The solution should open in Visual Studio 2022.
## Getting started

Note: If you download the repository as a `.zip` file (or a tarball) instead of using Git, you are going to have to manually download our fork of our git submodule dependencies and copy them to the correct directories. **We do not provide support for downloading as a `.zip` file, we only support using Git.**

Before compiling, ensure that you have properly cloned the repository. You should see all of the below files in the `vendor/LiteNetLib` directory. If you do not have `vendor/LiteNetLib` or it is a file instead of a directory, or if it an empty folder, please ensure that you cloned via git and followed the [Getting started](https://github.com/AscensionGameDev/Intersect-Engine/blob/main/README.md#getting-started) section of the main repository's README.md.

![LiteNetLib submodule expanded](https://github.com/AscensionGameDev/Intersect-Documentation/assets/1476550/4e571401-1935-4ab7-a94a-4803bb950fed)

## Opening the project

In order to get started open the Intersect.sln file in the Intersect-Engine folder. The solution should open in your preferred .NET development environment (e.g. Rider, Visual Studio 2022 or later, VS Code, VSCodium). If you use the Windows-only Visual Studio 20XX, do not use prior to VS2022 as it will likely not work (and if you manage to get it to work we can't effectively provide support for it).

![solution](https://www.ascensiongamedev.com/resources/filehost/bb694eabb570f22d541f87d1db2fc68f.png)

## Compiling the project

In most cases all you should have to do is hit Build -> Build Solution at the top of your Visual Studio window and it will fetch all the dependencies for you automatically.

![building](https://www.ascensiongamedev.com/resources/filehost/c1c27a3366987a9279610e40667eecf0.png)

Your first build will probably fail with errors seen below. This is due to the project downloading the dependencies during a build that a successful build depends on.

![errors](https://www.ascensiongamedev.com/resources/filehost/3ddd530d599409f7a8a69a510fa3ab70.png)
If your build fails, please verify that you have downloaded all of the prerequisites and if a second build attempt doesn't resolve the errors, please manually run `dotnet restore` in the repository root in a terminal/command line. If you are on Linux or MacOS and did not run the setup script and you are seeing editor compilation issues, you need to disable the Windows-only editor project (Intersect.Editor).

If you experience the errors above just click Build > Clean Solution and then Build -> Build Solution again. If that doesn't work try restarting visual studio.
If you see the below `Unable to find project LiteNetLib.csproj` errors, **you did not successfully follow the instructions**, please try again before asking for support.

![clean](https://www.ascensiongamedev.com/resources/filehost/068c7b0d67e8fa94d998f8b2151f98a1.png)
![LiteNetLib.csproj not found](https://github.com/AscensionGameDev/Intersect-Documentation/assets/1476550/c495be85-2d75-4d76-8edf-01b4d1b73b53)

Visual Studio will notify you of a successful build in the bottom left corner of your ide.

![success](https://www.ascensiongamedev.com/resources/filehost/cfbb467b54914238dcadcde9383f342f.png)

The compiled version of Intersect can be found in your Intersect-Engine/build directory. There will be a lot of xml files along side the executables but you should only really care about the .exe and .pdb files for the Client, Editor, and Server for now.
Your first build will probably fail with errors seen below. This is due to the project downloading the dependencies during a build that a successful build depends on.

![output](https://www.ascensiongamedev.com/resources/filehost/5c0070679608ae4d663de3bc34c4527b.png)
The compiled version of Intersect can be found in the `bin` directories of each project. There will be a lot of xml files along side the executables but you should only really care about the .exe and .pdb files for the Client, Editor, and Server for now.

** Please note, if you want to run your client or editor using the debugger you will need to [download and place the appropriate assets](https://github.com/AscensionGameDev/Intersect-Assets) in the /build/debug/client and /build/debug/editor directories. **
**Please note, if you want to run your client or editor using the debugger you will need to [download and place the appropriate assets](https://github.com/AscensionGameDev/Intersect-Assets) in the /assets/development/client and /assets/development/server directories.**
13 changes: 7 additions & 6 deletions src/content/docs/en-US/developer/start/prerequisites.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
title: Prerequisites
---

Note: The Visual Studio 2022 installer has additional options that can be used to download all of the necessary pieces to compile Intersect v0.7.2-beta and earlier, using the links below may not be necessary.
Note: The below may be out of date. If you run into issues, please refer to the [Dependencies](https://github.com/AscensionGameDev/Intersect-Engine/blob/main/README.md#dependencies) section of the engine README.md before asking for support.

v0.7.2-beta and earlier require:
- [MSBuild 17.0](https://learn.microsoft.com/en-us/visualstudio/msbuild/whats-new-msbuild-17-0?view=vs-2022)
- [.NET Framework 4.6.2](https://dotnet.microsoft.com/en-us/download/dotnet-framework/net462), specifically the [Developer Pack (offline installer)](https://dotnet.microsoft.com/en-us/download/dotnet-framework/thank-you/net462-developer-pack-offline-installer)
#### Required

v0.7.2-beta and earlier may also require depending on your environment:
- [.NET Framework 4.6.1](https://dotnet.microsoft.com/en-us/download/dotnet-framework/net461), specifically the [Developer pack (offline installer)](https://dotnet.microsoft.com/en-us/download/dotnet-framework/thank-you/net461-developer-pack-offline-installer)
- [.NET 7 SDK](https://dotnet.microsoft.com/en-us/download/dotnet/7.0), verified for v7.0.11 (SDK 7.0.401)
- git: required for cloning submodules, if you want to do this manually you don't need this and use the .zip download but that is not supported
- Tested on 2.42.0

This is currently up to date for 0.8.0-beta.
Loading