NoMansSky:The Modding Basics: Difference between revisions

From Step Mods | Change The Game
mNo edit summary
Line 4: Line 4:
== 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.


== Unpacking the Game Assets ==
== Unpacking the Game Assets ==

Revision as of 12:28, 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.

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.
.PAK files are compressed archive files originaly designed for PlayStation games.

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

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.

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.

Template:Notice Small

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. Template:Warning Small

Decompiling MBIN files[edit | edit source]

After NMS Modding Station has finished unpacking, your unpacked directory 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 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, they need to be decompiled into a more human-readable form and this is done thanks to a tool named MBINCompiler.

To decompile .MBIN files in NMS Modding Station, just right-click on 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

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.

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, 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 (Notepad++ is recommended). 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 !

Template:NMSPageClose