UlyssesWu / FreeMote

Managed Emote/PSB tool libs.
Other
343 stars 23 forks source link

[Question] Support UI/Menu PSB? #9

Closed 0xh3LL0 closed 6 years ago

0xh3LL0 commented 6 years ago
  1. what game are you test on?
  2. does it support non-emote? if yes, will you add support on it? cuz in my case, this tools only compatible with Dracu-Riot, but not with other kirikiri games... even though they have the same format (PSB)
UlyssesWu commented 6 years ago

This lib is called FreeMote rather than PsbTools so you can imagine it just focused on emote PSB. I assume M2 uses PSB not only for emote but also for packing scripts (.ks.psb) or textures in their games, and these PSBs are slightly different.

  1. I have tested on 3~4 emote games (from PSBv2 to PSBv4, including some "famous" games on steam) and all PSBs can be supported. The only thing you should be aware is finding correct CryptKey for PSBs and convert them to pure (unencrypted) PSBs. All tools except EmoteConv assume the input as pure PSB. While I have developed a more advanced tool (FreeMote.Purify) to infer the key, it's not going to be released for a while. For now FreeMote just can not support some texture formats (I will add more later) so it can not produce correct pictures in some cases but you can just export raw bytes and covert them by yourself. If you have some PSBs which can not be supported, send them to me by email.

  2. I don't play galgames very much. AFAIK, the PSB which packs scripts (.ks.psb) can be supported. The only problem (maybe) is it will be converted to json format (like emote ones) rather than those script(ks?) formats. But when you got the json, you can write a tool to convert it as you want.

This lib is not focused on decryption of encrypted krkr files, which means if you have an encrypted file and you just want to decrypt it automatically, our tools can not do that for you. Even for encrypted emote PSBs, you need to find the CryptKey by yourself and enter it in EmoteConv. This lib is mainly used to parse and modify pure PSB files, thus it's very "legal" (commercial games never use pure PSB, maybe except the one you mentioned).

0xh3LL0 commented 6 years ago

oh, i see... thats why its not compatible with normal PSB because its focused on emote PSB guess thats the reason, eh... but the decompiler run just fine though...

thanks for answering, and sure i'll email you when i have one!

UlyssesWu commented 6 years ago

If PsbDecompile works fine, I think that's enough... Which tool you want to use doesn't work? FreeMoteViewer is emote only since it's a tool to view emote models. Normal PSB doesn't need that.

You can just send me one now even if it's not an emote PSB file. Maybe I can tell you what's the problem (if I know). And if you are researching on a krkr game, you should always try KrkrExtract.

0xh3LL0 commented 6 years ago

both psbdecompile and psbuild run just fine on script only, but not the UI / menu... psbdecompile can extract them to PNG but i cant compile them back with psbuild... i can, however, only on one game i mentioned above, i use krkrextract too for pack/unpack the xp3, but it cant pack/compile the UI which is PSB

anyway, i'll email you both the script and UI

UlyssesWu commented 6 years ago

Thanks. I have received the file and I'll look into it.

0xh3LL0 commented 6 years ago

thank you! i'll send you more if you need it!

UlyssesWu commented 6 years ago

The current commit is able to decompile/compile pimg/scn psb files, but it won't convert tlg images (just export/import them). If you can convert tlg images by yourself, you can grab the latest build here. If you wish FreeMote convert tlg images for you, there is still a lot to be done.

0xh3LL0 commented 6 years ago

thank you very much! i don't have a problem with tlg, as long as the psbuild can compile them back. i try it just now and the pimg seem can be compiled with psbuild, i haven't test it yet with the game, but i hope it works, will tell you the details later.

0xh3LL0 commented 6 years ago

yay! it works! thank you very much!

UlyssesWu commented 6 years ago

Nice 👍 If it doesn't work for some games, firstly try specific version in PsBuild like PsBuild /v2. And if there are strange PSBs which are not supported, send them to me via email.

0xh3LL0 commented 6 years ago

sure i will, thank you!

UlyssesWu commented 6 years ago

BTW, what's the tool you used to convert normal pictures to TLG?

0xh3LL0 commented 6 years ago

the tools is krdevui, the compiled binary is here

0xh3LL0 commented 6 years ago

and since your tools is based on number201724 psbfile, maybe you can use his text tool? if that possible, that would be solve your problem on adding ks/scn support...

UlyssesWu commented 6 years ago

We can already get and set texts using FreeMote libs, even without necessary to decompile/recompile json (Load PSB -> Modify strings in PSB -> Build PSB. No json required) (see also). That card in Project means a feature to convert scn PSB to a script-like text file (similar to what krkr projects use) rather than json file in order to be used in krkr projects. But I'm not going to implement that actually.

0xh3LL0 commented 6 years ago

yes sure, but marcussacana ever said something like this so idk, maybe if he can implement those string sort (rather than in alphabetical order), i'll use his tool instead. anyway i use both his and number201724 tools, haven't encountered any problem yet...

UlyssesWu commented 6 years ago

Since FreeMote.Psb is a complete PSB parsing lib (psbfile can not support PSBv3 encryption and PSBv4, but that doesn't really matter for pimg/scn PSBs), the "string sort" is able to be implemented just in one line. Using it to implement a tool like KrKrZSceneManager is much easier for both developers and users, and should be faster than de/recompile json. Since I just write and use this lib for emote PSB, I don't have plans to write tools like that for now, but I believe it can be done with FreeMote. And I don't know if FreeMote really supports all kinds of PSB besides emote/pimg/scn PSB.

0xh3LL0 commented 6 years ago

yea, hope marcussacana can add those feature on his krkrzcsenemanager soon.

wish the best for you two!

0xh3LL0 commented 6 years ago

i just notice that it can convert the TLG to PNG now with /ep, but why it keep the original TLG? doesnt it better if it just automatically deleted, and leave the PNG only?

UlyssesWu commented 6 years ago

Because we can't encode TLG. TLG->PNG is ok, but PNG->TLG is not implemented. The decode code is borrowed from a powerful extract tool GARbro (MIT License). So PsBuild still needs tlg to compile. Maybe you can convert PNG to TLG with other tools, but some users may just want to change some fields in json and keep original tlgs.

0xh3LL0 commented 6 years ago

some users may just want to change some fields in json and keep original tlgs

man, i didnt even think that far... but hm, that make sense... i see, i see...

UlyssesWu commented 6 years ago

@0xh3LL0 I have implemented TLG encoding feature. You can test the latest release here. Read the wiki for more information - and I also added a link there for your walkthrough PDF!

0xh3LL0 commented 6 years ago

nice... i'll try it later, and if this works i'll update the tutorial as well...

0xh3LL0 commented 6 years ago

confirmed, it works!