NoMansSky:The Modding Basics: Difference between revisions

From Step Mods | Change The Game
No edit summary
Line 22: Line 22:
* '''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.
* '''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.
* '''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\).
* '''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. Notepadd++ is still the best text editor as far as we know.
* '''EXML Editor Path''' - This is the path to your prefered text editor. [https://notepad-plus-plus.org/ Notepad++] is still highly recommended.


After you are done with these steps, you can now close the Settings window and launch the unpacking process.<br>
After you are done with these steps, you can now close the Settings window and launch the unpacking process.<br>
Line 43: Line 44:


{{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 ==
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, 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 ==
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>
Then right-click on the .mbin and choose "Pack Mod" to recreate the .pak from the .mbin file.<br>
You can now right-click and choose "Copy to your MODS folder" and launch NMS to test your changes in game !


== Recompiling ==
== Recompiling ==
Line 55: Line 70:


Once you have the directory structure sorted out and your recompiled MBINs in the appropriate folders (e.g. BASEBUILDINGTABLE.MBIN in \METADATA\REALITY\TABLES), double-click '''MYMOD''' folder in the '''Project''' tab of NMS Modding Station, right-click within the '''MYMOD''' folder, select {{ui|Pack Mod}}, and you'll find yourself with a .pak called '''MYMOD.pak'''. However, feel free to name this file anything you like.
Once you have the directory structure sorted out and your recompiled MBINs in the appropriate folders (e.g. BASEBUILDINGTABLE.MBIN in \METADATA\REALITY\TABLES), double-click '''MYMOD''' folder in the '''Project''' tab of NMS Modding Station, right-click within the '''MYMOD''' folder, select {{ui|Pack Mod}}, and you'll find yourself with a .pak called '''MYMOD.pak'''. However, feel free to name this file anything you like.
== Creating your first mod ==
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>
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>
You can now right-click and choose "Copy to your MODS folder" and 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 13:14, 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[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[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".
Then right-click on the .mbin and choose "Pack Mod" to recreate the .pak from the .mbin file.
You can now right-click and choose "Copy to your MODS folder" and launch NMS to test your changes in game !

Recompiling[edit | edit source]

When creating your mod, you'll need to remember that the files you modified must have the same exact directory structure as you found them originally. For example, if you modified an MBIN file inside a directory called /METADATA/REALITY/TABLES/, you must preserve the same directory structure. You don't need to copy other files in the same directories if you didn't modify them, as this will only increase the size of your mod.

If you copied the directory into another folder such as "MY MOD", your directory will be /MYMOD/METADATA/REALITY/TABLES/ and so on. However, make sure that MYMOD doesn't contain ANY special characters (e.g. ( ) or [ ]), otherwise NMS Modding Station will NOT pack the mod correctly. This is due to an aspect of PSARCTool built into Modding Station, and applies whether you're using PSARCTool.exe or NMS Modding Station to pack your mods.

Packing Mods[edit | edit source]

To create your own PSARC archive, or .pak file, configure a projects folder path in NMS Modding Station via the top left Setup Menu\Settings and set all the paths.

If you don't have any project folder yet, you can create one called something like \My Mod Projects\. Within this folder you would place \MYMOD\[duplicated game directory structure].

Once you have the directory structure sorted out and your recompiled MBINs in the appropriate folders (e.g. BASEBUILDINGTABLE.MBIN in \METADATA\REALITY\TABLES), double-click MYMOD folder in the Project tab of NMS Modding Station, right-click within the MYMOD folder, select [Pack Mod], and you'll find yourself with a .pak called MYMOD.pak. However, feel free to name this file anything you like.

Template:NMSPageClose