74 lines
2.9 KiB
Markdown
74 lines
2.9 KiB
Markdown
---
|
||
title: Navigating Game Code
|
||
description: This page includes setup instructions for decompiling the game as well as basic description of game assemblies
|
||
published: true
|
||
date: 2025-07-07T13:40:23.556Z
|
||
tags:
|
||
editor: markdown
|
||
dateCreated: 2025-07-07T13:38:20.447Z
|
||
---
|
||
|
||
# Navigating Game Code
|
||
|
||
Understanding and navigating the Space Engineers game code is essential for developing powerful plugins with SE Launcher. This page provides an overview of how to browse, analyze, and make sense of the game's internal structure.
|
||
|
||
---
|
||
|
||
## Viewing Decompiled Code in IDEs
|
||
|
||
Most modern C# IDEs provide built-in decompilation features that allow you to explore game code directly:
|
||
|
||
- **Control + Click** on a type or method name in your code to navigate to its decompiled definition.
|
||
|
||
> This is ideal for quickly checking method signatures, class hierarchies, and understanding usage patterns.
|
||
|
||
---
|
||
|
||
## Using dnSpy for Deep Analysis
|
||
|
||
For a more detailed and structured approach to exploring game internals, it is highly recommended to use **dnSpy**:
|
||
|
||
- dnSpy is a powerful .NET assembly editor and decompiler that lets you browse the game's compiled assemblies with a complete tree view, IL inspection, and more.
|
||
|
||
Download it here:
|
||
[https://github.com/dnSpyEx/dnSpy/releases](https://github.com/dnSpyEx/dnSpy/releases)
|
||
|
||
---
|
||
|
||
## Game Code Structure Overview
|
||
|
||
The game is split into several assemblies (DLLs), each with its own responsibility. Here’s a breakdown of the most important ones:
|
||
|
||
### Core Engine Assemblies
|
||
|
||
These contain low-level functionality shared across all parts of the game engine:
|
||
|
||
- **`VRage`** – Base utility and system libraries
|
||
- **`VRage.Game`** – Core gameplay systems and logic definitions
|
||
- **`VRage.Input`** – Input management
|
||
- **`VRage.Math`** – Math utilities (vectors, matrices, geometry)
|
||
- **`VRage.Network`** – Networking layer
|
||
|
||
### Game and Mod API Assemblies
|
||
|
||
These contain actual gameplay logic and modding interfaces:
|
||
|
||
- **`Sandbox.Common`** – Public interfaces and modding API; includes most definitions with `Ingame` suffix used in vanilla mods and scripts.
|
||
- **`Sandbox.Game`** – Core game logic, systems, components, blocks, and gameplay mechanics. This is the main body of the game logic.
|
||
- **`SpaceEngineers.Game`** – Game-specific logic for Space Engineers itself.
|
||
Originally, `Sandbox.Game` was shared between **Space Engineers** and **Medieval Engineers**, but the codebases were split long ago.
|
||
|
||
---
|
||
|
||
## Accessing Game APIs from Plugins
|
||
|
||
Plugins have full access to the same APIs and patterns used in vanilla modding, including:
|
||
|
||
- **Session components**
|
||
- **Entity (GameLogic) components**
|
||
- **ObjectBuilders** (used to define and serialize game data)
|
||
|
||
In addition, plugins are not restricted like workshop mods, and can also interact with internal or private APIs, patch methods, and hook into engine-level systems.
|
||
|
||
This means you can both extend standard game logic and implement entirely new systems by leveraging both public and internal APIs.
|