Have Fun Exploring the Sega CD Claw Marks (June 7, 2010)

Anyone else managed to have any success? reached a bit of an impasse myself - don't know enough about audio files i fear!
 
Anyone else managed to have any success? reached a bit of an impasse myself - don't know enough about audio files i fear!

Sorry, I'm out of town for the weekend. I can't really do anything untill I get back tomorrow night.
 
Hey guys,

Good thread!

I was looking at the WC3 3DO files, but ended up making a small detour to look into the Sega CD files and was able to make a quick extractor for the game voices. You can find it on my site, along with a few extracted samples.

Madman you were definitely on the right track: there is indeed a large header before each voice which needs to be skipped, after that it's a matter of decoding the sign-magnitude encoding the Sega CD chip uses (i think this is where your static came from). This special encoding also has a special marker for hardware sound looping, apparently... Interesting stuff!

The sound appears to be 16KHz 8-bit mono, except for a few sounds which seem to be coded at a different sampling frequency. I recall at the top of my head a Paladin line which is coded at 32KHz... but i'm not correctly detecting this yet (working on it). Other than that it seems to work well though, so please give it a try and let me know if you find any problems!
 
Good to see you again, HCl. :)

I recall even the unencoded speech of WC2 had some headers marking the start of each line, or something to that effect. I didn't decode that sort of stuff, I just recognised it as static I needed to ignore.
 
Wow that's awesome HCL! Thanks so much for taking a look at it :) I'll have a play with the decoder tomorrow :)
 
Hmm, So having had a play, it seems to me that certain music is stored in the dat files:

If you examine the if2 files, it basically is a list of when what things play so, for the first briefing (S01M00_1.if2) we find:

;/*---------------*/
; S01M00_1.INF
;/*---------------*/


#00 ;
0 11 -1

0

#01 ;
1 0 -1

1

the #00 seems to be a generic marker, the next three numbers may control the pauses or possibly the graphics shown behind. (I'm guessing that the headers in the dat files are the lip movement stuff)

the final number is the audio segment - in this case meaning audio files 0 and 1.

I've picked this example for a reason though, as audio file 1 is actually the first thing Halcyon says (We've got a lot of work to do people, so let's get to it) which makes me think that the 0'th file is the music which plays for 3 or 4 seconds prior to that.

examining the 2nd mission file (S01M01_1), doesnt support that, so i'm interested as to what is in file 0 :p

Anyway, in m01, the game makes a choice over which line to play (epsilon wing is hotshot and spirit or epsilon wing is hotshot)

#02 ;
2 0 -1
J04 0 3,
28

#03 ;
2 0 -1
J05 0 4,
29

Not sure how it works, but I think the J04 line is to jump to marker 3 if this playback is not suitable?

The other final thing of potential interest, is the question of the number of these ordering files - there are 5 per mission suggesting that _1 does the briefing, _2 does the debrief (file 36 is referenced which is the "drop by my office", 35 is "spirit didnt make it back etc), _3 is shotglass, _5 is the left hand person in the bar (paladin for instance) and _4 is the right character (eg angel)

I have a big list now of those segments which hcl's ripper doesnt get out, if anyone wants a look then I'll be happy to provide. Hope this lot helps someone, I'd certainly like to work out which of the numbers dictates pauses etc.
 
So I still vaguely believe that the music for a scene (if constant eg briefing music) is stored in the dat file (Bri.dat file 0), where the debrief music is stored may be more complicated

I've been looking at the medals.

MEDAL0.IF2 reads as follows:
;/*---------------*/
; MEDAL0.INF
;/*---------------*/
; DONOT REMAKE!
;/*---------------*/


#00 ;
16 11 -1

0

#01 ;
6 0 -1
J13 02,J15 06,
$M5
1
1
1
;(SUN)
;(HONOR)

#02 ;
6 0 -1
J14 08,
2

#03 ;
6 0 -1

3

#04 ;
6 0 -1

4

#05 ;
6 0 -1

5

#06 ;
6 0 -1
J13 08,
6

#07 ;
6 0 -1

7

#08 ;
6 0 -1

$S13
8
9
10
11
12
13
14
15
16
17
18
19
20

#09 ;
6 0 -1

$A30
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50

#10 ;
7 0 -1
J13 11,J15 12,
$M3
51
52
53

#11 ;
7 0 -1
J14 13,
54

#12 ;
7 0 -1
J13 13,
55

#13 ;
84 0 12

56

#14 ;
93 9 13

57

#15 ;
8 11 -1

58

#16
-2


%

Now the audio files run as follows (number then content, ** indicates a variable over several files, either a system name, a medal name or a rank):

1 For meritorious conduct in confronting the Kilrathi enemy
2 In consideration of his valorous service to humanity
3 Leading the forces of the confederation against the empire of kilrah
4 Taking a decisive role in the Vega sector campaign
5 and commanding the squadron which accomplished the pivotal victory
6 For bravely sacrificing his vessel and endangering his life
7 In combat with the Kilrathi Enemy
8-20 System Names (In the ** system)
21-26 Bronze Star (The Terran Confederation is proud to present the ** to ** Hotshot)
27-32 Silver Star
33-38 Gold Star
39-44 Golden Sun
45-50 Terran Confederation Medal of Honour
51-53 Your courage is exemplorary of the Confederation's Finest Defenders
54 History shall number you among the greatest heroes of Humanity
55 Your Devotion to the Confederation honours all Humanity.
56 Good job, Hotshot. Congratulations.
57 Thankyou Sir.
58 Filled with Pride you meet the applause of your fellows.

Next, listening to the 5 medal speeches (medal, system earnt, file markers called, i've used 8 to mean any system in the 8-20 block, same with the medals but have specified the medal, just not the rank):
Bronze Star (Gimle) 1,8,21,51,56,57,58
Silver Star (Kurasawa) 1,8,27,51,56,57,58
Gold Star (Dakota) 1,8,33,51,56,57,58
Golden Sun (Venice) 6,7,8,39,55,56,57,58
Medal of Honour (Venice) 2,3,4,5,8,45,54,56,57,58

Okay so I believe that J13 (for instance) is a logic if clause, i.e.
J13 02 means if J13 is true then go to #02 in the file (simple enough right?)
meanwhile $M, $S13 $A30 etc are strings to identify - not sure, system/series and medal/rank being won respectively. I'm not sure about $M3 and $M5 because $M5 is only used at the beginning AFTER the choice has been made that this is a bronze/silver/gold star. $M3 is even more bizarre, as it (again) only applies for the 3 star type medals but basically precedes 3 file markers (51-53), all of which contain the same speech (identical speech!)

Oh and those J13, J14 etc logic gates - they determine the type of medal being won:

j13 is the medal of honour
j14 is normal medals
j15 is the golden sun

Anyway, that means we can break down the medal file into a nice simple basic style code (for the sake of argument im assuming $S13 is a 13 value array ranging from 0-12 - I dont have any reason to believe this, but it makes little difference and suits this example):

0 Play file 0
1 if (j13 goto 2)
if (j15 goto 6)
$M5
Play file 1
2 if (j14 goto 8)
Play file 2
3 Play file 3
4 Play file 4
5 Play file 5
6 if (j13 goto 8)
Play file 6
7 Play file 7
8 Play file 8+$13 //Select Series
9 Play file 21+$A30 //Select Medal and Rank
10 if (j13 goto 11)
if (j15 goto 12)
Play file 51+$m3
11 if (j14 goto 13)
Play file 54
12 if (j13 goto 13)
Play file 55
13 Play file 56
14 Play file 57
15 Play file 58
16 End

Sorry about the stupidly long post - but hopefully this isn't basic stuff to everyone :D (if it is, please tell me i'm a moron !)

Edit: In the FUNE_PC4.IF2 - the funeral for series 8,10,11,13 the $R6 is a string to tell the game which rank you have and thus which intro (we are gathered here...) to play - so the $M markers must be a string to indicate which medal is being won. Since we have $M3 AND $M5 I suggest that $M3 is simply the first 3 values of $M5 and indicates the 3 star medals, and values 4 and 5 indicate the sun and planet (though not necessarily in that order, since the j values refer to planet, stars, sun).
 
Just gave it a try and extracted the briefing files - works like a charme!

Fantastic work HCl - that was exactly what I was looking for :)
 
Thanks guys! :)

Wedge, agreed, when the number of voices is relatively low, you can treat the entire file as audio and cut the resulting static manually. However, this is not practical when the number of files is large. In the case of Sega WC1, there are over 2500 snippets of speech in the game. The debrief dat file alone has 1800+ files, so parsing the headers correctly in this case is a must.

Also, parsing the header allows you to retain the numeric references of the various lines, which allows for analysis such as what Madman has been doing. It also makes it easier for implementing a future patch for the WC1 PC version ;) I've been entertaining this idea for a while, although i don't plan on jumping at it right away, i do plan on working on it eventually (unless someone else would like to take a shot at it first... in that case, please let me know beforehand so we don't duplicate efforts)

Madman, i think what you're saying makes sense. At a glance, I would just like to suggest that since the $M, $A, $S etc seem to work as switch statements, the most correct interpretation probably involves dividing the statement as a variable+length+list.

So you could take:

$S13
8
9
10
(etc)
19
20

and read it as

"given the 13 element list [8,9,10,(etc),19,20], play audio number at position $S on the list"

where $S contains a value between 0 and 12.

For the $M3 case, you would have list [51,52,53] to select from, and for the $M5 case you would have list [1,1,1,None,None] (the lines are blank, except for comments, but they exist...).

This would probably work. You would then have:

$S would mean "series" (0..12)
$R would mean "rank" (0..5)
$M could be "medal" (the "SUN" and "HONOR" comments seem to support this) (0..4)
$A would probably mean award, with a value involving both Rank and Medal information (0..29, probably computed as medal*6+rank, as there are 6 ranks and 5 medals, both numbered between 0 and N-1)

Hmm it looks like it could be fun to make an interpreter for these files, starting with audio (which is now known, and therefore playable) and probably adding graphical elements later on if/when it becomes possible. What do you say Madman, want to give it a try? :)
 
heh, i'd love to try but im afraid my programming experience ends with physics simulations :D and even those are text only :D - I'll keep looking through the files though, see what I can work out. I agree with your assessment that the $M etc are triggers - thats pretty much the conclusion i'd come to, though in that case it seems easier to use them than the apparent "goto's" that the code also contains, but thats by the by.


Although, if I can work out how to use some sort of audio playback code I might be able to work something up :) (at the very least I can write something that calls the "use file x" and then ask for help on the "actually using file x" step!

One thing I am curious about is the fact that the IF2 files have .inf filename headers in them - relic from pc WC?

On a completely different note, HCL do you know if you have a copy of the file mentioned here:
https://www.wcnews.com/news/update/278
It's the WC Armada/3/4 to WCP/SO ship converter - it doesnt seem to be stored at the CIC anymore and I can't find it on your site (maybe it was never up there?)

Also, did you ever release (even as a beta) your armada to 3 and 3 to 4 converters or the 1 to 2/academy converter?
 
Last edited by a moderator:
One thing I am curious about is the fact that the IF2 files have .inf filename headers in them - relic from pc WC?
Hmm good question, i'm not sure i recall anything resembling conventional .inf files on PC WC1 (although it's been a while since i looked). If i had to guess, however, it would say that it is possible that some internal Origin tool was used to convert .inf files into .if2. There are indications that IFF files were compiled from a text representation in WCP, so something similar may have happened here.

On a completely different note, HCL do you know if you have a copy of the file mentioned here:

Ouch.. I remember this converter :) It was my first attempt at dabbling with 3D stuff, so it had a lot of problems, particularly the first versions. It was a useful tool for tearing apart and documenting the ship format WCP uses (while getting a few new ships in the game in the process), but wasn't that reliable in the end. My later attempts at doing 3D converters (for Starlancer and Freelancer, no less!) ended up working much better.

Also, the conversion process was not 100% automatic, you had to perform a good deal of steps manually. And the BSP generator could use some improving as well...

I think i still may have it around, so i can look for it. However, i recall it did have a good deal of problems, so i'm not sure you will thank me if i find it... ;)

Also, did you ever release (even as a beta) your armada to 3 and 3 to 4 converters or the 1 to 2/academy converter?

Unfortunately, these may have been lost at a hard-drive crash some years back, i'm not sure i have them anymore. Something good came out of it though, i learned to religiously back-up my data since then!

Still, i recall these converters were not incredibly complex. The WC1/2/Academy formats and WC3/4/Armada were fairly similar amongst themselves, so you had to manipulate the headers a bit and you were mostly done. You could even get away without doing palette conversion and it would look acceptable (some reds would turn orange, for example, but it would still look good enough for the most part).
 
Back
Top