Unusual background Music issue - bug???

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

Previous topic - Next topic

cdavenport

I'm not sure if this is some kind of bug, or something I've messed up somehow myself. I'm using [AGS Editor .NET (Build 3.4.1.13)
v3.4.1, May 2018].

When I'm playing or testing my game, sometimes at the end of a dialogue segment a piece of background music will inexplicably begin to play underneath the background music which I've already set to have playing during the scene. It seems to always happen during dialogue segments, and it is not always consistent. It doesn't happen in every dialogue, only sometimes.

There's nowhere in my scripting that I can find which would result in two different conflicting background music pieces being called to play over each other during the dialogue.

I have tried searching the forums, but it seems like such an unusual problem, that I haven't been able to narrow down any keyword searches which were brought up somewhere in the past.

I don't know if this is something simple I've overlooked, or if its some kind of unusual bug in the engine that's causing this behavior. Does anyone have any ideas of what could be causing such a thing, or any leads that I can try to investigate to solve it? :confused:


ManicMatt

I think it will help people to work out your problem if they can see your code, and how it is used to play background music, and where this code is, for instance - after fade in.

The song that plays over the other music, is it the same file being played or a different song?

cdavenport

It is a different song that plays underneath the music already playing.

The only solution I have found seems to create an entirely new dialogue segment. Then it seems to go away, but I think it will occur again in a different dialogue as it has done in the past.

As a test, I eliminated the background music in the room and dialogue segment and played it. And during the dialogue, the phantom background music still played even thoughthere is nothing in the script to call for any kind of sound or music.

ManicMatt

#3
Could you have told it to play music in the global script?

And again, if you could copy and paste any of your code, like in one of the dialogs that randomly plays music, it would certainly go a long way in identifying the problem.

Gurok

If you're using Sierra-style speech with portraits, check to see if any of your speech views have no frames.
[img]http://7d4iqnx.gif;rWRLUuw.gi

cdavenport

#5
I can't find anything in the global script that calls up music, and I checked to see if portraits were missing any frames and they all appear intact.

In the past I have fixed this issue by creating a new dialogue segment, and it went away for awhile, but then the phantom music seems to occur in the dialogue of another character in the game - like it jumps from one dialogue to infect another.

It has happened even at times when I have NO scripted music playing in either the room, or the dialogue segments between characters. So even though two characters are in a room where there is no music being called to play in either the rooms scripting, or the dialogue's scripting, the phantom music will play in the background. So I cannot identify an error by looking at the code, or posting it, since there is no music scripting at all in it. It's seems its something that's happening underneath everything else, hidden from plain view.

I cannot find anything about it as far as others troubleshooting a similar issue with their game, so I'm assuming it's a weird bug I've somehow stumbled upon.

I guess it is possible there could be some weird error I made without knowing about it in the global script or something, but right now I'm at a loss of where to look or what it could possibly be.

Privateer Puddin'

Do your dialogs run any animations? Could you have a sound tied to a view frame?

cdavenport


Was playing playing Unavowed and the phantom music sounded like it was going on in that game too, I could distinctly hear what sounded like two different background music songs playing over one another during a section of the game, but its too unpredictable to reproduce. At least I know its not just my game or something I did seems to be something in AGS.

Crimson Wizard

#8
That may be a silly question to ask, but I did not notice if this was asked anywhere above and want to confirm this to eliminate any chance of misunderstanding: is this "phantom" music actually a music clip from your game?
If yes, is it always the same clip?
How easy it is to reproduce this problem in your game? Have you tried giving your game to other people to test out to see if they get same error?

ManicMatt

that sounds like you're running the game twice?

Crimson Wizard

Quote from: ManicMatt on Sat 13/10/2018 07:50:50
that sounds like you're running the game twice?

By default AGS pauses on background, so unless multitasking mode was enabled deliberately by game creator they should not run in parallel.

ManicMatt

Just thought I'd throw that out there.

Would it also be useful perhaps if they game captured or even filmed what happens to show us?

Just to clarify also, what OS are you using?

cdavenport

Quote from: Crimson Wizard on Sat 13/10/2018 01:58:32
That may be a silly question to ask, but I did not notice if this was asked anywhere above and want to confirm this to eliminate any chance of misunderstanding: is this "phantom" music actually a music clip from your game?
If yes, is it always the same clip?
How easy it is to reproduce this problem in your game? Have you tried giving your game to other people to test out to see if they get same error?

Apologies for slow reply but I don't have reliable access to Internet at this time.

Yes, music is a clip from my game, and it is always same clip. It happened again when I was troubleshooting it last night.

The only fix I've found is to create a new dialog, to replace the one with where the music track plays when it's not supposed to. That seems to work, however it may occur again I won't know until all the dialogue sequences are finished and tested.

It *may* have something to do with when I use "player:" in the dialogue instead of using the characters name (e.g. "cEgo:") but I can't be certain.

Right now it's not feasible for me to send the game to other players to test, I was hoping somebody might have had this same issue but apparently not. If I can't figure out what it is I'll have to try and troubleshoot it later.

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.

All I can say is it doesn't happen with any other games I play, so I'm assuming its something in that version of AGS.






Crimson Wizard

#13
Quote from: cdavenport on Sun 14/10/2018 15:59:19
Yes, music is a clip from my game, and it is always same clip. It happened again when I was troubleshooting it last night.

The only fix I've found is to create a new dialog, to replace the one with where the music track plays when it's not supposed to. That seems to work, however it may occur again I won't know until all the dialogue sequences are finished and tested.

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


Quote from: cdavenport on Sun 14/10/2018 15:59:19
It *may* have something to do with when I use "player:" in the dialogue instead of using the characters name (e.g. "cEgo:") but I can't be certain.

Right now it's not feasible for me to send the game to other players to test, I was hoping somebody might have had this same issue but apparently not. If I can't figure out what it is I'll have to try and troubleshoot it later.

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.


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.

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

Snarky

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:

-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.

Monsieur OUXX

Isn't there an option in the Editor to attach a music to a room?
If yes, then there would be the automated room music, set with the editor, and another music that cdavenport plays manually, as the actual intended music.
 

morganw

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.

Crimson Wizard

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.

morganw

Does it get its own dedicated audio channel?

Crimson Wizard

#19
Quote from: morganw on Mon 15/10/2018 14:55:10
Does it get its own dedicated audio channel?

No, this property has no control over channels and such, it is simply converted into "aSomeMusic.Play();" command in the "On Room Load" script.

The reason I doubt this is related to current problem is that cdavenport mentioned "phantom music" starts playing at certain point in the dialog, not at the room start, and secondly, if this was the project imported from before AGS 3.2, there would be a noticable script command.

SMF spam blocked by CleanTalk