The Modding Process
This quick guide has the goal of quickly introducing fundamental aspects to modding No Man's Sky without going into many specifics.
Primarily this focuses on accessing game files to be able to modify them and then to repack them into a working mod.
For any NMS modding activity, you will always use the same few tools.
For this tutorial, you will need to download and unzip :
Unpacking the Game Assets
No Man's Sky stores all of its assets, from textures to models, shaders code to entity behaviors under the No Man's Sky/GAMEDATA/PCBANKS folder, in the form of .PAK files.
These .PAK files are compressed using the known PSARC Format initialy designed for PlayStation games and each .PAK files stores a specific part of all the game assets.
So in order to extract assets from the archives, you may use either the PSARCTool or NMS Modding Station.
For this tutorial, we will use NMS Modding Station as it simplifies some steps : simply download it, unzip anywhere you like, and launch it.
Upon double-clicking the .exe it may initially appear dysfunctional, but this is because you first need go to Setup -> Settings.
Indeed in order to begin unpacking, you first have to setup a few directories from the Setup menu:
- Unpacked Game Files Path - This is the where all the assets will be unpacked. You can create any folder and use it for this task.
- MBINCompiler - The folder where you placed MBINCompiler you downloaded previously. It is preferable to place this in an easy to access directory as you will come back to this tool very frequently.
- Project Path - This folder will host all your mod projects. You can create any folder to be your project folder.
|Notice:||Avoid to place your project folder nested too deep inside your hard drive. If the path is too long, your mod won't be able to be repacked at the end|
- PCBANKS Path - The path to the No Man's Sky .pak source files. Its location differs if you got the game on Steam (\Steam\steamapps\common\No Man's Sky\GAMEDATA\PCBANKS\) or GOG (\GOG Galaxy\Games\No Man's Sky\GAMEDATA\PCBANKS\).
- EXML Editor Path - This is the path to your prefered text editor. Notepad++ is still highly recommended.
After you are done with these steps, you can now close the Settings window and launch the unpacking process.
To do this, simply select Unpack Game Files from the Setup dropdown menu in NMS Modding Station and the unpacking will begin.
|Warning:||Be sure to have some free space on your hard drive. As of the 2.61.1 Update, the whole assets occupy 24.1 GB !|
|Warning:||The unpacking process usually takes anywhere between 10-15 minutes on a SSD and 15-25 minutes on a standard HDD.|
Decompiling MBIN files
After NMS Modding Station has finished unpacking, the Unpacked Game Files tab should now show a lot of folders and files. These are the game assets.
The most common file type you will see throughout these new folders are .MBIN files.
These are basically XML files containing the bulk of configurations the game reads such as global settings, procedural generation rules, item databases, behaviors of in-game objects, and so on. But in a binary format. So they need a second step to be decompiled into a more human-readable form and this can be done thanks to a tool named MBINCompiler.
In NMS Modding Station, to decompile .MBIN files, you just need to right-click one of them and choose "Decompile" to see the creation of the equivalent .EXML file that you can read and edit with any text editor.
When later you will need to convert the file back, just right-click on the .EXML file, click on "Compile" and it will convert the .EXML file back into the .MBIN file.
If you're not using NMS Modding Station, you can achieve the same following the How to use MBINCompiler page.
Creating your first mod project
To start with NMS modding, the most impactful files are GLOBALS. Globals are configuration files storing all the NMS global settings and you will find them all at the root of your unpaked files.
To edit one and create your first mod, select a file with a name that points toward a theme you would like to change in NMS, like SkyGlobals or AISpaceShipGlobals. Then right-click and choose "Copy to project Path". Doing so, you will create a copy of the original .MBIN file and won't edit the original file by mistake.
As this is your first mod project, NMS Modding Station will ask you to create a new project folder. Name it to your likings and here you are with your own project tab currently hosting the only .MBIN file you chose. The next step is now to decompile it and it just needs to double-click the file.
Making changes and create your mod
Once in .EXML format, you can now explore all the game settings and make the changes you like.
To do so, double-click your .EXML file to open it in your text editor. You can now observe the long list of setting names and values and make your first changes.
When you're done, do not forget to recompile the edited .EXML into a .MBIN by right clicking on the .exml and choosing "Recompile".
This will convert the .EXML including all your changes into the .MBIN file again.
Then right-click in the project window and choose "Pack Mod". This will create a .pak file including all the project files : your first mod is done !
Ready for a test ?
You can now right-click your .pak file and choose "Copy to your MODS folder". The last step is now to launch NMS to test your changes in game !