Skip to content

New Feature! OGG support!

NathanNathan Member Posts: 1,007
edited November 2012 in General Modding
Hey everyone, I just wanted to take a minute to inform you all of a great feature that we've added to the game for those who mod (and in general for the players as well)!

BG:EE will allow OGG Vorbis support, directly in-engine, both for SFX/Voice assets as well as in the music system! You should be able to create OGGs at any sample rate, be it 8, 11, 22.5, 44.1, 48, 96kHz or possibly higher (note: only 8 or 16 bit audio though), and the game will gracefully handle you dropping that into the engine.

For those not familiar with OGG Vorbis, it's basically like mp3 only better and open-source! Win-win situation all around. If you want a decent encoder, for windows I'm a big fan of OggdropXP - it's simple, no fuss, and has lots of great options. For every other operating system there are plenty of other options, you can check it out here: http://www.vorbis.com/

The way we had to hook into the engine (and still allow backwards compatibility!) is a little different, so let me explain:
-For SFX and Voice - create your OGG's and just rename the .ogg extension to ".wav"
-For Music - create your OGG's and rename the .ogg extension to ".acm"

The existing structure and method of implementation is unchanged, and fully backwards compatible with everything else already there.

Another item of interest as a result of this: the HQ Music mod by Erephine is now included by default with BG:EE, and better yet since we're working directly with her on a few things I've re-encoded all the original WAV rips in OGG form at decent quality. Something we'll look into is providing an additional max quality (Q10 OGG encode) download of the music assets for people that want to have the best of the best - it won't be included in the game by default for space considerations (remember: we have to cram this game onto tablets...!) but we still want to allow people the choice.

Enjoy, and if you have any questions about how this will work please just let me know!
Post edited by CameronTofer on
BerconTanthalasCuvAndreaColomboRabainJamesFake_SketchDiscoCatlekikinou33sanctvsRisingsuncmorganCleaveWardLekianAvenger_teambgWulfyAscension64neleotheszeDragonserpentdosentti666MajocaKirinaldomibblesXylinaMoiraSpace_hamsterArchaonEpitomyofShynesskcwiseCloutiersalomonkaneserabietMosesHallkilroy_was_herewaiceSneakyDumplingXanastIranicusAnduinRaklinGoddardseekaRaistlin82KirkorCandramelekhSyntia13KenjiDarksheerxxxsmb1987xxxNielsKunddahlGodKaiserHellCluasKerozevok
«1

Comments

  • NathanNathan Member Posts: 1,007
    Oh, also, the SONGLIST.2DA hardcoded limit will be fixed using a similar approach to @Ascension64's TobEx solution.

    Interestingly: since SONGLIST.2DA didn't exist in vBG1, there are a lot of unused entries within it. I've left them as-is for just-in-case-compatibility's sake, but, making this change will be good going forward (for BG2:EE).
    AndreaColomboDiscoCatsanctvsGodKaiserHell
  • WardWard Member Posts: 1,305
    edited September 2012
    @Nathan EDIT: Bookmarked this epic page. I know nothing about this, but I see the potential here in the right hands. You Beamdog people have bawlz if you assume this won't be used for evil. +1 insightful for you!
    Post edited by Ward on
  • Avenger_teambgAvenger_teambg Member, Developer Posts: 5,862
    edited September 2012
    @Ward how could .ogg be used for evil, it is goodness incarnate !!!
    serabiet
  • WardWard Member Posts: 1,305
    @Avenger_teambg There are some odd people out there man. One minute we have editable .oggs and the next minute, people editing the rain sound effect to a man peeing in a toilet.
    Bjjorick
  • Avenger_teambgAvenger_teambg Member, Developer Posts: 5,862
    The original engine played plain uncompressed .wav. People could pee in wavs already.
    WardFake_Sketchlolien
  • WardWard Member Posts: 1,305
    @Avenger_teambg See? That proves how little I know about how the game is set up. But imagine people who do, like you. What could YOU do with all those .oggs?

    There's the potential for great deeds and unspeaking evil.
  • SmeuuhSmeuuh Member Posts: 34
    Very cool, nicely done! @Avenger_teambg: do you mean that the original sound was uncompressed?! No wonder the game is so big...

    I'm not sure what the point of having audio at different sample rate than 44khz is though.
  • WardWard Member Posts: 1,305
    edited September 2012
    @Smeuuh Yes, some of the audio was uncompressed. Everything except music IIRC, which are encoded in .ACM (you can unlock them with ACMConverter).

    Higher sample rates take up more disk on your hard drive. Especially back then, when BG came on five CDs, less data usage was important. The music runs at 22.01khz, 44.01khz on the soundtrack CD.
    Post edited by Ward on
  • WardWard Member Posts: 1,305
    Nathan said:

    Another item of interest as a result of this: the HQ Music mod by Erephine is now included by default with BG:EE, and better yet since we're working directly with her on a few things I've re-encoded all the original WAV rips in OGG form at decent quality. Something we'll look into is providing an additional max quality (Q10 OGG encode) download of the music assets for people that want to have the best of the best - it won't be included in the game by default for space considerations (remember: we have to cram this game onto tablets...!) but we still want to allow people the choice.


    OMFG I DIDN'T READ THIS PART HORRAY!
  • AndreaColomboAndreaColombo Member Posts: 5,524
    Didn't @Nathan say that .WAVC was actually a compressed format? I've been exchanging PMs with him and he said uncompressed audio isn't really used in the game industry.
  • Ascension64Ascension64 Member Posts: 560
    edited September 2012
    Cool stuff!

    @AndreaColombo: game wave files are compressed WAV format. They are really just ACM
    http://iesdp.gibberlings3.net/file_formats/ie_formats/wavc_v1.htm
    AndreaColomboNathan
  • WardWard Member Posts: 1,305
    @AndreaColombo I seem to be able to access a few of the sound files in many traditional players, although I can't figure out what encoding they're in. I don't think they're regular .WAVs or else I could open them in sound recorder.

    There are a few games which use uncompressed mp3s, but it's not standard. Probably helps keep sound theft down. :P
  • AndreaColomboAndreaColombo Member Posts: 5,524
    @Ward - mp3 is a lossy compressed format (and not even a very good one), so there can be no "uncompressed mp3" :D Uncompressed formats are WAV and PCM/LPCM. You can have the same level of quality with some data compression using lossless compression algorithms such as FLAC, but files still end up being too big for the gaming industry's tastes.
  • Avenger_teambgAvenger_teambg Member, Developer Posts: 5,862
    Even in the original game, you could use wavc or wav. Both had the .wav extension outside.
    .acm is just wavc with an additional redundant header. And the music player couldn't use (originally) other than that. So now you can use:
    1. uncompressed or compressed wav and also ogg for sound
    2. compressed wav with acm header and also ogg for music
  • WardWard Member Posts: 1,305
    edited September 2012
    @AndreaColombo They keep various soundtrack files in zip archives in a few of my games. How the game accesses them, I'll never know. Didn't think it worked like that.

    EDIT: Maybe the game unpacks them and dumps it in your temp folder.

    EDITEDIT: I just realized that was me. :P I zip archived some game soundtracks and left them in the directory. I thought they were the only copies. My bad. xD

    EDITEDITEDIT: When I said uncompressed I meant not in a zip folder, not unencoded. :P
  • DemossDemoss Member Posts: 52
    Is the HQ mod tracks from the soundtrack cds replacing the in game ones? or? because I'm pretty sure the soundtrack cd is missing a few tracks.
  • NathanNathan Member Posts: 1,007
    edited September 2012
    @Demoss: where possible the HQ music from the OST is replacing the in-game sounds. Whatever wasn't covered by Erephine's HQ music mod is either Sam Hulick's excellent new music or has been left as-is (but I'm pretty sure everything is covered).

    @Smeuuh: Here's everything you could possibly want to know about sampling rates. =)

    the TL;DR is: take half of the sampling rate, and that's the theoretical max Hz a digital audio file can reproduce (a Hz being a measurement of frequency, or pitch) without introducing aliasing, which is a type of audio artifact (mistake). Human hearing ranges from 20Hz to 20kHz in general, so, that's why hollywood plays back at 48kHz, and most high end audio has gone towards that playback rate.

    If you hear about 96kHz and 192kHz - those are still useful, but, just for recording and editing for the most part.
    AndreaColombo
  • DemossDemoss Member Posts: 52
    Nice to know, also seems (after looking at my soundtrack and one from interplay many years ago(free mp3 download at one point) ) seems theirs only one track missing from the CD. (but not sure what one, interplays download was 34 tracks but missing 33, iirc it was explained why on their site... CD has only 33 tracks and based on names the same track 33 is missing)

    Just another little question is her higher quality files uncompressed wave? (nothing was clear over at Spellhold Studios) Mainly asking as if its not, going from one lossy format to another... is not nice.

  • NathanNathan Member Posts: 1,007
    Yes, I mentioned it above: "since we're working directly with her on a few things I've re-encoded all the original WAV rips in OGG form at decent quality".

    Erephine's mod shipped in ACM (a lossy format) but she was kind enough to send me the original uncompressed wavs - that's what I'll also be using to provide the high quality (Q10 OGG) music download.
    AndreaColomboMoira
  • DemossDemoss Member Posts: 52
    Thanks for answering! :D

    No more questions from me.
    Nathan
  • lordkimlordkim Member Posts: 1,063
    @Nathan, any chance of getting music only in download ?
  • NathanNathan Member Posts: 1,007
    @lordkim hmmmm? Sorry, I don't quite understand what you're asking?
  • AndreaColomboAndreaColombo Member Posts: 5,524
    @Nathan - I believe he's asking whether we'll get to download the soundtrack in high quality OGG format to listen to on portable players, computers, etc... :)
  • cmorgancmorgan Member Posts: 707
    For modders, this now means that instead of shell scripts and such, all our sound files can be compressed and shipped on both Windows and Mac (and Linux, too) using the same installer - and no need to pass through a decompression routine, or convert to ACM - just sample the sounds, make it an .ogg, and a little renaming higgery-pokery, and voila. One Sound to Rule Them, One Format to Find Them...
    AndreaColombo
  • NathanNathan Member Posts: 1,007
    @AndreaColombo oh. OH. Hmmm. I'm not sure about the legality of that. I think it's one thing to supply an add-on for the game, and another entirely to turn around and start supplying the soundtrack for download -- I have a feeling that the soundtrack as a "thing" is subject to agreements and licenses we don't have access to.

    It is possible that something could happen with Sam Hulick's excellent new music additions... blah, I can't speculate on that right now. Something maybe down the line?

    @cmorgan Awwwwww yiss. OGG for the win.
    AndreaColombo
  • lordkimlordkim Member Posts: 1,063

    @Nathan - I believe he's asking whether we'll get to download the soundtrack in high quality OGG format to listen to on portable players, computers, etc... :)

    Yup-- Sorry for the lousy english from my side :O)

  • CoM_SolaufeinCoM_Solaufein Member Posts: 2,607
    But can you play .ogg on Windows Media Player?
  • agrisagris Member Posts: 581
    @CoM_Solaufein

    Of course, with the correct codec...
  • Avenger_teambgAvenger_teambg Member, Developer Posts: 5,862

    But can you play .ogg on Windows Media Player?

    Most likely, though i use vlc.
  • NathanNathan Member Posts: 1,007
    You can play .ogg's via the regular Windows Media Player or via Windows Media Player Classic providing you have the right codecs installed. I'm a big fan of the Combined Community Codec Pack - install that and one should be good to go.
    darrenkuoAndreaColombo
Sign In or Register to comment.