-
Posts
317 -
Joined
-
Last visited
Everything posted by tracktwo
-
LiQuiD911: That's great, hopefully the random node will work for you. Should do. TRekNexus: Are you replacing an existing package with the same package name and same cue and sound node names in your replacement package? This should work, but might CTD the first time for the same reason long war does (something about file sizes/contents changing?). Does it start correctly the 2nd time or does it crash repeatedly? I have done this with voice files and had it work, so I don't believe there should be any reason it shouldn't work with music files too. Although, different music nodes are coded differently. Which one are you trying to replace?
-
Good suggestion, thanks. I've updated the download link to the new version. And congrats on LW Beta 14! I'm about to try it out now.
-
Thanks WGhost, that fixed it. I'm a little torn because I find playing two copies slightly too loud (but not nearly as loud as playing all the copies) but one is not quite loud enough. It is very easy to adjust to taste, so I put a comment in the description with a pointer to the value to change. Here's the script to reduce overwatch-all loudness (EDIT: attached so it doesn't eat the special characters) (EDIT2: Updated to use WGhost's alias suggestion. Change the number in the ALIAS line near the top of the file from 2 to the desired value to adjust the volume)
-
Yes, I noticed the crashes :smile: It was interesting because it also failed to figure out the size correctly. PatchUPK claimed the new size of the function was roughly negative 10GB. Not being able to add new instance variables is a pain. I can borrow the debug variables from XComTacticalCheatManager but I'd rather use fresh ones if possible so they won't interfere with any existing functions in case people are using them. Has anyone managed to add new ones yet? It seems funny that changing the object size would matter since so much of unrealscript seems to be dynamic, so I'm hopeful that I just did something wrong and this should work. But, there is a lot that I don't yet understand about the execution model.
-
OK, I started work on the overwatch fix. I made it so it played only one copy of the "overwatch" sound effect, but kept the voice announcements as they were. The overlapping sounds of everyone saying their cue doesn't seem to increase the volume significantly, I guess because it's a bunch of different cues playing instead of the same one repeatedly. But the trouble is, now the overwatch sound effect is too quiet. You can't really hear it over the sound of everyone playing their "on overwatch" sounds :smile: For a long time I thought it was bugged and wasn't working, but I put my headphones on and cranked the volume up and I could hear it underneath everything else. I'll experiment with playing maybe 2 or 3 copies of the sound to see if I can get it at a decent level compared to the audio cues.
-
LiQuiD911: I missed your post earlier. I believe the resize value needs to be the full size of the object. Exactly how big this will be depends on the size of the default parameters you put in the object. If you don't add any, and I don't think they are needed, the full size will be 4 (link) + 8 (name "none" to end the empty default list) + ogg size + 0x50 bytes for the native data structure. The object data itself needs to be: the 4 byte link (skip it with rel + 4), name <none>, 12 bytes of 0, the absolute offset, 4 bytes of 0, size of ogg as 4 byte little endian value, size of ogg as 4 byte little endian value again, absolute offset, ogg data, 12 bytes of 0, absolute offset, 12 bytes of 0, absolute offset, 12 bytes of 0, absolute offset. The absolute offset can be written by patchupk. I forget the key to use in the file and can't easily look it up on my phone, but it should be back in a much earlier post in this thread.
-
Yeah I was a little worried about the order too, but it turns out that it's exactly the same (wrong) order as before. It doesn't really matter too much, I don't think, because they aren't strictly ordered anyway - does it really matter if you see the Gauss Carbine before or after the Rifle? Next up on my annoying list is the very loud overwatch-all command. Fixing that is going to be tedious, I think. The cue is actually played from the ridiculously enormous switch statement in XGAbilityTree.ApplyEffectsToTarget(). The number of jump offsets in that function is just crazy. The only real way I can see to fix this is to set a flag in ForceOverwatch() that ApplyEffectsToTarget queries and will not play the sound if it's set. But I may not get around to that one for a while because it's going to be such a pain. I can probably just snip out the existing case for overwatch and move it to a new function, then overwrite the first few bytes of the case with a call to that function and a jump, and leave the rest as-is so I don't have to touch any offsets in that function. Or do you know if anyone else has already looked into this?
-
All Realize() seems to do is actually display the dialog box, from what I can tell. There isn't any good reason to display all the dialog boxes when multiple items are unlocked: only one needs to be shown, the others just need to be in the array so the next one will be shown when the first is dismissed. It looks to me like the way it originally worked is if you unlock three items with a research, it'll "display" all 3, playing three sounds. Only one dialog can actually be on the screen at a time, so the only one the player actually sees is the last one in the array. Each time a dialog is dismissed with RemoveDialog(), it removes it from the list and calls Realize() again, showing the next one and playing the one sound for the one realized dialog. One interesting thing: Look at UIDialogueBox.AddDialog(), at the top it has code that checks if there is already a dialog being displayed or not, checking if the size of the array is > 0 and if the last element on the list has the isShowing flag set. This flag is set by Realize() when the dialog is displayed. If these conditions are met, it uses m_arrData.InsertItem(m_arrData.Length-1, kData) to insert the new dialog into the list. If they aren't met, it uses m_arrData.AddData(kData) to insert the new dialog into the list. I think this was supposed to be the logic that handled dialog stacking, but it has two bugs. To me, it looks like this was actually supposed to be: if ((m_arrData.Length > 0) && m_arrData[m_arrData.Length-1].isShowing) { m_arrData.InsertItem(0, kData); // insert at beginning, this maintains ordering. return; // return, no reason to Realize() because there's already an item displaying } else { m_arrData.AddItem(kData); } (EDIT: This doesn't actually work, it looks like the management calls below insertion but before Realize() may be needed, so the first mod or a combination of the two to insert in the right order but avoid excess realizing might be best) As originally written, why use the if check at all? Inserting at the end of the list is exactly what AddItem does anyway, no need to use InsertItem to do that. If you look at the order in which the unlocked items appear in the report, and the order in which they show up when you close the report and get the unlock dialogs, you see the first one first, and then all the rest in reverse order. I.e. if you unlock 5 things, you see 1, 5, 4, 3, 2. That's because of the way the extra dialogs are stacked onto the end of the list with InsertItem (or AddItem would've done the same, with the exception that it'd be in completely the reverse order instead of the weird first-then-reverse order). If they were inserted at the beginning of the list, you'd see them in the natural order: 1, 2, 3, 4, 5, because RemoveDialog always displays the dialog that's last on the list. I think that's perhaps what the if check was trying to do in the first place, but it's bugged. And also it would just return after inserting the item, because there is no reason to display it when there is another one already present.
-
Yeah, I was just trying to figure out what was causing the crash by seeing if it was still hashing the original part of the file, if that's what it was actually doing. Still not sure, but that function doesn't seem to be relevant to the sound anyway.
-
The patch will actually clone the function, so that appears to be why it doesn't crash: the original is unmodified. But, weirdly enough, if I do this and then also modify the original function, it doesn't crash. Very odd. I have a fix for the overlapping sounds. The fix is to only call Realize() from AddDialog() if the dialog just added is the only element in the array. Adding additional dialogs will add them to the list, but not Realize(). Realize() is called again when the dialogs are dismissed, and this will pop up the next dialog in the list and play the sound. UPK_FILE=XComGame.upk AUTHOR=Tracktwo DESCRIPTION=Fixes the extremely loud overlapping SFX when research unlocks many items/projects/facilities. Version: 1.0 Compatible with XCOM Enemy Within versions: - all OBJECT=UIDialogueBox.AddDialog:AUTO [BEFORE_CODE] //Realize(); // return; 1C <UIDialogueBox.Realize> 16 04 0B [AFTER_CODE] // if (m_arrData.Length == 1) { 07 01 01 9A 36 01 <@m_arrData> 26 16 // Realize() 1C <UIDialogueBox.Realize> 16 // } // return; 04 0B
-
WGhost: The code in UIScreen.UnlockBox.DrawDBox makes a call to play the fanfare sound at the end of the function. This is in addition to the call in Realize(). Maybe this one is also contributing to the overlapping sounds? I tried modding it out with just a plain hex editor, replacing the start of the call with either a jump to the return or just a "return none" right there, but it always crashes the game. The log is reporting logs about hashing the packages, but I thought package hash verification was disabled in EW? It crashes with an assertion failure just before it would print the hash log info for xcomgame.upk in the unpatched version.
-
That's true... There must be a hook to trigger loading the report the next time you enter the labs, but I haven't seen it yet because its difficult to navigate around in UE explorer. I still don't know why ctrl-shift-f only seems to give me results in xcomgame.upk and not in xcomstrategygame.upk.
-
Cool, that's great. I've been digging through this code but for some reason I can't easily search XComStrategyGame in UE explorer, so it's hard to find things. I did notice that XGMissionControlUI.OnAlertInput seems to be the place that handles clicking on the first "research complete" dialog. That's case 28, which jumps to the lab facility. I can't recall right now the order in which the dialogs appear here, but that or near there might be the right spot to insert the fanfare sound.
-
LiQuiD911: I still owe you the patch details to make the combat music customizable. Here's the PatchUPK modfile: MOD_NAME=Combat Music Config Enabler AUTHOR=Tracktwo DESCRIPTION=Allows setting customized combat music packages from DefaultContent.ini Version: 1.0 Compatible with XCOM Enemy Within versions: - all UPK_FILE=XComGame.upk // Make XComTacticalSoundManager Config(Content) OBJECT=XComTacticalSoundManager [BEFORE_CODE] 12 00 80 00 <Class.Core.Object> <None> [AFTER_CODE] 16 00 80 00 <Class.Core.Object> <Content> // Change XComTacticalSoundManager.CombatMusicCues from array<string> to config array<config string> OBJECT=XComTacticalSoundManager.CombatMusicCues FIND_HEX=00 00 40 00 MODDED_HEX= 00 40 40 00 OBJECT=XComTacticalSoundManager.CombatMusicCues.CombatMusicCues FIND_HEX=00 00 40 00 MODDED_HEX= 00 40 40 00 After this you can add this section to defaultcontent.ini to set the combat music to the defaults. Change or add any element to the array to add more music or remove tracks. [XComGame.XComTacticalSoundManager] CombatMusicCues="CombatMusic1.ActionMusic1Cue" CombatMusicCues="CombatMusic2.ActionMusic2Cue" CombatMusicCues="CombatMusic3.ActionMusic3Cue" CombatMusicCues="CombatMusic4.ActionMusic4Cue" CombatMusicCues="CombatMusic5.ActionMusic5Cue" CombatMusicCues="CombatMusic6.ActionMusic6Cue" CombatMusicCues="CombatMusic7.ActionMusic7Cue" CombatMusicCues="CombatMusic8.ActionMusic8Cue" CombatMusicCues="CombatMusic9.ActionMusic9Cue"
-
I was going to look at that tonight too, that loud sound drives me crazy! :)
-
Ah, I didn't realize that. I didnt have ew until I got long war, I mostly just played EU. And makes sense with it not being seek free. I'll need to look into that a bit, cause not having absolute offsets to deal with would be really nice. And from what I understand seek free is mostly an optimization for consoles using optical disks, so it shouldn't (hopefully) be a big problem on a PC if the game will recognize them.
-
Amazing! Thanks WGhost for the hunker down mod, I really wanted a hotkey. I can't wait to try it and the overwatch fix. Does this also help with the really loud sound effect on alt-o? Edit: Also amazing that a cooked into xcomgame sound isn't broken because of all the mods moving the absolute offsets. Or do none of them alter the table sizes?
-
There is a post much earlier in this thread with a sample patch file that Wghost posted. Getting the size right is a little tricky because you have to count the native data (0x50 bytes), the size of the ogg, and the size of the default param array.
-
Ah yeah, I see the battle music cue now in the soldier select package. WGhost's recent changes to patchupk allow it to patch new ogg data into a package even with resizing, so you don't necessarily need to have them be the same size. I'm not sure if the version on nexusmods has been updated or if you need to compile from source on github to get the new feature that allows updating the absolute offsets in sound nodes.
-
That would ensure no one clip is more likely to play than any other, yeah. But the stock clips aren't that careful, lots have 6 or 7 or 11 clips.
-
JohnnyLump: Basically what WGhost said. There is no requirement that the new voices have 15 banks, or the banks have exactly the same number of unique clips. I posted that just to give you an idea of what a stock bank looks like. The naming scheme is just a convention for organization purposes and doesn't really play any part in the actual game logic. The 01 in SM01 just means voice 1. In general they map to the voice # you select in the UI, but not exactly. For females it seems to be the case, but for males it works a little differently. There is no male 2 english package, voice number 2 in the UI is actually the male 3 english package. I do think you need to have a clip for each event in each bank you choose to have. Having partially empty banks would mean that if that bank happens to be cued up when the event needs to play, it'll play silence instead of trying to find another bank that actually has something in it. That's just speculation on my part, but I believe it's accurate because the cueing of the next bank happens after a sound is played, not while trying play a sound. So if you want 15 banks per voice, but have only 9 healing ally clips, then yes, 6 of them will have to be re-used to fill out the remaining banks. This is precisely what the stock banks do. And yes, they'll be slightly more commonly chosen, simply because you have fewer clips to choose from. Having fewer options for rarely used events is likely fine. And again, I think this is why they went to using random cues to have two move and dash clips in most of the banks: 15 wasn't enough for those events, so they added more. Adding more banks just for the two really common events would mean more duplication of all the other sounds to fill out the remaining 12 or 13 new banks, which would just take up disc space and memory on multiple copies of exactly the same sounds. They probably determined 15 to be the best number for most events and so went with 15 banks, filling up the infrequently used sounds with duplicate copies in some banks, and adding random nodes for the more frequent ones to get more variety. LiQuiD911: Be careful with the cue names, because by default UDK uses the suffix "_Cue", which is the case in all the voice banks, but the music packs don't use an underscore, it's just something like ActionMusic1Cue, for example. Did you replace the HQSound_MCMusic_SF.upk package? (I think that's the loadout one?) Edit: I'll post the patch for the combat music when I get a chance. But that's specific to the tactical music. Changing the HQ music needs to be done slightly differently, and you can't just list multiple cues to the ini for the MC music to get it to play one randomly. However, you can import multiple tracks into one package and use a random node in the cue to get the same effect. If you're familiar with hex editing the UPKs the class you want is XcomHQSoundCollection. Making that one customizable is less useful though, because like I said they're done differently with a single track for each "event". Probably simpler for HQ music to just overwrite the package with a custom one, making sure the package and cues are named identically. Open up your new package in UE explorer to verify.
-
Ok. So my latest adventure is trying to get X-COM to load brand new sounds, instead of just replacing existing ones. I successfully built a package containing a sound file with the UDK. For some reason I haven't yet worked out, it places the SoundNodeWave and the cue in two separate packages. I think this is ok, as it looks like the same thing is happening for the new DLC sounds, like the Annette voice banks (AnnetteVoice1_Bank0_SF.upk and AnnetteVoice2_Bank0_SF_LOC_INT.upk, for example). I force the package to load via the Engine.StartupPackages section, but no dice. It appears to load the package (I think?), but nothing is requesting to actually load the sound so it doesn't play, even through the dev console. Second attempt: Make a little mod from the instructions in the "Scripting with UDK" thread to actually load the sound content through the XComContentManager. So far I haven't had much luck getting the mod loaded by the game. Or, if it's loading, it isn't working. I can't tell which. I tried putting the `Log messages into StartMatch() for debugging, but they aren't appearing in the Launch.txt file. I'm going to keep plugging at it, but I am also wondering if the StartMatch() is too early to load the sounds anyway and I need to trigger a script off some other condition.
-
Yes, that's correct. It's just a plain ogg file.
-
OK, so I have tested it a little bit and so far it works! Defining sound replacements in this way is a little awkward because of the need to compute the resize value, including the size of the property list (which I got wrong the first time and crashed the game :smile: ). I imagine once REPLACE_SOUND is implemented doing it this long way will be less important unless you want complete control over the particular property values that get inserted. Yeah - For example, all the weapon packages. I used move & resize, but accidentally specified :MOVE on the object line, which ended up moving it twice :smile: The first time upon seeing :MOVE and the second when it hits the RESIZE=.
-
Awesome! Yes I can help with some testing a bit later today. As for the ogg format, if you're looking to read the duration, channels, etc. values to populate the property list, that is part of the vorbis audio encoding. The best place to start there is probably to use the open source libvorbisfile library. It has a simple API to read a file and get information about the stream.