For support please join the SE Mods Discord.
Please consider supporting my work on Patreon or a one time donation via PayPal.
Thank you and enjoy!
This repository provides a way to decompile the game into C# 11.0 source code in several projects, combined into a single solution. It also contains a script and patches to fix the code to run on .NET 8.0.
See also: Plugin Loader on .NET 8.0
Space Engineers is a trademark of Keen Software House s.r.o.
I have no affiliation with Keen Software House.
This repository contains an advanced development tool. If you are only playing Space Engineers and not developing for it, then you should not use this repository in any way. Play the original game as it is installed by Steam.
The method described in this repository is completely unsupported by the game's developer. Use it only at your own risk.
Do not report any bugs based on running the game this way, unless the exact same issue is reproducible in the original game.
If decompiling software for your own personal learning, research, testing or debugging purposes is against the law in your country, then do not use this repository.
Never publish the decompiled source code, including, but not limited to uploading it to publicly available source code repositories.
- Space Engineers installed via Steam
- .NET 8.0 SDK, Windows x64
- JetBrains Rider or Microsoft Visual Studio
- ILSpy version 8.2.0.7535 - Install it by running
SetupILSpy.bat
- Python 3.12 or newer
- Git to create a local repository
Make sure these executables are available on PATH
:
ilspycmd
python
git
Define this environment variable: SPACE_ENGINEERS_ROOT
- Usual value:
C:\Program Files (x86)\Steam\steamapps\common\SpaceEngineers
- If you installed the game at a custom path, then use that path.
Run Prepare.bat
, it should take about 10-20 minutes to complete.
It should print DONE
at the end. If it prints FAILED
, then investigate
the console output and try again. This script is designed to be retryable,
but it requires reverting the working copy to the latest commit beforehand.
You can then open and built the project in your C# IDE (Rider, Visual Studio).
Alternatively you can build and run a Release
build from the command line by
executing the BuildAndRun.bat
script. It should work without an IDE.
Enjoy!
Debug
builds are running a bit slower than normal due to the lack
of code optimization, but still usable for development/research.
Release
builds should also work and provide the usual performance.
Release builds are less debuggable due to code optimization, you
may not be able to break the code everywhere and some variable
values may not be observable.
Investigating game bugs and performance issues directly without
continuously waiting on the decompiler. Being able to quickly navigate
the code and even change it at runtime. You can see all variable values
and can break the code anywhere if you run a Debug
build.
Prototyping plugins by directly changing the game's source code. Once it works and tested, it can be turned into a plugin usable on Plugin Loader. Combined with publicizer support (yet to be accepted to PL) it can be a powerful way to develop new plugins.
You can use the modified Plugin Loader on .NET 8.0. Please see the instructions there.
Please note, that plugins using transpiler patches or verifying the bytecode would likely break. Incompatible plugins could be made compatible with the .NET 8.0 build of the game, they just need some work. The plugin authors may make them available at their discretion either as an alternate version or by using runtime conditions on the IL code.
- The game analytics is disabled, because its logging broke. We don't want to confuse Keen's telemetry with our custom builds anyway.
- The script performance profiling is disabled, because it broke the script compiler. It has not been fixed, because without game analytics it is pointless to have anyway.
git format-patch -1 HEAD --stdout >Manual_fixes.patch
In alphabetical order
- BetaMark
- Bishbash777
- Casinost
- Dorimanx
- wafoxxx
- DontFollowOrders
- Gabor
- Lazul
- Lotan
- mkaito
- Raidfire
- ransomthetoaster
- zznty: motivation, slight hints into the right direction
Make sure you have the Bin64
folder linked to your solution folder.
If it is not there, then run LinkBin64.bat
to restore it.