Converse.bin

Sound & Voice list Editing (converse.bin); support/discussion/questions

Moderator: thunderchero

Post Reply
User avatar
DCER
Code Master
Code Master
Posts: 683
Joined: Sat Apr 26, 2008 2:00 am

Converse.bin

Post by DCER »

I've been looking into converse.bin and here's what I've figured out so far.

The file contains a header followed by two data segments and two map segments.

1. Header (14 bytes)

number of voice groups (4 bytes)
address to first map segment (4 bytes)
number of voice lists (4 bytes)
unknown (2 bytes)

2. First data segment

Contains voice lists.

3. Second data segment

Contains voice groups. Between each voice group there's a delimiter byte (0xFE) except the last one which is (0xFF).

4. First map segment

Contains entries listing voice groups.

Each entry consists of 16 bytes:

voice group type (4 bytes) (0 - snd indexes, 1 - voice list indexes)
unknown/zeroed out (4 bytes)
voice group data size (4 bytes)
address in file (4 bytes)

5. Second map segment

Contains entries listing voice lists.

Each entry consists of 16 bytes:

address in file (4 bytes)
number of indexes in the list (4 bytes)
voice list type (4 bytes) (4 - diplomatic intro)
unknown/zeroed out (4 bytes)


Voice group data consists of:

delimiter (1 byte) (0xFE)

followed by one or more groups of these:

voice group entry (10 bytes)
delimiter (0xFE) or end of group (0xFC - follows the last entry) (1 byte)

Voice group entry
race (1 byte) (36 - alien, 37 - neutral)
unknown (7 bytes)
index (2 byte) (either snd index or voice list index + 15000)


Voice list consists of:

where n is the number of entries listed in the voice list map entry

n * unknown (n * 2 bytes) (seems like an offset for some kind for botf's internal sound map)

n times:
unknown (2 bytes) (always 1)
snd index (2 bytes)
User avatar
Turner
Ensign
Ensign
Posts: 31
Joined: Fri May 09, 2008 2:00 am

A little breakthrough

Post by Turner »

Equipped with these informations I've tried to solve the annoying problem, that the Ferengi/Dominion phaser sound is identical to the federation sound.

In the research process I've found out, that converse.bin seems to be only be responsible for voices. Music and Sfx are directly linked from trek.exe.

The initial problem with the phaser sounds was, that there is only one wave-file in sfx.snd, which is used by Federation, Ferengi, Minors and Monsters. So it was not possible to change the Ferengi sfx without changing the Federation sfx.

But unfortunately there is this concentration too in trek.exe.
But I live with the hope, that we could solve this problem :wink:

Here are the offsets:

Code: Select all

0x91463  //Cardassian phasersound
0x91481  //Federation and Ferengi phasersound
0x91488  //Klingon and Romulan phasersound
User avatar
DCER
Code Master
Code Master
Posts: 683
Joined: Sat Apr 26, 2008 2:00 am

Post by DCER »

At 0x913F0 you have a list of 5 code addresses (4 bytes each), one for each empire.

62 20 49 00 -> sets phaser sound index to 31
80 20 49 00 -> sets phaser sound index to 34
87 20 49 00 -> sets phaser sound index to 30

In the vanilla list they are ordered as: 31, 34, 34, 30, 30

Just set/switch them to your liking.

Any race id above 4 is set to 5 and uses sound index 34 without reading the list.

The minors/alien id is set at 0x91479 so you can try changing it from 5 to an id of one of the empires (0-4) to make them use a different sound index instead.
User avatar
Tethys
Past Administrator
Past Administrator
Posts: 2392
Joined: Fri Jul 18, 2008 2:00 am
Location: Your mom's bed ;)
Contact:

Post by Tethys »

DCER, Do u think that it is possible to add extra sounds to the sfx.snd file, and make Ferengi use sound index 163? If I think it is how I think it is, might be able to use up to 255 sounds... :P

Tethys
Not for the weak of heart...
Galaxies MOD v0.4.0 <--- GALM/Galaxies Mod latest version
User avatar
DCER
Code Master
Code Master
Posts: 683
Joined: Sat Apr 26, 2008 2:00 am

Post by DCER »

I'm sure you could extend sfx if you knew what to edit.

Adding more phaser sounds would be difficult since you'd need to add additional code. There are 12 bytes free at the end of the function. For each new index you'd need at least 7 bytes or 10 if you're far from the rest of the code. So one additional index could be added without much trouble if we could extend sfx.snd, more would be trickier.
User avatar
Tethys
Past Administrator
Past Administrator
Posts: 2392
Joined: Fri Jul 18, 2008 2:00 am
Location: Your mom's bed ;)
Contact:

Post by Tethys »

Am I correct to assume that the reason there is no Add function (in UE) for sfx.snd is because there is insufficient information on how sfx.snd displays its information to trek.exe?

I have started an analysis thread on sfx.snd that I'm sure Peter will have a look at (hint hint wink wink) we can work on it in spare time, I'm rather buried atm with stuff...
Not for the weak of heart...
Galaxies MOD v0.4.0 <--- GALM/Galaxies Mod latest version
User avatar
Peter1981
Rear-Admiral
Rear-Admiral
Posts: 1118
Joined: Tue May 06, 2008 2:00 am
Location: England

Post by Peter1981 »

in the land of the blind tethys a wink is as good as a nod mate ;D
User avatar
Tethys
Past Administrator
Past Administrator
Posts: 2392
Joined: Fri Jul 18, 2008 2:00 am
Location: Your mom's bed ;)
Contact:

Post by Tethys »

DCER, you must have a bit of knowledge on sfx.snd (more than I admittedly), is there a way to make:
DCER wrote:At 0x913F0 you have a list of 5 code addresses (4 bytes each), one for each empire.

62 20 49 00 -> sets phaser sound index to 31
80 20 49 00 -> sets phaser sound index to 34
87 20 49 00 -> sets phaser sound index to 30
use, say, sound index 1? It is an explosion sound ive never heard used in game, so I replaced it with phaser sound. (i suppose its a matter of locating BF 01 in trek.exe, but there are several possibilities)

Closest locations before and after locations above are 0x8fb54 and 0x91909

I dont expect a reply tomorrow, life needs to be lived after all ;)

I just dont understand the mechanics of how these point to indexes:

62 20 49 00 -> sets phaser sound index to 31
80 20 49 00 -> sets phaser sound index to 34
87 20 49 00 -> sets phaser sound index to 30
Not for the weak of heart...
Galaxies MOD v0.4.0 <--- GALM/Galaxies Mod latest version
User avatar
DCER
Code Master
Code Master
Posts: 683
Joined: Sat Apr 26, 2008 2:00 am

Post by DCER »

At 0x914E4 replace zeroed bytes with BF 22 00 00 00 EB A1

Replace 22 00 00 00 with the desired sound index.

For the code address use E4 20 49 00 in the list. This will add an extra index slot.

Don't know if the sound at index 1 is used or not.

EDIT:
I just dont understand the mechanics of how these point to indexes:

62 20 49 00 -> sets phaser sound index to 31
80 20 49 00 -> sets phaser sound index to 34
87 20 49 00 -> sets phaser sound index to 30
They point to the code which sets the indexes.

It's a switch statement.

Code: Select all

jmp     off_491FF0[eax*4] ; switch jump
The above combined with the list at off_491FF0 amounts to:

Code: Select all

switch(race)
{
case 0: 
    edi = 0x1F
    break
case 1: case 2:
    edi = 0x22
    break
case 3: case 4: default:
    edi = 0x1E
}
User avatar
Tethys
Past Administrator
Past Administrator
Posts: 2392
Joined: Fri Jul 18, 2008 2:00 am
Location: Your mom's bed ;)
Contact:

Post by Tethys »

This is the only part of trek.exe which has space for sound effects indexes? Or has this yet to be determined, since there are in fact 163 files of sfx, they are probably scattered throughout the trek.exe

You wouldnt happen to know where most or all of them are? Mainly the ones for ambient sounds (and it would help if I knew how they worked as well, if they have the same structure), since it would make sense to make all races use same ambient sounds to free up several sfx index selections of choice for new phaser/torpedo sound.

Thanks DCER, I am off to test the above :)

EDIT: The above works a charm. I noticed two unused bytes at 914f5 - is it possible to push the bytes beginning at 914f0 back two places moving those empty bytes to the end of the (previous?) function?
Not for the weak of heart...
Galaxies MOD v0.4.0 <--- GALM/Galaxies Mod latest version
User avatar
Turner
Ensign
Ensign
Posts: 31
Joined: Fri May 09, 2008 2:00 am

Post by Turner »

Great Work DCER 8)
I did'nt expect to get a solution so fast. Now the Dominion War feels a little bit more realistic in BOTF, after spending a hour for extracting and adjusting a polaron beam sound from DS9 :)
DCER wrote: The minors/alien id is set at 0x91479 so you can try changing it from 5 to an id of one of the empires (0-4) to make them use a different sound index instead.
This didn't work in my testcases. The minors always used the index from 0x91480. However this isn't a real problem, aslong it's possible to change the majors index-positions.


There are still many unused soundfiles in sfx.snd (shield hit at example). Probably it's possible to locate other index-positions in trek.exe, which could activate the sound effects.
User avatar
Tethys
Past Administrator
Past Administrator
Posts: 2392
Joined: Fri Jul 18, 2008 2:00 am
Location: Your mom's bed ;)
Contact:

Post by Tethys »

Turner wrote:This didn't work in my testcases. The minors always used the index from 0x91480. However this isn't a real problem, aslong it's possible to change the majors index-positions.
Ive tried the same with the same result. I even tried copying the Rom/Kling sound from 0x91487 and pasting it to the minor race sound with nothing but crash. Also there are 2 other instances of BX 05 00 00 00 EB A6 at the following addresses: (the letter X representing variable code)

0x911da and 0x9136a

changing these values to reflect a different major race id had no effect as well. However there are several locations Ive seen with unused space for new sound indexes, DCER, if you are willing to take the time to decode them and do a little code writing, Im not too bright when it comes to code writing (tried several times with CTD's :()

Locations of unused code:

0x90f43
0x91259
0x912d6
0x91b12
0x91d42
0x92156
0x922c3
0x929d1

rest might be questionable?
0x94011
0x94043
0x942b1
0x94918
0x94b99
0x96618
0x96979
0x96c78
...the list could go on, im just searching for the (?) ending functions (?) and first byte of empty space before next function: 59 5B C3 00

where

59 5B C3 = end of function

and

00 = first byte of space

I could be wrong, I usually am... ;)
Not for the weak of heart...
Galaxies MOD v0.4.0 <--- GALM/Galaxies Mod latest version
User avatar
DCER
Code Master
Code Master
Posts: 683
Joined: Sat Apr 26, 2008 2:00 am

Post by DCER »

C3 is the end of a function (retn), the other two bytes are pop instructions.

You'd need BF ?? ?? ?? ?? to set the edi register followed by a jump.

If the jump destination is less then 128 bytes you can use EB ?? (rel. destination offset) otherwise you'd need E8 ?? ?? ?? ?? for an integer sized offset.

The functions you'll be jumping back into might not be using edi for the sound index in which case you'd need to change BF.

The function Turner found deals only with beam sounds.
Post Reply

Return to “Sound & Voice list Editing (converse.bin)”