emoose / DQXIS-SDK

Wrapper DLL & SDK for Dragon Quest XI S

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DataTables & UAssets

emoose opened this issue · comments

Been working on a quick UAsset reader/writer for messing with the DataTables, maybe with some work it could help with other UAsset formats too, but right now it's only really made to work with the DataTable format used by DQXI.

https://github.com/emoose/DQXIAsset

So far I've got it deserializing the UAsset/UExp into C# classes, and also serializing those C# classes back into a fresh UAsset/UExp pair (the created UAsset/UExp files match with the original fine, so it seems to be writing things properly enough)
Added a really quick CSV exporter to it too, hopefully I can get an importer working soon: https://i.imgur.com/yDBewFq.png

E: CSV importer is added now too, appears to work pretty well, tested converting all the games tables to CSV, then converted CSV back to uasset, and they all seem to match up with the original fine (well, after some debugging to the serialization code at least :P)

Things could also be modified with code, eg

  var slime = package.ExportObjects[0].PropertiesData["Slime"] as JackDataTableMeosiSlotMonsterParam;
  slime.Attack1_Damage = slime.Attack2_Damage = slime.Attack3_Damage = slime.Attack4_Damage = 1;

FNames & FStrings should be handled fine, FNames can be set via .Value field and if it already exists in UAsset's FName array it'll use it, else it'll add it to that array automatically (any unused FNames are also eliminated during re-serialization)
FNames/FStrings can be variable-length so you're not stuck with the string size that was already used :)

DataTable formats need to be changed a little from the formats in DQXIS-SDK, they mostly work with just a couple small C++ -> C# changes fine, but it seems the on-disk format also removes a lot of UnknownData/padding fields from it.
Luckily the Uexp usually contains the length of each data row, so we can compare against it to see if we've read enough or not, can help a lot when trying to correct the structure of it.


On topic for DQXIS-SDK, it'd be nice if we could access the loaded datatables in memory and modify them, haven't found a way to access ScriptStruct instances yet though.

Seems to serialize/deserialize from CSV <-> UAsset fine now for almost every DT, only exceptions are the ones mentioned in Program.cs blacklist. 0.1 release is now available in the DQXIAsset Releases section: https://github.com/emoose/DQXIAsset/releases