Giter Site home page Giter Site logo

mbincompiler's Introduction

MBINCompiler

Project Owner: monkeyman192

DOWNLOAD Github Total Downloads GitHub Latest Pre-Release Version GitHub Latest Release Version MBIN test file coverage

For Modders: You only need to download MBINCompiler.exe
For Developers: You can download a precompiled DLL or get the libMBIN source and integrate with your own NMS modding tools.

DOWNLOAD LATEST RELEASE

DESCRIPTION

A modding tool for the game: No Man's Sky that converts the game's MBIN data files (binary) into human-readable EXML files (text) that can be edited with any text editor and then converted back again for use in a modded game.

Various MBIN files have different data formats. MBINCompiler maps all of these formats to be able to understand how to read the binary data from file, convert it to EXML and vice versa.

Please note that every update to the game breaks any number of MBIN formats. This requires updating MBINCompiler for each game update and depending on the size and frequency of updates, can take some time so please be patient as new game updates roll out.

Because each version of MBINCompiler is tied to a specific version of NMS, it is also very important to note that MBIN files compiled with a previous version may not be decompiled successfully with a newer version of MBINCompiler if that particular MBIN format has changed. The correct version of MBINCompiler should be used to decompile the corresponding file, then it can be updated and recompiled with the newer version.

If you need to find out what version of MBINCompiler to download for a particular MBIN file, there is a --version command line option that will tell you what version the MBIN file was compiled with. You can get more information about the command line options in the User Documentation.

If you are a developer, you can access all the functionality that MBINCompiler uses for it's own command line interface by downloading or compiling the libMBIN.dll and linking it in your own application. The API makes things like MBIN/EXML de/serialization acessible as well as all the MBIN structure definitions. The structures are C# classes that map the mbin data as public fields, so they can be used in code like any other class.

If you need help, would like to help or just interested in NMS modding, check out the No Man's Sky Modding Server on discord chat.

USAGE INSTRUCTIONS

If you are new to modding in NMS, check out the NMS Modding Wiki for how to get started before you continue with MBINCompiler.

Before you decompile any MBIN files you must know how to unpack the game assets.
To use your recompiled MBIN files, you must know how to enable mods, install them and how to repack assets into your own mods.

To create a modified MBIN:

  1. Drag the MBIN file onto the MBINCompiler.exe to create an EXML file in the same directory as the MBIN file.
    The exe does not need to be in the same directory.
  2. Open the EXML file with a text, xml or code editor. Make your changes and save.
    Notepad++ is good.
  3. Drag the EXML file onto the MBINCompiler.exe to recompile back to an MBIN file.

Repack your file(s) into a new mod and add to your game.

See the User-Documentation on the wiki for more details and advanced usage.

SUBMITTING BUG REPORTS

If you run into errors, in most cases the errors are because:

a) You made an error when editing the EXML file and it fails to recompile. Check if it's a problem with your file or with MBINCompiler by decompiling the vanilla MBIN to EXML and then recompling it back to MBIN to verify that it works or not. If the vanilla file recompiles fine, then it's most likely a problem with your file changes.

b) You are trying to use an older version of MBINCompiler with a newer version of MBIN/EXML or vice versa.
Make sure you are using the correct version of MBINCompiler for the file you are trying to process.

c) MBINCompiler has yes to be updated for the current game version of the data structure used by a particular file.
Check if there are any Open Issues for the file you are having problems with.

If the vanilla MBIN fails to recompile, you are using the correct version of MBINCompiler and there are no issues already open that are related to the file, then open a New issue.

Detail as much information about the error and how to reproduce it as you can in your bug report.

Include:

  • relevant error messages
  • name and path of the file relative to the GAMEDATA folder
  • the MBINCompiler version you are using
  • the NMS version of the MBIN file

TESTING INSTRUCTIONS

For anyone helping to develop MBINCompiler, if you are contributing new structs or updating existing ones, it is good to ensure that the tests that are run on the CI service that builds and tests MBINCompiler will pass.

Requirements

To run the tests you will need python installed and on the path. It is recommended you get a recent version (3.7 or above). The required dependencies are pytest and requests. These can be installed by entering python -m pytest -U pytest requests in your favorite command line program. Before running the tests, you need to have built a Release version of MBINCompiler locally.

Running the tests

Open a command line window in the root MBINCompiler directory and enter python -m pytest. This will pull the latest test data into the directory ./tests/data.

Command line arguments:

  • --datapath: "The relative or absolute path to a folder containing .MBIN files to be tested. If not provided, the test data will be downloaded from the MBINCompiler-test-data repository."

  • --use_cache (bool): "Whether or not to use cached data that was downloaded by running the tests with no additional arguments." Defaults to False.

  • --rerun: "If tests are failing, you can chose to just re-run the ones that have failed."

    Choices:

    all (Default) - Run all tests again, ignoring any _failed.txt file in the directory.

    failed - Run only the failed tests again. Names are retrieved from a _failed.txt file in the same directory.

  • --report (bool): "Whether to output a report of the failure to the local directory." Defaults to False.

Notes: Use of --use_cache=True should only be done if you are 100% sure that the local data is up to date with the external test data as the tests run on the CI will pull the external test data every time.

--datapath is primarily used for running tests on folder of data files to test which files pass or fail for the updating of the MBINCompiler-test-data repository. This option can however be used to point the tests at any other directory (such as an unpacked PCBANKS directory or sub-folder to run the tests on any of the games' files.)

CREDITS

Original project thanks to Emoose: https://github.com/emoose/MBINCompiler

mbincompiler's People

Contributors

monkeyman192 avatar emoose avatar gaticushax avatar thefisher86 avatar elementia avatar gregkwaste avatar bananasft avatar naomichan avatar rmcolbert avatar thebob12 avatar lobolmart avatar atvaark avatar holterphylo avatar exp13 avatar alutman avatar cjbok avatar yretenai avatar pecikoza avatar noobzpowah avatar obsidianminor avatar wadimich avatar thiakil avatar fre-sch avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.