Skip to content

A .NET class library to read and write save files from the game No Man's Sky for all possible platforms as well as related actions.

License

Notifications You must be signed in to change notification settings

zencq/libNOM.io

Repository files navigation

libNOM.io

Maintained GitHub Actions Workflow Status Maintainability

.NET | Standard 2.0 - 2.1 | 6 - 8 C# 12 GitHub Release NuGet Version NuGet Downloads

Introduction

The libNOM label is a collection of .NET class libraries originally developed and used in NomNom, the most complete savegame editor for No Man's Sky.

libNOM.io can be used to read and write save files for all supported platforms as well as performing related actions.

Getting Started

Currently save formats 2001 (Foundation 1.10 to Prisms 3.53), 2002 (Frontiers 3.60 to Adrift 4.72) including the extension made in Waypoint 4.00, and 2003 (Worlds Part I 5.00 and up) are supported. The original format 2000 that was used in the vanilla game is not supported. If you are interested in it, have a look at the nms-savetool by MetaIdea.

The lowest officially supported game version is Beyond 2.11 to enable support for homebrew users on PlayStation 4 which could not update further at some point. You can use older saves nonetheless, but the game version cannot be determined and it will be marked as IsOld.

Each platform has anchor file patterns to check whether it is worth to look further into the selected directory. This must be in or one level below the selected one.

Compatibility

  • Apple
    • Notes: Currently only available via Steam (see below).
  • GOG.com (Windows PC)
    • Location: %AppData%\HelloGames\NMS\DefaultUser
    • File Patterns: save*.hg
  • PlayStation 4
    • File Patterns: memory.dat, savedata*.hg
    • Notes: There are a few options to do this. The only one that does not require homebrew is SaveWizard. Two other tools that are confirmed working are Save Mounter and Apollo but require homebrew. Results of other tools may or may not work but the code is as generic as possible.
  • PlayStation 5
    • Notes: This version of the game is not supported due to restrictions on the console itself. By playing the PlayStation 4 version on it, you can still save edit with a few additional steps.
  • Steam (PC)
    • Location
      • Windows: %AppData%\HelloGames\NMS\st_<SteamID>
      • SteamDeck: ~/.local/share/Steam/steamapps/compatdata/275850/pfx/drive_c/users/steamuser/Application Data/HelloGames/NMS/st_<SteamID>
      • macOS: ~/Library/Application Support/HelloGames/NMS/st_<SteamID>
    • File Patterns: save*.hg
    • Notes: If you use a cloud gaming service like GeForce NOW you can still use it by starting the game to trigger synchronization from/to the cloud.
  • Microsoft Store (Windows PC)
    • Location: %LocalAppData%\Packages\HelloGames.NoMansSky_bs190hzg1sesy\SystemAppData\wgs\<XboxID>_29070100B936489ABCE8B9AF3980429C
    • File Patterns: containers.index
    • Notes: Reloading of modified saves while the game is running does not work.
  • Nintendo Switch
    • File Patterns: manifest*.dat
    • Notes: To get your saves you need homebrew software on your Switch. EdiZon and JKSV are confirmed working. Results of other tools may or may not work but the code is as generic as possible.
  • Xbox One/Series X|S
    • Notes: Not directly supported but can easily achieved with cloud sync via the Microsoft Store. The synchronization is triggered short after you close the game (no need to load a save). This also works for Xbox Cloud Gaming.

Usage

Here you'll find an example usage.

var path = "...";
var settings = new PlatformSettings { LoadingStrategy = LoadingStrategyEnum.Current };

var collection = new PlatformCollection(); // detects all available PC platforms on a machine
var platform = collection.AnalyzePath(path, settings); // get platform in path and add to collection

var collection = new PlatformCollection(path); // additionally analyzes path
var platform = collection.Get(path); // get a previously detected platform with this path

var account = platform.GetAccountContainer(); // always loaded if exists
var save = platform.GetContainer(0); // Slot1Auto // loaded by default if LoadingStrategyEnum.Full

platform.Load(save); // needs to be loaded before you can modify its JSON

// Get the entire object or parts of it to modify on your own or get and set values directly.
// The getter and setter except multiple expressions but only the first valid one will be returned.
JsonObject jsonObject = save.GetJsonObject();
JToken? jsonToken = save.GetJsonToken("JSONPath1");
IEnumerable<JToken> jsonTokens = save.GetJsonTokens("JSONPath1");
int? jsonObject = save.GetJsonValue<int>("PlayerStateData.UniverseAddress.GalacticAddress.VoxelZ");
int? jsonObject = save.GetJsonValue<int>(new[] { 2, 0, 1, 2 }); // as above but with indices

save.SetJsonValue(1, "PlayerStateData.UniverseAddress.GalacticAddress.PlanetIndex");
save.SetJsonValue(1, new[] { 2, 0, 1, 4 }); // save as above

platform.Write(container);

Projects using libNOM.io

License

This project is licensed under the GNU GPLv3 license - see the LICENSE file for details.

Authors

  • Christian Engelhardt (zencq) - GitHub

Credits

Thanks to the following people for their help in one way or another.

  • u/Gumsk - Working out how to properly move a save from one platform to another
  • MetaIdea - Decrypt and encrypt Steam saves
  • u/MegaGold_Fighter - Storm21 - Helping and verifying to make PlayStation support possible
  • Moo - Helping and verifying to make Microsoft Store support possible

Dependencies