Important information: this site is currently scheduled to go offline indefinitely by end of the year.

My quickBMS scripts

Coders and would-be coders alike, this is the place to talk about programming.
Rmm4K
ultra-n00b
Posts: 3
Joined: Tue Jan 21, 2020 10:44 pm
Been thanked: 1 time

Re: My quickBMS scripts

Post by Rmm4K »

Does anybody here have the skills to make a bms script for the tekken 4 3d models?
marcoxD95
n00b
Posts: 10
Joined: Sun May 26, 2019 10:14 pm
Been thanked: 3 times

Re: My quickBMS scripts

Post by marcoxD95 »

AlphaTwentyThree wrote: Tue May 29, 2012 12:04 am sdu extractor for "The Suffering" (Xbox)
Uses my new version of the Xbox ADPCM header adder, so be sure to update that!
XMV movies can be converted with VGM Toolbox (at least in most cases).
Remember to decode the *.lwav files with toWAV because the vgmstream playback is errornous!

Code: Select all

# extract the *.sdu and *.vdu files from The Suffering (Xbox)
# (c) 2012-05-29 by AlphaTwentyThree of XeNTaX

include "func_header_XADP.bms" # be sure to have this file in the same directory!
idstring "SRSC"
get UNK byte
get UNK byte
get INFO long
get ENTRIES long # head/file/tail entries
goto INFO
get EXT extension
if EXT == "sdu"
	callfunction sdu 1
elif EXT == "vdu"
	callfunction vdu
endif


startfunction sdu
	for i = 1 <= ENTRIES
		get SIG byte # head/data/tail
		get UNK2 byte #always 3?
		get FILE_ID short
		get UNK4 short # some identifier
		get OFFSET long
		get SIZE long
		if SIG == 2
			if FILE_ID != 0
				savepos MYOFF
				math OFFSET += 0x2c
				goto OFFSET
				get CH short
				get BITS short # always 4
				get FREQ long
				goto MYOFF
			endif
		elif SIG == 4
			get NAME basename
			string NAME += "_"
			string NAME += FILE_ID
			#string NAME += "_"
			#string NAME += UNK4
			string NAME += ".lwav"
			callfunction XADP 1
		elif SIG == 5 # some file tail - do nothing?
		endif
	next i
endfunction

startfunction vdu
	for i = 1 <= ENTRIES
		get SIG byte # head/data/tail
		get UNK2 byte #always 3?
		get FILE_ID short
		get UNK4 short # some identifier
		get OFFSET long
		get SIZE long
		if SIG != 66
			get NAME basename
			string NAME += "_"
			string NAME += FILE_ID
			string NAME += ".xmv"
			if FILE_ID != 0
				log NAME OFFSET SIZE
			endif
		endif
	next i
endfunction
Does anybody know how to extract the .sdu and .vdu archives from the PC version of the game? I tried this script here but it didn't extract anything so my guess is, it only works with the Xbox version.

After digging some more I also found this:
http://wiki.xentax.com/index.php/Surrea ... ot_Engine)

I tried the Drakan bms script on it and it did work, however, I end up with a bunch of .dat, .ico and .img files. My guess is that the audio stuff is in some of these .dat files but I found no way to open/extract/playback them yet.

Does anybody here know anything by chance? I could just use the Xbox version but from my experience the Xbox audio codec is often inferior and sounds bad especially in the hights.
AlphaTwentyThree
double-veteran
double-veteran
Posts: 982
Joined: Mon Aug 24, 2009 10:55 pm
Has thanked: 76 times
Been thanked: 660 times

Re: My quickBMS scripts

Post by AlphaTwentyThree »

I'm not coding anymore. Given the age of the game, they mostly used mp3 for music. It's actually inferior to the native Xbox codec (a really good ADPCM). After all, it's the direct pre-decessor of WMA.
If you like what you see, why not click the little Thank You button? ;) It will definitely motivate me! :)
And here's Mr.Mouse's Facebook link: http://www.facebook.com/permalink.php?s ... 8469022795 - thanks ;)
marcoxD95
n00b
Posts: 10
Joined: Sun May 26, 2019 10:14 pm
Been thanked: 3 times

Re: My quickBMS scripts

Post by marcoxD95 »

AlphaTwentyThree wrote: Mon May 17, 2021 6:43 am I'm not coding anymore. Given the age of the game, they mostly used mp3 for music. It's actually inferior to the native Xbox codec (a really good ADPCM). After all, it's the direct pre-decessor of WMA.
Yeah, you could be right. I have a feeling that this BMS script doesn't even work properly on these files. I also end up with many 1kb files that just seem to be corrupt. Some files do seem to contain data but this seems to be only voice acting and video audio. I was able to import these in Audacity with the raw audio import option but couldn't find anything else out. Their header doesn't seem to be recognized by anything except rarely as rare video codec. I also didn't find any music so far so my guess is, it doesn't even get extracted and I extracted multiple .sdu and .vdu files already. The PC version of The Suffering just doesn't seem to be extractable right now, only the Xbox version with your script. If nothing else works I guess I just gonna work with these but still gotta rip Ties That Bind since I was only able to find a The Suffering 1 Joshw xbox rip.

I decided to upload the PC version files in case anybody with the knowledge wanna try figuring out how to extract their data properly including the music audio. Drakan script doesn't seem to work properly since more than half of the files end up as unusable 1kb files.
https://www.mediafire.com/file/nel7nspc ... es.7z/file
marcoxD95
n00b
Posts: 10
Joined: Sun May 26, 2019 10:14 pm
Been thanked: 3 times

Re: My quickBMS scripts

Post by marcoxD95 »

Not sure if anybody cares but I was able to extract the PC OST of The Suffering. It isnt as good as the Xbox source so dont waste your time like me.

Furthermore, I dont know if anybody knew but the script to extract music from the Xbox version of The Suffering also works on the second game Ties That Bind. Xbox version of course. Was just a random thing I figured out. Weirdly enough didnt find a single OST rip of Ties That Bind. You btw need to extract a file named music.sdu which, at least on the Xbox, is in some weird shared folder. Furthermore it seems like that also in this case the Xbox has the highest music quality. Both PS2 and PC seem to use 22050khz files for everything. The Xbox uses 44100khz for dynamic action music and 22050khz for dark ambient music. Sometimes there also seem to be weird 32000khz or even 6000khz music files but some are also duplicates.

Just thought I leave this note to anyone wanting to rip the music from the games.
Eraea
n00b
Posts: 13
Joined: Mon May 28, 2018 2:49 pm
Been thanked: 4 times

Re: My quickBMS scripts

Post by Eraea »

Hi, looking for help with extracting from a .bdt file. I tried using the func GetType bms but it didn't work. The file has a BDF4 Header unlike the Dark Souls BDF3 and the recent BDF5. The game is from PS3 called Kido Senshi Gundam Unicorn
image_2021-08-21_053842.png
You do not have the required permissions to view the files attached to this post.
sanderson169
ultra-n00b
Posts: 3
Joined: Sat Sep 03, 2022 6:24 pm
Been thanked: 1 time

Re: My quickBMS scripts

Post by sanderson169 »

If someone is so kind, I was looking for 2 things, but I can't find a way, I found something on Alpha's side but it doesn't seem to work very well.

I was looking for 2 script for the following
- how to extract audio from a .bnk
- then once extracted, a script that is capable of being based on a "SoundBankInfo.XML" or "bnk.XML" to create the appropriate folders for AUDIO, Ambience, MUSIC etc... and rename the extracted .WEM files.
- sometimes there are some audios that are not in the XML, move them to an Unknow wwise folder.

Someone could help me? Thank you!

EDIT: I found this, but is soooo old...

Code: Select all

# file types: Wwise *.txt with same name as *.bnk files or soundbanks.xml
# script type: parser
# note 1: all *.wem files must be in the same folder as this script and the txt
# note 2: script will maintain the original folder structure
#
# (c) by AlphaTwentyThree of Zenhax
# script for QuickBMS http://quickbms.aluigi.org

get EXT extension
if EXT == "txt"
	callfunction bnk_txt 1
elif EXT == "xml"
	callfunction soundbanks 1
else
	print "script only for txt and xml"
endif

startfunction bnk_txt
	callfunction getARRAYSIZE 1
	print "columns: %COLUMNS%, lines: %LINES%, %EMPTY% of which are empty"
	xmath LINES "LINES - EMPTY"
	goto 0
	set ARRAYLINE 0
	for i = 0 <= LINES
		set HEADERLINE 0
		for j = 0 < COLUMNS
			set NEWENTRY 0
			getCT FIELD string 0x09
			#print "(%i%, %j%): %FIELD%"
			if FIELD == "ID" # check for every line in case structure changes
				set C1 j
				set HEADERLINE 1 # don't enter data
			elif FIELD == "Wwise Object Path"
				set C2 j
				set HEADERLINE 1
			endif
			if HEADERLINE == 0
				if j == C1
					putArray 0 ARRAYLINE FIELD
					set NEWENTRY 1
					#print "enter ID %FIELD% at line %ARRAYLINE%"
				elif j == C2
					#print "enter path %FIELD% at line %ARRAYLINE%"
					putArray 1 ARRAYLINE FIELD
					set NEWENTRY 1
				endif
			endif
		next j
		getCT FIELD string 0x0d
		#print "(%i%, %j%): %FIELD%"
		get DUMMY byte
		if NEWENTRY == 1
			math ARRAYLINE += 1
		endif
		#print "line %i%: %NEWENTRY%"
	next i
	#print "entries: %ARRAYLINE%"

	for i = 0 < ARRAYLINE
		getArray IDX 0 i
		getArray NAME 1 i
		string NAME += ".wem"
		string IDX += ".wem"
		open FDSE IDX 1 EXIST
		if EXIST == 1
			get SIZE asize 1
			log NAME 0 SIZE 1
		endif
	next i
endfunction

startfunction getARRAYSIZE
	FindLoc SEARCHLINEEND string \x0d\x0a 0 ""
	getDstring FIRSTLINE SEARCHLINEEND
	strlen LENGTH FIRSTLINE
	set COLUMNS 0
	for i = 0 < LENGTH
		getVarChr TEST FIRSTLINE i byte
		if TEST == 0x09
			math COLUMNS += 1
		endif
	next i
	set LINES 0
	set LINEEND 0
	
	set EMPTY 0
	for
		goto LINEEND
		savepos MYOFF
		FindLoc LINEEND string \x0d\x0a 0 ""
		if LINEEND == ""
			break
		endif
		xmath TEST "LINEEND - MYOFF"
		math LINES += 1
		if TEST == 0
			print "line %LINES% is empty"
			math EMPTY += 1
		endif
		math LINEEND += 2
	next
	goto -4
	get TEST long
	if TEST == 0x0a0d0a0d
		math LINES -= 1
	endif
endfunction

startfunction soundbanks
	for i = 1
		FindLoc SEARCH string "<File Id=" 0 ""
		if SEARCH == ""
			cleanexit
		endif
		goto SEARCH
		getDstring DUMMY 10
		getCT DIDX string 0x22
		string DIDX += ".wem"
		getDstring TEST 3 # sometimes the file id tag is empty
		if TEST != " />"
			math SEARCH += 12
			goto SEARCH
			FindLoc SEARCH string "<Path>" 0 ""
			goto SEARCH
			getDstring DUMMY 6
			getCT FNAME string 0x3c
			string FNAME -= 13
			open FDSE DIDX 1 EXIST
			if EXIST == 1
				get SIZE asize 1
				log MEMORY_FILE 0 0
				log MEMORY_FILE 0 SIZE 1
				string FNAME += ".wem"
				log FNAME 0 SIZE MEMORY_FILE
			endif
		endif
		math SEARCH += 10
		goto SEARCH
	next i
endfunction
moonsarito1
ultra-n00b
Posts: 5
Joined: Mon Jul 03, 2023 2:45 am
Has thanked: 3 times
Been thanked: 1 time

Re: My quickBMS scripts

Post by moonsarito1 »

AlphaTwentyThree wrote: Wed Dec 05, 2012 11:32 pm
Can you help me?, I need to extract and compress the data.vfs file from Crash Nitro Kart 3D made by Porlabit from Zeebo, iOS, Symbian to try to create some mods like changing the 3D model, soundtrack and etc...

But I couldn't find any program that would work with this type of file.
Jubilee
ultra-n00b
Posts: 1
Joined: Thu Jul 13, 2023 5:34 am

Re: My quickBMS scripts

Post by Jubilee »

AlphaTwentyThree wrote: Sun Nov 28, 2010 3:25 pm

Is there a way to recompress files with this script?
touxd
ultra-n00b
Posts: 1
Joined: Wed Aug 30, 2023 2:43 pm

Re: My quickBMS scripts

Post by touxd »

Hey, does anyone have a script for bin files from Captain Tsubasa J - Get In The Tomorrow (psx)?
Post Reply