SoulMemory 1.3.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package SoulMemory --version 1.3.0
NuGet\Install-Package SoulMemory -Version 1.3.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SoulMemory" Version="1.3.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SoulMemory --version 1.3.0
#r "nuget: SoulMemory, 1.3.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install SoulMemory as a Cake Addin
#addin nuget:?package=SoulMemory&version=1.3.0

// Install SoulMemory as a Cake Tool
#tool nuget:?package=SoulMemory&version=1.3.0

SoulMemory

build github__version NuGet version (SoulMemory)
GitHub last commit GitHub repo size
<a href="https://ko-fi.com/wasted1" title="Donate to this project using Buy Me A Coffee"><img src="https://img.shields.io/badge/buy%20me%20a%20coffee-donate-yellow.svg" alt="Buy Me A Coffee donate button" /></a> build <a href="https://www.youtube.com/@1wasted"><img src="https://img.shields.io/badge/-YouTube-red"></a>

Backing library of SoulSplitter.

This library provides an API that lets you read/write from/to running fromsoft games (Dark Soul 1, Dark Souls 2, Dark Souls 3, Sekiro: Shadows die twice and Elden Ring). It uses the Win32 API to achieve this. It is build mainly with speedrunning in mind, and focuses on timer and autosplitter features.

Example usage

var ds1 = new DarkSouls1(); //Automatically resolves differences between PTDE & Remastered. Same applies to DarkSouls2

while (true)
{
    if (!ds1.TryRefresh(out Exception e)) //Each game object must be refreshed often, best would be 60 times per second.
    {
        //TODO: handle error
    }

    var inGameTime = ds1.GetInGameTimeMilliseconds(); //Get the amount of milliseconds played on the current character
    var isAsylumDemonAlive = ds1.ReadEventFlag((uint)DarkSouls1.Boss.AsylumDemon); //Read an arbitrary event flag, in this case the boss defeated flag for asylum demon
    var inventory = ds1.GetInventory(); //Read all items in the players inventory

    Thread.Sleep(10);
}

API

DarkSouls1 (PTDE & remastered)
bool ReadEventFlag(uint eventFlagId);                //Read any event flag (more info about event flags on the wiki: https://github.com/FrankvdStam/SoulSplitter/wiki/Eventflags)
int GetAttribute(Attribute attribute);               //Read an attribute (one of the player's levels)
bool IsWarpRequested();                              //True if a loading screen is visible, and a warp was requested via a bonfire, homeward bone, darksign or homeward miracle
bool IsPlayerLoaded();                               //True if the player object is loaded in memory
int GetInGameTimeMilliseconds();                     //Returns the amount of milliseconds played on the current savefile. Returns 0 in the main menu
int NgCount();                                       //Returns what the current NG+ cycle is
int GetCurrentSaveSlot();                            //Returns what the current, or last loaded save slot is
Vector3f GetPosition();                              //Returns the players position in a vector of 3 floats
bool AreCreditsRolling();                            //Returns true if the credits are rolling
void ResetInventoryIndices();                        //Overwrites a number of in-game indices (current selected inventory slot for instance)
List<Item> GetInventory();                           //Returns a list of items, read from the players inventory
BonfireState GetBonfireState(Bonfire bonfire);       //Returns the state of a bonfire
string GetSaveFileLocation();                        //Attempts to find the path to the savefile, depending on locale

bool TryRefresh(out Exception exception);            //Refresh the internal structures, make sure the game is still running, etc. Must be called often for reliable return values
TreeBuilder GetTreeBuilder();                        //Returns a structure representing memory addresses, pointers and offsets. Can be used to resolve said pointers, or verified against a file. You likely won't need this, unless you want to extend the object
DarkSouls2 (Vanilla & SOTFS)
bool Refresh(out Exception exception);               //Refresh the internal structures, make sure the game is still running, etc. Must be called often for reliable return values
Vector3f GetPosition();                              //Returns the players position in a vector of 3 floats
int GetBossKillCount(BossType bossType);             //Returns a value representing the current NG+ cycle plus the amount of boss kills on this cycle. If you kill last giant once on ng, it will return 1. Kill him twice, it will retun 2. Kill him 0 times on ng+, it will return 1.
int GetAttribute(Attribute attribute);               //Read an attribute (one of the player's levels)
bool IsLoading();                                    //Returns true when a loading screen is visible
bool ReadEventFlag(uint eventFlagId);                //WARNING: not finished, will return garbage data. Event flags are weird in DS2.
DarkSouls3
bool Refresh();                                      //Refresh the internal structures, make sure the game is still running, etc. Must be called often for reliable return values
bool IsLoading();                                    //Returns true when a loading screen is visible
bool IsPlayerLoaded();                               //Returns true when the player object is loaded into memory
int GetInGameTimeMilliseconds();                     //Returns the amount of milliseconds played on the current savefile. Returns 0 in the main menu
void WriteInGameTimeMilliseconds(int millis);        //Overwrite the game's in game time with a new value (used in blackscreen removal to create the illusion of a paused timer)
Vector3f GetPosition();                              //Returns the players position in a vector of 3 floats
int ReadAttribute(Attribute attribute);              //Read an attribute (one of the player's levels)
bool ReadEventFlag(uint eventFlagId);                //Read any event flag (more info about event flags on the wiki: https://github.com/FrankvdStam/SoulSplitter/wiki/Eventflags)
bool BlackscreenActive()                             //Reads a combination of flags in memory to determine of a blackscreen is active

Sekiro

Refeshing Sekiro will install nologo and notutorial mods into the game. Additionally it installs a fix to the imprecise in game time.

bool Refresh(out Exception exception);               //Refresh the internal structures, make sure the game is still running, etc. Must be called often for reliable return values
int GetInGameTimeMilliseconds();                     //Returns the amount of milliseconds played on the current savefile. Returns 0 in the main menu
void WriteInGameTimeMilliseconds(int value);         //Overwrite the game's in game time with a new value (used in blackscreen removal to create the illusion of a paused timer)
bool IsPlayerLoaded();                               //Returns true when the player object is loaded into memory
Vector3f GetPlayerPosition();                        //Returns the players position in a vector of 3 floats
bool IsBlackscreenActive();                          //Reads a combination of flags in memory to determine of a blackscreen is active
bool ReadEventFlag(uint eventFlagId);                //Read any event flag (more info about event flags on the wiki: https://github.com/FrankvdStam/SoulSplitter/wiki/Eventflags)
EldenRing

Refreshing Elden Ring will install a fix to the imprecise in game timer

bool Refresh(out Exception exception);               //Refresh the internal structures, make sure the game is still running, etc. Must be called often for reliable return values
void EnableHud();                                    //The HUD can be on disabled or on "auto". This function sets it to always on.
Position GetPosition();                              //Returns the players position in a vector of 3 floats + the ID's of the current tile
bool IsPlayerLoaded();                               //Returns true if the player object is loaded into memory
ScreenState GetScreenState();                        //Returns the current "screenstate", can be InGame/Loading/MainMenu/Unknown
bool IsBlackscreenActive();                          //Reads a combination of flags in memory to determine of a blackscreen is active
List<Item> ReadInventory();                          //Reads the player's inventory. A part of the inventory seems stored in event flags (especially key-items) so be warned: some things might not be in this list
bool ReadEventFlag(uint flagId);                     //Read any event flag (more info about event flags on the wiki: https://github.com/FrankvdStam/SoulSplitter/wiki/Eventflags)
int GetInGameTimeMilliseconds();                     //Returns the amount of milliseconds played on the current savefile. Returns 0 in the main menu
void WriteInGameTimeMilliseconds(int milliseconds);  //Overwrite the game's in game time with a new value (used in blackscreen removal to create the illusion of a paused timer)
void ResetIgt();                                     //Overwrite the game's in game time with 0 (used to prepare NG+ save files)
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.5.2 132 9/11/2023
1.5.1 91 9/10/2023
1.4.6 111 8/30/2023
1.4.2 152 4/8/2023
1.4.0 179 3/24/2023
1.3.0 249 12/17/2022
1.2.6 247 12/7/2022
1.2.1 276 11/22/2022
1.2.0 296 11/17/2022
1.1.9 299 11/9/2022
1.1.8 295 11/3/2022
1.1.7 324 10/27/2022