New Horizon on 16/4/2005 at 20:41
Hmmm, this is where a super version of sound drone would come in handy. The next revison was to have the ability to extract and replace files. I wonder,with the knowledge we now have, if we could create a small app that could be packaged with the T3 fan mission installer and rewrite the existing schema meta files?
rujuro on 16/4/2005 at 20:45
That would be ideal, but it is way beyond my ability. If someone who knows perl looks at the compileschemas.pl they should be able to see exactly how the metafiles are constructed (if that is an unknown). Tough to know how to proceed here, since it means that true custom ambience is going to be VERY hard to distribute.
rujuro on 17/4/2005 at 18:40
UPDATE:
I've added the instructions for making the metafiles to the wikki. I'm not sure how much this will actually be useful though.
OrbWeaver on 18/4/2005 at 18:32
Quote Posted by rujuro
That would be ideal, but it is way beyond my ability. If someone who knows perl looks at the compileschemas.pl they should be able to see exactly how the metafiles are constructed (if that is an unknown). Tough to know how to proceed here, since it means that true custom ambience is going to be VERY hard to distribute.
From a cursory glance through the code it looks like the schema metafile is comprised of packed schema data (the values in the text file converted to binary form, as well as various tagging and subtitle information) followed by uncompressed WAV data (which explains why the files are so large).
This means that it ought to be possible to extract the WAV files to rebuild the metafiles, since the data is essentially unmangled. On the downside, if this format is to be used then the metafiles are going to be large no matter what.
However, there are lots of references to the OGG format as well, and from the looks of things it is possible to use an OGG instead of a WAV for any schema, which should cut down the size enormously. Of course, the fact that the schema metafile supports the format does not mean that the game does, but we shall see.
I will look through the code some more, and perhaps attempt to write some kind of extraction tool at some point (probably in Python, rather than Perl).
OrbWeaver on 18/4/2005 at 18:38
Another interesting fact relating to metafile distribution is that there are five metafiles: 3 DVD, 1 hard disk and 1 memory.
From the script it looks like it does not actually matter which one you put stuff in; they are just used for performance reasons. If this is the case, then it might be possible to put all of the custom schemas in one of the smaller metafiles (SchemaMetafile_HardDrive.csc or SchemaMetafile_Memory.csc) and just distribute that, whilst leaving the bulk of the sounds in the DVD metafiles on the player's hard drive.
rujuro on 18/4/2005 at 18:57
That is an excellent point, since the memory metafile was near 0, if I remember correctly. Although I wonder if they really are all handled the same way by the engine...
Regarding OGG, the game definitely uses them, but only on the PC. The -p flag in compileschems.pl tells the metafile to use OGG in place of wav wherever it's available.
OrbWeaver on 18/4/2005 at 19:19
Quote Posted by rujuro
That is an excellent point, since the memory metafile was near 0, if I remember correctly. Although I wonder if they really are all handled the same way by the engine...
If any of them is handled differently, my money would be on Memory - i.e. it may be loaded permanently into memory at startup. This does not mean we could not use it, as most PCs should have ample memory to store a few OGGs.
Quote:
Regarding OGG, the game definitely uses them, but only on the PC. The -p flag in compileschems.pl tells the metafile to use OGG in place of wav wherever it's available.
Excellent, that means it should theoretically be possible to extract the whole lot, encode it as Vorbis and rebuild the (much smaller) metafile.
SneaksieDave on 18/4/2005 at 20:40
There's definitely ogg in there, if that's in question. Also, if there are multiple files in the game distribution, what are the chances of simply creating a new one? One that contains only an FM's assets, and is therefore, only the size it needs to be.
e.g.,
SchemaMetafile_DVD1.csc
SchemaMetafile_DVD2.csc
SchemaMetafile_MyFM.csc
...
Edit:
Bingo(?) In DEFAULT.ini, the following is found:
SchemaMetafileName=SchemaMetafile_HardDrive.csc
SchemaMetafileName_Memory=SchemaMetafile_Memory.csc
SchemaMetafileName_DVD1=SchemaMetafile_DVD1.csc
SchemaMetafileName_DVD2=SchemaMetafile_DVD2.csc
SchemaMetafileName_DVD3=SchemaMetafile_DVD3.csc
Question is, can we add to that.
rujuro on 18/4/2005 at 21:02
I don't think so, the metafile flag is set in the schema browser, and they seem hard-coded to DVD, Hard drive, memory, or unassigned (it's a little pull down menu). The one you choose puts a number in the schema file, then it looks like the perl script looks at the number and packs them accordingly.
I assume the game engine is hard coded to know how to handle the different types. However, it might be interesting to see how it would handle a DVD4 (just a simple rename), for example, since I don't know how it differentiates the different DVD metafiles...
OrbWeaver on 19/4/2005 at 19:58
After some more examination, I discovered the following.
* The SchemaMetafile_HardDisk.csc file is the one with all of the metadata in, so if any custom schemas were used, I think they would have to go in this one. I do not yet know if ALL of the required metadata is in this file, or if there are other files that need to be distributed also.
* The DVD metafiles look like back-to-back OGG streams, which are presumably referenced from the metadata in HardDisk. This suggests that they are not that useful as distribution media, and should probably be left untouched.
* My SchemaMetafile_Memory.csc is completely empty, which may mean it is not used at all on the PC version. Perhaps somebody who was creating custom schemas could try to compile their schema into the Memory metafile, and see if it does indeed play in game?
As the HardDisk metafile is about 37 megs in size, and this data is uncompressed, it might be feasible to redistribute this file with FMs, especially if all its WAV content was re-encoded as Vorbis.