News: Welcome back to Bullworth! If you haven't already, you will need to reset your password..


Show Posts

* Messages | Topics | Attachments

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - Charor

Pages: [1]
1
Script Modding / Re: Decompiled scripts complete
« on: February 08, 2025, 12:12:04 PM »
preserve

2
Mod Releases / PS4 buttons hud MOD
« on: February 02, 2024, 08:22:06 PM »
PS4 buttons hud MOD

https://bully-board.com/index.php?action=downloads;sa=view;down=257



This mod replaces button textures of Xbox 360 Controller with the DualShock 4 buttons

This mod uses external tga files to replace textures.
You can edit this files in any Graphics Editor to change buttons view if you like

There is a color buttons in 'color' folder if you dont like pale version

Enjoy!

3
Mod Releases / XBOX ONE buttons hud MOD
« on: February 02, 2024, 08:22:04 PM »
XBOX ONE buttons hud MOD

https://bully-board.com/index.php?action=downloads;sa=view;down=258



This mod replaces button textures of Xbox 360 Controller with the Xbox One buttons

Installation:
Unzip to the TXD folder (and don't forget to backup the original file)

This mod uses external tga files to replace textures.
You can edit this files in any Graphics Editor to change buttons view if you like

4
Mod Releases / [PC] PS4 buttons hud MOD
« on: February 01, 2024, 07:17:15 AM »


This mod replaces button textures of Xbox 360 Controller with the DualShock 4 buttons

This mod uses external tga files to replace textures.
You can edit this files in any Graphics Editor to change buttons view if you like

There is a color buttons in 'color' folder if you dont like pale version

Enjoy!

5
Mod Releases / [PC] XBOX ONE buttons hud MOD
« on: February 01, 2024, 07:14:53 AM »


This mod replaces button textures of Xbox 360 Controller with the Xbox One buttons

Installation:
Unzip to the TXD folder (and don't forget to backup the original file)

This mod uses external tga files to replace textures.
You can edit this files in any Graphics Editor to change buttons view if you like

6
TUTORIALS / Re: [PS2][Tutorial] Sound MOD tutorial
« on: January 31, 2024, 12:36:49 AM »
Here is a proof of concept
First two cutscenes with russian voice over

its xdelta patch for USA iso (SLUS_212.69)

Unzip
Run DeltaPatcher.exe
Choose "Original file" your iso
Choose xDelta patch "Bully (USA).xdelta"
In settings ⚙ check "backup original file"
Press "Apply patch"
Wait for patched iso

7
TUTORIALS / [PS2][Tutorial] Sound MOD tutorial
« on: January 30, 2024, 11:33:39 PM »
This is a sound mod tutorial for PS2 version of Bully video game

-------------------------------
LONG STORY SHORT
-------------------------------
  • download PS2 sound kit.zip and extract it
  • Make sure .lst file is there with .bin (from ISO \AUDIO\PLAYLIST\)
  • Drag and Drop .bin file on export wav.bat
  • Edit wavs you want and delete unmodified wavs
    Modded audio must be same duration or shorter, same sample rate and channels as originals
  • Save as wav s16 pcm. Don't change names
  • Drag and Drop .bin file on import.bat
  • Replace original .bin with moded .bin in ISO
  • Done!

FOR THOSE WHO WANT TO DIVE DEEPER

------------------------------------
GENERAL INFORMATION
------------------------------------

audio\PLAYLIST\ folder contains some .bin files:
Sound for cutscenes and dialogs resides in Cuts.bin and Speech.bin files
Music is in Music.bin
Ambient sound, like birds, crowd noise, dogs, music class intro, preacher prayers etc are in Ambs.bin

Aside there is a .LST files with same name as .bins (Cuts.lst Music.lst etc)
Its a name list files. We will need them later
You can open them with notepad if you need to

.bin sound file contains .rsm (idstring RSTM) files
According to vgmstream Is a Rockstar Games RSTM
Compressed as Playstation 4-bit ADPCM


For all chimichanga we will need some tools:
  • quickbms - universal script based files extractor and reimporter
  • MFAudio - a tool allows you to play, convert, and downsample audio files that use some of the more common formats among PS2 games
------------------------------------------------
EXTRACT SOUND FOR MODDING
------------------------------------------------
to extract PS2 bins use PS2bin2ss2.bms
Make sure .lst file is there with .bin
Code: [Select]
// Bully Scholarship Edition PS2 ss2 extrctor
// Extract ss2 file or files from bin using this script
// use quickbms PS2bin2ss2.bms <<Dir>>.bin to extract ss2 files
open FDDE bin 0
open FDDE lst 1

get Dir BASENAME
idstring "Hash"
get FILES long
log MEMORY_FILE 0 0
log MEMORY_FILE2 0 0

for i = 0 < FILES
//file data
   get FILEHASH long
   get OFFSET long
   get DataSIZE long
//read filename from lst file
get NAME line 1
string NAME - 4
string NAME P "%DIR%/%NAME%.ss2"

//rstm header
log MEMORY_FILE OFFSET 0x800

math OFFSET + 0x800
math DATASIZE - 0x800

//PS ADPCM data
log MEMORY_FILE2 OFFSET DataSIZE

//audio settings from header
set Format long 0x10 // 0x01 PCM 0x10 4bit PS ADPCM (OKI ADPCM?)
set BitsPerSample long 16
GetVarChr SampleRate MEMORY_FILE 0x08 long
GetVarChr nChannels MEMORY_FILE 0xC long

//create ss2 header instead of rstm for MFAudio
set MEMORY_FILE binary "\x53\x53\x68\x64\x18\x00\x00\x00\x10\x00\x00\x00\x22\x56\x00\x00\x02\x00\x00\x00\x10\x00\x00\x00\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x53\x53\x62\x64\xC0\xB9\x17\x00"
putvarchr MEMORY_FILE 0x08 Format long
putvarchr MEMORY_FILE 0x0C SampleRate long
putvarchr MEMORY_FILE 0x10 nChannels long
putvarchr MEMORY_FILE 0x14 BitsPerSample long
putvarchr MEMORY_FILE 0x24 DataSIZE long

   append
   log MEMORY_FILE 0 DATASIZE MEMORY_FILE2
   append
   get DATASIZE asize MEMORY_FILE
   log NAME 0 DATASIZE MEMORY_FILE

next i

As a result, we will get folder named as .bin name with .ss2 files in it
(script create ss2 header instead of rstm for correct MFAudio work)

.ss2 need to be decoded:
as i know, MFAudio can decode/encode .ss2
Code: [Select]
MFAudio.exe /II10 /OTWAVU "Speech\Algie_CHATTER_v2.ss2" "Speech\Algie_CHATTER_v2.wav"

Now you can edit this wavs in any audio editor you like
Modded audio must be same duration or shorter same sample rate and channels as original
Save as wav s16 pcm

--------------------------------------
COMPRESS SOUND BACK
--------------------------------------
use MFAudio again:
Code: [Select]
MFAudio.exe /OTRAWC "Speech\Algie_CHATTER_v2.wav" "import\Algie_CHATTER_v2.datAs a result we got our moded wavs PSADPCM encoded in import\ folder ready to be imported in .bin

----------------------------------------------------
IMPORTING MODDED SOUND BACK
----------------------------------------------------
Use PS2bin2dat.bms script with r and w options
Code: [Select]
quickbms -r -w PS2bin2dat.bms Speech.bin
Code: [Select]
// Bully Scholarship Edition PS2 sound dat extractor
// Extract dat file or files from bin using this script
// use quickbms PS2bin2dat.bms <<Dir>>.bin to extract dat files
// Mainly used for importing sound back to .bin
// Usage: quickbms -r -w PS2bin2dat.bms <<Dir>>.bin

open FDDE bin 0
open FDDE lst 1

get Dir BASENAME
idstring "Hash"
get FILES long

for i = 0 < FILES
//file data
   get FILEHASH long
   get OFFSET long
   get DataSIZE long
   
   math OFFSET + 0x800
   math DataSIZE - 0x7E0 // 0x800 - 0x20 fix for MFAudio raw import (+0x20 footer)
//read filename from lst file
get NAME line 1
string NAME - 4
string NAME P "import/%NAME%.dat"

log NAME OFFSET DataSIZE

next i
to import back sound dat file(s) from import folder to .bin (Speech.bin in example above)
.dat files must be named same as in .LST (i.e. Gordon_CONVC_v2.dat Isaacs_3-S01d_D5_PASS_v1.dat Handy_CFH_v2.dat)
.LST file must be near .bin file

Now you need to replace original .bin inside ISO with modded and test in game!

Easiest way to do that is open ISO in hex editor and rewrite file at its offset (LBA*2048)
i.e. for Cuts.bin LBA is 682568 offset 682568*2048=1397899264

Not sure is it correct way to replace file in PS2 iso. Maybe it will brake some crc or copyright protections.
Better use special PS2 tools for that.

Anyway, this method works on emulator for test purposes

UPD: tutorial updated - solved batch encode/decode with MFAudio

8
TUTORIALS / [PC][Tutorial] Sound MOD tutorial
« on: January 30, 2024, 11:00:07 PM »
This is a sound mod tutorial for PC version of Bully video game

-------------------------------
LONG STORY SHORT
-------------------------------
  • download PC sound kit.zip PC sound kit_v2.zip and extract it
  • Drag and Drop .bin file (from \AUDIO\PLAYLIST\) or .sea file (from \AUDIO\xact\) on export wav.bat
  • Edit wavs you want and delete unmodified wavs
    Modded audio must be same duration or shorter, same sample rate and channels as originals
  • Save as wav s16 pcm. Don't change names
  • Drag and Drop .bin or .sea file on import.bat
  • Done!


FOR THOSE WHO WANT TO DIVE DEEPER

------------------------------------
GENERAL INFORMATION
------------------------------------
audio\PLAYLIST\ folder contains some .bin files:
Sound for cutscenes and dialogs resides in Cuts.bin and Speech.bin files
Music is in Music.bin
Ambient sound, like birds, crowd noise, dogs, music class intro, preacher prayers etc are in Ambs.bin

Aside there is a .LST files with same name as .bins (Cuts.lst Music.lst etc)
Its a name list files.
You can open them with notepad if you need to

PC version:
.bin sound file or .sea file is archive containing Sound Banks (.xsb idstring SDBK) and Wave Banks (.xwb idstring WBND)
This banks is microsoft's audio lib file types
We need Wave Banks cos they are containing raw wave data
Compressed as Microsoft ADPCM

For all chimichanga we will need some tools:
------------------------------------------------------
2.EXTRACT SOUND FOR MODDING
------------------------------------------------------
to extract PC wave data in usable format, we can use 2wav.bms
Code: [Select]
// Bully Scholarship Edition PC wav extrctor
// Extract wav file or files from .bin/.sea using this script
// use quickbms 2wav.bms <<Dir>>.bin  or quickbms 2wav.bms <<Dir>>.sea to extract wav files
// Edit wav. Keep same duration or shorter. Save as wav s16 pcm (Speech - mono, Cuts - stereo)

get DirName basename

for
findloc Offset binary "WBND"
set BankOFFSET long OFFSET
math Offset + 0x2c
goto Offset
get DataOFFSET long
get DataSIZE long
get Unk1 long //flags?
get WavesCount long
getDString BankName 64
getDString Dummy 24

for i = 0 < WavesCount
get Dummy long
get AudioFormat long // binary32: BitsPerSample(1) BlockAlign(8) SampleRate(18) Channels(3) FormatTag(2)
// 0001 1000 0000 1010 1100 0100 0110 1010
// ||>>>>>>>> |>>>>>>>>>>>>>>>>>>>>>|>>>|format
// B|Align    |SampleRate           |channels
// format: 0-PCM; 1-XMA; 2-ADPCM; 3-WMA
//xmath Format "AudioFormat & 3"               //                     11 mask (2)
xmath numChannels[i] "AudioFormat >> 2 & 7"     //                    111 mask (3)
xmath SampleRate[i] "AudioFormat >> 5 & 262143" // 11 1111 1111 1111 1111 mask (18)
//xmath blockAlign "AudioFormat >> 23 & 255"   //              1111 1111 mask (8)
xmath BitsPerSample[i] "AudioFormat >> 31 & 1"  //                      1 mask (1)
xmath BitsPerSample[i] "8 * BitsPerSample[i] + 8"  // BitsPerSample(PCM only): 0-8bit; 1-16bit
get WaveOffset[i] long
get WaveSize[i] long
get Dummy long
get Dummy long
next i

for i = 0 < WavesCount
getDString WaveName[i] 64
next i

for i = 0 < WavesCount
xmath Offset "BankOFFSET + DataOFFSET + WaveOffset[i]"
callfunction WavHeader
next i
next

startfunction WavHeader
log MEMORY_FILE1 0 0
log MEMORY_FILE2 0 0

//create wav header in memory
set MEMORY_FILE2 binary "\x52\x49\x46\x46\x72\x21\x1E\x00\x57\x41\x56\x45\x66\x6D\x74\x20\x32\x00\x00\x00\x02\x00\x02\x00\x22\x56\x00\x00\x10\x5E\x00\x00\x8C\x00\x04\x00\x20\x00\x80\x00\x07\x00\x00\x01\x00\x00\x00\x02\x00\xFF\x00\x00\x00\x00\xC0\x00\x40\x00\xF0\x00\x00\x00\xCC\x01\x30\xFF\x88\x01\x18\xFF\x64\x61\x74\x61\x20\x21\x1E\x00"

//audio settings
if numChannels[i] = 2
set blockAlign short 140 //blockAlign 70(mono) or 140(stereo)
else
set blockAlign short 70
endif

//write settings to header
xmath SIZE "WaveSize[i] + 0x46"
    putvarchr MEMORY_FILE2 0x04 SIZE long
    putvarchr MEMORY_FILE2 0x16 numChannels[i] short // mono-stereo
putvarchr MEMORY_FILE2 0x18 SampleRate[i] long
    xmath BYTERATE "(SampleRate[i] * BitsPerSample[i] * numChannels[i]) / 8"
    putvarchr MEMORY_FILE2 0x1c BYTERATE long // (Sample Rate * BitsPerSample * Channels)/8
    putvarchr MEMORY_FILE2 0x20 blockAlign short
    putvarchr MEMORY_FILE2 0x4a WaveSize[i] long

//append audio data
    log MEMORY_FILE1 Offset WaveSize[i]
append
    log MEMORY_FILE2 0 WaveSize[i] MEMORY_FILE1
append

//write to wav file
    get MF2Size asize MEMORY_FILE2
if WavesCount > 1 //SEA
string Name p "%s/%s_%s.wav" BankName i WaveName[i]
else //bin
string Name p "%s/%s.wav" DirName WaveName[i]
endif
    log Name 0 MF2Size MEMORY_FILE2
endfunction

As a result, we will get folder named as bin or sea name with wav files (MS ADPCM) in it

PC MSADPCM .wavs are ready to edit with any audio editor you like(i.e. audiacity)

Modded audio must be same duration or shorter same sample rate and channels as original
Save as wav s16 pcm

----------------------------------------
5.COMPRESS SOUND BACK
----------------------------------------
for PC we can use cli tool AdpcmEncode.exe from Microsoft DirectX SDK
After installation it will be in \Program Files (x86)\Microsoft DirectX SDK (June 2010)\Utilities\bin\x86\
encode example:
Code: [Select]
AdpcmEncode.exe Speech\Algie_CHATTER_v2.wav import\Algie_CHATTER_v2.wavSpeech\Algie_CHATTER_v2.wav is s16 pcm wav
import\Algie_CHATTER_v2.wav is output file with MS ADPCM 128 samples/block compression
Don't forget to remove unmoded(MSADPCM) wavs from Speech (or whatever your .bin/.sea name is) folder
otherwise AdpcmEncode will decode them
As a result we got our moded wavs MSADPCM encoded in import\ folder
Now, we need to cut out a RIFF header with wav2dat.bms
Code: [Select]
// MSADPCM wav header cutter quickbms script
idstring "RIFF"
goto 0x14
get FORMAT short
 
if FORMAT != 2
print "not a Microsoft ADPCM"
print "REMOVE ALL UNMODIFIED WAVS BEFORE IMPORT. IMPORTED WAVS MUST BE S16 PCM"
exit
endif

get FNAME BASENAME
string FName P "import/%FName%.dat"

Findloc DataOFFSET string "data"
goto DataOFFSET
get data long
get DataSIZE long
SavePos DataOFFSET
math DataSIZE - 0x80 //cut tail just in case

log FNAME DataOFFSET DataSIZE
sound dat is ready to be imported in .bin/.sea
------------------------------------------------------
5.IMPORTING MODDED SOUND BACK
------------------------------------------------------
Use 2dat.bms script with r and w options
Code: [Select]
quickbms -r -w 2dat.bms Cuts.bin
Code: [Select]
// Bully Scholarship Edition PC audio dat extrctor (wav without header)
// Extract dat file or files from .bin/.sea using this script
// use quickbms 2dat.bms <<Dir>>.bin or quickbms 2dat.bms <<Dir>>.sea to extract dat files
// use quickbms -r -w 2dat.bms <<Dir>>.bin or quickbms -r -w 2dat.bms <<Dir>>.sea
//to import dat files from "import" folder back to .bin/.sea

for
findloc Offset binary "WBND"
set BankOFFSET long OFFSET
math Offset + 0x2c
goto Offset
get DataOFFSET long
get DataSIZE long
get Unk1 long //flags?
get WavesCount long
getDString DirName 64
getDString Dummy 24

for i = 0 < WavesCount
get Dummy long
get AudioFormat long
get WaveOffset[i] long
get WaveSize[i] long
get Dummy long
get Dummy long
next i

for i = 0 < WavesCount
getDString WaveName[i] 64
next i

for i = 0 < WavesCount
xmath Offset "BankOFFSET + DataOFFSET + WaveOffset[i]"
if WavesCount > 1
string Name p "import/%s_%s.dat" i WaveName[i]
else
string Name p "import/%s.dat" WaveName[i]
endif
log Name Offset WaveSize[i]
next i
next

to import back sound dat file(s) from import folder to .bin/.sea (Cuts.bin in example above)

Now you can test modded .bin/.sea in game!

UPD: tutorial updated - add .SEA files support

Pages: [1]