Unusual background Music issue - bug???

Started by cdavenport, Thu 04/10/2018 20:18:05

Previous topic - Next topic

Monsieur OUXX

Quote from: Crimson Wizard on Mon 15/10/2018 14:48:50
Quote from: morganw on Mon 15/10/2018 14:19:18
Quote from: Monsieur OUXX on Mon 15/10/2018 11:42:51
Isn't there an option in the Editor to attach a music to a room?
There is no such option.

This option existed before version 3.2, where this and few other room options were deprecated in favor of scripting. It still exists internally for importing old projects but not displayed on Editor UI.

Since Unavowed has the same issue according to cdavenport, couldn't it be that the feature wakes up somehow, even without it being available in the UI? Something to do with the game having been developed in earlier AGS versions at the beginning, or even the Editor screwing up some import or room creation at some point?
 

cdavenport

Quote from: Crimson Wizard on Sun 14/10/2018 16:02:24
Quote from: cdavenport on Sun 14/10/2018 15:59:19

Are you using voice-over notations in the dialogs? Can it be that you put music clip in Speech folder and forgot about it?


If this happens again and will reproduce steadily, could you at least post particular dialog script?, because it's hard to guess the problem without having more details.

Have you tried reporting this to Dave Gilbert? He might be able to find out something about this problem too.

Thanks Crimson Wizard I've checked the speech folder and nothing is amiss in it except that I have a duplicate WAV audio file I forgot to delete, but it's a voice file not music so that couldn't have been it. I haven't reported this about Unavowed to Dave Gilbert yet it's really so subtle that I doubt anyone would even notice, and I wanted to play it a little more and try and see if and where it's happening, so I could reproduce it 100% before raising the issue.

It's sort of the thing that only a Developer might be aware of, because normally a player or even a play-tester would have no reason to suspect anything was going awry if the wrong background music was playing during a dialogue sequence.

I'll do some more troubleshooting and try some of the things others have brought up over the next few days.

Quote from: Snarky on Sun 14/10/2018 18:39:45
A sound randomly/continuously playing when you're not calling any audio functions, I'd say 99 times out of 100 are (as Privateer Puddin' says) because you've got an audio clip linked to an animation frame somewhere. One way to test that is to run this snippet (which removes linked audio from all frames in all loops in all views) and seeing if the problem disappears:
   
Some other details that might be useful to understand the problem:

-Once the error occurs in one place, is it consistent? (It always appears in that place until you change something in the script)
-Does the wrong clip play on a continuous loop? Does it play all the way through or is it interrupted before finishing? And if interrupted, is it always at the same place, or does it vary?
-How have you got your AudioTypes/AudioChannels set up? (How many channels assigned to each audio type)
-What are the AudioTypes of the clips that are playing?

You could also use the code here to take a look at what's happening with the audio as it's happening.

Thanks Snarky, I'll try running that code I manually checked to see if there was any music linked to any frames, I didn't find any checking it earlier but it's possible it could have been done accidentally, so that snippet will be a real help.

Yes, the wrong music error is consistent until I create a new dialogue, then it goes away. But it tends to reappear in another dialogue somewhere after that?

I haven't waited to see if the music looped because it's a rather long piece, lasting a few minutes. I'll try that. The wrong music always starts up during a dialogue, then continues in the game even after I break out of the dialogue segment.

I do not think I played around with assigning different audio channels, but I might have, I've been working on the game for over a year. I'll check that.

I'm using OGG files for everything, and the files are categorized as either Music or Sound. I have tried to keep everything simple as I'm a novice at scripting, and tried not to do anything with the game's audio handling besides the most basic usage and commands.

I'm mainly looking for ideas that will help me troubleshoot it so these will help, I'll see if I can find anything new.

ManicMatt

Clutching at straws here, but could there be any script ID names that are identical that cdavenport entered, which could confuse AGS?

I realise that doesn't explain Gilbert's game, however.

Khris

cdavenport: Which type of speech are you using? Are you using Lip sync? (If not, make sure you didn't enable it accidentally).

Anyway, I did a quick test and if I assign a piece of music to a talking view frame, then let the character talk, the music will start over and over again while the character is talking (whenever the frame is used during the animation), then keep playing when they finish talking. So if the piece has a couple of seconds of silence at the start, it'll simply sound like the music starts playing randomly.
I'm still 99% convinced that this is what's happening.

Crimson Wizard

#24
Quote from: Monsieur OUXX on Mon 15/10/2018 15:35:25
Since Unavowed has the same issue according to cdavenport, couldn't it be that the feature wakes up somehow, even without it being available in the UI? Something to do with the game having been developed in earlier AGS versions at the beginning, or even the Editor screwing up some import or room creation at some point?

While hypothetically that may be possible, IMHO this is too much to assume at once without firm evidence. We do not know if what cdavenport experienced in "Unawoved" is a bug and not by Dave's design, we do not know if it's the same kind of bug as he has in his game, and we still have no actual details to make conclusion of its nature.

Of all the theories mentioned in this thread, the clip linked to the frame sounds most logical to me so far, but I'd rather wait for further test results.

Dave Gilbert

Quote from: cdavenport on Sun 14/10/2018 15:59:19
I can say it sounded like it was happening while I was playing Unavowed, I was in the section outside the police station talking to Donny, I could hear the ambient sounds, the musical track that was playing in the room, and then all of a sudden underneath those another musical fanfare started playing over and over again (just as what happens in my game) beneath the other tracks, while I was in the middle of a dialogue. It happened more than once but again I cannot predict exactly when and where it will occur.

If it's in that location, than it's by design. Donny is playing a game on his phone and the music plays when you get close to him. You'll hear the same music in Unavowed HQ when Logan is playing the same game on his phone.

cdavenport

Thanks for all the help and suggestions I'll keep troubleshooting it, it doesn't seem to be a game-breaking issue (yet) and I can eliminate it by setting the music volume to 1 on the music that keeps playing in the background. The music doesn't appear to loop continuously, it just plays through once and stops.

Quote from: Snarky on Sun 14/10/2018 18:39:45
A sound randomly/continuously playing when you're not calling any audio functions, I'd say 99 times out of 100 are (as Privateer Puddin' says) because you've got an audio clip linked to an animation frame somewhere. One way to test that is to run this snippet (which removes linked audio from all frames in all loops in all views) and seeing if the problem disappears:

Spoiler
Code: ags

  for(int i=1; i<=Game.ViewCount; i++)
  {
    int loopCount = Game.GetLoopCountForView(i);
    for(int j=0; j<loopCount; j++)
    {
      int frameCount = Game.GetFrameCountForLoop(i, j);
      for(int k=0; k<frameCount; k++)
      {
        ViewFrame* viewFrame = Game.GetViewFrame(i, j, k);
        viewFrame.LinkedAudio = null;
      }
    }
  }
[close]
Some other details that might be useful to understand the problem:

I'd like to try this but not sure where to insert the code for it to work, I tried placing it in Room Load in the particular scene where the bug happens but it didn't seem to do anything. I still got the phantom music playing during the dialogue. Should it be in the Global script, or the dialogue script where the music starts playing when it's not supposed to?

Quote from: Dave Gilbert on Tue 16/10/2018 21:50:08
Quote from: cdavenport on Sun 14/10/2018 15:59:19
I can say it sounded like it was happening while I was playing Unavowed, I was in the section outside the police station talking to Donny, I could hear the ambient sounds, the musical track that was playing in the room, and then all of a sudden underneath those another musical fanfare started playing over and over again (just as what happens in my game) beneath the other tracks, while I was in the middle of a dialogue. It happened more than once but again I cannot predict exactly when and where it will occur.

If it's in that location, than it's by design. Donny is playing a game on his phone and the music plays when you get close to him. You'll hear the same music in Unavowed HQ when Logan is playing the same game on his phone.

Ah, I didn't make the connection that he was playing the game and it was coming from his phone, but now I understand.

Snarky

Quote from: cdavenport on Wed 17/10/2018 19:17:21
I'd like to try this but not sure where to insert the code for it to work, I tried placing it in Room Load in the particular scene where the bug happens but it didn't seem to do anything. I still got the phantom music playing during the dialogue. Should it be in the Global script, or the dialogue script where the music starts playing when it's not supposed to?

Room Load should be fine. The important thing is that it's called before the music play command is called. If it doesn't help, then that's a sign that linked audio on a frame is not the cause of the phenomenon. Which is interesting.

(If you want to check that the code snippet is actually running correctly, you could try adding some linked audio on a speech frame: without the code it should play during speech, with the code, the sound should go away.)

SMF spam blocked by CleanTalk