DatReaderWriter 0.1.0-beta.42

This is a prerelease version of DatReaderWriter.
dotnet add package DatReaderWriter --version 0.1.0-beta.42                
NuGet\Install-Package DatReaderWriter -Version 0.1.0-beta.42                
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="DatReaderWriter" Version="0.1.0-beta.42" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add DatReaderWriter --version 0.1.0-beta.42                
#r "nuget: DatReaderWriter, 0.1.0-beta.42"                
#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 DatReaderWriter as a Cake Addin
#addin nuget:?package=DatReaderWriter&version=0.1.0-beta.42&prerelease

// Install DatReaderWriter as a Cake Tool
#tool nuget:?package=DatReaderWriter&version=0.1.0-beta.42&prerelease                

DatReaderWriter

DatReaderWriter is an open-source library for reading and writing .dat files used by the game Asheron's Call. This tool allows players and developers to access and modify game data files for various purposes, such as creating mods or analyzing game content.

Table of Contents

Features

  • Read/Write AC .dat files (Including creating new dats)
  • Full Dat BTree seeking / insertion / removal / range queries

Basic Usage

See Tests for full usage.

Update spell names and descriptions

var portalDat = new PortalDatabase(Path.Combine(config.clientDir, "client_portal.dat"), DatAccessType.ReadWrite);
var spellTable = portalDat.SpellTable ?? throw new Exception("Failed to read spell table");

// update spell name / description (no need to worry about updating Components with newly
// encrypted values, they will be transparently decrypted/encrypted during (un)packing).
spellTable.Spells[1].Name = "Strength Other I (updated)";
spellTable.Spells[1].Description = "Increases the target's Strength by 10 points. (updated)";

//write the updated spell table
if (!portalDat.TryWriteFile(spellTable)) {
    throw new Exception("Failed to write spell table");
}

// close dat
portalDat.Dispose();

Rewrite all MotionTables to be 100x speed

var portalDat = new PortalDatabase(Path.Combine(config.clientDir, "client_portal.dat"), DatAccessType.ReadWrite);

// loop through all motion tables and update framerates
foreach (var mTable in portalDat.MotionTables) {
    // build a list of all animations
    var anims = new List<AnimData>();
    anims.AddRange(mTable.Cycles.Values.SelectMany(c => c.Anims));
    anims.AddRange(mTable.Modifiers.Values.SelectMany(c => c.Anims));
    anims.AddRange(mTable.Links.Values.SelectMany(v => v.MotionData.Values.SelectMany(c => c.Anims)));

    // update all animation framerates
    foreach (var anim in anims) {
        anim.Framerate *= 100f;
    }

    // write MotionTable back to the dat
    portalDat.TryWriteFile(mTable);
}

// close dat
portalDat.Dispose();

Contributing

We welcome contributions from the community! If you would like to contribute to DatReaderWriter, please follow these steps:

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature-branch).
  3. Make your changes.
  4. Commit your changes (git commit -am 'Add some feature').
  5. Push to the branch (git push origin feature-branch).
  6. Create a new Pull Request.

Thanks

In no particular order, thanks to ACE team, GDLE team, OptimShi, paradox, and Yonneh. Used lots of projects as a reference for different parts.

License

This project is licensed under the MIT License. See the LICENSE.txt file for details.

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 is compatible.  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 is compatible.  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
0.1.0-beta.42 63 11/16/2024