Coder Social home page Coder Social logo

bdat-rs's Introduction

bdat-rs

Crates.io Version GitHub Release GitHub Actions Workflow Status docs.rs (with version)

A library to read and write MONOLITHSOFT's proprietary BDAT format, used for data tables in all Xenoblade games.

Usage

Refer to the documentation for detailed info on how to use the library.

You may also find other projects that use the library useful:

  • This repository includes a command-line tool to convert BDAT tables to various formats.
  • Recordkeeper is a save editor for Xenoblade 3 and Future Redeemed that reads game data from BDAT tables.

If you have a project that uses the library, feel free to add it to the list by submitting a PR.

License

The bdat-rs library is dual-licensed under both Apache-2.0 and MIT.
The bdat-toolset executable is licensed under the GPLv3.

Credits

bdat-rs's People

Contributors

roccodev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

bdat-rs's Issues

--hashes <HASHES>

What would be the file format for hashes? I tried a CSV with hashes, and it didn't work. I also didn't see any examples in the code.

XC3 Hashes

declarative parsing and writing

I've been experimenting with making the reading and writing code for modern bdat files more self documenting using binrw. I've linked a gist for code with binrw 0.13.3 that can read and rebuild all bdat files in Xenoblade 3 1:1 with the originals. This code doesn't include converting to and from the ModernTable type since it looks like you're reworking that on a separate branch. It should also be doable to store enum values instead of bytes for each row and still rebuild the data correctly.
https://gist.github.com/ScanMountGoat/a406b36a8d103eed035663ec42c3b9f5

The implementation is a lot shorter, but the main advantage in my opinion is making the code easier to reason about. The basic process for reading would be to parse the bdat data into an owned Bdat. Writing this back to the file without any changes should produce identical bytes. Converting the Bdat to a friendlier representation like ModernTable can be done with from_ and to_ conversion functions. Splitting the read/write logic and conversion logic also means the conversions can be tested by comparing the Bdat structs instead of diffing binary files.

If we want the types to be an implementation detail, we could just have functions that take a reader or bytes and return Vec<ModernTable, Vec<LegacyTable, or an enum with both. This would avoid all the current complexity on the user side of dealing with opaque readers or slices that will probably get converted immediately to tables anyway. The bdat files are tiny, so the performance cost of parsing and converting all tables is low.

Borrowed tables

Table structures that borrow strings from their buffer, instead of cloning them.

failed to build row hash table

I dont know why, but I keep getting this error and as a result everything gets extracted except for system.bdat

"thread '' panicked at src\table\modern.rs:328:35:
failed to build row hash table: duplicate key Hash(2344178646)"

Screenshot attached.
Screenshot 2024-05-15 210621

automated release builds with github actions

This will make it easier for people that don't want to compile the program from source. It looks like it should just be a matter of copying some of ci.yml to a new file with a trigger for releases.

XC1/DE/2 BDATs

Currently, the library only supports BDATs from Xenoblade 3.

Toolset: Inline schema

The ability to pack tables on-the-fly without a schema file, with a syntax like:

bdat-toolset pack --table Table1=Table1.json --table Table2=Table2.json -f json -o file.bdat

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.