Old style .eff to editable .emt zone sounds converter
The original game packed the background music and environment sound effect locations for zones in a binary ZoneNick_sounds.eff file, text ZoneNick_sndbnk.eff file that listed the sound effects referenced in the binary file, and ZoneNick.xmi multi-song MIDI files.
With Planes of Power, they added mp3 music for some of the higher-level planes, added the list of them to mp3index.txt, and pointed music references in the appropriate planes' x_sounds.eff files to these new mp3s by using negative numbers for the song numbers. In Legacy of Ykesha, they completely revamped the system. No more xmi music files and no more eff files for new zones. Zones newly created now used a text-based .emt file that listed the locations and characteristics of background music and environment sounds for zones. No documentation was ever released on either format, but a request from Grimluck on figuring out how to customize music in the zones led me on a journey to reverse engineer them. The result is a tool that can convert the old-style .eff files for Original through PoP zones into the editable .emt file that can be customized at will. If the client finds a .emt file for a zone, it'll ignore any old .eff files that are hanging around for it. The field definitions in the comma-delimited .emt file are also included in any converted files, for easy human reference while editing. ------------------------------------------------------------ The source code for the command-line version is here: https://github.com/Shendare/Eff2Emt The source code for the GUI version in .Net 3.5 C# is here: https://github.com/Shendare/Eff2EmtGUI Compiled binaries can be found here: http://www.shendare.com/EQ/Emu/Eff2Emt/ Current Screenshot (GUI version): http://www.shendare.com/EQ/Emu/Eff2Emt/screenshot.png Screenshot Mirror (in case my site goes down for some reason): http://i.imgur.com/6Dbpmhj.png |
For historical documentation purposes, here's what I figured out on the file formats during the course of my h4x:
ZoneNick_sndbnk.eff - Text listing of sound effects used in a zone: Code:
EMIT Code:
public struct EffSoundEntry - Each sound effect record can reference up to 2 sound effects / music subsongs, SoundID1 and Cooldown1 are for daytime, SoundID2/Cooldown2 for nighttime. RandomDelay is added to whichever is active. - SoundType 0 is for day/night environment sounds that play at a constant volume, such as bats screeching or wind blowing across an open area. - SoundType 1 is for background music, with the option of specifying different music for daytime vs nighttime in the same location. If either SoundID is a negative number, it's a PoP-added reference to the associated line number in mp3index.txt. Otherwise, it indicates which sub-song to play in the ZoneNick.xmi MIDI file at that location. - SoundType 2 is for environment sounds that play at all times of day or night, loudest at the center and quickly fading quieter as a character moves away. Campfires, for instance. - SoundType 3 is for day/night sound effects like SoundType 0, but the sounds act like SoundType 2 where they are only at full volume within FullVolRange, and quickly drop off as the character moves farther away from them. - SoundID1 (32-bit signed) is either:
- AsDistance acts like a volume dampener, making an effect sound like it's happening farther away. 3000-3100 seems to be the cutoff where the sound disappears completely no matter what volume your speakers are on, so I use 3000 as a scale for the Volume setting in the .emt file. - Any other fields are undetermined or self-explanatory. UnkRange64 ranges from -60 to +3000, similar to AsDistance's -60 to +4000, but plugging different values in it didn't seem to do anything. Same with UnkRange72 (0 - 10000, which would seem to be a candidate for FadeInMS, but didn't do anything), and UnkRange80 (0 - 3000) also had no effect. Hard-coded SoundIDs found in the .eff files (I think these are all found packed in snd2.pfs): Code:
39 - death_me |
Oh, and the fields in the .emt files. I just paste this line as-is at the top of a .emt file for reference. The game doesn't find a "SoundFile (wav=sound mp3/xmi=music)" in the game files as a sound file to play, so it ignores the line.
;?,SoundFile (wav=sound mp3/xmi=music),Unknown (0=OK 1=OK),WhenActive (0=Always 1=Daytime 2=Nighttime),Volume (1.0 = 100%),FadeInMS,FadeOutMS,WavLoopType (0=Constant 1=Delayed Repeat),X,Y,Z,WavFullVolRadius,WavMaxAudibleDist,N onZero = RandomizeLocation,ActivationRange,MinRepeatDelay,M axRepeatDelay,xmiIndex,EchoLevel (50 = Max),IsEnvSound (for option toggle) |
And c++ command-line version is now available as well.
|
Very nice work, Shendare!
|
Thanks. It was a fun little puzzle challenge. I haven't been able to work on some stuff I've been wanting to lately, so it was nice being able to play with something at least.
|
Well done :)
|
Thanks! Next step would be a quick user-friendly UI for adding and editing the sounds and music. Somewhere down the line.
|
Thank you so much for your amazing tools! I'm using this converter for a project to implement Maestrobob's awe32 mp3 transfers in the trilogy era zones instead of the default windows midi or other soundfont workarounds.
Rivervale was where I started. As far as I know, there's only one song and it plays throughout the whole zone. Looking into the rivervale.emt, I didn't see any reference to rivervale.xmi. Next, I compared your documentation to the raw rivervale_sounds.eff and found a reference to background music at index 0 of the xmi. So, I studied Eff2EmtConverter.cs and found why this song was left out after the conversion. On line 481 and 489 the sound file name is generated based on the index type. A PoP mp3 song if <0, empty if 0, xmi if >0. Code:
_soundFile1 = (_effEntry.SoundID1 < 0) ? SoundFileNumber(_effEntry.SoundID1) : (_effEntry.SoundID1 == 0) ? "" : ZoneNick + ".xmi"; |
I just wanted to note a strange bug when converting old zone sounds to .emt. The old environmental sound effects, like wind_lp_4, after conversion sound much louder depending on which direction you’re facing in game. At first I thought it was loudest if I was facing the source location, but it ended up that they are consistently loudest when facing north and south and are quieter when facing east west. This makes it difficult to customize or try and repair old zones sounds because it doesn’t sound good with this bug. To narrow down the issue, I tested a newer zone and added a line for the old environmental sound, and it happened there as well.
|
Quote:
|
All times are GMT -4. The time now is 12:02 AM. |
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.