Skip to content

Compiling for Windows

Starciad edited this page Jan 15, 2025 · 2 revisions

Introduction

Compiling for Windows is a straightforward process that requires just a few steps. If you have already followed the instructions in Compiling the Game and Development Setup, you are ready to proceed.

Preparation

First, select a stable release version. This is important because the main branch might contain changes that are incompatible with external assets required for the game. These assets are only available in official release versions.

Visit the Releases page on the game's repository to choose a version. Download the source code and its corresponding assets. Once downloaded, extract the files to a directory of your choice.

Next, move the assets subdirectory (found in StardustSandbox.v*.assets/) to the following path:

{your chosen directory}/StardustSandbox/src/SS.ContentBundle/

This ensures the assets are correctly integrated into the project.

Compiling

With everything prepared, you can start the compilation process. Choose one of the methods below:

Compiling with Visual Studio 2022

In the src directory of the source code, you will find .sln (solution) files with the following naming pattern:

StardustSandbox.{platform}.sln

The {platform} suffix indicates the technology used by the project. For more information, refer to the Game Platforms article.

  1. Open the corresponding solution file in Visual Studio 2022.
  2. Press F6 to start the compilation process, or use the option Compilation > Compile Project.

During the build process, all required libraries will be downloaded, and the assets will be processed. This may take some time, so please be patient.

If everything goes smoothly, the compilation will complete successfully.

Compiling via Terminal

After extracting the source code, navigate to the src directory. Locate the solution file you want to use, following the same naming pattern:

StardustSandbox.{platform}.sln

Open a PowerShell terminal in the directory and execute the following command to compile the project:

dotnet build "StardustSandbox.{platform}.sln"

To optimize and publish the game, use:

dotnet publish "StardustSandbox.{platform}.sln"

Replace {platform} with the desired platform, such as DesktopGL or WindowsDX.

The process will download the necessary libraries and build all project components. This might take a while, so please wait.

If everything completes without errors, the game will be successfully compiled.

Running and Debugging

After compiling the project, the executable file will be available at:

StardustSandbox/src/SS.Game/bin/Debug/StardustSandbox.exe

or

StardustSandbox/src/SS.Game/bin/Release/StardustSandbox.exe

With this, you can run the game for testing, experimentation, or just for fun. If you want to contribute to the project, check out the Contributing to the Project article.