Skip to content

Add native ASB and BAEV merging - #17

Open
KB0MB wants to merge 3 commits into
TKMM-Team:masterfrom
KB0MB:feature/asb-baev-merging
Open

KB0MB wants to merge 3 commits into
TKMM-Team:masterfrom
KB0MB:feature/asb-baev-merging

Conversation

@KB0MB

@KB0MB KB0MB commented Aug 24, 2026

Copy link
Copy Markdown

This adds native ASB and BAEV support to TkSharp.Merging.

The merger uses the vanilla file as its reference and applies mod files in load order. ASB node and command references are remapped when custom nodes are added, and BAEV events are merged by their group, node, and event identifiers. Embedded EXB data is preserved unchanged.

I tested this using real ASB and BAEV files from the game. Both formats survive repeated C# read/write cycles, and the output can also be read by TotkBits. I also tested merging added nodes, command references, event changes, and cases where a later unmodified file should not undo an earlier mod.

If any issues arise, I'm willing to fix them and even improve them

@ArchLeaders

Copy link
Copy Markdown
Member

I haven't looked at the merging logic at all yet, but IO libraries are out of the scope of TkSharp and should be abstracted to another library.

@ArchLeaders
ArchLeaders marked this pull request as draft August 24, 2026 22:27
@ArchLeaders ArchLeaders added the enhancement New feature or request label Aug 24, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any reason for this to exist? It looks to me like it's just parsing the file, then ignoring it and writing the entire file anyway. Unless the .Read function mutates srcBuffer, but that seems sketchy.

Could it be solved with a high-level copy?

@ArchLeaders

ArchLeaders commented Aug 24, 2026

Copy link
Copy Markdown
Member

This is mostly unrelated to the merging logic, but is there a particular reason for using JSON objects instead of standard C# types for the ASB/BAEV object classes?

@KB0MB

KB0MB commented Aug 25, 2026

Copy link
Copy Markdown
Author

Quick update: I moved the ASB/BAEV parsing and writing out of TkSharp into a separate package, AsbLibrary 0.1.0, and replaced the JSON-backed objects with regular C# types. TkSharp now references that package and only contains the merging logic.
I tested the merger with the Player ASB files from my Emotes mod and Shinobi no Satori(Catzy), along with Shinobi’s BAEV. It seems to work well. It's hard to find any mods that edit the asb to be honest but I'm hoping more people will like to venture into animations and asb editing in the future.

@KB0MB
KB0MB marked this pull request as ready for review August 25, 2026 01:25
@ArchLeaders ArchLeaders self-assigned this Aug 25, 2026
@ArchLeaders

Copy link
Copy Markdown
Member

Hopefully I'll have time to review this soon. However, before I do, is any of this code written by AI?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants