Rogueadyn / SaintCoinach

A .NET library written in C# for extracting game assets and reading game assets from Final Fantasy XIV: A Realm Reborn.
Do What The F*ck You Want To Public License
70 stars 99 forks source link

Saint Coinach

A .NET library written in C# for extracting game assets and reading game assets from Final Fantasy XIV, now with support for including the Libra Eorzea database.

Functionality

Fully implemented

Partially implemented

To-do

Usage

Set-up

Note: When building an application using this library make sure to include a copy of SaintCoinach/SaintCoinach.History.zip in the application's directory. This should be done automatically if the project is included in the solution and referenced from there.

All important data is exposed by the class SaintCoinach.ARealmReversed, so setting up access to it is fairly straightforward.

The following is an example using the game's default installation path and English as default language:

const string GameDirectory = @"C:\Program Files (x86)\SquareEnix\FINAL FANTASY XIV - A Realm Reborn";
var realm = new SaintCoinach.ARealmReversed(GameDirectory, SaintCoinach.Ex.Language.English);

It's that simple. It is recommended, however, to check if the game has been updated since the last time, which is accomplished like this, in this example including the detection of data changes:

if (!realm.IsCurrentVersion) {
    const bool IncludeDataChanges = true;
    var updateReport = realm.Update(IncludeDataChanges);
}

ARealmReversed.Update() can also take one additional parameter of type IProgress<UpdateProgress> to which progress is reported. The returned UpdateReport contains a list of changes that were detected during the update.

Accessing data

Game files can be access directly through ARealmReversed.Packs, game data can be accessed through ARealmReversed.GameData.

Game Data (XivCollection)

Specific collections can be retrieved using the GetSheet<T>() method. Note: This only works for objects whose game data files have the same name as the class. This applies for most classes directly inside the SaintCoinach.Xiv namespace, so there should be no need to worry about it in most cases.

Special cases are exposed as properties:

The following is a simple example that outputs the name and colour of all Stain objects to the console:

var stains = realm.GameData.GetSheet<SaintCoinach.Xiv.Stain>();

foreach(var stain in stains) {
    Console.WriteLine("#{0}: {1} is {2}", stain.Key, stain.Name, stain.Color);
}

Notes

State of documentation

Only SaintCoinach contains documentation, and even that only in some places (anything directly in the SaintCoinach namespace as well as some things in SaintCoinach.Xiv.*), everything else is virtually void of documentation.

There should, however, be enough documentation available to know how to use the library for game data, but figuring out the internal workings might prove difficult.

SaintCoinach.Cmd

The project SaintCoinach.Cmd is a very basic console application that can be used to extract various assets. The following commands are currently supported:

Godbert

Godbert is a simple application to display game data and 3D models from Final Fantasy XIV using the above-mentioned library.

Functionality

Fully implemented

Partially implemented

To-Do