NoMansSky:The Modding Basics: Difference between revisions

From Step Mods | Change The Game
(17 intermediate revisions by the same user not shown)
Line 1: Line 1:
__NOTITLE__
__NOTITLE__
{{NMSPage|contentTitle=Getting Started}}
{{NMSPage|contentTitle=The Modding Process}}
{{TOC_right}}
{{TOC_right}}
== Introduction ==
== Introduction ==
This quick guide has the goal of quickly introducing fundamental aspects to modding No Man's Sky without going into many specifics.<br>
This quick guide has the goal of quickly introducing fundamental aspects to modding No Man's Sky without going into many specifics.<br>
Primarily this focuses on accessing your game files and introducing some core tools involved with modding.
Primarily this focuses on accessing game files to be able to modify them and then to repack them into a working mod.<br><br>
For any NMS modding activity, you will always use the same few tools.<br>
For this tutorial, you will need to download and unzip :
* [https://github.com/monkeyman192/MBINCompiler/releases MBINCompiler] by '''Monkeyman192'''
* [https://www.nexusmods.com/nomanssky/mods/320 NMS Modding Station] by '''Tub0Crisco'''


== Unpacking the Game Assets ==
== 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.<br>
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.<br>
.PAK files are compressed archive files originaly designed [http://www.psdevwiki.com/ps3/PlayStation_archive_(PSARC) for PlayStation games].
These .PAK files are compressed using the known [http://www.psdevwiki.com/ps3/PlayStation_archive_(PSARC) PSARC Format] initialy designed for PlayStation games and each .PAK files stores a specific part of all the game assets.


In order to extract assets from the archives, you may use either the [https://github.com/periander/PSArcTool PSARCTool] or [https://www.nexusmods.com/nomanssky/mods/320 NMS Modding Station].<br>
So in order to extract assets from the archives, you may use either the [https://github.com/periander/PSArcTool PSARCTool] or [https://www.nexusmods.com/nomanssky/mods/320 NMS Modding Station].<br>
For this tutorial, we will use '''NMS Modding Station''' as it is easy to use : simply download it, unzip anywhere you like, and follow the instructions - or continue to read as this will guide you on how to use it.
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 and configure the paths to the PCBANKS folder and a folder for where you want to unpack all the assets.
Upon double-clicking the .exe it may initially appear dysfunctional, but this is because you first need go to Setup -> Settings.<br>
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 Small|text=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. [https://notepad-plus-plus.org/ Notepad++] is still highly recommended.


Each .PAK files stores a part of all the game assets. While some modders prefer to unpack specific files, it is preferable to unpack all of the game's archives. Be sure to have at least up to 25 GB free on your hard drive though as as of the 2.61.1 Update, about 24.1 GB of space is used by all unpacked assets.
After you are done with these steps, you can now close the Settings window and launch the unpacking process.<br>
To do this, simply select '''Unpack Game Files''' from the Setup dropdown menu in NMS Modding Station and the unpacking will begin.  


{{Notice Small|text=Remember you will need to re-unpack all the game assets each time Hello Games will release a new patch/update.}}
{{Warning Small|text=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 !}}
 
In order to begin unpacking, you first have to setup a few directories from the Setup menu:
* '''Set Path to Unpacked Game Files''' - This is a folder you will create, in which all the No Man's Sky files will be unpacked.
* '''Set Path to MBINCompiler''' - The folder where you placed MBINCompiler, one of the tools you downloaded. It is preferable to place this in an easy to access directory as you will come back to this tool very frequently.
* '''Set Path to PCBANKS''' - 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\).
 
After you are done with these steps, simply select '''Unpack Game Files''' from the Setup dropdown menu in NMS Modding Station.  
{{Warning Small|text=The unpacking process usually takes anywhere between 10-15 minutes on a SSD and 15-25 minutes on a standard HDD.}}
{{Warning Small|text=The unpacking process usually takes anywhere between 10-15 minutes on a SSD and 15-25 minutes on a standard HDD.}}


== Decompiling MBIN files ==
== Decompiling MBIN files ==
After NMS Modding Station has finished unpacking, your unpacked directory should now show a lot of folders and files. These are the game assets.
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 serialized [http://www.w3schools.com/xml/ 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.


Since .MBIN files are in a raw format, you will need to decompile these files into a more human-readable form with the use of [https://github.com/monkeyman192/MBINCompiler/releases MBINCompiler].
The most common file type you will see throughout these new folders are .MBIN files.<br>
These are basically [http://www.w3schools.com/xml/ 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 [https://github.com/monkeyman192/MBINCompiler/releases MBINCompiler].


To decompile .MBIN files, just right-click on them in NMS Modding Station and choose "Decompile" to see the creation of the equivalent .exml file that you can read and edit with any text editor. If later you right-click on the resulting .exml file, you will see you can "Compile" and it will convert the exml file back into the mbin file.
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.<br>
If you're not using NMS Modding Station, you can achieve the same by simply dragging an .mbin file or a folder containing some onto the MBINCompiler executable. This will create .EXML files with the same name that can be opened with any text editor. And dragging an .EXML file or a folder with some .exml files back onto MBINCompiler will do the reverse, including any change you made.  
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.<br>
<br>
If you're not using '''NMS Modding Station''', you can achieve the same following the [https://wiki.step-project.com/NMS:Tutorials/HowToMBINCompiler How to use MBINCompiler page].  


{{Notice Small|text=Be sure to make a copy of any .MBIN you want to edit in a project folder of your choice before editing them. This way you will keep all the original game files without having to unpack the archives all over again because you once edited them for another project.}}
{{Notice Small|text=Be sure to make a copy of any .MBIN you want to edit in a project folder of your choice before editing them. This way you will keep all the original game files without having to unpack the archives all over again because you once edited them for another project.}}


== Creating your first mod ==
== Creating your first mod project ==
To start with NMS modding, the most impactful files are [https://wiki.step-project.com/NMS:Reference_Guides/Global_Files GLOBALS]. Globals are configuration files storing all the NMS global settings and you will find them all at the root of your unpaked files.<br>
To start with NMS modding, the most impactful files are [https://wiki.step-project.com/NMS:Reference_Guides/Global_Files GLOBALS]. Globals are configuration files storing all the NMS global settings and you will find them all at the root of your unpaked files.<br>
To edit one and create your first mod, pick 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 "Decompile" to decompile it and double-click it to open your text editor ([https://notepad-plus-plus.org/ Notepad++] is recommended). You can now observe the long list of setting names and values and make your first changes.<br>
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.<br>
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.<br>


== Making changes and create your mod ==
Once in .EXML format, you can now explore all the game settings and make the changes you like.<br>
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.<br>
<br>
When you're done, do not forget to recompile the edited .EXML into a .MBIN by right clicking on the .exml and choosing "Recompile".<br>
When you're done, do not forget to recompile the edited .EXML into a .MBIN by right clicking on the .exml and choosing "Recompile".<br>
Then right-click on the .mbin and choose "Pack Mod" to recreate the .pak from the .mbin file.<br>
This will convert the .EXML including all your changes into the .MBIN file again.<br>
You can now right-click and choose "Copy to your MODS folder" and launch NMS to test your changes in game !
<br>
 
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 !<br>
<br>
Ready for a test ?<br>
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 !
{{NMSPageClose}}
{{NMSPageClose}}
[[Category:No Man's Sky]][[Category:NMS-Tutorial]]
[[Category:No Man's Sky]][[Category:NMS-Tutorial]]

Revision as of 18:10, August 11, 2020

Template:TOC right

Introduction[edit | edit source]

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[edit | edit source]

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.

Template:Notice Small

  • 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.

Template:Warning Small Template:Warning Small

Decompiling MBIN files[edit | edit source]

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.

Template:Notice Small

Creating your first mod project[edit | edit source]

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[edit | edit source]

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 ! Template:NMSPageClose