BrawlBox v0.78

Started by libertyernie, May 03, 2014, 08:29:50 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

March 12, 2017, 11:56:03 AM #1005 Last Edit: March 12, 2017, 12:00:09 PM by Platinum Lucario
Okay, testing RSTM files... They seem to be out of position in their music offsets, causing the clicking noise.

Testing CSTMs and FSTMs... It seems there's been no changes between 0.77 and 0.78 in regards to FSTM and CSTM playback. CSTMs with more than one track data are still not supported yet (single track data CSTMs however work without any problems so far), FSTMs still have the clicking noise (since their offsets are still in the same position as in 0.77, no changes have been made).

Comparing the difference in the changes between 0.77 and 0.78 in regards to RSTM playback, it seems some code has been altered in that area that determines where the waveform offset starts at. I'm glad the bug has been successfully replicated, so now it will be easier to fix the issue with the FSTMs and revert the changes with the RSTMs.

Also, just to note. The code for FSTMs and CSTMs still has "NW4R Node" in the info, instead of it saying "NW4C Node" or "NW4F Node".

I think this commit is to blame for the clicking sounds in RSTM playback. It was intended to fix something with the encoding, but I think the decoding needs to be updated now. I don't know why the memory usage would be so high, though.

https://github.com/libertyernie/brawltools/commit/9eee52703df7d9967f2bc5a369c3536c0e602993

Also, I'm surprised that CSTM and FSTM would be the same, since I added a field at the beginning of a struct that wasn't there before. Someone might need to take a look at the code and see if they can get it working.

ficion: Are you on Windows?

Quote from: libertyernie on March 13, 2017, 02:09:27 AM
ficion: Are you on Windows?

Yes, Windows 10 to be precise.

I found the issue - should be fixed in the next release. It only kicks in when your sound card is using OpenAL (this would include anyone running it on Unix with Mono, I think.) I've got a workaround that is a little confusing to me but it seems to work OK.

The RSTM artifacts issue will be fixed too. Not sure about CSTM/FSTM.

Quote from: libertyernie on March 13, 2017, 02:09:27 AM
Also, I'm surprised that CSTM and FSTM would be the same, since I added a field at the beginning of a struct that wasn't there before. Someone might need to take a look at the code and see if they can get it working.

I'm pretty sure the same thing that you did to RSTM is identical to the problem that FSTM has. But as for CSTM, it doesn't have any clicking noise, so it doesn't seem to have any issue in it's encoding.

I just need to find where the code is for encoding CSTMs and FSTMs, then I'll experiment around with them and see if I can fix the issue.

Quote from: Platinum Lucario on March 14, 2017, 02:35:15 PM
I'm pretty sure the same thing that you did to RSTM is identical to the problem that FSTM has. But as for CSTM, it doesn't have any clicking noise, so it doesn't seem to have any issue in it's encoding.

I just need to find where the code is for encoding CSTMs and FSTMs, then I'll experiment around with them and see if I can fix the issue.
BrawlLib actually just encodes RSTMs. For CSTM and FSTM, it converts to RSTM when it loads it, and converts from RSTM when it saves. Hopefully the fix will fix FSTMs too (and not break CSTMs.)

It's great to see that brawlbox is still improving!
Super Smash Sisters Facebook page: https://www.facebook.com/SmashSistersFinalConflict/?fref=nf

Smash Sisters Discord: https://discord.gg/QMwMgvg

Ah, if only Brawlbox had Smash Wii U support.

Quote from: Goombaswag on March 20, 2017, 06:33:40 PM
Ah, if only Brawlbox had Smash Wii U support.
There's already a dedicated program that supports Sm4sh Wii U files.
https://github.com/jam1garner/Smash-Forge/releases
I don't take requests.

My PSA Thread
[move][/move]

March 23, 2017, 12:38:03 AM #1014 Last Edit: March 27, 2017, 03:01:14 AM by Goombaswag
Quote from: KingJigglypuff on March 20, 2017, 07:12:26 PM
There's already a dedicated program that supports Sm4sh Wii U files.
https://github.com/jam1garner/Smash-Forge/releases
You don't need a dump to use Brawlbox. That was what I was getting at.

I've just noticed something quite interesting about CSTMs. I've found that Pokémon Mystery Dungeon: Gates to Infinity's CSTMs use a different encoding than Pokémon Super Mystery Dungeon's CSTMs.

Pokémon Super Mystery Dungeon's CSTMs use ADPCM, where as Gates to Infinity's CSTMs use an original NW4C encoding. Probably because the developers of that said game were using a much earlier version of NW4C Soundmaker at the time of developing Gates to Infinity.

Here's two CSTMs of Ragged Mountain in which I can show you the difference and compare them with the Super Mystery Dungeon's version.

BGM_DUN_01 (Original NW4C/Gates to Infinity version):

43 53 54 4D FF FE 40 00 00 00 01 02 40 B2 1D 00
03 00 00 00 00 40 00 00 40 00 00 00 20 01 00 00
01 40 00 00 60 01 00 00 C0 03 00 00 02 40 00 00
20 05 00 00 20 AD 1D 00 00 00 00 00 00 00 00 00
49 4E 46 4F 20 01 00 00 00 41 00 00 18 00 00 00
01 01 00 00 5C 00 00 00 01 01 00 00 68 00 00 00
02 01 02 00 C0 5D 00 00 00 48 03 00 B4 F6 19 00
77 00 00 00 00 20 00 00 00 38 00 00 67 16 00 00
B4 26 00 00 80 16 00 00 04 00 00 00 00 38 00 00
00 1F 00 00 18 00 00 00 00 01 00 00 00 00 00 00
FF FF FF FF 01 00 00 00 01 41 00 00 20 00 00 00
02 00 00 00 02 41 00 00 28 00 00 00 02 41 00 00
30 00 00 00 7F 40 00 00 00 01 00 00 0C 00 00 00
02 00 00 00 00 01 00 00 00 03 00 00 10 00 00 00
00 03 00 00 36 00 00 00 E3 01 EB 00 2C 0A EC FA
00 07 CA FE F0 0C 31 FA F5 03 48 02 AE 0B C3 FA
2D 08 2B FF 33 0D 77 FA 00 00 00 00 00 00 28 00
19 EA 38 E9 00 00 0E 02 B1 00 FD 09 F4 FA 47 07
7F FE FE 0C 20 FA 47 04 AF 01 94 0B D6 FA 4D 08
02 FF 4C 0D 5D FA 00 00 00 00 00 00 78 00 8A D3
19 D0 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
53 45 45 4B


BGM_DUN_01_OLD (ADPCM/Super Mystery Dungeon version):
43 53 54 4D FF FE 40 00 00 00 03 02 20 B2 1D 00
03 00 00 00 00 40 00 00 40 00 00 00 00 01 00 00
01 40 00 00 40 01 00 00 C0 03 00 00 02 40 00 00
00 05 00 00 20 AD 1D 00 00 00 00 00 00 00 00 00
49 4E 46 4F 00 01 00 00 00 41 00 00 18 00 00 00
00 00 00 00 FF FF FF FF 01 01 00 00 64 00 00 00
02 01 02 00 C0 5D 00 00 00 48 03 00 B4 F6 19 00
77 00 00 00 00 20 00 00 00 38 00 00 67 16 00 00
B4 26 00 00 80 16 00 00 04 00 00 00 00 38 00 00
00 1F 00 00 18 00 00 00 00 01 00 00 00 00 00 00
FF FF FF FF 3D 31 03 00 F1 DF 19 00 02 00 00 00
02 41 00 00 14 00 00 00 02 41 00 00 1C 00 00 00
00 03 00 00 10 00 00 00 00 03 00 00 36 00 00 00
E3 01 EB 00 2C 0A EC FA 00 07 CA FE F0 0C 31 FA
F5 03 48 02 AE 0B C3 FA 2D 08 2B FF 33 0D 77 FA
00 00 00 00 00 00 28 00 19 EA 38 E9 00 00 0E 02
B1 00 FD 09 F4 FA 47 07 7F FE FE 0C 20 FA 47 04
AF 01 94 0B D6 FA 4D 08 02 FF 4C 0D 5D FA 00 00
00 00 00 00 78 00 8A D3 19 D0 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
53 45 45 4B


The differences between the two are at 0x0A, 0x0C, 0x1C, 0x24, 0x30, 0x50-51, 0x54-57, 0x5C, 0xA4-A6, 0xA8-AA, 0xAC, 0xB1, 0xB4-B5, 0xB8-B9, 0xBC-BD, 0xC0-C1, 0xC4-C5, 0xC9, 0xCC, 0xD0-D2, 0xD4-D7, 0xD9-E0, 0xE2-EE, 0xF1-11C, 0x11E-135, 0x13C, 0x13E-145, 0x150, 0x152, 0x154, 0x156, 0x158-15C and 0x15E-163.

SEEK begins at 0x160 on the non-ADPCM one (Gates to Infinity), while SEEK begins at 0x140 in ADPCM encoded CSTMs (Super Mystery Dungeon. INFO is located at 0x40 in both versions. It seems the INFO section in the non-ADPCM ones are literally 30 bytes larger than ADPCM ones. And somehow, the program mistakes the non-ADPCM file for having more than one stream, which it clearly doesn't, therefore showing this text:
System.Exception: BCSTM files with more than one track data section are not supported.

at BrawlLib.SSBBTypes.CSTMINFOHeader.get_ChannelInfoRefTable()
at BrawlLib.SSBBTypes.CSTMINFOHeader.get_ChannelInfoRefTableEnd()
at BrawlLib.SSBBTypes.CSTMINFOHeader.get_ChannelInfoEntries()
at BrawlLib.SSBBTypes.CSTMINFOHeader.Get_ChannelInfo(Int32 index)
at BrawlLib.Wii.Audio.CSTMConverter.ToRSTM(CSTMHeader* cstm)
at BrawlLib.SSBB.ResourceNodes.RSTMNode.OnInitialize()
at BrawlLib.SSBB.ResourceNodes.ResourceNode.Initialize(ResourceNode parent, DataSource origSource, DataSource uncompSource)
at BrawlLib.SSBB.ResourceNodes.NodeFactory.FromSource(ResourceNode parent, DataSource source)
at BrawlLib.SSBB.ResourceNodes.NodeFactory.FromFile(ResourceNode parent, String path, FileOptions options)
at BrawlBox.Program.Open(String path)


It's probably bringing up this error, because multistream is supported, but it just can't find the extra stream that it the program thinks that it has to initialise and convert to RSTM.

Perhaps one day in the future, the file responsible for encoding for RSTM can also have CSTM and FSTM variants.

Quote from: Goombaswag on March 23, 2017, 12:38:03 AM
You don't need a dump to use Brawlbox. That was what I was getting at.

You don't need a dump to use Smash Forge either. Me, Jam, and Ploaj designed it to function similarly to BBox in that it's a multi file editor. You must be thinking of Sm4shExplorer

just wanted to praise the python support :)
that caught me off guard. ;D

glad to see some extendability brought to brawlbox.

I hope it's not ironpython though or you'll really be lacking in n areas of support. >.>

[spoiler]Quote: Friedslick6
you have been through a lot of hassle. I've watched every topic you posted on this, and most of them seemed to disintegrate gradually.
But the coolest part was that you didn't stop working on it despite that.

Quote: Internet Explorer
you're doing more with your life right now than probably most other people around you. You're a valuable asset to the Smash community. So yeah, you should be proud.

quote: Greg
You do have a gift which I've seen many developers use to their advantage. You can become a great coder, and with all of those ideas I think you can really build something great.

I really, really, really want BrawlBox to have the ability to export BRSTMs as OGG files with loop points and vice versa.

It seems there is an issue with the model merger when you try to actually merge both models. I can't seem to make it work with v0.78.

On a side note, I think there was one Brawlbox version before that could export all the Modeldata as a .DAE. Am I remembering it wrong?
[black]ㅤlㅤ[/black]

[black]ㅤlㅤ[/black]