Post tutorial Report RSS Ace Combat Zero: The Belkan War - Audio modding tutorial

This tutorial covers how to prepare and add custom music to the game.

Posted by on - Basic Music

ACE COMBAT ZERO: THE BELKAN WAR - AUDIO MODDING TUTORIAL

by death_the_d0g

///DESCRIPTION

This tutorial will cover how to prepare and add custom music to Ace Combat Zero: The Belkan War.

Ace Combat Zero (as well Ace Combat 5) uses the NPSF format (Namco [Production/Playstation] [Sound/Stream] [File/Format]?) to store most of its audio data. This audio format shares some similarities to other formats created by Sony for audio playback on the Playstation 2 so with the available information I created a small "converter" that will allow to mod music into the game.

The author of this tutorial assumes that you have at least some basic audio editing knowledge, as topics related such as finding loop points in an audio track, adjusting its volume levels, etc. will NOT be covered here.

///REQUIRED FILES AND PROGRAMS:

  • Any audio editor of your choice, as long it has the option to display the HH:MM:SS.SSS time format in samples. For this tutorial I will use Audacity, which is free and can be downloaded here.
  • Audio file to add.
  • ACZ BGM MODDING TOOLS PACK available here.
  • BGM.PAC file (you can get it from inside ACZ's ISO, in the STREAM folder).

More information about the required ISO file for this tutorial (taken from redump.org):

Ace Combat Zero: The Belkan War (NTSC-US):

Serial: SLUS-21346
Region: USA
Version: 1.00
CRC32: F7E98EEB
MD5: 61C016FAD9D992DEE8DCB0AEC2A6C31F
SHA-1: E72C3D5FD27BCD6C71CDD1A5BEE26956BC625E43

Notes:

This tutorial (and by extension the Python scripts) are not compatible with the european/japanese/other regions releases of Ace Combat Zero.

Modified ISOs have not been tested on a real Playstation 2 so I can't guarantee they will work neither will provide support for that.

It goes without saying, but always make a backup of your files.


Before we start you will need to have a DATA folder with the contents extracted from the DATA.PAC file. To get yours you will need to follow the STEP 2 of Ace Combat Zero: The Belkan War: Importing aircraft from Ace Combat 5: The Unsung War tutorial.

As an example for this tutorial I will replace "Mayhem" with "Comona" from the Ace Combat 04: Shattered Skies OST.


///STEP 1:

Extract the contents of your ACZ ISO then navigate to the STREAM folder. You'll see a file called BGM.PAC. Copy that file and paste it to where the contents of the ACZ BGM MODDING TOOLS PACK are located.

audiomod01


Run the "ACZ BGMPAC unpacker" script and wait while it extracts the contents from inside the BGM.PAC archive. Once the process is complete, a new folder will be created (named "BGM") that will contain all the audio streams used in the game. The original BGM.PAC file will be deleted.

Inside the folder you will find NPSF files, which is the format used by the game to store its audio data.

audiomod02


///STEP 2:

Open Audacity then open (or drag into the program) the audio file you want to add to the game.

audiomod03

Once you are done editing your audio track, identify its start and end loop points and place a label (by hitting CTRL + B) on each one of them. Go to the end of the audio track and place another label there.

audiomod04

In the bottom part of Audacity you will see two toolbars, called the "Selection Toolbar" and the "Time Toolbar". Click on the little triangle next to the time counter (the big one to the right side of the screen) to open a context menu then select SAMPLES.

audiomod05

This will change the time format from HH:MM:SS.SSS to be displayed in sample values.

audiomod06

Click on the labels we previously set up and write down the sample values that the time counter displays. We will need this information for later. In my example, the loop start point in samples is 154,145 (0:03 minutes), loop end point is 6,750,040 (02:33 minutes) and the total duration of the song is 7,248,724 (02:44 minutes).

Export your audio file to the WAV format by going to FILE > EXPORT > EXPORT AS WAV and using the following settings:

-Sample rate: 44100 Hz
-Encoding: 16 bits signed

Note: you can change the sample rate of the audio by clicking on the drop-down menu under the PROJECT RATE (Hz) section. If your audio file's sample rate is higher than 44100Hz quality loss will ensue.

Note 2: You might need to resample your song if its sample rate is different from 44100Hz. If the song has has a higher sample rate the exported wave file will play in a lower pitch/slower. Same with songs that have a lower sample rate, they will play in a higher pitch/faster.

Now run MFAudio.

audiomod07

In the Input audio file section click on OPEN and select your exported WAV file. Now go to the FILE FORMAT drop-down menu and select SS2 - Sony PS2 Sound - Compressed ADPCM. In the INTERLEAVE field set the value to 800 bytes. Click on the SAVE AS button and save the file in the same folder as the scripts/tools used in this tutorial.

Your instance of MFAudio should look like this:

audiomod08

Hit the PROCESS! button and wait to the program to convert your file.

///STEP 3:

Open the "ACZ music list" text file. You will see that the text is separate in four sections: FILENAME, USED IN and NOTES.

audiomod09

FILENAME: the name of the NPSF files stored inside BGM.PAC.

USED IN: name of the mission/section where the song is played.

NOTES: some little extra info about unused/duplicate songs

Run the SS2-NPSF converter script file and follow the instructions shown in the window. You will be asked the name of the SS2 file, the total duration/length of the song in samples and the start/end loop points (if the audio track has any).

Remember the values I told you to write down in the previous step? now is the time to use them.

audiomod11

The script will create a new NPSF file. Since for this tutorial I'm replacing "Mayhem" with "Comona" from AC04 as an example I will rename this NSPF file to "0012_m10a.npsf".

Move the file into the BGM folder, replacing the file when asked.

///STEP 4:

Run the "ACZ BGMPAC repacker" script and wait to the script to merge the contents in the BGM folder into a new BGM.PAC file. As soon the process is complete, the script will also create a "0000.dat" file.

Now copy the 0000.dat file and drop it inside the DATA folder then move the new BGM.PAC file into the STREAM folder.

From this point you will need to rebuild both the DATA.PAC file and the entire ISO but I won't type the steps to do that again, so you can check the Ace Combat Zero: The Belkan War: Importing aircraft from Ace Combat 5: The Unsung War tutorial and starting from near the end of STEP 4.

Test the ISO with PCSX2 then go to the game's music player. If everything was done correctly your custom music should play there and during the mission/section.


///EXTRA NOTES

Audio lenght and file size

The average duration of the music data found in the game is about 4 minutes, with the longest track being around 5:30 minutes long (0017_m13a.nspf, "Merlon") and the shortest one being around 5 seconds long (the second part of the "MORGAN" song, 0313_m18title.npsf).

File size-wise, the average size of the music data in the game is around 7 Mb, again "Merlon" having the largest size file of the bunch (17,5 Mb) and "Morgan" having the smallest one (238 Kb).

When converting a custom music track to the NSPF format, make sure that its lenght doesn't go beyond the 6 minutes mark and the final file size is around the 17 Mb limit. While not fully tested/confirmed, an audio file that goes beyond these limits will play with some popping/cackling or in the worst of the cases sound like garbled mess. If this is the case, reducing the lenght of the audio track could fix this problem. Sometimes some songs will repeat the loop section two or three times to create an even longer song, so if you could cut these repeated loop sections down so the song has only one loop section it will reduce the final NSPF file size significantly.

Importing music data from Ace Combat 5: The Unsung War

Just like ACZ, AC5 also uses the NSPF format to store audio data. Since the format bewteen both games are the same, you can add music tracks from AC5 to Zero.

Just rename the AC5's NSPF file you want to use with the file name of the ACZ song you want to replace and repack the BGM folder.

You can download the AC5's NSPF files from Zophar's Ace Combat 5: The Unsung War page (click on Download original music files (497 Mb))

Playing music in the MUSIC PLAYER vs. playing music in-flight

Music tracks that have start/end loop points will play indefinitely during missions, but when playing them from the game's own music player they will loop just once.

Before converting the files I suggest you adding a 5-10 second fade-out effect so the song doesn't abruptly end once it is done playing.

Audio volume

Audio files, regardless of how loud they might sound, are still bound to the game's own volume settings.

So make sure your music track's volume matches with the original tracks of the game. You can do this by extracting the NSPF files from an unmodified BGM.PAC file and convert them to WAV format using vgmstream, then comparing both tracks and make proper volume gain adjustments to your custom music file.

Modding voice clips

Modding audio data such as voice clips it is also possible, but for the time being this tutorial and the tools provided will only support music tracks.

Non-looping audio tracks

There are some music tracks in the game that don't loop, such as:

0016_m12b.npsf - M12's nuke sequence ambient noise
0026_gameover.npsf - Game over
0034_startup.npsf- Game startup
0035_title.npsf - Title screen
0311_m18ed.npsf - RETURN TO BASE
0312_ending.npsf - EPILOGUE - NEAR A BORDER
0313_m18title.npsf - MORGAN (M18 title screen)
0314_i17a2_bgm.npsf - MORGAN (cutscene: PJ gets shot down and Pixy appears)

And probably some other tracks I'm not aware of. When replacing some of these files make sure you type the N key when asked if the track has looping points so the game will know that the music doesn't loop.

Also keep in mind that in the case of replacing these specific tracks, the duration of your custom music must be the same or close as possible to the duration of the original tracks, otherwise it will be abruptly interrupted when playing.

0000.dat

The 0000.dat archive is the file that contains (among other files) the offset/address table of the audio files found inside the BGM.PAC file. When the game needs to play an audio stream it will look for its offset in this table then use said offset to locate the position of the required audio stream in the BGM.PAC file and load it.


And this concludes the audio modding tutorial for ACZ. For any issues, corrections or questions you might have feel free to contact me.

Post comment Comments
Stray1_FeralCat
Stray1_FeralCat - - 11 comments

Nice tutorial....for replacing the game's music. But will there be a tutorial for replacing the game's sound effects? I have sound effects from the entire series on my YouTube channel. All I need is the tutorial.

Reply Good karma Bad karma+1 vote
Post a comment

Your comment will be anonymous unless you join the community. Or sign in with your social account: