T
T
Tilted Online
Search…
Build Guide
How to work with the code and compile it.

Cloning the repository

Choose or create a directory for the repository to get cloned into, such as your Desktop. This is the directory we'll be working out of, so pick somewhere convenient. Be aware that spaces in the path will not work! For example C:\dev\git_projects\TiltedOnline is fine but C:\dev\git projects\TiltedOnline will NOT work.
Using a CLI, run the following command in the directory from the previous step: git clone --recursive https://github.com/tiltedphoques/TiltedOnline.git
Once the command has finished executing, you should have a copy of this repository named TiltedOnline inside your project directory.
Do NOT use the debug build for the client as it will ONLY work for the server. If you want to debug the client, use releasedbg.

Setting up the environment

Requirements

As mentioned in the Readme you will need Visual Studio 2019 (the community edition is freely available for download) and xmake to build the project, as well as Node.js for the scripts to run properly.

Generating the project files

You can either directly build the project by running xmake -y in the root folder, or generate Visual Studio solutions with xmake project -k vsxmake which can then be found in the vsxmake20** folder. The instructions are identical for Linux.
You MUST do this step every time you merge changes from the main repository to avoid conflicts.
If all goes well, everything should now be compiled. Should you encounter any errors, feel free to ask for help in the Skyrim Together Discord #coding channel.

Linking the files to the game

Building is the first step; once the project compiled successfully you will need to generate an install by running xmake install -o distrib, which will create a directory called distrib in the root path that contains all of the files needed to run.

Optional steps

Shortcuts to binaries

For your convenience, it's recommended to create a shortcut to TiltedOnline\distrib\bin\TiltedOnline.exe and TiltedOnline\distrib\bin\SkyrimTogetherServer.exe (or TiltedOnline\distrib\bin\FalloutTogetherServer.exe for Fallout) either on your task bar or in the root folder containing TiltedOnline.

Server parameters

Instead of running the server executables directly, you can instead create a .bat or .sh file to run the executables with any of the following (optional) parameters:
1
-p, --port N port to run on (default: 10578)
2
--premium Use the premium tick rates (60 ticks instead of 20 ticks)
3
-h, --help Display the help message
4
-n, --name arg Name to advertise to the public server list
5
-v, --verbose Log verbose
6
-t, --token arg The token required to connect to the server, acts as a password
Copied!
For example, SkyrimTogetherServer.exe --name "My Server" --port "10578" --premium would launch a SkyrimTogether server instance with (publicly visible) name My Server, on port 10578 UDP, with a premium tickrate (60 ticks per second instead of 20).

Verifying

Launch TiltedOnline.exe to start up the mod, either directly or via a shortcut. If everything worked as intended, a Tilted Reverse Console will pop up and the Imgui UI will be displayed on top of your game. Once loaded into a save, run the corresponding server executable (or script, if you created one). You should now be able to connect in-game by using the UI in the top left corner; pressing RCTRL thrice should free your mouse so that you're able to interact with the UI. The UI is layered on top of one another by default, so you'll need to move the UI windows first to be able to connect.

Debugging

In Visual Studio, go to Debug -> Attach to process and select the game(s) (SkyrimSE.exe or Fallout4.exe) then click Attach.
If you explicitly require a debugger, you can add the line Debug::WaitForDebugger(); in the TiltedOnlineApp::TiltedOnlineApp() constructor. This will block the game from running on startup until a debugger has been attached.
You can also just set the Launcher project as the startup project and launch it directly from Visual Studio. This requires to get a setup similar to the distrib/bin directory where the debug process is located.

Working in this repository

From now on, whenever you want to make a change in the repository, you will first need to branch off the master branch. Using a CLI in the TiltedOnline directory, first check if the master branch is fully up to date:
1
git checkout master
2
git fetch
3
git pull
Copied!
Now you can create a new branch. Please use the feature- prefix so that it's clear that your branch is a temporary, in-progress development branch. Creating your branch can be done using one of two methods:

CLI

Simply enter git checkout -b feature-somenamehere to have a branch created for you.

GitHub for Desktop

In the application, go to Branch -> New branch.... Give this an appropriate name (don't forget the prefix) and ensure that the branch is based on the master branch.

Understanding the code

Project structure

When it comes to the actual code (located in TiltedOnline\Code), the two primary folders of interest are client and server.
Client is the core of the mod and can be broken down into Games, Services, and Systems.
  • Games contains all of the code that is Skyrim and Fallout 4 related, it mostly contains class structures and hooks to different parts of the engine
  • Services contains the different services that handle the actual sync, display, and gameplay
  • Systems contains specific tasks like interpolation and consuming animations
Server is the, well, server! It doesn't really contain much at the moment, it's a translation layer more than anything for the time being.

Starting points

When getting started, a good place to begin is looking at the TestService in client as it demonstrates how to get a service to listen to update events and how to spawn a copy of yourself.
Once you wrap your head around that you can have a look at ScriptService, which shows how to iterate over the world entities, retrieve the components and manipulate them correctly.

Afterword

And that's all! With that, you're on your way to making great contributions to the repository. As mentioned previously, if you have any questions or encounter any hurdles, feel free to use the #coding channel in the Skyrim Together Discord!
Last modified 4mo ago