No Man's Sky Modding Wiki
Tags: Visual edit apiedit
(→‎Unpacking the Game Assets: Updating unpacked size for 2.41)
Tag: Visual edit
 
(22 intermediate revisions by 7 users not shown)
Line 1: Line 1:
This quick guide has the goal of quickly introducing fundamental aspects to modding No Man's Sky without going into many specifics, starting with setting up your game client for the possibility of making your own mods and get you familiar with some core tools involved with modding.
+
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 your game files and introducing some core tools involved with modding.
   
You will be using three tools for the time being:
+
You will be using three tools for the time being:
* [https://nomansskymods.com/mods/nms-modding-station/ NMS Modding Station]
+
* [https://www.nexusmods.com/nomanssky/mods/320 NMS Modding Station]
  +
* [https://github.com/monkeyman192/MBINCompiler/releases MBINCompiler]
* MBINCompiler
 
 
* Any text editor of your choice (however, [https://notepad-plus-plus.org/download/v7.3.3.html Notepad++] is recommended).
 
* Any text editor of your choice (however, [https://notepad-plus-plus.org/download/v7.3.3.html Notepad++] is recommended).
  +
These tools will help you unpacking, decompiling and editing the game files (as well as the opposite process). While NMS Modding Station will allow you to do the initial unpacking of all the game assets, in the future you will also be able to pack/unpack single files by using PSArcTool. For the scope of this tutorial, though, we will only use the other tools.
MBINCompiler is linked in the tutorial below.
 
   
  +
'''Edit 12/2018:''' You can now also use the [https://www.nexusmods.com/nomanssky/mods/957 "auto mod builder - updater - lua mod script definition all in one system"] by Mjjstral, that automates every single step of NMS modding and comes with an easy to use new mod defintion file system.
== Accessing Game Assets ==
 
  +
[[File:Process Overview.jpg|none|thumb|800x800px]]
No Man's Sky stores all of its assets, from textures to models, shader code to entity behaviors, in the [http://www.psdevwiki.com/ps3/PlayStation_archive_(PSARC) PSARC archive] format used in general for PlayStation games. All these archives can be found under No Man's Sky/GAMEDATA/PCBANKS/ and have the extension *.pak.
 
  +
__FORCETOC__
 
== Unpacking the Game Assets ==
 
No Man's Sky stores all of its assets, from textures to models, shader code to entity behaviors, in the [http://www.psdevwiki.com/ps3/PlayStation_archive_(PSARC) PSARC archive] format used in general for PlayStation games. All these archives can be found under No Man's Sky/GAMEDATA/PCBANKS/ and have the extension *.pak.
   
In order to extract assets from the archives, you may use the [https://nomansskymods.com/mods/nms-modding-station/ NMS Modding Station]. NMS Modding Station is easy to use, simply download it, unzip the folder and extract the .exe and readme anywhere you like, and follow the instructions. However, you may also continue reading and this will guide you how to use it. Upon double-clicking the .exe it may appear dysfunctional, but this is because first you must go to the upper left Setup option and configure the paths to the PCBANKS folder and a folder for where you want to unpack its contents (i.e. the aforementioned .paks' content).
+
In order to extract assets from the archives, you may use the [https://nomansskymods.com/mods/nms-modding-station/ NMS Modding Station]. NMS Modding Station is easy to use, simply download it, unzip the folder and extract the .exe and readme anywhere you like, and follow the instructions. However, you may also continue reading and 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 its contents (i.e. the aforementioned .paks' content).
Different PAK files contain different files for the game. While some modders who wish to save disk space will simply unpack specific files, it is preferable to unpack all of the game's archives for now. Reserve at least up to 13 GB of space on your game install directory. As of the 1.24 Path Finder Update, about 10.3 GB of space is used when everything is unpacked.
 
   
 
Different PAK files contain different files for the game. While some modders who wish to save disk space will simply unpack specific files, it is preferable to unpack all of the game's archives for now. Reserve at least up to 25 GB of space on your game install directory. As of the 2.41 Update, about 23.2 GB of space is used when everything is unpacked.
In order to begin unpacking, simply select the Unpack Game Files option in the Setup dropdown menu in NMS Modding Station once you've provided it the proper paths. The unpacking process usually takes anywhere between 15-25 minutes on a standard HDD.
 
   
  +
'''NOTE:''' remember to re-unpack all the game assets whenever Hello Games releases a new patch for No Man's Sky.
== After Unpacking: The MBIN Format ==
 
  +
After NMS Modding Station has finished unpacking, your unpacked directory should now show completely new folders and files where all the files of the game are organized. It is preferable to have made your unpacked directory in the same folder as the original /PCBANKS/, so /GAMEDATA/, but it is not essential.
 
  +
In order to begin unpacking, you first have to setup few directories from the Setup menu:
  +
* '''Set Path to Unpacked Game Files''' - This is a folder you will create, and in which all the No Man's Sky files will be unpacked. It is preferable to have made your unpacked directory in the same folder as the original /PCBANKS/, so /GAMEDATA/ but it is not essential.
  +
* '''Set Path to MBINCompiler''' - The folder where you stored MBINCompiler, one of the tools you downloaded. It is preferable to place this in a different directory as you will come back to this tool very frequently.
  +
* '''Set Path to PCBANKS''' - The path to the source files of No Man's Sky. 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. The unpacking process usually takes anywhere between 15-25 minutes on a standard HDD.
  +
  +
== Decompiling MBIN files ==
 
After NMS Modding Station has finished unpacking, your unpacked directory should now show completely new folders and files where all the files of the game are organized.
   
 
The most common filetype you will see throughout these new folders are *.MBIN files. These are basically serialized [http://www.w3schools.com/xml/ XML files]. These files contain the bulk of configurations the game reads such as [[DESCRIPTOR Files|controls for procedural generation]], the [[ENTITY Files|behaviors of in-game objects]], and so on.
 
The most common filetype you will see throughout these new folders are *.MBIN files. These are basically serialized [http://www.w3schools.com/xml/ XML files]. These files contain the bulk of configurations the game reads such as [[DESCRIPTOR Files|controls for procedural generation]], the [[ENTITY Files|behaviors of in-game objects]], and so on.
   
Since MBIN files are encrypted, you will still need to decompile these files into a more human-readable form with the use of the [https://github.com/monkeyman192/MBINCompiler MBINCompiler]. Download the MBINCompiler and preferably place this on another directory as you will come back to this tool very frequently.
+
Since MBIN files are encrypted, you will still need to decompile these files into a more human-readable form with the use of the [https://github.com/monkeyman192/MBINCompiler/releases MBINCompiler].
   
To decompile .MBINs you must drag them onto the MBINCompiler executable. Once done, you will get a completely human-readable EXML file that can be opened with any text editor of your choice. Dragging an EXML file back onto MBINCompiler does the reverse, and recompiles the EXML into an MBIN file. If any changes were made to the EXML file, it will also attempt to recompile it into an MBIN, and should the changes be valid, recompile without issue.
+
To decompile .MBINs you must drag them onto the MBINCompiler executable. Once done, you will get a completely human-readable EXML file that can be opened with any text editor of your choice. Dragging an EXML file back onto MBINCompiler does the reverse, and recompiles the EXML into an MBIN file. If any changes were made to the EXML file, it will also attempt to recompile it into an MBIN, and should the changes be valid, recompile without issue.
   
 
However, this also means that you may wish to copy MBINs you're looking to change into a /_backup folder in its directory, so that you can revert to the default and rework any changes you may have been experimenting with, without having to unpack the archives all over again.
 
However, this also means that you may wish to copy MBINs you're looking to change into a /_backup folder in its directory, so that you can revert to the default and rework any changes you may have been experimenting with, without having to unpack the archives all over again.
   
  +
NOTE: In case MBinCompiler doesn't support your MBIN you can also use [https://nmsmodding.fandom.com/wiki/Mod_Creation_by_hex_editing_MBINs hex editing to create a mod].
== Compiling a Fully Releasable Mod and Playing It ==
 
Assuming you have modified several EXML files and succesfully recompiled them back into MBINS with MBINCompiler, you will 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 / SIMULATION / WHATEVERNAME /, you must preserve the same directory structure. You do not need to copy other files in the same directories if you did not modify them so you don't need to accidentally reship vanilla game assets.
 
 
If you copied the directory into another folder such as "MY MOD", your directory will be / MYMOD / METADATA / SIMULATION / WHATEVERNAME / and so on.
 
 
To create your own PSARC archive, simply configure a projects folder path in NMS Modding Station via the top left Setup option, Set Path to Your Mod Projects, that holds your mod projects, such as above, but a level higher, so /My Mod Projects/MYMOD/[duplicated game directory structure]. Once you have the directory structure sorted out and your recompiled MBINs in the appropriate folders, simply double click MYMOD folder in the Project tab of NMS Modding Station and then right click, select Pack Mod, and you'll find yourself with a .pak called MYMOD.pak. Feel free to name this file anything you like, but the preferred convention is _MOD.MYNAME.MYMOD.pak.
 
   
  +
== Where to start? ==
As of the Foundation Update, all mods are now run from a new MODS folder found in your default PCBANKS directory. Simply pop the ENABLEMODS.txt in the PCBANKS directory in a backup folder somewhere, then place your PAK file inside the MODS folder and run the game to check for your mod! It is important to note that mods are run in alphanumerical order. Alongside that, mods that use the same files will be overwritten by the last mod to be loaded.
 
  +
A good place to begin after this is to try [[Adding new buildable objects|adding existing objects to the build menu]] in the game. This is a relatively simple process that gives you a sense for how to mod the game, and helps to introduce you to the way the game files tend to be interconnected.
   
  +
Also check out [[EXML File Structure Documentation]].
As such, if you're lazy and don't wish to test for mod conflicts/issues, simply notify users in your mod description of what files you've modified and that this may create conflicts/issues with other mods that changed the same files.
 
  +
[[Category:Tutorial]]

Latest revision as of 22:20, 16 April 2020

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 your game files and introducing some core tools involved with modding.

You will be using three tools for the time being:

These tools will help you unpacking, decompiling and editing the game files (as well as the opposite process). While NMS Modding Station will allow you to do the initial unpacking of all the game assets, in the future you will also be able to pack/unpack single files by using PSArcTool. For the scope of this tutorial, though, we will only use the other tools.

Edit 12/2018: You can now also use the "auto mod builder - updater - lua mod script definition all in one system" by Mjjstral, that automates every single step of NMS modding and comes with an easy to use new mod defintion file system.

Process Overview

Unpacking the Game Assets[]

No Man's Sky stores all of its assets, from textures to models, shader code to entity behaviors, in the PSARC archive format used in general for PlayStation games. All these archives can be found under No Man's Sky/GAMEDATA/PCBANKS/ and have the extension *.pak.

In order to extract assets from the archives, you may use the NMS Modding Station. NMS Modding Station is easy to use, simply download it, unzip the folder and extract the .exe and readme anywhere you like, and follow the instructions. However, you may also continue reading and 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 its contents (i.e. the aforementioned .paks' content).

Different PAK files contain different files for the game. While some modders who wish to save disk space will simply unpack specific files, it is preferable to unpack all of the game's archives for now. Reserve at least up to 25 GB of space on your game install directory. As of the 2.41 Update, about 23.2 GB of space is used when everything is unpacked.

NOTE: remember to re-unpack all the game assets whenever Hello Games releases a new patch for No Man's Sky.

In order to begin unpacking, you first have to setup few directories from the Setup menu:

  • Set Path to Unpacked Game Files - This is a folder you will create, and in which all the No Man's Sky files will be unpacked. It is preferable to have made your unpacked directory in the same folder as the original /PCBANKS/, so /GAMEDATA/ but it is not essential.
  • Set Path to MBINCompiler - The folder where you stored MBINCompiler, one of the tools you downloaded. It is preferable to place this in a different directory as you will come back to this tool very frequently.
  • Set Path to PCBANKS - The path to the source files of No Man's Sky. 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. The unpacking process usually takes anywhere between 15-25 minutes on a standard HDD.

Decompiling MBIN files[]

After NMS Modding Station has finished unpacking, your unpacked directory should now show completely new folders and files where all the files of the game are organized.

The most common filetype you will see throughout these new folders are *.MBIN files. These are basically serialized XML files. These files contain the bulk of configurations the game reads such as controls for procedural generation, the behaviors of in-game objects, and so on.

Since MBIN files are encrypted, you will still need to decompile these files into a more human-readable form with the use of the MBINCompiler.

To decompile .MBINs you must drag them onto the MBINCompiler executable. Once done, you will get a completely human-readable EXML file that can be opened with any text editor of your choice. Dragging an EXML file back onto MBINCompiler does the reverse, and recompiles the EXML into an MBIN file. If any changes were made to the EXML file, it will also attempt to recompile it into an MBIN, and should the changes be valid, recompile without issue.

However, this also means that you may wish to copy MBINs you're looking to change into a /_backup folder in its directory, so that you can revert to the default and rework any changes you may have been experimenting with, without having to unpack the archives all over again.

NOTE: In case MBinCompiler doesn't support your MBIN you can also use hex editing to create a mod.

Where to start?[]

A good place to begin after this is to try adding existing objects to the build menu in the game. This is a relatively simple process that gives you a sense for how to mod the game, and helps to introduce you to the way the game files tend to be interconnected.

Also check out EXML File Structure Documentation.