Skip to content

A .NET library for reading and writing standard Unreal Engine save game files.

License

Notifications You must be signed in to change notification settings

CrystalFerrai/UeSaveGame

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Unreal Engine Save Game Library

This is a .NET library for reading and writing standard Unreal Engine 4 and 5 save game files. This library should work with most games which do not use any custom serialization, but may require updating for games it hasn't seen before.

Releases

There are no releases of this library at this time nor are any planned any time soon.

How to build

The repo contains Visual Studio 2022 projects and is configured to build using .NET 6. There are no third party libraries in use. You should be able to add the desired projects to a solution and build them. There are two projects:

  1. UeSaveGame: This is the main library.
  2. UeSaveGame.Json: This is an optional library that provides json serialization for save game data.

The Json library has NuGet dependencies, so be sure to either run dotnet restore or "Restore NuGet Packages" from the Visual Studio solution context menu.

How to use - Main library

WARNING: Several parts of the library remain unimplemented. Things are only implemented when they are encountered in some game's save file. There is a chance that the library will fail to load or properly save a file from a game it has not yet been tested on.

The API of the library should be considered unstable for the foreseeable future. For now, all it provides is a deserialized version of a save file for you to work with as you see fit. There are no helper methods as of yet for accessing things in nice ways. You just dig into the raw data from code and manipulate it.

To load a file:

SaveGame sg;
using (FileStream file = File.OpenRead("some_path"))
{
    sg = SaveGame.LoadFrom(file);
}

To save a file:

using (FileStream file = File.Create("some_path"))
{
    sg.WriteTo(file);
}

The first thing you should do is load a file, write it back out unchanged, then do a binary comparison to make sure the files are identical. If there are any diffs, then the library did not properly handle that file. In such a case, there may be a bug or unimplemented feature in the library, or the save file may have game specific custom data in it.

In some cases, you may have only the property list portion of a save file without any headers. For these cases, you can use the PropertySerializationHelper class to load and save the property list.

How to use - Json library

This optional library provides utilities for serializing save files to or from a custom json format. This format cannot be used by Unreal Engine. The purpose of the library is to provide a human editable view of save files which can then be converted back into binary files.

First, create input and output streams using whatever method suits your needs. For example using files:

using FileStream inStream = File.OpenRead("some_path");
using FileStream outStream = File.Create("some_path");

To convert binary to json:

SaveGameSerializer serializer = new();
serializer.ConvertToJson(inStream, outStream);

To convert json to binary:

SaveGameSerializer serializer = new();
serializer.ConvertFromJson(inStream, outStream);

In some cases, you may have only the property list portion of a save file without any headers. For these cases, you can use the PropertiesSerializer class to convert the properties.

Note: I also have a CLI program which makes use of this library to convert save files. It can be found here: UeSaveConverter.

Support

This is just one of my many free time projects. No support or documentation is offered for this library beyond this readme.

Games tested

The following games have been tested using the library. Testing consists of loading a file, saving it, and checking that the output is binary equal to the input. Testing of the Json library is less comprehensive, so there may be games listed as working which will not convert to/from json properly.

Working

  • Abiotic Factor - Fully working
  • Aven Colony - Technically works, but the data is just a couple large byte arrays that would need further decoding
  • Carnal Instinct - Fully working
  • Icarus - Fully working. There is a block of base64 in prospect json files. Convert it to binary, then decompress with zlib, then use PropertySerializationHelper.ReadProperties to read the data. (It is basically a save file with no header.)

Not working

  • Dragon Quest XI - Files are compressed. Have not attempted to decompress and examine
  • Moss - Crashes, cause unknown, needs investigation
  • Satisfactory - Missing file headers, could possibly be made to work but tools exist for this game already

Will never work

  • Astroneer - Uses a hefty amount of custom serialization as well as compresses the file. Needs an entirely custom library to handle.

About

A .NET library for reading and writing standard Unreal Engine save game files.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages