Mod Development Tips
This is a non-exhaustive, potentially opinionated list of mod development tips for No Man’s Sky, both for Retro and in general. Feel free to add to it.
Don’t Trust The Old Structs
don’t trust the old structs trust the data haha
-monkeyman192
Much work has been done on MBINCompiler in the years since No Man’s Sky released. While work is being done to backport modern versions of MBINCompiler to support older versions of NMS, we are not quite there yet. Until then, you can generally assume the following:
- The newer a version is, the more reliable its MBINCompiler structs are.
- This especially applies to 1.38 Atlas Rises, as it had a year to mature!
- Globals are going to be missing names for a while.
- Until 1.50 NEXT, property names for globals were not included in the exe
- NEXT was a big update and so a lot of globals were added, changed, or removed
- That makes it difficult and tedious, but not impossible, to find matching values (especially if they’re nearby in order with other matching values) for 1.38 Atlas Rises
- EXMLs may fail to compile, and it may not be your fault.
- Most globals do not compile correctly with MBINCompiler for 1.13 Foundations
- MBINCompiler may have the wrong data types for structs.
- This particularly applies to the 1.0x Release versions
- This is where the above quote comes from.
- In this case you may have better luck manually editing an MBIN with a hex editor
- This particularly applies to the 1.0x Release versions
We will get there eventually. In the meantime, question the output as well as your edits.
EXML is flexible
MBINCompiler compiles an EXML by serialization, and as a result it does not care much about the visual layout of the XML, so long as it is valid XML, the XML is formed as expected, and the XML can be reconstructed into an object. This gives you some flexibility. You can change the indentation style, add breaks between lines (I think), and use XML comments:
<!-- This is an XML comment -->
Use this to your advantage - documentation is invaluable.
File Explorer
EXML and MBIN
It’s highly recommended that you go ahead and set a default program for editing EXML files. Notepad++ is typically the editor of choice, but this is up to personal preference.
Additionally, if you generally stick to a specific version of NMS, you might find it helpful to set MBINs to open with MBINCompiler by default.
Multi-version modders experienced with the command line might consider creating aliases for different MBINCompiler versions. (PowerShell instructions here??)
Textures
Textures can be previewed using a program that generates thumbnails for .dds files. (More details??)
Tips for specific editors
Neovim
tree-sitter has a decent module for glsl that adds pretty good highlighting. It’s available through the usual means. It’s far better, in my opinion, than using Notepad++ (which does not actually provide proper GLSL highlighting).
To get neovim to automatically switch file types for shaders, pipelines, and EXMLs, add the following snippet to your init.
vim.filetype.add({ extension { exml = 'xml', }, pattern = { ['.*.SHADER.*.BIN'] = 'glsl', ['PIPELINE.*.BIN'] = 'xml', }, })